Stack Exchange Network

Stack Exchange network consists of 174 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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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
30 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
21 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
26 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
56 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
52 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
35 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
28 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]':!...
2
votes
0answers
45 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
131 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
2answers
62 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
45 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
41 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
50 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
43 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
0answers
30 views

How to display a list of buffer in tabline or statusline without messing up with tabs

I am wondering if there is a way that I can have a constant list of opened buffers being displayed somewhere like tabline or statusline? I know vim-airline provides a tabline functionality. But it ...
0
votes
1answer
72 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
28 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
235 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
141 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
431 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
169 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
115 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
47 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
248 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
194 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
128 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
416 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
86 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
343 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
117 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
1answer
76 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
331 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
150 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
334 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
274 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
405 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
158 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
196 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
69 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
87 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
630 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?
1
vote
1answer
1k views

Problem with color, symbols and upper bar using airline with Vim in terminal

I noticed 3 problems with my Vim terminal setup on Ubuntu which can be illustrated by the following picture of my current Vim. I get the same look with a lot of airline-themes (e.g. molokai, ...
6
votes
1answer
232 views

Display current subroutine/subprogram in statusline

I am currently coding fortran, and I have huge "subprograms" (called "subroutine" in fortran). So I would like the name of the current subroutine (the subprogram my cursor is currently in) to be ...
2
votes
2answers
89 views

How to extract part of the current working directory to the statusline?

I have a lot of projects of the form: /home/karl/source/project-name/further/hierarchy/... I would like to extract just the project-name to put into my statusline. I use autochdir, so I know I can ...
2
votes
1answer
596 views

Status line: Display path to file in the buffer, *without* filename

I can use %t in my statusline to display the file name (tail) of the file in the buffer, but there's no corresponding option to display only the path, without the file name. What I'm after: I'd like ...
5
votes
1answer
242 views

Conditional strings on the statusline

Is it possible to print a conditional string on the statusline? e.g. GREEK if iminsert=1 and LATIN otherwise?
7
votes
2answers
2k views

How to get rid of the command line bar?

I am using vim-airline and it's really nice. However, I get that second status bar below it which I want to hide. I have tried set noshowmode in my .vimrc, but that only seemed to hide the default ...
5
votes
1answer
510 views

How to cut/trim line in statusline?

I'm trying to cut string returned from fugitive plugin. It returns branch name of current file. By default returned string is Git(branchname) and this is why I want to get rid of odd Git(..) wrapper. ...
6
votes
1answer
733 views

How to disable '— INSERT --' text beneath statusline?

I have powerline statusline plugin and set laststatus=2 in .vimrc, so I have two places it tells me my mode in. What is the bottom one called and can I disable it?
4
votes
1answer
227 views

How can I make a slow-ish `system` call in a statusline without corrupting the display?

I wrote a quick snippet of VimL to display, in my statusline, the type of the currently focused Haskell expression It looks like this (click for better quality (as gfy)): I've included the code below,...