meow-edit / meow

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

How to use C-u prefix? #428

Closed morgandavidson closed 1 year ago

morgandavidson commented 1 year ago

For example, in an org-table, C-c = adds $1= to #+TBLFM: where C-u C-c = adds@1$1=.

With meow I can do C-c = with SPC c =. How can I do C-u C-c =?

DogLooksGood commented 1 year ago

Prepend universal-argument, use C-u or SPC u.

morgandavidson commented 1 year ago

C-u SPC C = adds @1$1= indeed, but SPC u writes "u "in the buffer.

I use meow 20230327.524 on Emacs 28.2.

DogLooksGood commented 1 year ago

Oh, sorry. You just bind SPC u (or whatever key) to meow-universal-argument.

(meow-leader-define-key '("u" . meow-universal-argument))
morgandavidson commented 1 year ago

Thank you, it now works, but SPC has to be hit twice : SPC u SPC c =

  (use-package meow
    :init
    (meow-global-mode 1)
    (define-key meow-motion-state-keymap (kbd "<escape>") nil)
    :bind
    ("z" . meow-insert)
    ("u" . meow-universal-argument)
    )
DogLooksGood commented 1 year ago

Well the binding is totally up to you. If you want u SPC c =, then you bind meow-universal-argument to normal and motion keymap. But there's no way to make it SPC u c =, for now.

morgandavidson commented 1 year ago

Actually, my config wasn't working properly because I was unable to type the letter "u" when in insert mode. Here is the correct config:

  (use-package meow
    :init
    (meow-global-mode 1)
    (meow-leader-define-key '("u" . meow-universal-argument))
    )

Thanks again.

DogLooksGood commented 1 year ago

I think they should be put into :config instead of :init. I don't use use-package, but it seems that in use-package, :init will be evaluated before loading the package.