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/shortcuts
generates shortcuts for shell, zsh, lf, vim.The changes you make are applied on saving (
:wq
)To understand this, open
.config/lf/lfrc
and look at that final line (which basically appends the above.local/bin/shortcuts
generated mapping at the end oflfrc
)This purpose of
.local/bin/shortcuts
is 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
C
for some directory but theCopyTo
menu opens, and messes up your shortcuts.The superseded issue (#1239) fixed this by mapping lf shortcuts to
Ctrl+x
andCtrl+z
, but I find these mappings to be inefficient, asLeftCtrl
is the hardest key to press with the left pinky, andRightCtrl
is 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 (j
k
) 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
f
andF
(find, find-back) are needless, because/
and?
do the exact same job (n
repeats the search if needed). Andf
is adjacent tor
(Super+r
opening lf, so the finger movement is minimal to move fromr
tof
)Also changed
m
tomm
becausem
shortcut always overridesmn
(shortcuts of longer length under the same characters are overriden)