How do you customize the status line in Vim?
set statusline=%f\ %m%r%h\ %=%l,%c\ %P
Configure statusline with format items: %f (filename), %m (modified flag), %= (right-align), %l,%c (line,column), %P (percentage).
12 results for "H M L"
set statusline=%f\ %m%r%h\ %=%l,%c\ %P
Configure statusline with format items: %f (filename), %m (modified flag), %= (right-align), %l,%c (line,column), %P (percentage).
:set statusline=%f\ %m%r%h%w\ %=%l/%L\ %p%%
Vim's statusline option accepts printf-style format codes that display file info, position, mode, and any custom expression.
{count}H and {count}L
Most Vim users know H jumps to the first visible line, M to the middle, and L to the last.
M to move to the middle, L to move to the bottom
How it works Vim offers three commands to jump the cursor to specific vertical positions on the visible screen without scrolling: H moves to the top of the scre
L
The L command moves the cursor to the last line visible in the current window.
H
The H command moves the cursor to the first line of the currently visible screen (the "High" position).
:nnoremap <leader>d "=strftime('%Y-%m-%d')<CR>p
The expression register (=) evaluates Vimscript expressions and uses the result as register content.
M
The M command moves the cursor to the line in the middle of the current window.
set statusline=%{MyCustomFunc()}
How it works Vim's statusline supports the %{expr} syntax which evaluates a Vimscript expression and displays the result.
:set nostartofline
By default, many Vim movement commands — gg, G, Ctrl-d, Ctrl-u, Ctrl-f, Ctrl-b, and others — snap the cursor to the first non-blank character of the destina
<C-o> / <C-i>
Vim maintains a jumplist — a history of every "jump" you make (searches, marks, gg, G, %, etc.
zt / zb
The zt and zb commands scroll the viewport so the current cursor line appears at the top or bottom of the screen respectively, without moving the cursor.