Is there a way to programmatically write on the bar below vim windows? I'm referring to the bar which displays the filename, cursor row + column, and the percentage of the document above the bottom of the window.
It is called the status line.
You can get more information by typing :help statusline
.
This is the one I used which includes line and column at the bottom right.
set statusline=%f%m%r%h\ [%L]\ [%{&ff}]\ %y%=[%p%%]\ [line:%05l,col:%02v]
│ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ └─ column number
│ │ │ │ │ │ │ │ └─── line number
│ │ │ │ │ │ │ └── percentage in file
│ │ │ │ │ │ └── file type
│ │ │ │ │ └── file format (dos/unix)
│ │ │ │ └── total number of line in file
│ │ │ └── help flag
│ │ └── read only flag
│ └── modified flag : [+] if modified, [-] if not modifiable
└── relative`
The rendering is not ideal but the options, which are starting with the %
sign, are described from left to right as you go down. They are all described in help.
This is a pretty static configuration, if you are willing to use a vim-plugin, there are some like vim-airline that provides more advanced features like git integration.
The information in that bar is set in the option statusline
. You can set this from within a script by using let &statusline =
just as you would any other vim option.
See :help statusline
for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With