From ab96a7bcef442a3061e01871c3a553cb9ea6e8bb Mon Sep 17 00:00:00 2001 From: Riyyi Date: Sat, 13 Mar 2021 00:33:59 +0100 Subject: [PATCH] Remove unnecessary functions, fix evil variables --- .config/emacs/config.org | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/.config/emacs/config.org b/.config/emacs/config.org index 6d37949..a1c4ed6 100644 --- a/.config/emacs/config.org +++ b/.config/emacs/config.org @@ -260,19 +260,17 @@ Evil mode and related packages. (use-package evil :after (undo-tree goto-chg) :init - ;; Needed by evil-collection - (setq evil-want-integration t) - (setq evil-want-keybinding nil) - :config (setq evil-ex-complete-emacs-commands nil) + (setq evil-kill-on-visual-paste nil) + (setq evil-operator-state-cursor 'box) ; Do not set half cursor (setq evil-search-module 'evil-search) - (setq evil-shift-round nil) (setq evil-split-window-below t) (setq evil-undo-system 'undo-tree) (setq evil-vsplit-window-right t) (setq evil-want-C-u-scroll t) - ;; Do not set half cursor in operator state - (setq evil-operator-state-cursor 'box) + (setq evil-want-Y-yank-to-eol t) + (setq evil-want-keybinding nil) ; Needed by evil-collection + :config (evil-mode)) (use-package evil-collection @@ -1263,13 +1261,6 @@ Fix keybinds.. *** Evil functions #+BEGIN_SRC emacs-lisp -(defun dot/evil-copy-until-end-of-line () - "Copy text until the end of the line. - -Vim equivalence: y$" - (interactive) - (evil-yank (point) (line-end-position))) - (defun dot/evil-normal-sort-paragraph () "Sort paragraph cursor is under. @@ -1288,15 +1279,6 @@ Vim equivalence: " (interactive) (evil-shift-left (line-beginning-position) (line-end-position))) -(defun dot/evil-visual-paste () - "Paste over visual selection, retains clipboards contents. - -Vim equivalence: pgvy" - (interactive) - (call-interactively 'evil-paste-after) - (evil-visual-restore) - (call-interactively 'evil-yank)) - (defun dot/evil-visual-shift-left () "Shift visual selection left, retains the selection. @@ -1591,17 +1573,18 @@ Set keybinds to functionality of installed packages. ;; Global evil keymap (general-def evil-normal-state-map - "Y" #'dot/evil-copy-until-end-of-line ;; y$ "C-n" #'neotree-toggle-in-project-root - "C-S-p" #'evil-paste-pop-next) + "C-S-p" #'evil-paste-pop-next + ) (general-def evil-insert-state-map - "" #'dot/evil-insert-shift-left) ;; << + "" #'dot/evil-insert-shift-left ;; << + ) (general-def evil-visual-state-map - "p" #'dot/evil-visual-paste ;; pgvy "<" #'dot/evil-visual-shift-left ;; " #'dot/evil-visual-shift-right) ;; >gv + ">" #'dot/evil-visual-shift-right ;; >gv + ) ;; Custom (M-x customize) (general-def 'normal custom-mode-map