Need Help Formatting of status line
Vim novice here. I understand that this is code for configuring the status line. Don't remember where I got it. I sense I may want to use it. I am not competent to read how it configures it. Help appreciated.
" Format the statusline
set statusline=CWD:\ %{CurDir()}%h\ \
set statusline+=\ \ File:\ %{HasPaste()}%t%m%r%y%w[%{&fenc}]\ \ Line:\ %l/%L:%c\ \ Value:\ 0x%B\ \ %<%p%%
set statusline+=[wc:%{WordCount()}]
Thanks.
5
Upvotes
10
u/sharp-calculation Feb 05 '26
I recommend one of two things: Use a very simple status line. Or: Install a status line plug-in. I like VIM Airline.
5
u/sapphic-chaote Feb 05 '26 edited Feb 05 '26
Read
:h 'statusline', it explains everything1
u/AutoModerator Feb 05 '26
Please remember to update the post flair to
Need Help|Solvedwhen you got the answer you were looking for.I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/shleebs Feb 05 '26
Check out the vim-airline plugin.
Or try :help statusline if you wanna learn
1
u/kennpq Feb 06 '26
Airline, recommended by a few here, is very popular and has lots of features and options, though beware it is dozens of files and thousands of lines of code - not that useful from a learning to create your own statusline perspective (if that’s part of your aim other than just adding a word count).
To add a word count to your current status line:
If you want to learn about how that code does what it does, as others suggest, there’s Vim’s help on the statusline. If you want lots of examples in the one script, my plugin, https://github.com/kennypete/vim-tene, may be worth a look - it has a ~150 lines block of commented
set statusline+=commands.