LukeSmithxyz / voidrice

My dotfiles (deployed by LARBS)
GNU General Public License v3.0
4.26k stars 1.22k forks source link

Fixed lf shortcuts keybindings #1379

Open TheYellowArchitect opened 9 months ago

TheYellowArchitect commented 9 months ago

Supersedes https://github.com/LukeSmithxyz/voidrice/pull/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 of lfrc)

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 https://github.com/LukeSmithxyz/voidrice/pull/1239 the shortcuts conflict lf's C (mapped to CopyTo) and E (mapped to Extract), but lf shortcuts are also mapped on C (bm-dirs) and E (bm-files) This means all shortcuts are disabled in lf, as you press C for some directory but the CopyTo menu opens, and messes up your shortcuts.

The superseded issue (https://github.com/LukeSmithxyz/voidrice/pull/1239) fixed this by mapping lf shortcuts to Ctrl+x and Ctrl+z, but I find these mappings to be inefficient, as LeftCtrl is the hardest key to press with the left pinky, and RightCtrl 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 and F (find, find-back) are needless, because / and ? do the exact same job (n repeats the search if needed). And f is adjacent to r (Super+r opening lf, so the finger movement is minimal to move from r to f )

Also changed m to mm because m shortcut always overrides mn (shortcuts of longer length under the same characters are overriden)