aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-12-05 20:17:03 +0000
committerYann Herklotz <ymherklotz@gmail.com>2018-12-05 20:17:03 +0000
commitea3a087ab7ff51029c661100af38b3418fdc4dd9 (patch)
tree1f32ff9fdda15ef91fa3b734febe40f1b74ec913
parent518e64da31148caa12ecc77354cce5f062e14794 (diff)
downloaddotfiles-ea3a087ab7ff51029c661100af38b3418fdc4dd9.tar.gz
dotfiles-ea3a087ab7ff51029c661100af38b3418fdc4dd9.zip
Add options to emacs
-rw-r--r--emacs/loader.org70
1 files changed, 43 insertions, 27 deletions
diff --git a/emacs/loader.org b/emacs/loader.org
index fccab11..2d663cd 100644
--- a/emacs/loader.org
+++ b/emacs/loader.org
@@ -1,4 +1,4 @@
-#+TITLE: GNU Emacs Configuration
+n#+TITLE: GNU Emacs Configuration
#+DATE: <2017-08-11 Fri>
#+AUTHOR: Yann Herklotz
@@ -20,10 +20,10 @@ Set path so that it picks up some executables that I use
#+BEGIN_SRC emacs-lisp
(setenv "PATH"
- (concat
- (expand-file-name "~/.local/bin") ":"
- (expand-file-name "~/.yarn/bin") ":"
- (getenv "PATH")))
+ (concat
+ "/home/yannherklotz/.local/bin" ":"
+ "/home/yannherklotz/.yarn/bin" ":"
+ (getenv "PATH")))
#+END_SRC
#+RESULTS:
@@ -93,8 +93,8 @@ buffer instead.
#+BEGIN_SRC emacs-lisp
(setq inhibit-startup-message t
- confirm-nonexistent-file-or-buffer nil
- fill-column 80)
+ confirm-nonexistent-file-or-buffer nil)
+ (setq-default fill-column 80)
(tool-bar-mode 0)
(menu-bar-mode 0)
(fset 'yes-or-no-p 'y-or-n-p)
@@ -527,10 +527,31 @@ 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"
+ (interactive)
+ (push-mark (point) t nil)
+ (message "Pushed mark to ring"))
+
+ (global-set-key (kbd "C-`") 'push-mark-no-activate)
+
+ (defun jump-to-mark ()
+ "Jumps to the local mark, respecting the `mark-ring' order.
+ This is the same as using \\[set-mark-command] with the prefix argument."
+ (interactive)
+ (set-mark-command 1))
+
+ (global-set-key (kbd "M-`") 'jump-to-mark)
#+END_SRC
#+RESULTS:
-: prev-window
+: jump-to-mark
Enable winner mode to save window state.
#+BEGIN_SRC emacs-lisp
@@ -539,7 +560,7 @@ Enable winner mode to save window state.
*** Ivy
-#+BEGIN_SRC emacs-lisp
+#+BEGIN_COMMENT emacs-lisp
(use-package flx-ido
:config
(ido-mode 1)
@@ -554,11 +575,11 @@ Enable winner mode to save window state.
("M-X" . smex-major-mode-commands))
:config
(smex-initialize))
-#+END_SRC
+#+END_COMMENT
#+RESULTS:
-#+BEGIN_COMMENT emacs-lisp
+#+BEGIN_SRC emacs-lisp
(use-package ivy
:bind
(("C-c s" . swiper)
@@ -576,7 +597,7 @@ Enable winner mode to save window state.
(define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history)
(setq ivy-re-builders-alist
'((t . ivy--regex-fuzzy))))
-#+END_COMMENT
+#+END_SRC
#+RESULTS:
: counsel-unicode-char
@@ -658,9 +679,12 @@ incrementally selecting more and more of the text.
#+BEGIN_SRC emacs-lisp
(use-package expand-region
- :bind ("M-m" . er/expand-region))
+ :bind ("M-o" . er/expand-region))
#+END_SRC
+#+RESULTS:
+: er/expand-region
+
*** Dired
#+BEGIN_SRC emacs-lisp
@@ -735,25 +759,17 @@ incrementally selecting more and more of the text.
(setq-default TeX-master nil)
(setq TeX-PDF-mode t)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
- (add-hook 'LaTeX-mode-hook 'flyspell-buffer)
(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)
- (defun turn-on-outline-minor-mode ()
- (outline-minor-mode 1))
- (add-hook 'LaTeX-mode-hook 'turn-on-outline-minor-mode)
- (add-hook 'latex-mode-hook 'turn-on-outline-minor-mode)
- (setq outline-minor-mode-prefix "\C-c \C-o")
- ) ; with Emacs latex mode
+ (add-hook 'LaTeX-mode-hook 'turn-on-reftex)
+ (setq reftex-bibliography-commands '("bibliography" "nobibliography" "addbibresource"))) ; with Emacs latex mode
#+END_SRC
#+RESULTS:
@@ -851,7 +867,6 @@ Add org noter
#+BEGIN_SRC emacs-lisp
(use-package org-noter
:after org
- :ensure t
:config (setq org-noter-default-notes-file-names '("notes.org")
org-noter-notes-search-path '("~/org/research")
org-noter-separate-notes-from-heading t))
@@ -859,7 +874,7 @@ Add org noter
#+RESULTS:
: t
-
+p
*** Templates
#+BEGIN_SRC emacs-lisp
(setq org-capture-templates
@@ -1078,9 +1093,10 @@ Haskell mode with company mode completion.
:bind (("M-." . haskell-mode-jump-to-def))
:config
(add-hook 'haskell-mode-hook 'haskell-decl-scan-mode)
- (setq haskell-mode-stylish-haskell-path (expand-file-name "~/.local/bin/stylish-haskell")
+ (setq haskell-mode-stylish-haskell-path "/home/yannherklotz/.local/bin/stylish-haskell"
haskell-stylish-on-save t
- haskell-process-type 'stack-ghci))
+ haskell-process-type 'stack-ghci
+ haskell-process-path-stack "/home/yannherklotz/.local/bin/stack"))
(use-package interactive-haskell-mode
:ensure haskell-mode