I know that I can use either:
A shortcut that has worked for me (both muscle memory and intuitiveness) is to map __
(which is a double _
) to "insert at start of current line".
Rationale:
_
already goes to the start of line_
doesn't conflict with any motions (you're already at the start of line)vimscript:
"insert at start of current line by typing in __ (two underscores)
function DoubleUnderscore()
if v:count == 0 && getcurpos()[2] == 1
:silent call feedkeys('I', 'n')
else
:silent call feedkeys('^', v:count + 'n')
endif
endfunction
nnoremap _ :call DoubleUnderscore()
It's this complicated because the easy alternative nnoremap __ _I
causes vim to delay on pressing _
to distinguish between _
and __
.