How do I build a custom statusline without plugins?
: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.
11 results for "H M L"
: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.
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).
L
The L command moves the cursor to the last line visible in the current window.
:set statusline=%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
Vim's built-in statusline option lets you build a custom status bar that displays exactly the information you want — without any plugin.
H
The H command moves the cursor to the first line of the currently visible screen (the "High" position).
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
set statusline=%{MyCustomFunc()}
How it works Vim's statusline supports the %{expr} syntax which evaluates a Vimscript expression and displays the result.
M
The M command moves the cursor to the line in the middle of the current window.
:nnoremap <leader>d "=strftime('%Y-%m-%d')<CR>p
The expression register (=) evaluates Vimscript expressions and uses the result as register content.
<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.