Sometimes I work with really small terminal windows and need every piece of space available. So I want to hide the vim status line.

I already set laststatus=0 this hides one of the status lines. But there is still another one with the content -- INSERT -- and "filename.ext" 22L 500C.

How can I hide this line?


Add these lines to your .vimrc:

let s:hidden_all = 0
function! ToggleHiddenAll()
    if s:hidden_all  == 0
        let s:hidden_all = 1
        set noshowmode
        set noruler
        set laststatus=0
        set noshowcmd
        let s:hidden_all = 0
        set showmode
        set ruler
        set laststatus=2
        set showcmd

nnoremap <S-h> :call ToggleHiddenAll()<CR>

Then in normal mode, type Shift + H to hide all, type again to make them visible.

You can change <S-h> to any key you want.

  • Thank you, this is already a good step. But the status line still exists. It says "filename.ext" 22L 500C when I start vim. – ph3nx Jul 5 '14 at 11:14
  • @ph3nx: What happen when you type Shift + H – cuonglm Jul 5 '14 at 11:23
  • 3
    Then messages like -- INSERT -- are not shown anymore, but the line still exists and says "filename.ext" 22L 500C. – ph3nx Jul 5 '14 at 11:25
  • 1
    Updated my answer! – cuonglm Jul 5 '14 at 12:18
  • In order to get rid of the fileinfo in the command line, you can put: set shortmess=F in your vimrc. I recommend reading :help shortmess – m4110c Sep 20 '18 at 0:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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