Vim like movement keys
See original GitHub issueHi, just installed cerebro and I have to say that I’m quite enjoying it. I was opening this issue to check whether you’d be happy for me to implement a feature that I would quite like to have.
I use spacemacs and vimium and am quite used to using vim-like command keys to navigate around. I was wondering if it would be ok for me to add these to cerebro.
For instance, Ctrl+j
would go down Ctrl+k
would go up, Ctrl+h
would go left and Ctrl+l
would go right.
If it’s not wanted generally we could put them behind a feature flag in the settings. What do you think?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:7
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Vim Movements Part I
The Basics · h – Moves the cursor left · j – Moves the cursor down · k – Moves the cursor up...
Read more >Vim Cheat Sheet
Cursor movement · h - move cursor left · j - move cursor down · k - move cursor up · l -...
Read more >Vim in Ten Keys
You can hit it as many times as you like, it will even wrap around to the next line. Moving one word to...
Read more >vi Complete Key Binding List
complete key binding reference ; v, UNBOUND ; w, move foreward one word ; x, delete single character ; y, yank command, cursor...
Read more >Here is why vim uses hjkl keys as arrow keys
I was reading about vim the other day and found out why it used hjkl keys as arrow keys. When Bill Joy created...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It doesn’t have to be one or another, the shortcuts <kbd>Ctrl+j/k/h/l/n/p</kbd> are unused now and can be added right away, for everyone, not controlled by any settings - and for some people that would be enough.
The command mode is a different beast, it has to be hidden in the settings and disabled by default, otherwise people will just be confused a lot. But it potentially provides much more control than a simple navigation.
Ok, summarizing:
There are two steps of implementation.
Lightweight vim-mode
On first step we just add few more shortcuts: <kbd>ctrl+hjkl</kbd> – navigate in results (the same as arrows now) <kbd>ctrl+o</kbd> – select (=== <kbd>enter</kbd>)
Hardcore vim-mode
Insert mode
It works, like Cerebro works now. Only one exception <kbd>esc</kbd> switches app to command mode, instead of closing the window
Command mode
In this mode you can’t change input term, but you have more powerfull commands, like
<kbd>hjkl</kbd> – navigate in results (the same as arrows in insert mode) <kbd>o</kbd> – select (=== <kbd>enter</kbd>) <kbd>i</kbd> – switch app back to insert mode <kbd>q</kbd> – close the window
Any more thoughts?