docs: mention differences to Vim's key notation (#2417)

This commit is contained in:
CatsDeservePets authored and GitHub committed 2026-03-05 02:31:25 +01:00
1 parent 0bbeae73df
commit 941866b62f
3 files changed
+38 -4

No files matched your search

+10 -1
View File
@@ -1566,7 +1566,7 @@ Angle brackets can be assigned with their special names:
map <lt> down
map <gt> down
Function keys are prefixed with `f` character:
Function keys are prefixed with an `f` character:
map <f-1> down
@@ -1592,6 +1592,15 @@ It is possible to combine special keys with modifiers:
Combining multiple modifiers (e.g. `Ctrl+Shift+Space`) is not supported.
Note that lf's key mapping syntax is similar to Vim's, but not identical.
Some special keys and modifiers use different names and separators, and key names are matched literally (i.e. no case-folding, no aliases), so some familiar forms will not work:
map <enter> down # not <Enter>, <Return> or <CR>
map <f-1> down # not <F1>
map <a-j> down # not <A-j> or <M-j> (Meta)
map <m-2> open # not <RightMouse>
map <m-up> down # not <ScrollWheelUp>
WARNING: Some key combinations will likely be intercepted by your OS, window manager, or terminal.
Other key combinations cannot be recognized by lf due to the way terminals work (e.g. `Ctrl+h` combination sends a backspace key instead).
The easiest way to find out the name of a key combination and whether it will work on your system is to press the key while lf is running and read the name from the `unknown mapping` error.