how to let tab display only file name rather than the full path in vim

后端 未结 4 1268
Happy的楠姐
Happy的楠姐 2020-12-13 18:05

If the full path of a file is very long, you can\'t tell which file is in a given tab. so I\'m wondering is there is a way let the tab only disply the file name rather than

4条回答
  •  心在旅途
    2020-12-13 19:10

    The other solutions only work for GUI VIM and does not work for terminal vim or embedded vim (nvim).

    You can use vim-plug and vim-airline. Then, add this to your .vimrc.

    call plug#begin(stdpath('data') . '/plugged')
    Plug 'vim-airline/vim-airline'
    Plug 'vim-airline/vim-airline-themes'
    call plug#end()
    
    let g:airline#extensions#tabline#enabled = 1
    let g:airline#extensions#tabline#fnamemod = ':t'
    

提交回复
热议问题