meow-edit / meow

Yet another modal editing on Emacs / 猫态编辑
GNU General Public License v3.0
1.09k stars 127 forks source link

If I use lispy, then lispy will cover meow's keybindings #9

Closed KiteAB closed 3 years ago

KiteAB commented 3 years ago

Can this package use with Lispy?

KiteAB commented 3 years ago

Cannot (

DogLooksGood commented 3 years ago

Oh, I don't think they can play well :(

KiteAB commented 3 years ago

Well, my configuration file is this: https://github.com/KiteAB/.emacs.d

u runs the command special-lispy-undo (found in lispy-mode-map), which
is an interactive Lisp function in ‘lispy.el’.

It is bound to u.

(special-lispy-undo)

Call ‘lispy-undo’ when special, self-insert otherwise.

Deactivate region and ‘undo’.

I did'nt set u key's keybinding, I think it should be caused by it So we should set all the keys to nil or self-insert-command by default?

DogLooksGood commented 3 years ago

Meow needs a complete keymap setup, since it has no default keybinding. The keymap(meow-normal-state-keymap) already have high priority, so it won't be covered by other packages, unless a key is not undefined.

I'm not a colemak user, here is an example for colemak, from a user.

(defun meow-setup ()
  (setq meow-cheatsheet-layout meow-cheatsheet-layout-colemak)
  (meow-motion-overwrite-define-key
   ;; Use e to move up, n to move down.
   ;; Since special modes usually use n to move down, we only overwrite e here.
   '("e" . meow-prev))
  (meow-leader-define-key
   ;; To execute the originally e in MOTION state, use SPC e.
   '("e" . meow-motion-origin-command)
   '("1" . meow-digit-argument)
   '("2" . meow-digit-argument)
   '("3" . meow-digit-argument)
   '("4" . meow-digit-argument)
   '("5" . meow-digit-argument)
   '("6" . meow-digit-argument)
   '("7" . meow-digit-argument)
   '("8" . meow-digit-argument)
   '("9" . meow-digit-argument)
   '("0" . meow-digit-argument))
  (meow-normal-define-key
   '("0" . meow-expand-0)
   '("1" . meow-expand-1)
   '("2" . meow-expand-2)
   '("3" . meow-expand-3)
   '("4" . meow-expand-4)
   '("5" . meow-expand-5)
   '("6" . meow-expand-6)
   '("7" . meow-expand-7)
   '("8" . meow-expand-8)
   '("9" . meow-expand-9)
   '("-" . negative-argument)
   '(";" . meow-reverse)
   '("," . meow-inner-of-thing)
   '("." . meow-bounds-of-thing)
   '("[" . meow-beginning-of-thing)
   '("]" . meow-end-of-thing)
   '("/" . meow-visit)
   '("a" . meow-append)
   '("A" . meow-open-below)
   '("b" . meow-back-word)
   '("B" . meow-back-symbol)
   '("c" . meow-change)
   '("C" . meow-change-save)
   '("d" . meow-delete)
   '("e" . meow-prev)
   '("E" . meow-prev-expand)
   '("f" . meow-find)
   '("F" . meow-find-expand)
   '("g" . meow-keyboard-quit)
   '("G" . goto-line)
   '("h" . meow-head)
   '("H" . meow-head-expand)
   '("i" . meow-tail)
   '("I" . meow-tail-expand)
   '("j" . meow-join)
   '("J" . delete-indentation)
   '("k" . meow-kill)
   '("K" . meow-kill-whole-line)
   '("l" . meow-line)
   '("m" . meow-mark-word)
   '("M" . meow-mark-symbol)
   '("n" . meow-next)
   '("N" . meow-next-expand)
   '("o" . meow-block)
   '("O" . meow-block-expand)
   '("p" . meow-yank)
   '("q" . meow-quit)
   '("r" . meow-replace)
   '("R" . meow-replace-save)
   '("s" . meow-insert)
   '("S" . meow-open-above)
   '("t" . meow-till)
   '("T" . meow-till-expand)
   '("u" . undo)
   '("v" . meow-search)
   '("V" . meow-pop-search)
   '("w" . meow-next-word)
   '("W" . meow-next-symbol)
   '("x" . meow-delete)
   '("y" . meow-save)
   '("z" . meow-pop-selection)
   '("Z" . meow-pop-all-selection)
   '("&" . meow-query-replace)
   '("%" . meow-query-replace-regexp)
   '("?" . meow-cheatsheet)
   '("<escape>" . meow-last-buffer)
   '("<f3>" . meow-start-kmacro)
   '("<f4>" . meow-end-or-call-kmacro)))

Then you got this.

image

Use ? to open cheatsheet.

DogLooksGood commented 3 years ago

So we should set all the keys to nil or self-insert-command by default?

Basically you don't, you can still use all other keybindings(especially Vanilla Emacs keybindings).

KiteAB commented 3 years ago

So why this colemak example is not on README file

DogLooksGood commented 3 years ago

This Colemak example is someone send me on Bilibili, so I wonder if he want some discussions or PR about this. I'm not sure would Colemak user prefer H/N/E/I or not.

What do you think? Any idea is appreciated.

KiteAB commented 3 years ago

This Colemak example is someone send me on Bilibili, so I wonder if he want some discussions or PR about this. I'm not sure would Colemak user prefer H/N/E/I or not.

What do you think? Any idea is appreciated.

I don't like H/N/E/I keys ever since using (Neo)Vim, I think U/N/E/I is better than that (Equivalent to the arrow keys)

DogLooksGood commented 3 years ago

Meow was started with a semantic layout, not ergonomic layout(like xah-fly-key, boon). Since layout is a about preferences, so I decided not to spend time on this.

If we could have an ergonomic layout, then the problem will be solved on every keyboard layout. Both xah-fly-key and boon have support for Colemak, my idea was to steal the idea from them. But their systems are constructed with Do-What-I-Mean commands, and commands in Meow are designed to be simple and orthogonal. The command sets are quite different.

KiteAB commented 3 years ago

Meow was started with a semantic layout, not ergonomic layout(like xah-fly-key, boon). Since layout is a about preferences, so I decided not to spend time on this.

If we could have an ergonomic layout, then the problem will be solved on every keyboard layout. Both xah-fly-key and boon have support for Colemak, my idea was to steal the idea from them. But their systems are constructed with Do-What-I-Mean commands, and commands in Meow are designed to be simple and orthogonal. The command sets are quite different.

Oops...I think these works are very good, but the starting point is different. Meow has powerful customization, it's different from person to person.

M1zzu commented 3 years ago

Regarding Lispy: If you only need the binds, I think you can just bind the appropriate commands in insert mode:

(define-key meow-insert-state-keymap "<" 'special-lispy-barf)
(define-key meow-insert-state-keymap ">" 'special-lispy-slurp)

At least those two work and don't interfere with normal mode. Maybe have paredit running at the same time to also get balanced parens?

edit1: Perhaps Lispy's lispy-compat (readme) could be useful here.

edit2: Oh, you actually have slurp/barfage integrated already :+1: ofc it's not as smart.

DogLooksGood commented 3 years ago

Meow's slurp and barf is implemented via the kbd execution of C-) and C-}. It doesn't care whether you are using Paredit or smartparens. This is why Meow prefer executing commands by simulating the keybinding.