How do I customize the status line at the bottom of the screen?
Answer
:set statusline=%f\ %m%r%=%l/%L
Explanation
The statusline option controls what information is shown in the status bar at the bottom of each window. You can display filename, position, file type, and more.
How it works
%fshows the filename%mshows the modified flag ([+])%rshows the readonly flag%=separates left and right sections%l/%Lshows current line / total lines
Example
set statusline=%f\ %m%r\ %y%=%l/%L\ (%p%%)
Shows: src/main.go [+] [go] 42/500 (8%)
Tips
:set laststatus=2always shows the status line%yshows the file type%p%%shows the percentage through the file%{FunctionName()}calls a Vimscript function for dynamic content- Plugins like vim-airline and lightline provide advanced status lines