Questions tagged [statusline]

A status line will be used to separate windows. Questions about how to format and change the content of this status line.

Filter by
Sorted by
Tagged with
0
votes
1answer
32 views

Show buffer title at top of window instead of bottom

By default vim shows the filename of the current buffer (or whatever status line you have specified) at the bottom of each split window. Is there any way to change it so that it displays at the top of ...
0
votes
0answers
29 views

How to set statusline for specific buffer

I want to use netrwm instead of nerdtree. I have my own statusline but I don't want it to be displayed in netrw. Nerdtree had it's own option for it (let NERDTreeStatusline="") which made it ...
3
votes
1answer
46 views

Statusline wrong column count for multi-byte characters

I have set this statusline. :set statusline=%c According to :help statusline, %c means column number. If the buffer contents is abcdef éÀ│§õ→ and the cursor is on the f character, the statusline ...
0
votes
0answers
24 views

colorscheme murphy interferes with statusline

I do not know if its my term colors or something, but one of my colorschemes (murphy) makes the statusline unreadable I do not wnat the problem is. Here's my vimrc: "source $HOME/cscope_maps.vim ...
1
vote
1answer
42 views

Default rulerformat

I like the default rulerformat, but I would like to add to it. However it seems the default value is hidden. If I try these: set rulerformat set rulerformat? I just get: rulerformat= Same for ...
2
votes
1answer
93 views

Suddenly running :colorscheme breaks lightline

Suddenly, after a Vim update, I guess, when I run :colo some_color_scheme, the coloring of my lightline status bar is black and white, as you can see in the following screencast: Since I version my ...
3
votes
1answer
82 views

Is it possible to get vim-airline to make the statusline 2 or more lines high?

My statusline has too much information to fit on one line. It was already marginal, but now that I've rotated my monitor into portrait mode, it's a huge issue. I really like all the information ...
2
votes
1answer
548 views

How to get Vim to show git status in the statusline?

I want to show the git status in the vim statusline, but I can't find any advice on how to do that. The output of git status -s would be fine, or alternatively a single field readout indicating ...
2
votes
1answer
45 views

Use pipe symbol as separator in statusline

I wanted to make my own status line and I wonder how can I use a pipe as a separator? I want to achieve something like this: NORMAL | file.html [html] | utf-8 | 80:10
1
vote
0answers
48 views

Local “statusline” override problem

I'm currently writing a plugin, and got stuck with this problem. My plugin opens a new window with all local options I want, but also sets the statusline option to display some useful information. Vim ...
1
vote
0answers
34 views

rulerformat truncated when filename included

Given the limited screen real estate on my device (27x48), I'm trying set laststatus=1 set rulerformat=%25(%<%f%M\ %=%l\|%c%) No matter the minwid prefix, or if I apply it to %() or %f, or if I ...
2
votes
1answer
36 views

Is there a way to get a count of the number of spelling errors in a buffer?

I'd like to be able to show the number of spelling errors in a buffer in my status line. Is there a vimscript way of getting a count of the number of spelling errors? I could write some code to count ...
2
votes
1answer
51 views

Mapping statuses fails on Visual Block ^V

I've got some code to print the current mode in the status line. let g:currentmode={ \ 'n' : 'Normal', \ 'no' : 'Normal·Operator Pending', \ 'v' : 'Visual', \ 'V' : 'V·Line', \ ...
2
votes
1answer
38 views

Having current filename in the command line

Some time ago I completely got rid of the status line. Vertical space is a scarcity in the modern HD world. The only thing I missed from it is an ability to see what file I'm working with. So I'm ...
2
votes
0answers
25 views

Can I trigger a command when the status bar shows up or hides?

I'm using set laststatus=1 so the status bar is only visible when needed, e.g. to display file names when multiple splits are open. However, when the status bar shows up, the existing buffer seems to ...
0
votes
2answers
42 views

Require nested evaluation within the status line, a render status line function?

With regards to this line (full code at the bottom): let savestatus = "%{&modified ? '%#StatusUnsaved#[+++]%*' : &modifiable ? '[---] ' : '[ R ]'}" If the file is modified, I wish to print [...
0
votes
1answer
39 views

Is it possible to pass local variables to functions inside statusline=%{}?

I have a function that builds my status line by appending values with statusline+= depending on the context. Everything works, except that if I try to call a function in the following form: setlocal ...
3
votes
1answer
360 views

ctermbg and ctermfg are backwards or incorrect for certain highlighting groups

I am currently attempting to create a custom colorscheme for vim by using ctermfg and ctermbg values, and checking what the colorscheme looks like with the highlight test file provided by Vim. What I ...
1
vote
0answers
137 views

Add to statusline

I'm using vim-airline plugin for my statusline. Now I want to install kite which suggests adding a section to the statusline. I tried adding using: set statusline+=%{kite#statusline()} but that ...
3
votes
2answers
859 views

Disable Lightline on Nerdtree

I would like to disable or hide Lightline (i.e. vim's statusline) when my cursor is in Nerdtree, while keeping it activated for other buffers. Here is what I mean: How can I achieve this? ...
3
votes
1answer
84 views

Sourcing vimrc duplicates statusline in nvim

I'm new to vim so I'm not sure if this is intended behavior or not, but it seems like a bug. Desired Behavior After sourcing vimrc from within nvim, don't duplicate the contents of my statusline. Or ...
1
vote
1answer
111 views

detecting insert-normal mode

I notice that when in insert, pressing <C-o> will take me to normal mode, but once I finish pressing a sequence of keys, I get taken back to insert mode. I find this very useful, but I want a ...
1
vote
1answer
270 views

How to move airline status bar to the bottom of the editor?

There is VIM's default bar below my Airline's status bar, which causes file information to be viewed twice (as shown in the image). How can I move my airline's bar to the bottom? I have tried adding ...
1
vote
0answers
74 views

Is there a keybinding that allows to scroll through the status line?

I was wondering if it was possible to scroll (left or right) along the status line so that the content (which could not be displayed due to the size of the window) could be seen. Perhaps there is a ...
2
votes
2answers
958 views

Review: git branch in statusline

Note: this is an educational exercise. For those wanting a ready-made solution, use vim-gitbranch. I am learning vimscript, and the code below is part of my .vimrc used to display the current git ...
1
vote
1answer
227 views

How can I add a count of all columns on every line to the statusline in Vim?

I'm using vim-airline and would like to add a count of all characters on the current line to it. It should be displayed like 1:75 where 1 is the column the cursor is currently on and 75 the total ...
2
votes
1answer
60 views

How to have getcwd() give path with ~ in place of home folder?

I have the following (simplified) statusline config in my vimrc: set laststatus=2 set statusline= set statusline+=%{getcwd()} When I'm somewhere in my home directory on macOS, my statusline looks ...
1
vote
2answers
67 views

How to efficiently use the paste registers?

I often don't remember what was copied lately. So I don't know if I need to do <C-r>0 or <C-R>1 in insert mode. I tend to rely only on the * register, or type :reg, look at everything ...
0
votes
1answer
91 views

Custom string colors in statusline

This is my statusline setting: :set laststatus=2 :set statusline=%{GetMode()}\ %n\ %#StatusLineY#%m%*\%#StatusLineR#%r%*\ %t\ [%o\ %l\,%c\ %p%%\] and this is the GetMode() functiom function! ...
2
votes
1answer
789 views

Change/Set color to a string in statusline

I'll preface by saying that I am using Airline, plytophogy/vim-virtualenv plugin and gruvbox as the Airline theme. I am trying to change the color of some string in the status line to, say, orange. ...
2
votes
2answers
789 views

Vim Statusline colors not appearing

I want my vim statusline to have some color and I can't figure out why it does not with this code: set laststatus=2 set statusline+=%1*\ %f\ %* set statusline+=%2*\ %<%F%* set statusline+=%2*%m%* ...
1
vote
1answer
3k views

How to display all buffer names in tabline?

How do I display the list of all buffers in the tabline? I am using the lightline plugin, with the following settings in my .vimrc: set showtabline=2 let g:lightline = { 'colorscheme': 'PaperColor' } ...
4
votes
1answer
891 views

How to get the current mode in vim?

I'm writting scripts for vim, and I want to let the script do different things in different mode. I know that the statusline will show the current mode, but I don't know how to get the exact current ...
2
votes
1answer
53 views

How to use plugin provided value in statusline?

Some vim plugins provides functions especially designed to be used for statusline rendering. For example, in my .vimrc I create the status line format string like this: ... set statusline+=%{...
0
votes
1answer
98 views

Add whitespace conditionally, based on flags

I'm trying to add whitespace on the left side of the flags section, and to hide this whitespace when flags aren't exist. Here is what I mean: Statusline with no flags: :File.txt ...
1
vote
1answer
192 views

Replace text in status line flags

How could I replace text in status line flags? set laststatus=2 set statusline= set statusline+=%r%m Is there a way to replace [RO] to Read only, and [+] to Modified?
1
vote
0answers
69 views

How to write to a temproary buffer in a plugin

I've started to write my first vim plugin, a simple timer. I want to be able to set a timer for an arbitrary amount of time, and have it notify me once that time has passed. I've got it all working, ...
0
votes
2answers
325 views

Statusline percentage is erratic

The rightmost entry of the status line changes erratically. Reproduce: vim --clean :set number o<Esc>98. Press and hold k The rightmost entry of the status line first says Bot and only ...
2
votes
2answers
174 views

How to show [noeol] flag in custom statusline?

If I create a file without an EOL, for example: $ echo -n "1" > test ...and then open it in vim: $ vim --clean test ...the left hand side of the statusline looks like: "test" [noeol] 1L, 1C ...
0
votes
1answer
76 views

How to use a regexp to search/match specific pattern only for the custom statusline and/or tabline?

I got this regexp from google which is for matching specific glyphs in vim-nerdtree. autocmd FileType nerdtree syntax match {hl-group} /\v{glyph}/ containedin=ALL But obviously it won't work on ...
3
votes
1answer
322 views

How to update the statusline continuously even if the window becomes inactive

I have a vim script function MyFunction that returns a string value. I want to display this output in the statusline and so I have set the statusline as follows statusline +=\ %{MyFunction()}. I want ...
1
vote
0answers
231 views

How to access “additional sections” in vim-airline?

The vim-airline documentation addresses statusline sections as "airline_section_[a-z]" and mentions "additional sections" ([...]). I have searched in vain to figure out what letter/number could be ...
1
vote
0answers
55 views

Airline section_x for particular filetype

For .js files, I set a particular filetype in order to enable snippets, like this: augroup project autocmd! autocmd BufRead,BufNewFile *.js set filetype=javascript.javascript-es6-react.jsx ...
4
votes
2answers
1k views

How to remove ^@ character returned by `system()`?

When I call this function inside vim statusline it returns this nvim^@.weird character, What is the meaning of ^@ in returned value and how to get rid of it? function! GetEditor() let s:name = ...
0
votes
2answers
327 views

Statusline – update variables on file change

I'm currently learning Vimscript, but I'm stuck at a particular problem. I'm creating a statusline which shows the full path (~) of the file currently displayed in the buffer. Instead of just using %...
2
votes
1answer
167 views

Set different values for non-current and current statuslines

When vim is split into different panes horizontally, each pane has its own statusline. It's easy to highlight the statuslines differently based on current and non-current panes. BUT, I cannot figure ...
0
votes
1answer
243 views

Ctrl-G doesn't show column in Nvim

I have both vim and nvim using the same configuration file (basically nvim's config is a symlink to vim's one) but vim shows current column when I press Ctrl-G, while nvim doesn't. Is there some ...
2
votes
1answer
645 views

Cannot change the color of status line

I tried: hi StatusLine ctermfg=red highlight statisline ctermfg=red hi! statusline ctermfg=008 hi statusline ctermfg=008 hi statusline cterm=bold hi StatusLineNC ctermfg=2 ctermbg=8 cterm=NONE hi ...
1
vote
1answer
603 views

How to differentiate quickfix window buffers and location list buffers?

Recently I've been playing with my statusline and I'm coming to a point where I want to set a different highlighting group for the statusline of my quickfix window, location list window, and the other ...
3
votes
1answer
106 views

Why do I need two escaped spaces to insert one space in statusline

I have this lines for my statusline set statusline=%{&paste?'\ \ paste\ ':''} set statusline+=\ %{expand('%:~:.')!=#''?expand('%:~:.'):'[No\ Name]'} set statusline+=%{&readonly?'\ \ [RO]':!...