Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I open a file in Vim, a text appears in command line "filename" 99L, 9999C The text disappears when I hit PgDn for example, and then I have an empty command line.

How can I summon that text again, and how can I customize it, say add cursor position?

Note, I am aware of status line and it's not what I'm after.

share|improve this question
Ctrl+g will give you filename and line count, and g Ctrl+g gives you current position in terms of total column/line/word/byte count. Do you need more file info? – Daniel Andersson Mar 22 '12 at 17:47
Daniel, thanks, that's all the info I need at the moment. I looked up help and it seems the output of these is not customizable? – nameanyone Mar 22 '12 at 22:17
nameanyone, actually yes it is customizable. Specifically look at "set statusline". Also, you may want to use "set laststatus=2" to keep the file and location info. visable. – pottsdl Apr 3 '12 at 16:44
@pottsdl, I don't see how I can use statusline to control the output of Ctrl-G. I think they are two completely different things. There is shortmess that can be used to make the message shorter, but I didn't find how to customize it completely. – nameanyone Apr 4 '12 at 3:08
@nameanyone Sorry, I made a slight mistake. If you use the statusline, it will allow you to customize and keep it up "permanently" (really regardless of the number of files you have open). Although in noticing my mistake, there is a "rulerformat" option that allows for customizing the "ruler" talked about by Diogo Rocha and Anthem below. – pottsdl Apr 4 '12 at 13:44
up vote 4 down vote accepted

You can :set ruler to make this change stick (same output as Ctrl+G). Put that in your .vimrc to make it stick across sessions.

share|improve this answer
In my Vim, :set ruler and Ctrl-G produce different output. The combination of having "set ruler" in .vimrc and using Ctrl-G when required answers my needs. Thanks. – nameanyone Apr 4 '12 at 3:35

I use ' :e ' as command it will display the line again like you would reopen the file you are currently working in.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .