Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
31 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 ...
0
votes
1answer
29 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
20 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
46 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
1answer
32 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
31 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 ...
2
votes
1answer
57 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
34 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
24 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 ...
2
votes
2answers
362 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
1answer
63 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 %...
1
vote
0answers
39 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
78 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
191 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 ...
0
votes
1answer
154 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 ...
0
votes
0answers
103 views

Display output of a shell command in vim-airline status upon every save

I have access to both vim8.xx and neovim. For the vim-airline plugin for filetype tex, I'd like to add the output from the following shell command each time the buffer is saved to disk. texcount -sum ...
1
vote
1answer
46 views

Why do I need two backlashed 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]':!...
3
votes
1answer
80 views

How to display in the statusline the number of matches from a search?

I've seen this question: Is there a way to count the number of occurrences of a word in a file? but most of the time I search using * or just /. It is possible to display automatically in the ...
2
votes
1answer
191 views

Carets in status line

When splitting the editor window, the caret symbols appear in the status line of the current window. This happens when StatusLine and StatusLineNC have the same highlighting. For example, when cterm=...
-1
votes
1answer
101 views

Showing read-only or non-modifiable status in status line

I am building my statusline. Previously I used functions to return information, but recently I learnt that these can be done in one line. For example: set statusline+=%{&modified?'\ \ [+]':''} ...
0
votes
1answer
114 views

remove vim statusline for horizontal splits with laststatus already set to 0

I was wondering if the statusline between horizontal splits can be removed. Maybe it can be replaced by command line?
0
votes
1answer
166 views

Show filename tail and parent directory in statusline

If I'm at file /a/b/c/foo.txt, I'd like the statusline to display c/foo.txt. Is this possible? The reason for this is that for web development, too many files are named index.js to make just the tail ...
0
votes
0answers
54 views

Powerline buffers bar breaks when I switch color schemes

I am using iTerm2's default 'Light Background' terminal profile. I am using the latest version of vim-airline for my powerline bar and whatnot. When I use the :color command, even to "switch" to the ...
0
votes
0answers
57 views

Get the current running program in command-line mode with Vim8

I want to rename the current buffer to have the current running program. Show the running program in the statusline like this : /usr/bin/zsh;#neoterm-2 [bin/rails console] The current buffer name ...
0
votes
1answer
88 views

My status line is getting erased, so I can't print function result

I have a function that counts the number of matches in a file using the substitute Ex command with the /n flag and returns the value. However, I cannot echo the answer because the status line is ...
1
vote
0answers
30 views

How to trigger :redrawstatus to a different window?

Is there a way to invoke :redrawstatus from a window that is different than the window whose statusline is to be updated ? Not a global :redrawstatus to all windows, but to one specific window.
1
vote
1answer
369 views

How to display file size in vim rulerformat?

I want to display file size in the rulerformat in vim. Please answer for all file size formats like bits, bytes, kibibytes, mebibytes, gibibytes
0
votes
1answer
218 views

vim: count how many buffers been modified?

Pursuing a vimscript function or expression that count how many buffers been modified. i.e., how many buffers :bm could switch to, given that option hidden is set. == Edit == In the hope of used ...
2
votes
1answer
1k views

Problem of neovim with powerline-status

I have neovim 0.2.0 and powerline-status (2.6) on Fedora 26. But it fails as follows: Se ha detectado un error al procesar function provider#python3#Call: línea 18 Traceback (most recent call last):...
1
vote
2answers
243 views

Setting custom statusline for help window

I've been trying to set a custom statusline for help files. I tried: set statusline=%!StatusLine() function! StatusLine() if &ft == 'help' let b:status = "%#error#[HELP]%*" else ...
1
vote
1answer
158 views

Checking if Makefile exists before executing autocmd

I want Vim to execute build the project automatically after I write the buffer to a *.c or *.cpp file. Here is what I've done: autocmd BufWritePost *.c,*.cpp make This one works as expected (but the ...
0
votes
1answer
77 views

Change messages display duration

Is there a way to make Vim's messages stay longer on the screen? Messages and error messages are currently shown for a very short time; for about half-second, if not mistaken.
1
vote
2answers
336 views

Display enclosing namespace, class, and function

How can I convince Vim or Neovim to show the enclosing namespace, class, and function that the cursor is in? Some programming languages have no interesting namespaces or class names. In general, this ...
1
vote
1answer
249 views

turn off “— INSERT --” color

vim 7.4 console mode. When in insert mode, I would like to turn off the ugly yellow when I am in insert mode. My background is set to light, so vim should not use a light yellow for anything.
0
votes
2answers
156 views

Can I use different User1… User9 colors for active and inactive panes?

I know User1... User9 colors the status line. I have applied several colors to the statusline to make it easy to recognize, but I wish this is only applied to active panes, not inactive panes. So that ...
3
votes
1answer
534 views

How to get git branch information supplied by vim-fugitive asynchronously for my statusline?

I can directly use the following approach to get the git branch information: ... let l:git = "%6*%{exists('g:loaded_fugitive')?fugitive#statusline():''}%*" ... If so, it can cause a delay to the ...
1
vote
1answer
94 views

I want to indicate in the status line whether or not `spell` is set

I am using vim-tinyline and it doesn't seem to have an option for this and I have no idea how to write a function to do this. Example function from tinyline that checks whether the file has been ...
3
votes
1answer
589 views

My statusline is missing. How do I get it back?

I'm using Vim 8, and my status line is missing. I type in: set statusline=%f ...and hit Enter, and nothing seems to happen. Once I do some moving or editing, what I just typed in disappears, and ...
0
votes
1answer
158 views

Ask a list of all percent-prefixed variables

In reading other's .vimrc, I find many percent signs. For instance in the portion concerning the status line, I know %F%m%r%h must stands for something like the current filename being edited. But ...
0
votes
2answers
91 views

remove buffer list from command area - VIM 7.4

I want to hide the buffer list from the command area - the list doesn't need to be always visible as it can be viewed with a command eg :ls. The behavior would be similar to set nobl but global and ...
3
votes
1answer
443 views

How do I conditionally add items to the statusline?

As a simple example, let's say I want to show the line number only when :spell is set. I would assume the following would work, but does not. %{&spell ? %l : ""}
4
votes
1answer
160 views

Keep beginning of current fold on top of the screen

I've googled around but can't find anything about this. There is a case: when I navigate deep down through large blocks of code in (for example) python, it would be useful to see which method, ...
3
votes
1answer
487 views

Difference between `virtual column number` and `column number` in statusline

What's the difference between virtual column number and column number (%v and %c respectively) in the statusline? Is it like virtualedit, where the virtual column number counts the position of the ...
1
vote
1answer
458 views

How can I show the containing directory in the window title?

I'm trying to customize my window title, which uses the same format as the statusline. I know I can show the full path to the file with %F (or %-0.20F to restrict it to 20 characters). I'd prefer to ...
1
vote
1answer
522 views

Gvim : Statusline is loading but not its colours

I have been experimenting with colours for my statusline recently and I put the plugin file in the bundle directory. I use pathogen which loads everything up from that directory. But, Even though the ...
1
vote
0answers
185 views

Vimrun.exe keeps opening and closing when statusline is updated

I am working on a plugin and as part of that plugin I am trying to update the statusline with setlocal statusline=%!GetMPCStatusline(). But this causes vimrun.exe to open and close very fast. This ...
1
vote
1answer
262 views

Statusline function only displayed when sourcing .vimrc

I have a function that detects the name of the subroutine* my cursor is in, thanks to this answer. function! SubName() abort if &syntax !='fortran' return "" endif let ...
1
vote
1answer
75 views

Status line group constant width

I have this in my vimrc for setting the status line: set laststatus=2 set statusline=%3(%{mode()}\ %) set statusline+=%1*\ %F For normal and visual mode (but also for all other modes tested): But ...
0
votes
0answers
119 views

Why doesn't select mode appear in the status line?

Regardless of the mode I select, it appears on the status line. But when I switch to select mode, it is not shown on the status line in Vim, whereas it is shown in gVim. How do I make it work?
0
votes
1answer
736 views

Auto-updating statuslines of inactive windows

When a variable on which a statusline depends changes, I see the result only in statuslines of active windows. Can inactive ones be made to see those changes too?