Giter Club home page Giter Club logo

Comments (2)

DogLooksGood avatar DogLooksGood commented on August 26, 2024

Here's an example if you are using KEYPAD mode.

(defvar window-keymap
  (let ((keymap (make-keymap)))
    (define-key keymap (kbd "w") #'ace-window)
    (define-key keymap (kbd "u") #'winner-undo)
    (define-key keymap (kbd "r") #'winner-redo)
    (define-key keymap (kbd "h") #'split-window-below)
    (define-key keymap (kbd "v") #'split-window-right)
    (define-key keymap (kbd "c") #'delete-window)
    (define-key keymap (kbd "o") #'delete-other-windows)
    keymap))

;; define an alias for your keymap
(defalias 'window-keymap window-keymap)

(global-set-key (kbd "C-x C-w") 'window-keymap)
;;                              ^ note the quote

Then in KEYPAD popup, it will be displayed as +window-keymap.

I think the alias way is the built-in way in Emacs, how kmacro-keymap is defined in emacs source code.


But if you define your keys in leader, there's no key description. The popup description in Meow is only for KEYPAD. The reason is leader is designed to be simple, since the shortcuts in leader is not baked by a normal key binding, it is not recommended to have complex keymap in leader.

If you want SPC w ?, you should define C-w ?, and add '("w" . meow-keypad-start) in leader.


And C-w is kill-region by default, you should not overwrite it, since it is used by Meow. If you do, remember to binding kill-region to another key, and set meow--kbd-kill-region.

Maybe C-o is an good option.


Feel free to ask if this is not clear to you.

from meow.

bsag avatar bsag commented on August 26, 2024

Defining the keymap as you describe definitely sounds like the best way to do it. And thanks for reminding me that C-w is bound to kill-region - I definitely need to change that binding!! I previously used evil, so I tend to forget about the basic Emacs keybindings.

Thanks for the help!

from meow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.