, makes key bindings more intuitive and ergonomic.
Vim-Aliases step in for
<leader> key mappings.
- people mapping the command-line key
;(to ease pinkie pain) and
- people mapping the
,(to be better reachable).
However, inside a line, we maneuver most efficiently by first looking up a character by
T) and then hemming it in by
Because either mapping cripples this, better swap
nnoremap : , nnoremap , :
This way, not only is pinkie pain eased, but also the back-and-forth motions
: are consistent with
?, and therefore more intuitive than
Then instead of various leader mappings, commonly used for commands such as, say
nnoremap <leader>gc :<c-u>!git commit<cr>
let a command-line alias step in:
Alias gc !git\ commit
This way, the former
<leader> key commands are better reachable (by now hitting
, to enter command-line) and what’s more:
the alias offers more flexibility than its corresponding leader key mapping by letting you add parameters like
!git commit -a.
- a leader key mapping cannot achieve at all, for example adding the parameters
!git commit -m 'my commit message'
- or which even additional leader key mappings
nnoremap <leader>gc :<c-u>!git commit<cr> nnoremap <leader>gca :<c-u>!git commit -a<cr>
can only achieve by side effects:
<leader>gc, it must wait for a timeout to be fired.
, and command-line aliases replace the former
<leader> key commands, the
<leader> key is freed up;
for example, for random ad-hoc commands.
For consistency and less pinkie pain, add to
nnoremap : , and
nnoremap , : the following mappings:
nnoremap : , xnoremap : , onoremap : , nnoremap , : xnoremap , : onoremap , : nnoremap g: g, nnoremap g, <NOP> nnoremap @, @: nnoremap @: <NOP> " NOTE: Causes lag when 'q' is hit, for example when " - stopping to record a macro or " - exiting a buffer by a custom mapping to 'q'. nnoremap q, q: xnoremap q, q: nnoremap q: <NOP> xnoremap q: <NOP>