(Change to TipImported template + severe manual clean) |
(Move categories to tip template) |
||
Line 9: | Line 9: | ||
|version=6.0 |
|version=6.0 |
||
|rating=31/17 |
|rating=31/17 |
||
+ | |category1= |
||
+ | |category2= |
||
}} |
}} |
||
I wanted to write a good looking statusline, grouping all the informations I need about a file and the environment. The needed things were the filename, the format of this file, its type, the position (line, column) of the cursor, the relative position in the file (%) and the date (day/month/year - hours:minutes). |
I wanted to write a good looking statusline, grouping all the informations I need about a file and the environment. The needed things were the filename, the format of this file, its type, the position (line, column) of the cursor, the relative position in the file (%) and the date (day/month/year - hours:minutes). |
Revision as of 04:17, 25 April 2008
created June 3, 2004 · complexity basic · author Bounga · version 6.0
I wanted to write a good looking statusline, grouping all the informations I need about a file and the environment. The needed things were the filename, the format of this file, its type, the position (line, column) of the cursor, the relative position in the file (%) and the date (day/month/year - hours:minutes).
There is one thing to always remember when you write a statusline. You have to escape all the blank characters and the " characters. To escape a character you have to use \, so if you want a whitespace you have to do "\ ".
Now here is the statusline:
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}
Comments
I think it is better
set statusline=%F%m%r%h%w\ (%{&ff}){%Y}[%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}
Try this:
set statusline=%<%F%h%m%r%h%w%y\ %{&ff}\ %{strftime(\"%d/%m/%Y-%H:%M\")}%=\ col:%c%V\ ascii:%b\ pos:%o\ lin:%l\,%L\ %P
if you want above statusline appear when there is single window, try:
set laststatus=2
--- The status line is update on potentially *each* key stroke. So having a too dynamic modeline is going to make vim really slow.
To see the file modified time on status line
set statusline=%{strftime(\"%c\",getftime(expand(\"%:p\")))}
Here's the statusline I'm currently using:
set statusline=%<%F%h%m%r%h%w%y\ %{&ff}\ %{strftime(\"%c\",getftime(expand(\"%:p\")))}%=\ lin:%l\,%L\ col:%c%V\ pos:%o\ ascii:%b\ %P