简体   繁体   中英

Disable status line in vim's Syntastic

I use syntastic plugin for vim on a computer with small screen, so want to cut out the unnecessary space. But, syntastic, when there's an error, displays eg:

[Syntax: line: 5 (1)]
a.cpp|5 col 59 warning|some error
[Location List] :SyntasticCheck gcc (cpp)
Vim status bar

Is is possible to remove the status line ( [Syntax: line... ) and the last line ( [Location List... ), which I don't necessarily need? I tried disabling the loclist altogether (then I see the warnings/errors in the vim status bar), but I cannot scroll status bar, when it's too long -- but maybe it is possible?

Before turning on loclist: 没有本地列表

After:

与 loclist 上

Here I have already removed the statusline formatting string from my ~\.vimrc . I would like the loclist to occupy one extra line, now it takes 3.

What you need is to hide the statusbar.

Take a look at this post , which implements a function to toggle that functionality.

Or, to disable it altogether:

set noshowmode
set noruler
set laststatus=
set noshowcmd

I think the it's not possible to entirely solve the problem that I asked for, as the loclist is considered another vim window and as such, the first extra line is a mandatory status line of the main window. One can disable the second extra line though by passing:

set laststatus=0

To disable the status bar (the top bars, not the bottom line with format '%d' ... )

Supposedly set laststatus=0 should work. However I noticed this was not working in my vimrc but would work if set manually for each vim session.

To resolve this issue, I added an autocmd within my .vimrc to override any existing laststatus setting:

# ~/.vimrc

" Hide Status Line
set laststatus=0 " For some reason this doesnt work
autocmd BufRead,BufNewFile * set laststatus=0 " This will work instead

As Weston Ganger said, laststatus=0 may not work in the vimrc file. In my case, the reason was in the vim-airline plugin. As stated in https://bbs.archlinux.org/viewtopic.php?id=241303 , in airline.vim has a line set laststatus=2 , which just needs to be corrected to set laststatus=0 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM