Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I have a permanent status line showing the name of the current file?

Tags:

vim

I keep on forgetting which file I'm editing.

In Vim 7.x, how can I have a permanent status bar at the bottom (like what is displayed when I press Ctrl+G) showing the current file name I'm editing?

like image 534
anon Avatar asked Mar 08 '10 21:03

anon


People also ask

How do I see the filename in Vim?

If all that is wanted is to display the name of the current file, type Ctrl-G (or press 1 then Ctrl-G for the full path). When using @% , the name is displayed relative to the current directory. In insert mode, type Ctrl-R then % to insert the name of the current file.

What is status line in Vim?

The statusline in Vim is the bar along the bottom of the Vim window. By default it does not show when you open Vim until there is more than one window.

How do I get full path of file in Gvim?

Pressing 1 followed by Ctrl + G shows the full path of the current file.


1 Answers

From the manual, you're really just wanting:

set laststatus=2 set statusline=%f "tail of the filename 

As an aside: if you're wanting a status line with a ton more information be sure to check out this link. It'll give you something a bit more fancier like so:-

alt text

like image 132
Gavin Gilmour Avatar answered Sep 30 '22 19:09

Gavin Gilmour