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
0answers
20 views

Cursor get stuck at the statusline bar when saving a .tex file (probably due to vimtex)

To preface this, I'm relatively new to vim, and I'm using Windows Subsytsem for Linux, and the Windows Terminal if this makes any difference. So whenever I'm editing a .tex file and want to save, ...
0
votes
0answers
13 views

Handling softlink directories in Windows

I'll edit the title as soon as I think of a way to succinctly word my question. I have the following for my statusline: set stl=%{expand('%:~:.') It gets the current filename's fullpath and truncate ...
0
votes
1answer
81 views

Statusline/Tabline - Unable to see which buffer is open when many buffers are open in a tab

I have a tab with the following window structure: _________________________________ 1 | 3 | | | | | ...
1
vote
1answer
37 views

To toggle statusline colors when switching modes. Problem with C-C

I use the following code to have different statusline colors for Normal and Insert modes: highlight statusLine ctermfg=black ctermbg=red guifg=red guibg=black autocmd ...
0
votes
1answer
39 views

Difference between %f and %F (it's not that obvious!)

This might be a silly question, but what is the actual difference between %f and %F in status line? From :h statusline: f Path to the file in the buffer, as typed or relative to current directory. F ...
0
votes
1answer
30 views

Titlesting/Statusline: to differentiate empty buffer from non-empty ones

I use the following settings to have the filename in the header line before the rest of the path: set titlestring= set titlestring+=%M set titlestring+=%(\ %t%) set titlestring+=%(\ (%{expand('%:p:h')}...
0
votes
1answer
31 views

Building: --disable-statusline is unrecognized option

I want to improve Gentoo ebuild. I tried :helpgrep statusline. In the future, how can I get all possible build flags about features in :version?
0
votes
1answer
157 views

Is there a way to display in the statusline when capslock is detected?

One of the biggest problems I currently have in Vim is I start working enter a few commands and suddenly all key binds and commands start acting up. After a few seconds of panic and trying to do the ...
1
vote
2answers
34 views

MacVim mode() does not return 'c' for Command mode when pressing ':'

mode() won't return anything when I go into Command mode. I use this for StatusLine info: set statusline+=%{mode()} as a test to see what mode() returns. pressing c or C and my StatusLine stays as ...
0
votes
0answers
24 views

How do I turn off powerline-based statusline when it seems to be locked on?

The system on which I do a lot of my work just "upgraded" and among other changes, powerline is now installed and turned on by default for all vim users. I... really don't like it. It's ...
0
votes
1answer
52 views

How to show ruler always in the last line instead of statusline?

From h:ruler: If a window has a status line, the ruler is shown there. Otherwise, it is shown in the last line of the screen. How to instead show it only in the last line for the currently active ...
2
votes
1answer
62 views

How to set the background color for colored items in the statusline to the background color of the statusline?

I am experimenting with creating a statusline and have opted for coloring different parts of it. The problem is that while the item's foreground color is changed, the background is black and doensn't ...
3
votes
3answers
205 views

How to prevent whitespace associated with items in the statusline from taking up space, when the item is not shown?

Consider the following statusline that makes use of %r to display [RO], when readonly has been set. The problem is that when readonly is not set, two spaces occur between %f (file path) and %y (file ...
2
votes
1answer
228 views

How to add the "filetype" to the default "statusline" in Vim?

I like the default statusline in Vim, but would you like to add the filetype to it. Is it possible to add the filetype to the default statusline without having to create a new statusline from scratch?
2
votes
1answer
176 views

Vim Terminal interferes with statusline

I am editing a lot of files with Vim, and I have the following in my .vimrc to help me stay oriented as to which file I am in: " Add file name to statusline so we know where we are in the ...
0
votes
1answer
62 views

Unclosed expression sequence error when setting statusline?

I am trying to display the number of loaded buffers on my statusline using: ... set statusline += %{len(getbufinfo({"buflisted":1}))} ... The error I get is : E540: Unclosed expression ...
-1
votes
2answers
82 views

How can i make this autocmd BufEnter command work?

i am setting the default vim-statusline, and i made this line on my colorscheme: hi MyStatusLineDevIcon ctermfg=7 ctermbg=0 cterm=NONE So i can color the devicons on my statusline.vim config I call ...
3
votes
1answer
233 views

check if plugin is loaded in .vimrc and set option accordingly?

I apologise if this seems very basic but I wasn't able to find a satisfactory answer. In my vimrc I want to check if the lightline status bar is loaded and set options accordingly. call plug#begin('~/....
0
votes
1answer
100 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
124 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 ...
5
votes
1answer
101 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
34 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
339 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
286 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
526 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
2k 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
153 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
65 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
45 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
53 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 ...
3
votes
1answer
127 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
53 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
28 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
112 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
101 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
928 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
275 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
2k 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
116 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
207 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
512 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
102 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
2k 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
359 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
93 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
75 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
152 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
1k 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
1k 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%* ...
2
votes
1answer
5k 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' } ...