Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed lf shortcuts keybindings #1379

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TheYellowArchitect
Copy link
Contributor

@TheYellowArchitect TheYellowArchitect commented Nov 25, 2023

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 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 #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 (#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)

…ose to SuperR, and you can go anywhere with 1 finger (instead of 2) since its the most often used button now. Emphasis that on saving .local/bin/shortcuts, it automatically generates these shortcuts on the configs of vim, st, lf. To see this yourself, go to the final line of lfrc, look at the file it sources.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant