Feature Request: Vim-like Keybindings for spf
Feature Request: Vim-like Keybindings for spf
Is your feature request related to a problem? Please describe.
As a Vim user, I find the default keybindings in spf difficult and unintuitive to use. The lack of familiar Vim-like shortcuts significantly hinders my workflow and efficiency.
Describe the solution you'd like
I propose implementing Vim-like keybindings in spf, drawing inspiration from the Ranger file manager. Specifically, I suggest the following:
- Copy/Paste:
yyto copy the current line/selection.ppto paste the copied content (with a double-click confirmation for safety).
- Navigation:
hlto toggle between parent and child directory.gfollowed by a directory name (e.g.,gh) to jump to the home directory.g/followed by a directory name to jump to root directory.ggto jump to the first file in the current directory.Gto jump to the last file in the current directory.
Describe alternatives you've considered
I've considered remapping existing spf keybindings, but this approach is cumbersome and doesn't fully address the need for a more Vim-centric experience.
Additional context
These Vim-like keybindings are widely adopted and appreciated by Vim users. Implementing them in spf would greatly enhance the tool's usability and appeal to a broader audience familiar with Vim's efficient workflow.
It's a good idea. But I would like to make some small comments:
yyto copy the current line/selection.ppto paste the copied content (with a double-click confirmation for safety).
We can use the single operators y and p for this.
ppto paste the copied content (with a double-click confirmation for safety).
I don't think we need a confirmation, instead we should add undo, redo to the actions we took.
hlto toggle between parent and child directory.
Totally agree, I'm surprised it's not set by default now.
gfollowed by a directory name (e.g., gh) to jump to the home directory.g/~~followed by a directory name~~ to jump to root directory.
Great, I would also like to be able to customize these aliases in the config. Something like this:
[goto]
h = "$HOME"
d = "$HOME/Desktop"
c = "$HOME/.config"
"/" = "/"
ggto jump to the first file in the current directory.Gto jump to the last file in the current directory.
Additionally, in select mode, we can highlight the files we jumped.
Would also be nice to have functionality similar to ctrl-u and ctrl-d in vim which moves the cursor half a page up or down respectively. Very convenient for quickly scrolling through directories with a large amount of files.
@Rido-o There is already support for that. You have the PageUp key that does it.
@Rido-o There is already support for that. You have the PageUp key that does it.
Whoops your right, not sure how I managed to miss it.