mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.94k stars 716 forks source link

Add option to anchor custom menus to the cursor #4186

Open sclu1034 opened 3 years ago

sclu1034 commented 3 years ago

Feature

Add a new switch to the menu command that makes a custom menu look and behave like the completers menu. I.e. it turns into a vertical list and is anchored to the cursor. The -anchor and -style below|above switches from info would be a candidate for this.

Usecase

Language servers offer "Code Actions", which kak-lsp makes available by opening a menu. While Kakoune's menu is fixed to one edge of the screen, other editors, such as VSCode or Vim, offer such a menu as described above, so that focus doesn't have to move. Since these actions are performed in normal mode, using the existing completer framework is not an option.

danr commented 3 years ago

Perhaps not so convenient but you could roll your own using info and on-key.