I'm a Vim user and I'm not a Vim developer. I collect some useful vim plugins in ~/.vim/and add some usable Vim commands in my ~/.vimrc. Now it seems like IDE as this pic.

I would like to add a full file path in the status bar but couldn't find in which place I can do it.

I know some short key like Ctrl-g.

How can I do that?

enter image description here

  • Are you using a plugin to manage your status line (e.g. vim-airline or powerline)? Commented Feb 21, 2023 at 6:44
  • I don't know. I run find .vim/ -name '*air*' , only ale_linter return. Commented Feb 21, 2023 at 6:53
  • Could you tell us what is the result of :set statusline?. Commented Feb 21, 2023 at 6:58
  • thanks.statusline=%{lightline#link()}%#LightlineLeft_inactive_0#%( %t %)%#LightlineLeft_inactive_0_1# %#LightlineMiddle_inactive#%=%#LightlineRight_inactive_1_2# %#LightlineRight_inactive_1#%( %3p%% %)%#LightlineRight_inactive_0_1# %#LightlineRight_inactive_0#%( %3l:% -2c %) Commented Feb 21, 2023 at 7:02
  • 1
    I am not the down-voter, but I suspect that the downvote is for the following reason: your question does not provide enough information to get a good answer. It took some time in the comment to find out that you are using the lightline plugin, so answers customizing the statusline need to target that. You can edit to include this information, which probably should have been there to begin with. More generally, it's a good idea to include as much relevant information as possible up front.
    – D. Ben Knoble
    Commented Feb 21, 2023 at 15:21

1 Answer 1


To show the full path in the status line using lightline you can add the following line in your .vimrc file:

if !exists('g:lightline')
  let g:lightline = {}
if !exists('g:lightline.component')
  let g:lightline.component = {}
let g:lightline.component.filename='%F'

enter image description here

  • it changes the status line totally and changes the colorSchema, also it would disappear after :w. I would like to add a new column after the existing columns. in the above pic after the file name. Commented Feb 21, 2023 at 7:59
  • 1
    If you don't include the propose changes what is the result of :echo g:lightline. I suspect you already have some lightline configuration that need to be merged. Commented Feb 21, 2023 at 8:04
  • I only vim fan, I don't know about vim sysntax and ... Commented Feb 21, 2023 at 8:11
  • the result of your edition is like the previous result. disappear after :w, change color and change it totally/ Commented Feb 21, 2023 at 8:14
  • 1
    thats worked. it needs to close vim and reopen.thanks to you. Commented Feb 21, 2023 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.