diff options
author | Julian T <julian@jtle.dk> | 2021-10-14 09:28:49 +0200 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2021-10-14 09:28:49 +0200 |
commit | 29feca42b7d3162a6d3090c143744a34e91476fb (patch) | |
tree | 093ae2bb96db7a7c196d17d9b3e9d1aff62e9691 /emacs/.emacs | |
parent | 98d4650d53b1033956ec92c9f71d769d5b64ff5e (diff) |
Emacs haskell and latex mode
Diffstat (limited to 'emacs/.emacs')
-rw-r--r-- | emacs/.emacs | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/emacs/.emacs b/emacs/.emacs index e2f65ad..016a4b7 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -13,6 +13,8 @@ 'lsp-mode 'magit 'auctex + 'better-jumper + 'lsp-haskell )) (defun install-stuff () (interactive) (mapc (lambda (pack) @@ -69,6 +71,26 @@ (funcall switch 'adwaita 'dark)))) (toggle-dark-mode) +(setq-default TeX-master 'shared) + +(better-jumper-mode +1) +(with-eval-after-load 'evil-maps + (define-key evil-motion-state-map (kbd "C-o") 'better-jumper-jump-backward) + (define-key evil-motion-state-map (kbd "<tab>") 'better-jumper-jump-forward)) + +;; The following add mappings to 40j and 20k to add it to the jump list. +;; It was stolen from [1] +(defun my-jump-advice (oldfun &rest args) + (let ((old-pos (point))) + (apply oldfun args) + (when (> (abs (- (line-number-at-pos old-pos) (line-number-at-pos (point)))) + 1) + (save-excursion + (goto-char old-pos) + (evil-set-jump))))) + +(advice-add 'evil-next-line :around #'my-jump-advice) +(advice-add 'evil-previous-line :around #'my-jump-advice) ;; Keyboard bindings (defun split-and-follow-horizontal () @@ -96,9 +118,12 @@ ;; Completion (require 'lsp-mode) +(require 'lsp-haskell) (mapc (lambda (mode) (add-hook mode #'lsp)) (list 'c-mode-hook 'python-mode-hook + 'haskell-mode-hook + 'haskell-literate-mode-hook )) (mapc (lambda (mode) (add-hook mode 'company-mode)) (list @@ -118,10 +143,12 @@ '(ansi-color-names-vector ["black" "red3" "ForestGreen" "yellow3" "blue" "magenta3" "DeepSkyBlue" "gray50"]) '(package-selected-packages - '(auctex lsp-haskell haskell-mode geiser-racket magit use-package evil-surround evil-collection))) + '(better-jumper auctex lsp-haskell haskell-mode geiser-racket magit use-package evil-surround evil-collection))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ) + +;; [1] https://www.reddit.com/r/emacs/comments/8flkrg/evil_add_numbered_movement_to_the_jump_list/dy6b8qq/ |