Doom-emacs: [HOWTO] Remap 's' back to substitute

Created on 6 Aug 2019  Â·  2Comments  Â·  Source: hlissner/doom-emacs

Hey, I'm currently trying to switch to doom-emacs from vim. I'm not really a fan of 's' for snipe though and would like to remap it back to evil-substitute. I've tried too many things to remember all of them but the closest I've gotten is using the following:

(define-key evil-motion-state-map "s" 'evil-substitute)
(define-key evil-motion-state-map "S" 'evil-change-whole-line)

This works, but only once. If I reload emacs and hit s, it'll have the expected behavior, deleting the character and entering insert mode, but once exiting to normal mode it will not work again. It's as if the insert exit hook is overriding the map back to snipe.

System information

  • OS: gnu/linux (x86_64-pc-linux-gnu)
  • Shell: /usr/bin/fish
  • Emacs: 26.2 (Apr 12, 2019)
  • Doom: 2.0.9 (HEAD -> develop, origin/develop, origin/HEAD f754d4ff 2019-07-23 18:23:17 +0200)
  • Graphic display: t (daemon: nil)
  • System features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD LCMS2
  • Details:
    elisp env bootstrapper: envvar-file elc count: 0 uname -a: Linux 5.2.5-arch1-1-ARCH #1 SMP PREEMPT Wed Jul 31 08:30:34 UTC 2019 x86_64 modules: (:completion company ivy :ui doom doom-dashboard doom-quit hl-todo modeline nav-flash ophints (popup +all +defaults) treemacs vc-gutter vi-tilde-fringe window-select workspaces :editor evil file-templates fold multiple-cursors rotate-text snippets :emacs dired electric vc :tools eval flycheck (lookup +docsets) magit :lang data emacs-lisp markdown (org +dragndrop +ipython +pandoc +present) sh :config default) packages: n/a exec-path: (/usr/local/sbin /usr/local/bin /usr/bin /usr/lib/jvm/default/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl ~/go/bin/ ~/go/bin/ ~/go/bin/ /usr/lib/emacs/26.2/x86_64-pc-linux-gnu/)
:editor evil question elisp keybinds resolved

Most helpful comment

You can disable evil-snipe with either:

(after! evil-snipe
  (evil-snipe-mode -1))

Or completely (at the cost of incremental highlighting and repeating with ;/, on f/F/t/T) by adding the following to ~/.doom.d/packages.el:

(package! evil-snipe :disable t)

(Remember to run doom refresh and restart Emacs after modifying your packages.el file)

All 2 comments

You can disable evil-snipe with either:

(after! evil-snipe
  (evil-snipe-mode -1))

Or completely (at the cost of incremental highlighting and repeating with ;/, on f/F/t/T) by adding the following to ~/.doom.d/packages.el:

(package! evil-snipe :disable t)

(Remember to run doom refresh and restart Emacs after modifying your packages.el file)

Perfect! Thanks that works great..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rgrinberg picture rgrinberg  Â·  3Comments

nasoundead picture nasoundead  Â·  3Comments

benjaminbauer picture benjaminbauer  Â·  3Comments

governorgoat picture governorgoat  Â·  3Comments

laishulu picture laishulu  Â·  3Comments