If you are a Vim user, you will hopefully have been using HJKL and to navigate your documents, rather than the arrow keys. However I like to take this idea a little further. Well, a lot further.
It can seem like an odd thing to someone who has never tried it, however the more you use it the more you notice the micro inefficiencies that come from reaching for a mouse, or even the arrow keys.
My thinking is, if I can save a few seconds every day from having my fingertips where they need to be, over a life time that makes a difference! Plus it looks cool to whizz around your system without moving a muscle from your keyboard.
On my Chromebook I have three modifier keys, Ctrl + Alt + Shift, when we combine those with HJKL we end up with 32 key combinations. Add to that different contexts in different applications, there should never be a reason to leave the home row!
Vimium / VimFX
To use HJKL in your browser, doesn't require that much of a configuration or change to your system at all. Just install Vimium for Chrome, or VimFX for Firefox.
Now you can scroll pages with
hjkl, go backwards and forwards with
L, and switch tab with
K. To click links, you use
f for current tab or
F for new tab. Then you type the letters that are on the link that you want to go to.
It takes a bit of getting used to, but once you get the hang of it, you can navigate so much quicker for most basic web browsing. It helps you practice touch typing too!
Everyone's vim setup and workflow is different, but to tie in with my HJKL theme, I've tweaked a few things. Firstly, I mapped
K to mimic the changing of tabs in Vimium. This is probably a controversial move, as you have to rebind the
J key, I chose to use
nnoremap J :tabprev<CR> nnoremap K :tabnext<CR> nnoremap M J
The next thing I did was to enable
k to work in drop down auto complete lists. This makes it easier to select items without moving your fingers.
inoremap <expr> j ((pumvisible())?("\<C-n>"):("j")) inoremap <expr> k ((pumvisible())?("\<C-p>"):("k")) inoremap <expr> <tab> ((pumvisible())?("\<Cr>"):("<Cr>"))
I also found it really handy to map
L to jump to the beginning and ends of lines.
nnoremap H ^ nnoremap L $
Tiling Window Manager / Xmonad
On my systems I run a tiling window manager called Xmonad. Below I will give the bindings specific to Xmonad, but hopefully you can see the idea I'm getting at and apply it to your own DE / WM if you fancy giving this a try.
-- Adjust split ((mod1Mask, xK_j), sendMessage MirrorShrink), ((mod1Mask, xK_k), sendMessage MirrorExpand), -- Workspaces ((controlMask .|. mod1Mask, xK_l), nextWS), ((controlMask .|. mod1Mask, xK_h), prevWS), ((mod1Mask .|. shiftMask, xK_l), shiftToNext >> nextWS), ((mod1Mask .|. shiftMask, xK_h), shiftToPrev >> prevWS),
What this lets me do is resize my current window with
h/j/k/l, move the current window around the workspace with
J/K, or move it to another workspace with
H/L. I can then also shift workspaces with
This means that if I have Vim on one workspace, and Chrome on the other, I can seamlessly move between them and interact with them, without moving my fingers at all!
After having lived with this setup for the better part of two years, I am pretty happy with it, although I'm always looking for some ways to improve it, as well as a few bugs to solve. One of the most rage inducing bugs is in Chrome, viewing a PDF will stop Vimium from running, meaning you can get stuck on a tab.
If you give this a try, I'd be interested to hear how you find it, hopefully you will really notice those times you are forced to use the mouse or arrow keys.
My dotfiles have a lot more configurations, so if you want to get the bigger picture check them out.