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

后端 未结 8 751
别那么骄傲
别那么骄傲 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:25

    I found 2 ways to display the file path in the Title bar of the gnome-terminal while editing a file with Vim.

    The simpler (and better) way: Add the following line to your ~/.vimrc:

    set title
    

    Which will show you at the top:

    filename.ext (~/path_to_directory_where_your_file_is/) - VIM
    

    The more complicated way will show you the absolute file path. It's documented in a bit more detail in this blog post I recently wrote.

提交回复
热议问题