How can I permanently display the path of the current file in Vim?

后端 未结 8 762
别那么骄傲
别那么骄傲 2020-12-12 12:26

I know CTRLg displays the current file you\'re working on. Is there a way to modify my .vimrc such that the filename/path is always displa

8条回答
  •  渐次进展
    2020-12-12 13:18

    If you want the path to include resolved symlinks, use the following:

    set statusline +=%{resolve(expand('%:p'))}\ %*
    

    To keep the '~' abbreviation for your home directory, include fnamemodify

    set statusline +=%{fnamemodify(resolve(expand('%:p')),':~')}\ %*
    

提交回复
热议问题