Fixed lf shortcuts keybindings #1379
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Supersedes #1239
The script at
.local/bin/shortcutsgenerates shortcuts for shell, zsh, lf, vim.The changes you make are applied on saving (
:wq)To understand this, open
.config/lf/lfrcand look at that final line (which basically appends the above.local/bin/shortcutsgenerated mapping at the end oflfrc)This purpose of
.local/bin/shortcutsis that all shortcuts are in one place (;bd;bf->.config/shell/bm-dirs,.config/shell/bm-files)So if you want to add a shortcut of a new folder or file, you don't have to copy-paste the mapping onto the config of lf, st, zsh, vim, seperately.
The Problem
As explained in #1239 the shortcuts conflict lf's
C(mapped toCopyTo) andE(mapped toExtract), but lf shortcuts are also mapped onC(bm-dirs) andE(bm-files)This means all shortcuts are disabled in lf, as you press
Cfor some directory but theCopyTomenu opens, and messes up your shortcuts.The superseded issue (#1239) fixed this by mapping lf shortcuts to
Ctrl+xandCtrl+z, but I find these mappings to be inefficient, asLeftCtrlis the hardest key to press with the left pinky, andRightCtrlis slightly awkward to press with the right pinky. Having mapped my own personal directories and files, I can confirm that this functionality is the most used alongside selection (Spacebar) because I now never move up or down (jk) to move to a different directory, so it makes no sense to have such core functionality in a 2-key press, instead of a single key-press.The key
fandF(find, find-back) are needless, because/and?do the exact same job (nrepeats the search if needed). Andfis adjacent tor(Super+ropening lf, so the finger movement is minimal to move fromrtof)Also changed
mtommbecausemshortcut always overridesmn(shortcuts of longer length under the same characters are overriden)