how do you write text on the status line with the filename, row and col number with vimscript?

vim

Solution

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.

Problem

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.

Original source