Typing ^G gives

"filename" 119 lines --17%-- 21,0-1 Top

Setting statusline=%t\ %m%r%50l,%c%V\ %P gives e.g.:

filename [+]                            21, 0-1       Top
-- INSERT --

i.e. the statusline is in addition to the normal line used for :ex cmds, showmode and ruler.

Ideally, I'd like something like:

filename [+]       -- INSERT --                          21, 0-1       Top

as the line normally used by the ruler. I.e. not using a statusline (and not the window title either).

  • ruler might be it?
    – Maxim Kim
    Feb 6 at 21:55
  • @MaximKim I seem to recall rulerfmt that might do it if the filename can be included.
    – D. Ben Knoble
    Feb 6 at 22:00
  • Yes, :set rulerformat=%t\ %m%r\ %l,%c%V\ %P is more or less what I want. It gives -- INSERT -- tst.c [+] 5,1 All (in insert-mode, with showmode set).
    – colinh
    Feb 6 at 22:16
  • I've changed this to:set rulerformat=%50(%t\ %m%r\ %l,%c%V\ %P%) because the output gets truncated if the output is too long. The change means the output is no longer right-justified :-(
    – colinh
    Feb 6 at 22:56

1 Answer 1


I believe in neovim you would do this with :set cmdheight=0 so that the statusline occupies the bottom of the window. There is a side-effect that opening a command line with : shifts the display a bit, IIRC.

I think the closest thing in Vim is the ruler. You could make this show what you want with rulerformat.

  • Thanks, rulerformat does the trick (and no, cmdheight=0 doesn't work in vim).
    – colinh
    Feb 6 at 22:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.