diff options
Diffstat (limited to 'emacs')
| -rw-r--r-- | emacs/custom.el | 2 | ||||
| -rw-r--r-- | emacs/init.org | 43 |
2 files changed, 12 insertions, 33 deletions
diff --git a/emacs/custom.el b/emacs/custom.el index f78663f..02bb485 100644 --- a/emacs/custom.el +++ b/emacs/custom.el @@ -15,7 +15,7 @@ '(markdown-command "/usr/bin/markdown-calibre") '(package-selected-packages (quote - (emojify auctex diminish bats-mode bool-flip salt-mode flycheck-rust rust-playground rust-mode vue-mode coffee-mode json-reformat erc-hl-nicks emoji-cheat-sheet-plus helm-circe htmlize cmake-mode websocket markdown-mode go-mode magit evil-leader evil helm projectile writeroom-mode org-eldoc evil-commentary yasnippet yaml-mode which-key web-mode wc-mode use-package terraform-mode smart-tabs-mode slim-mode scss-mode rainbow-delimiters php-mode org-evil olivetti mu4e-alert mmm-jinja2 markdown-preview-mode helm-projectile helm-ag go-eldoc go-add-tags flycheck expand-region evil-surround evil-org evil-numbers evil-mu4e evil-magit evil-args dockerfile-mode disable-mouse default-text-scale crux cmake-font-lock ag)))) + (debbugs async-await request emojify auctex diminish bats-mode bool-flip salt-mode flycheck-rust rust-playground rust-mode vue-mode coffee-mode json-reformat erc-hl-nicks emoji-cheat-sheet-plus helm-circe htmlize cmake-mode websocket markdown-mode go-mode magit evil-leader evil helm projectile writeroom-mode org-eldoc evil-commentary yasnippet yaml-mode which-key web-mode wc-mode use-package terraform-mode smart-tabs-mode slim-mode scss-mode rainbow-delimiters php-mode org-evil olivetti mu4e-alert mmm-jinja2 markdown-preview-mode helm-projectile helm-ag go-eldoc go-add-tags flycheck evil-surround evil-org evil-numbers evil-mu4e evil-magit evil-args dockerfile-mode disable-mouse default-text-scale crux cmake-font-lock ag)))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/emacs/init.org b/emacs/init.org index 224ee3a..e15d9cc 100644 --- a/emacs/init.org +++ b/emacs/init.org @@ -689,34 +689,6 @@ that often, but it's cool to have a distraction-free screen from time to time. :ensure t) #+END_SRC -The =expand-region= package is an extension that is based on a Vim one, which -expands the region of selection with a single key chord. Even if evil covers -most of my uses, it's convenient to have this tool anyways. - -#+BEGIN_SRC elisp -(use-package expand-region - :ensure t - :config - - ; Set C-e as the expand command (mnemonic: expand). This command will - ; supercede the evil binding for "move one line", which I never use anyways. - (global-set-key (kbd "\C-e") 'er/expand-region) - (with-eval-after-load 'evil - (define-key evil-normal-state-map (kbd "\C-e") 'er/expand-region) - (define-key evil-visual-state-map (kbd "\C-e") 'er/expand-region))) - -(defun er/add-text-mode-expansions () - "This way we can also expand the region into paragraphs & pages in text mode. -Directly taken from: https://github.com/magnars/expand-region.el." - - (set (make-local-variable 'er/try-expand-list) (append - er/try-expand-list - '(mark-paragraph - mark-page)))) - -(add-hook 'text-mode-hook 'er/add-text-mode-expansions) -#+END_SRC - Editing files as root is a bit of a pain because usually the root user doesn't have the same configuration as the current one, and attempting to do so can be messy. So, instead of that, we could advice the =find-file= function so if the @@ -839,6 +811,14 @@ First of all, let's define a function that will be called whenever Evil is loade (global-unset-key (kbd "M-j")) (global-unset-key (kbd "M-k")) + ; Go back to Emacs' bindings on beginning/end of line. + (eval-after-load "evil-maps" + (dolist (map '(evil-motion-state-map + evil-insert-state-map + evil-emacs-state-map)) + (define-key (eval map) "\C-a" 'beginning-of-line) + (define-key (eval map) "\C-e" 'end-of-line))) + ; both this function and the subsequent lines about [escape] are taken from ; @aaronbieber configuration. (defun minibuffer-keyboard-quit () @@ -969,15 +949,14 @@ respectively. #+END_SRC Last but not least, =evil-numbers= brings a couple of bindings available to Vim -into Evil: @@html:<kbd>C-a</kbd>@@ for increasing a number, and -@@html:<kbd>C-c -</kbd>@@ for decreasing it (modified because -@@html:<kbd>C-z</kbd>@@ is my escape sequence). +into Evil: @@html:<kbd>C-c +</kbd>@@ for increasing a number, and +@@html:<kbd>C-c -</kbd>@@ for decreasing it. #+BEGIN_SRC elisp (use-package evil-numbers :ensure t :config - (define-key evil-normal-state-map (kbd "C-a") 'evil-numbers/inc-at-pt) + (define-key evil-normal-state-map (kbd "C-c +") 'evil-numbers/inc-at-pt) (define-key evil-normal-state-map (kbd "C-c -") 'evil-numbers/dec-at-pt))) #+END_SRC |
