This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" this | |
set statusline=%f%n | |
" is the same as this | |
" but this variant is cleaner and easier to maintain | |
set statusline= | |
set statusline+=%f | |
set statusline+=%n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The second character in "item" is the type: | |
N for number | |
S for string | |
F for flags as described below | |
- not applicable | |
ITEM MEANING ~ | |
f S Path to the file in the buffer, as typed or relative to current | |
directory. | |
F S Full path to the file in the buffer. | |
t S File name (tail) of file in the buffer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set laststatus=2 | |
set statusline= | |
set statusline+=%f | |
set statusline+=%l | |
set statusline+=%L | |
set statusline+=%n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set statusline= | |
set statusline+=%f | |
set statusline+=%m | |
" switching to right side | |
set statusline+=%= | |
set statusline+=%l | |
set statusline+=%L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" from scrooloose's blog post | |
" https://got-ravings.blogspot.com/2008/08/vim-pr0n-making-statuslines-that-own.html | |
set statusline= | |
set statusline+=%<\ " cut at start | |
set statusline+=%2*[%n%H%M%R%W]%*\ " flags and buf no | |
set statusline+=%-40f\ " path | |
set statusline+=%=%1*%y%*%*\ " file type | |
set statusline+=%10((%l,%c)%)\ " line and column | |
set statusline+=%P " percentage of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Dictionary: take mode() input -> longer notation of current mode | |
" mode() is defined by Vim | |
let g:currentmode={ 'n' : 'Normal ', 'no' : 'N·Operator Pending ', 'v' : 'Visual ', 'V' : 'V·Line ', '^V' : 'V·Block ', 's' : 'Select ', 'S': 'S·Line ', '^S' : 'S·Block ', 'i' : 'Insert ', 'R' : 'Replace ', 'Rv' : 'V·Replace ', 'c' : 'Command ', 'cv' : 'Vim Ex ', 'ce' : 'Ex ', 'r' : 'Prompt ', 'rm' : 'More ', 'r?' : 'Confirm ', '!' : 'Shell ', 't' : 'Terminal '} | |
" Function: return current mode | |
" abort -> function will abort soon as error detected | |
function! ModeCurrent() abort | |
let l:modecurrent = mode() | |
" use get() -> fails safely, since ^V doesn't seem to register |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! FileSize() abort | |
let l:bytes = getfsize(expand('%p')) | |
if (l:bytes >= 1024) | |
let l:kbytes = l:bytes / 1025 | |
endif | |
if (exists('kbytes') && l:kbytes >= 1000) | |
let l:mbytes = l:kbytes / 1000 | |
endif | |
if l:bytes <= 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! ReadOnly() abort | |
if &readonly || !&modifiable | |
return '' | |
else | |
return '' | |
endfunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set statusline= | |
" file encoding | |
set statusline+=\ %{(&fenc!=''?&fenc:&enc)} | |
" current time, when buffer saved | |
set statusline+=\ %{strftime('%R', getftime(expand('%')))} | |
set statusline+=\ %{&fileformat} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set laststatus=2 | |
set statusline= | |
set statusline+=%#function#\ %l | |
set statusline+=\ %* | |
set statusline+=\ ‹‹ | |
set statusline+=\ %f\ %* | |
set statusline+=\ ›› | |
set statusline+=\ %m | |
set statusline+=%#keyword#\ %F | |
set statusline+=%= |