noctuid / lispyville

lispy + evil = lispyville
GNU General Public License v3.0
313 stars 23 forks source link

Are `lispy-splice`, `lispy-kill` and `lispy-splice` supposed to work in insert mode? #65

Closed Andre0991 closed 4 years ago

Andre0991 commented 4 years ago

Hi.

I'm using lispyville with Doom Emacs. I know lispy, and I'm not sure what's the intended behavior for certain keys:

Splice

<cursor>(foo bar)

In lispy-mode, / would call lispy-splice. But this won't work in my setup. It inserts the / character instead.

Is this expected?

I see that running x over ( will splice as well, but I don't want to switch to normal mode.

How can I make / call lispy-splice in insert mode?

lispy-delete and lispy-kill

<cursor>(foo bar)

In lispy, C-d and C-k would call lispy-delete and lispy-kill. This won't work in insert mode.

What's the expected workflow for deleting stuff?

I'm using C-word BACKSPACE. I pressdfor going to the matching parenthesis. But this is not as practical as just usingC-d`.

Andre0991 commented 4 years ago

I can get lispy-splice work with this hack:

(defun raise-minor-mode (mode)
    "Make MODE the first on `minor-mode-map-alist'."
    (let ((x (assq mode minor-mode-map-alist)))
      (when x
        (setq minor-mode-map-alist
              (cons x (delq mode minor-mode-map-alist))))))

;; after loading lispy
(raise-minor-mode 'lispy-mode)
Andre0991 commented 4 years ago

Well, overriding the keybindings again did the trick.

Using doom's after! and map! macros:

(after! lispy
  (map! :map lispy-mode-map
        :i "C-d" 'lispy-delete)
  (map! :map lispy-mode-map
        :i "C-k" 'lispy-kill))