I have a global statusline set, but it would be useful if each split window had the current filename in its own statusline.
How to show the current filename in each split window's status line in Vim?
Asked Answered
OK, the default setting is empty so I added the following setting for stock console vim that seems to play nice with the NERDTree and Syntastic plugins:
" [buffer number] followed by filename:
set statusline=[%n]\ %t
" for Syntastic messages:
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
" show line#:column# on the right hand side
set statusline+=%=%l:%c
very nice -> surprised there are fewer upvotes on this. I'm currently learning Elixir's Phoenix web framework, and it forces work on many interdependent small files, so this is almost indispensable. –
Thesis
how would you refresh this - running from inside tmux then this status will disappear when moving between tmux panes ? –
Kumasi
@Kumasi Im using screen with split panes (basically a main window with vim running in it and a smaller pane below which is just a bash command-line). I looked at replicating this setup with tmux, but you can't do with a single file the way you can with screen, so I stayed with screen. –
Rattoon
© 2022 - 2024 — McMap. All rights reserved.
set statusline
and tell us what's the value oflaststatus
. – Bildungsromanstatusline
:set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
I dont explicitly setlaststatus
but I see it has the value of2
. I do see a status line but not for individual vim windows. – Rattoon$ /usr/bin/vim -u NONE .bashrc -c "vs .ctags" -c "sp .tmux.conf"
. Note the three filenames. If you don't have something similar add all the details you can to your question. – Bildungsroman:help 'statusline'
. – Bildungsromanstatusline
on my machine is empty. – Rattoon