I wrote a little Vim function that moves the cursor to the first character of the current line. If the cursor was already on the first character, then the cursor is moved to the first column instead.
" Jump to first character or column noremap H :call FirstCharOrFirstCol()<cr> :function! FirstCharOrFirstCol() : let current_col = virtcol('.') : normal ^ : let first_char = virtcol('.') : if current_col == first_char : normal 0 : endif :endfunction
How do I call this function silently? I’d rather ‘:call FirstCharOrFirstCol()’ wasn’t displayed in the status line. Simply changing to
noremap H :silent call… doesn’t seem to be enough.