aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2019-01-11 14:14:22 +0000
committerYann Herklotz <ymherklotz@gmail.com>2019-01-11 14:14:22 +0000
commitdf8514baccddfab2e3ace21d8ced8a941d1218d3 (patch)
treef94e899026754a962022adb8ebefd7d0a4e1d380
parenta7deafced378c188b6c5c5014307b459e98324a6 (diff)
downloaddotfiles-minimal-emacs.tar.gz
dotfiles-minimal-emacs.zip
Add minimal configurationminimal-emacs
-rw-r--r--emacs/loader.org826
1 files changed, 0 insertions, 826 deletions
diff --git a/emacs/loader.org b/emacs/loader.org
index a0e9215..dc143cc 100644
--- a/emacs/loader.org
+++ b/emacs/loader.org
@@ -361,103 +361,6 @@ programming and looking at source code.
#+RESULTS:
: eshell
-*** Reload
-
-#+BEGIN_SRC emacs-lisp
- (defun y/reload ()
- (interactive)
- (load-file (expand-file-name "~/.emacs.d/init.el")))
-#+END_SRC
-
-* Social
-** Mail
-~mu4e~ is automatically in the load path when installed through a package
-manager.
-
-For archlinux, the command to install mu4e is:
-
-#+BEGIN_SRC shell
- pacman -S mu
-#+END_SRC
-
-which comes with mu.
-
-Set the email client to be mu4e in emacs, and set the correct mail directory. As
-I am downloading all the mailboxes, there will be duplicates, which can be
-ignored in searches by setting ~mu4e-headers-skip-duplicates~.
-
-Also delete messages when they are sent, and don't copy them over to the sent
-directory, as Gmail will do that for us.
-
-To download the mail using imap, I use ~mbsync~, which downloads all mail with
-the ~-a~ flag.
-
-Finally, remove buffers when an email has been sent.
-
-#+BEGIN_SRC emacs-lisp
- (load-user-file "personal.el")
-#+END_SRC
-
-#+RESULTS:
-: t
-
-** Elfeed
-
-#+BEGIN_SRC emacs-lisp
- (use-package elfeed-org
- :config
- (elfeed-org)
- (setq rmh-elfeed-org-files (list (expand-file-name "~/Dropbox/org/elfeed.org"))))
-
- (use-package elfeed
- :bind (:map elfeed-search-mode-map
- ("A" . y/elfeed-show-all)
- ("E" . y/elfeed-show-emacs)
- ("D" . y/elfeed-show-daily)
- ("q" . y/elfeed-save-db-and-bury)))
-#+END_SRC
-
-#+RESULTS:
-: y/elfeed-save-db-and-bury
-
-Define utility functions to make the reader work.
-
-#+BEGIN_SRC emacs-lisp
- (defun y/elfeed-show-all ()
- (interactive)
- (bookmark-maybe-load-default-file)
- (bookmark-jump "elfeed-all"))
-
- (defun y/elfeed-show-emacs ()
- (interactive)
- (bookmark-maybe-load-default-file)
- (bookmark-jump "elfeed-emacs"))
-
- (defun y/elfeed-show-daily ()
- (interactive)
- (bookmark-maybe-load-default-file)
- (bookmark-jump "elfeed-daily"))
-
- ;;functions to support syncing .elfeed between machines
- ;;makes sure elfeed reads index from disk before launching
- (defun y/elfeed-load-db-and-open ()
- "Wrapper to load the elfeed db from disk before opening"
- (interactive)
- (elfeed-db-load)
- (elfeed)
- (elfeed-search-update--force))
-
- ;;write to disk when quiting
- (defun y/elfeed-save-db-and-bury ()
- "Wrapper to save the elfeed db to disk before burying buffer"
- (interactive)
- (elfeed-db-save)
- (quit-window))
-#+END_SRC
-
-#+RESULTS:
-: y/elfeed-save-db-and-bury
-
* Utility
** Navigation
@@ -470,10 +373,6 @@ Set navigation commands in all the buffers
(global-set-key (kbd "C-.") #'other-window)
(global-set-key (kbd "C-,") #'prev-window)
- (use-package golden-ratio
- :config
- (golden-ratio-mode))
-
(defun push-mark-no-activate ()
"Pushes `point' to `mark-ring' and does not activate the region
Equivalent to \\[set-mark-command] when \\[transient-mark-mode] is disabled"
@@ -499,41 +398,6 @@ Enable winner mode to save window state.
#+BEGIN_SRC emacs-lisp
(winner-mode 1)
#+END_SRC
-
-#+BEGIN_SRC emacs-lisp
- (use-package flx)
-
- (use-package ivy
- :bind
- (("C-c s" . swiper)
- ("M-x" . counsel-M-x)
- ("C-x C-f" . counsel-find-file)
- ("C-c g" . counsel-git)
- ("C-c j" . counsel-git-grep)
- ("C-c C-r" . ivy-resume)
- ("C-x b" . ivy-switch-buffer)
- ("C-x 8 RET" . counsel-unicode-char))
- :config
- (ivy-mode 1)
- (counsel-mode t)
- (setq ivy-use-virtual-buffers t)
- (setq ivy-count-format "(%d/%d) ")
- (define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history)
- (setq ivy-re-builders-alist
- '((t . ivy--regex-fuzzy))))
-#+END_SRC
-
-#+RESULTS:
-: counsel-unicode-char
-
-** Visual
-*** All the icons
-#+BEGIN_SRC emacs-lisp
- (use-package all-the-icons)
-#+END_SRC
-
-#+RESULTS:
-
** Editing
*** Hungry Delete
#+BEGIN_SRC emacs-lisp
@@ -542,73 +406,6 @@ Enable winner mode to save window state.
(global-hungry-delete-mode))
#+END_SRC
-#+RESULTS:
-: t
-
-*** SmartParens
-#+BEGIN_SRC emacs-lisp
- (use-package smartparens
- :bind (("M-[" . sp-backward-unwrap-sexp)
- ("M-]" . sp-unwrap-sexp)
- ("C-M-f" . sp-forward-sexp)
- ("C-M-b" . sp-backward-sexp)
- ("C-M-d" . sp-down-sexp)
- ("C-M-a" . sp-backward-down-sexp)
- ("C-M-e" . sp-up-sexp)
- ("C-M-u" . sp-backward-up-sexp)
- ("C-M-t" . sp-transpose-sexp)
- ("C-M-n" . sp-next-sexp)
- ("C-M-p" . sp-previous-sexp)
- ("C-M-k" . sp-kill-sexp)
- ("C-M-w" . sp-copy-sexp)
- ("C-)" . sp-forward-slurp-sexp)
- ("C-}" . sp-forward-barf-sexp)
- ("C-(" . sp-backward-slurp-sexp)
- ("C-{" . sp-backward-barf-sexp)
- ("M-D" . sp-splice-sexp)
- ("C-]" . sp-select-next-thing-exchange)
- ("C-<left_bracket>" . sp-select-previous-thing)
- ("C-M-]" . sp-select-next-thing)
- ("M-F" . sp-forward-symbol)
- ("M-B" . sp-backward-symbol)
- ("M-S" . sp-split-sexp))
- :hook ((minibuffer-setup) . turn-on-smartparens-strict-mode)
- :config
- (require 'smartparens-config)
- (show-smartparens-global-mode +1)
- (smartparens-global-mode 1)
-
- (sp-with-modes '(c-mode c++-mode)
- (sp-local-pair "{" nil :post-handlers '(("||\n[i]" "RET")))
- (sp-local-pair "/*" "*/" :post-handlers '((" | " "SPC")
- ("* ||\n[i]" "RET")))))
-#+END_SRC
-
-*** Whitespace
-#+BEGIN_SRC emacs-lisp
- (use-package whitespace
- :bind (("C-x w" . whitespace-mode)))
-#+END_SRC
-
-*** IEdit
-#+BEGIN_SRC emacs-lisp
- (use-package iedit
- :bind (("C-;" . iedit-mode)))
-#+END_SRC
-
-*** Expand Region
-
-Expand region is very useful to select words and structures quickly by
-incrementally selecting more and more of the text.
-
-#+BEGIN_SRC emacs-lisp
- (use-package expand-region
- :bind ("M-o" . er/expand-region))
-#+END_SRC
-
-#+RESULTS:
-: er/expand-region
-
*** Dired
#+BEGIN_SRC emacs-lisp
@@ -618,629 +415,6 @@ incrementally selecting more and more of the text.
(setq dired-dwim-target t)
#+END_SRC
-** Search
-*** Deadgrep
-
-#+BEGIN_SRC emacs-lisp
- (use-package deadgrep
- :bind (("C-c d" . deadgrep)))
-#+END_SRC
-
-#+RESULTS:
-: deadgrep
-
-** Yasnippets
-
-#+BEGIN_SRC emacs-lisp
- (use-package yasnippet
- :config
- (yas-global-mode))
-
- (use-package yasnippet-snippets)
-#+END_SRC
-
-* Writing
-
-#+BEGIN_SRC emacs-lisp
- (add-hook 'text-mode-hook (lambda ()
- (auto-fill-mode 1)))
-#+END_SRC
-
-** Spellcheck in emacs
-#+BEGIN_SRC emacs-lisp
- (defun spell-buffer-german ()
- (interactive)
- (ispell-change-dictionary "de_DE")
- (flyspell-buffer))
-
- (defun spell-buffer-english ()
- (interactive)
- (ispell-change-dictionary "en_UK")
- (flyspell-buffer))
-
- (use-package ispell
- :ensure nil
- :config
- ;; (setq ispell-program-name "aspell"
- ;; ispell-extra-args '("--sug-mode=ultra"))
- :bind (("C-c N" . spell-buffer-german)
- ("C-c n" . spell-buffer-english)))
-
- (use-package flyspell
- :ensure nil
- :hook ((text-mode) . flyspell-mode)
- :config
- (define-key flyspell-mode-map (kbd "C-.") nil)
- (define-key flyspell-mode-map (kbd "C-,") nil))
-#+END_SRC
-
-** Latex
-#+BEGIN_SRC emacs-lisp
- (use-package latex
- :ensure auctex
- :config
- (require 'tex-site)
- ;; to use pdfview with auctex
- (setq TeX-view-program-selection '((output-pdf "PDF Tools"))
- TeX-view-program-list '(("PDF Tools" TeX-pdf-tools-sync-view))
- TeX-source-correlate-start-server t) ;; not sure if last line is neccessary
- ;; to have the buffer refresh after compilation
- (add-hook 'TeX-after-compilation-finished-functions
- #'TeX-revert-document-buffer)
- (setq TeX-auto-save t)
- (setq TeX-parse-self t)
- (setq TeX-save-query nil)
- (setq-default TeX-master nil)
- (setq TeX-PDF-mode t)
- (add-hook 'LaTeX-mode-hook 'flyspell-mode)
- (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
- (defun turn-on-outline-minor-mode ()
- (outline-minor-mode 1))
- (add-hook 'LaTeX-mode-hook 'turn-on-outline-minor-mode)
- (setq outline-minor-mode-prefix "\C-c \C-o")
- (autoload 'reftex-mode "reftex" "RefTeX Minor Mode" t)
- (autoload 'turn-on-reftex "reftex" "RefTeX Minor Mode" nil)
- (autoload 'reftex-citation "reftex-cite" "Make citation" nil)
- (autoload 'reftex-index-phrase-mode "reftex-index" "Phrase Mode" t)
- (add-hook 'LaTeX-mode-hook 'turn-on-reftex)
- (setq reftex-bibliography-commands '("bibliography" "nobibliography" "addbibresource"))) ; with Emacs latex mode
-#+END_SRC
-
-#+RESULTS:
-: t
-
-** Markdown
-Markdown is the standard for writing documentation. This snippet loads GFM
-(Github Flavoured Markdown) style.
-
-#+BEGIN_SRC emacs-lisp
- (use-package markdown-mode
- :commands (markdown-mode gfm-mode)
- :mode (("README\\.md\\'" . gfm-mode)
- ("\\.md\\'" . markdown-mode)
- ("\\.markdown\\'" . markdown-mode))
- :init (setq markdown-command "multimarkdown"))
-#+END_SRC
-
-** Org
-Agenda setup for org mode, pointing to the write files.
-
-#+BEGIN_SRC emacs-lisp
- (setq org-log-into-drawer t
- org-log-done "note"
- org-hide-leading-stars t
- org-confirm-babel-evaluate nil
- org-directory (expand-file-name "~/Dropbox/org")
- org-image-actual-width nil
- org-format-latex-options (plist-put org-format-latex-options :scale 1.5)
- org-latex-pdf-process (list "latexmk -shell-escape -bibtex -f -pdf %f")
- org-default-notes-file (concat org-directory "/inbox.org"))
-
- (eval-after-load "org"
- '(setq org-metaup-hook nil
- org-metadown-hook nil))
-
- (add-hook 'org-trigger-hook 'save-buffer)
-#+END_SRC
-
-Set global keys for org mode to access agenda.
-
-#+BEGIN_SRC emacs-lisp
- (global-set-key "\C-cl" 'org-store-link)
- (global-set-key "\C-ca" 'org-agenda)
- (global-set-key "\C-cc" 'org-capture)
- (global-set-key "\C-cb" 'org-iswitchb)
- (define-key global-map "\C-cc" 'org-capture)
-#+END_SRC
-
-Set up ob for executing code blocks
-
-#+BEGIN_SRC emacs-lisp
- (use-package ob
- :ensure nil
- :config
- (org-babel-do-load-languages
- 'org-babel-load-languages
- '((emacs-lisp . t)
- (js . t)
- (java . t)
- (haskell . t)
- (python . t)
- (ruby . t)
- (org . t)
- (matlab . t)
- (ditaa . t)
- (clojure . t)
- (dot . t)
- (shell . t))))
-#+END_SRC
-
-#+RESULTS:
-: t
-
-Exporting to html needs htmlize.
-
-#+BEGIN_SRC emacs-lisp
- (use-package htmlize
- :commands (htmlize-file
- htmlize-buffer
- htmlize-region
- htmlize-many-files
- htmlize-many-files-dired
- htmlize-region-save-screenshot))
-#+END_SRC
-
-Add md backend
-
-#+BEGIN_SRC emacs-lisp
- (require 'ox-md)
-#+END_SRC
-
-Add org noter
-
-#+BEGIN_SRC emacs-lisp
- (use-package org-noter
- :after org
- :config (setq org-noter-default-notes-file-names '("notes.org")
- org-noter-notes-search-path '("~/org/research")
- org-noter-separate-notes-from-heading t))
-
- (use-package org-ref
- :after org
- :bind (("C-c r" . org-ref-cite-hydra/body)
- ("C-c b" . org-ref-bibtex-hydra/body))
- :init
- (require 'org-ref)
- :config
- (setq reftex-default-bibliography '("~/Dropbox/bibliography/references.bib"))
- (setq org-ref-bibliography-notes "~/Dropbox/bibliography/notes.org"
- org-ref-default-bibliography '("~/Dropbox/bibliography/references.bib")
- org-ref-pdf-directory "~/Dropbox/bibliography/bibtex-pdfs/")
- (setq org-latex-pdf-process (list "latexmk -shell-escape -bibtex -f -pdf %f"))
- (setq org-ref-completion-library 'org-ref-ivy-cite))
-#+END_SRC
-
-#+RESULTS:
-: org-ref-bibtex-hydra/body
-
-*** Templates
-#+BEGIN_SRC emacs-lisp
- (setq org-capture-templates
- '(("t" "todo" entry (file+headline "~/Dropbox/org/inbox.org" "Tasks")
- "* TODO %?\n\n%i\n%a\n\n")))
-#+END_SRC
-
-*** Agenda
-
-#+BEGIN_SRC emacs-lisp
- (setq org-agenda-files (mapcar 'expand-file-name
- '("~/Dropbox/org/inbox.org"
- "~/Dropbox/org/main.org"
- "~/Dropbox/org/tickler.org"))
- org-refile-targets '(("~/Dropbox/org/main.org" :maxlevel . 2)
- ("~/Dropbox/org/someday.org" :level . 1)
- ("~/Dropbox/org/tickler.org" :maxlevel . 2))
- org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)")))
-
- (setq org-agenda-custom-commands
- '(("w" "At work" tags-todo "@work"
- ((org-agenda-overriding-header "Work")))
- ("h" "At home" tags-todo "@home"
- ((org-agenda-overriding-header "Home")))
- ("u" "At uni" tags-todo "@uni"
- ((org-agenda-overriding-header "University")))))
-#+END_SRC
-
-*** Remove Binding
-#+BEGIN_SRC emacs-lisp
- (define-key org-mode-map (kbd "C-,") nil)
-#+END_SRC
-
-*** Registers
-
-#+BEGIN_SRC emacs-lisp
- (set-register ?l (cons 'file "~/.emacs.d/loader.org"))
- (set-register ?m (cons 'file "~/Dropbox/org/main.org"))
- (set-register ?i (cons 'file "~/Dropbox/org/inbox.org"))
-#+END_SRC
-
-*** Exporting
-
-#+BEGIN_SRC emacs-lisp
- (use-package ox-twbs)
-#+END_SRC
-
-** PDF Tools
-
-#+BEGIN_SRC emacs-lisp
- (use-package pdf-tools
- :hook (doc-view-mode . pdf-view-mode)
- :commands pdf-view-mode)
-#+END_SRC
-
-#+RESULTS:
-| pdf-view-mode |
-
-* Programming
-My emacs configuration is mostly focused on programming, therefore there is a
-lot of different language support.
-
-** Version Control and Project Management
-*** Magit
-#+BEGIN_SRC emacs-lisp
- (use-package magit
- :bind (("C-x g" . magit-status))
- :config
- (setq server-switch-hook nil))
-#+END_SRC
-
-#+RESULTS:
-: magit-status
-
-*** Projectile
-#+BEGIN_SRC emacs-lisp
- (use-package projectile
- :config
- (projectile-mode +1)
- (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
- (setq projectile-enable-caching nil)
- (setq projectile-git-submodule-command "")
- (setq projectile-mode-line '(:eval (format " Proj[%s]" (projectile-project-name)))))
-
- (use-package counsel-projectile
- :config
- (counsel-projectile-mode t))
-#+END_SRC
-
-** Language Support
-*** C++
-
-Setting up CC mode with a hook that uses my settings.
-
-#+BEGIN_SRC emacs-lisp
- (use-package cc-mode
- :config
- (add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))
- (setq c-default-style "linux"
- tab-width 4
- c-indent-level 4)
- (defun my-c++-mode-hook ()
- (c-set-offset 'inline-open 0)
- (c-set-offset 'inline-close 0)
- (c-set-offset 'innamespace 0)
- (c-set-offset 'arglist-cont-nonempty 8)
- (setq indent-tabs-mode nil))
- (add-hook 'c-mode-hook 'my-c++-mode-hook)
- (add-hook 'c++-mode-hook 'my-c++-mode-hook)
-
- (define-key c-mode-map (kbd "C-c C-c") 'comment-or-uncomment-region))
-#+END_SRC
-
-Adding C headers to company backend for completion.
-
-#+BEGIN_SRC emacs-lisp
- (use-package irony
- :config
- (add-hook 'c++-mode-hook 'irony-mode)
- (add-hook 'c-mode-hook 'irony-mode)
- (add-hook 'objc-mode-hook 'irony-mode)
-
- (defun my-irony-mode-hook ()
- (define-key irony-mode-map [remap completion-at-point]
- 'irony-completion-at-point-async)
- (define-key irony-mode-map [remap complete-symbol]
- 'irony-completion-at-point-async))
- (add-hook 'irony-mode-hook 'my-irony-mode-hook)
- (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))
-
- (use-package company-irony)
-
- (use-package flycheck-irony
- :config
- (add-hook 'c++-mode-hook #'flycheck-irony-setup))
-
- (use-package company-c-headers
- :config
- (add-to-list 'company-backends 'company-c-headers)
- (add-to-list 'company-backends 'company-irony)
-
- (add-hook 'irony-mode-hook 'company-irony-setup-begin-commands))
-#+END_SRC
-
-Using clang format to format the region that is currently being selected (need
-to install clang format script).
-
-#+BEGIN_SRC emacs-lisp
- (use-package clang-format
- :bind (("C-c C-i" . 'clang-format-region)
- ("C-c u" . 'clang-format-buffer)))
-#+END_SRC
-
-#+RESULTS:
-: clang-format-buffer
-
-*** Clojure
-Using Cider for clojure environment.
-
-#+BEGIN_SRC emacs-lisp
- (use-package cider
- :commands cider-mode
- :config
- (setq cider-repl-display-help-banner nil))
-#+END_SRC
-
-Adding hook to clojure mode to enable strict parentheses mode.
-
-#+BEGIN_SRC emacs-lisp
- (add-hook 'clojure-mode-hook 'turn-on-smartparens-strict-mode)
-#+END_SRC
-
-*** CMake
-#+BEGIN_SRC emacs-lisp
- (use-package cmake-mode
- :commands cmake-mode
- :config
- (setq auto-mode-alist
- (append
- '(("CMakeLists\\.txt\\'" . cmake-mode))
- '(("\\.cmake\\'" . cmake-mode))
- auto-mode-alist))
- (autoload 'cmake-mode "~/CMake/Auxiliary/cmake-mode.el" t))
-#+END_SRC
-
-*** Elm
-
-#+BEGIN_SRC emacs-lisp
- (use-package elm-mode
- :mode ("\\.elm\\'"))
-#+END_SRC
-
-*** Emacs Lisp
-Adding strict parentheses to emacs lisp.
-
-#+BEGIN_SRC emacs-lisp
- (add-hook 'emacs-lisp-mode-hook 'turn-on-smartparens-strict-mode)
-#+END_SRC
-
-*** F#
-F# mode for uni work.
-
-#+BEGIN_SRC emacs-lisp
- (use-package fsharp-mode
- :commands fsharp-mode
- :config
- (defun y/fsharp-reload-file ()
- "Reloads the whole file when in fsharp mode."
- (interactive)
- (fsharp-eval-region (point-min) (point-max)))
- (add-hook 'fsharp-mode-hook
- (lambda () (local-set-key (kbd "C-c C-c") #'y/fsharp-reload-file))))
-#+END_SRC
-
-*** Haskell
-
-Haskell mode with company mode completion.
-
-#+BEGIN_SRC emacs-lisp
- (defun y/haskell-align (start end)
- (interactive "r")
- (align-regexp start end "\\(\\s-*\\)--"))
-
- (use-package haskell-mode
- :commands haskell-mode
- :bind (("M-." . haskell-mode-jump-to-def)
- ("C-c a" . y/haskell-align))
- :config
- (add-hook 'haskell-mode-hook 'haskell-decl-scan-mode)
- (setq haskell-mode-stylish-haskell-path "/home/yannherklotz/.local/bin/stylish-haskell"
- haskell-stylish-on-save t
- haskell-process-type 'stack-ghci
- haskell-process-path-stack "/home/yannherklotz/.local/bin/stack"))
-
- (use-package interactive-haskell-mode
- :ensure haskell-mode
- :hook haskell-mode)
-#+END_SRC
-
-#+RESULTS:
-| haskell-decl-scan-mode | interactive-haskell-mode |
-
-*** Python
-Elpy package for python, which provides an IDE type environment for python.
-
-#+BEGIN_SRC emacs-lisp
- (use-package elpy
- :commands python-mode
- :config
- (elpy-enable)
- (setq py-python-command "python3")
- (setq python-shell-interpreter "python3"))
-
- (with-eval-after-load 'python
- (defun python-shell-completion-native-try ()
- "Return non-nil if can trigger native completion."
- (let ((python-shell-completion-native-enable t)
- (python-shell-completion-native-output-timeout
- python-shell-completion-native-try-output-timeout))
- (python-shell-completion-native-get-completions
- (get-buffer-process (current-buffer))
- nil "_"))))
-#+END_SRC
-
-*** JSON
-JSON files should be opened in js-mode.
-#+BEGIN_SRC emacs-lisp
- (add-to-list 'auto-mode-alist '("\\.json\\'" . js-mode))
-#+END_SRC
-
-*** SCSS
-#+BEGIN_SRC emacs-lisp
- (use-package css-mode
- :ensure nil
- :commands (scss-mode
- css-mode)
- :config
- (setq css-indent-offset 2))
-#+END_SRC
-
-*** Shell
-#+BEGIN_SRC emacs-lisp
- (setq sh-basic-offset 2)
- (setq sh-indentation 2)
-#+END_SRC
-
-** Completion Support
-*** Company
-#+BEGIN_SRC emacs-lisp
- (use-package company
- :config
- (add-hook 'after-init-hook 'global-company-mode)
- (setq company-backends (delete 'company-semantic company-backends))
-
- (define-key c-mode-map (kbd "C-c n") 'company-complete)
- (define-key c++-mode-map (kbd "C-c n") 'company-complete)
- (setq company-dabbrev-downcase 0))
-#+END_SRC
-
-*** Flycheck
-Enabling global flycheck support.
-#+BEGIN_SRC emacs-lisp
- (use-package flycheck
- :config (global-flycheck-mode))
-#+END_SRC
-
-*** Yasnippets
-#+BEGIN_SRC emacs-lisp
- (use-package yasnippet
- :hook ((org-mode cc-mode) . yas-minor-mode)
- :config
- (yas-minor-mode 1))
-#+END_SRC
-
-*** SMerge
-
-Shamelessly taken from https://github.com/alphapapa/unpackaged.el#hydra.
-#+BEGIN_SRC emacs-lisp
- (use-package smerge-mode
- :config
- (defhydra unpackaged/smerge-hydra
- (:color pink :hint nil :post (smerge-auto-leave))
- "
- ^Move^ ^Keep^ ^Diff^ ^Other^
- ^^-----------^^-------------------^^---------------------^^-------
- _n_ext _b_ase _<_: upper/base _C_ombine
- _p_rev _u_pper _=_: upper/lower _r_esolve
- ^^ _l_ower _>_: base/lower _k_ill current
- ^^ _a_ll _R_efine
- ^^ _RET_: current _E_diff
- "
- ("n" smerge-next)
- ("p" smerge-prev)
- ("b" smerge-keep-base)
- ("u" smerge-keep-upper)
- ("l" smerge-keep-lower)
- ("a" smerge-keep-all)
- ("RET" smerge-keep-current)
- ("\C-m" smerge-keep-current)
- ("<" smerge-diff-base-upper)
- ("=" smerge-diff-upper-lower)
- (">" smerge-diff-base-lower)
- ("R" smerge-refine)
- ("E" smerge-ediff)
- ("C" smerge-combine-with-next)
- ("r" smerge-resolve)
- ("k" smerge-kill-current)
- ("ZZ" (lambda ()
- (interactive)
- (save-buffer)
- (bury-buffer))
- "Save and bury buffer" :color blue)
- ("q" nil "cancel" :color blue))
- :hook (magit-diff-visit-file . (lambda ()
- (when smerge-mode
- (unpackaged/smerge-hydra/body)))))
-#+END_SRC
-
-#+RESULTS:
-| lambda | nil | (when smerge-mode (unpackaged/smerge-hydra/body)) |
-
-* Look and Feel
-
-Keybindings
-
-#+BEGIN_SRC emacs-lisp
- (defun y/set-theme (theme)
- (load-theme theme t)
- (toggle-scroll-bar -1))
-
- (defun y/sanityinc-tomorrow-bright ()
- (interactive)
- (y/set-theme 'sanityinc-tomorrow-bright))
-
- (defun y/inkpot ()
- (interactive)
- (y/set-theme 'inkpot))
-
- (defun y/zenburn ()
- (interactive)
- (y/set-theme 'zenburn))
-
- (defun y/solarized-light ()
- (interactive)
- (y/set-theme 'solarized-light))
-
- (defun y/gruvbox ()
- (interactive)
- (y/set-theme 'gruvbox))
-
- (define-key y-map (kbd "1") 'y/sanityinc-tomorrow-bright)
- (define-key y-map (kbd "2") 'y/zenburn)
- (define-key y-map (kbd "3") 'y/solarized-light)
- (define-key y-map (kbd "4") 'y/gruvbox)
- (define-key y-map (kbd "5") 'y/inkpot)
-#+END_SRC
-
-#+RESULTS:
-: y/inkpot
-
-#+BEGIN_SRC emacs-lisp
- (defadvice load-theme
- (before theme-dont-propagate activate)
- (mapc #'disable-theme custom-enabled-themes))
-
- (if (daemonp)
- (add-hook 'after-make-frame-functions
- (lambda (frame)
- (select-frame frame)
- (load-theme 'doom-one t)
- (toggle-scroll-bar -1)))
- (progn (load-theme 'doom-one t)
- (toggle-scroll-bar -1)))
-#+END_SRC
-
-#+RESULTS:
-| (lambda (frame) (select-frame frame) (load-theme (quote doom-one) t) (toggle-scroll-bar -1)) | (lambda (frame) (select-frame frame) (load-theme (quote inkpot) t) (toggle-scroll-bar -1)) | x-dnd-init-frame |
-
* Conclusion
Setting the gc-cons threshold back to what it was at the beginning.