mirror of
https://github.com/mawww/kakoune.git
synced 2024-07-14 16:10:24 +03:00
Page:
Ambiguous Keys
Pages
Ambiguous Keys
Annotated examples of "Kakoune script"
Avoid the escape key
Bar
Bc
Building
Clang
Community
Ctags
Distinguish between focused and unfocused clients in Tmux
Documenting Plugins
EditorConfig
Eval Exec
Fuzzy finder
Git integration via Tig
Grep
HTML editing
Hacking
Header files
Highlighters
Home
IDE
Implementing user mode
Increment and Decrement
Indentation and Tabulation
Info boxes
Installing Plugins
Integrating Other CLI apps
JSON RPC
Jumplist
Kak daemon helper : 1 session per project
Languages
Line flags
Manipulating dates with Chronic
Migrating from Vim popular plugins
Migrating from Vim
Normal mode commands
OpenBSD
Plugin Managers
Qalculate
Ranger
Readline
Regex
Registers & Clipboard
Registers Clipboard
Reverse search
Running commands at startup
Rust
Selections combinations
Selections
Setting Plugin Options
Shell scripting
Status line
String syntax
TUI
The window scope
Tips for building from source
Undo tree
Wc
Windows tips
Wrapping
Writing Plugins
kak ‐p
macOS tips
zsh zle
3
Ambiguous Keys
Alan edited this page 2022-04-04 15:54:24 -07:00
Table of Contents
For historical reasons, most terminals (except for some modern ones like Kitty, iTerm, and foot) send the exact same keycodes for different keys. For example, the <tab>
key sends the same code as <c-i>
. When Kakoune receives an ambiguous code, it has to decide what key to decode it to:
This key | Decodes as |
---|---|
<c-m> |
<ret> |
<c-j> |
<ret> |
<c-i> |
<tab> |
<c-h> |
<backspace> |
Therefore, if you map a key from the first column, the mapping will not trigger in the regular terminal UI. Instead, you should map the key from the right-hand column to achieve the same effect.
If you really want to map <c-m>
instead of <ret>
(because <c-m>
has some mnemonic value, for example) you can make Kakoune manually trigger the first-column mappings in addition to the second-column mappings:
hook global normal RawKey <ret> %{ execute-keys -with-maps <c-m>; execute-keys -with-maps <c-j> }
hook global normal RawKey <tab> %{ execute-keys -with-maps <c-i> }
hook global normal RawKey <backspace> %{ execute-keys -with-maps <c-h> }
Relevant discussions
Wiki Home Page
Onboarding
Keys
- Normal mode commands
- Avoid the escape key
- Implementing user mode (Leader key)
- Kakoune explain
- Kakoune TV
Editing
User Interface
Integration with OS and other tools
- Languages
- IDE
- Bar
- Kak daemon helper : 1 session per project
- Registers & Clipboard
- macOS tips
- Windows tips
- Fuzzy finders
- JSON-RPC UI
- bc
- Qalculate!
- wc
- Shell Scripting
- Manipulating dates with Chronic
- Integrating Other CLI apps