开发者

Grey bar on left in vim?

I get a grey bar on left side in vim for one file. This does not happen for any other file. What is this? And how to get rid of it?

EDIT:

This is what it looks like: This goes on for the full height of the file. It does not appear in any other files. The file is a *.C which is correctly identified as of cpp file type but this thing does not happen to other files where they are being identified as cpp. colourscheme is default

Grey bar on left in vim?

EDIT2: Here is the view file for the file:

let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0
argglobal
setlocal keymap=
setlocal noarabic
setlocal autoindent
setlocal nobinary
setlocal bufhidden=
setlocal buflisted
setlocal buftype=
setlocal cindent
setlocal cinkeys=0{,0},0),:,0#,!^F,o,O,e
setlocal cinoptions=
setlocal cinwords=if,else,while,do,for,switch
setlocal comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-
setlocal commentstring=/*%s*/
setlocal complete=.,w,b,u,t,i
setlocal completefunc=
setlocal nocopyindent
setlocal nocursorcolumn
setlocal nocursorline
setlocal define=
setlocal dictionary=
setlocal diff
setlocal equalprg=
setlocal errorformat=
setlocal expandtab
if &filetype != 'cpp'
setlocal filetype=cpp
endif
setlo开发者_如何学Ccal foldcolumn=2
setlocal foldenable
setlocal foldexpr=0
setlocal foldignore=#
setlocal foldlevel=0
setlocal foldmarker={{{,}}}
setlocal foldmethod=diff
setlocal foldminlines=1
setlocal foldnestmax=20
setlocal foldtext=foldtext()
setlocal formatexpr=
setlocal formatoptions=tcq
setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s*
setlocal grepprg=
setlocal iminsert=0
setlocal imsearch=0
setlocal include=
setlocal includeexpr=
setlocal indentexpr=
setlocal indentkeys=0{,0},:,0#,!^F,o,O,e
setlocal noinfercase
setlocal iskeyword=@,48-57,_,192-255
setlocal keywordprg=
setlocal nolinebreak
setlocal nolisp
setlocal nolist
setlocal makeprg=
setlocal matchpairs=(:),{:},[:]
setlocal nomodeline
setlocal modifiable
setlocal nrformats=octal,hex
setlocal nonumber
setlocal numberwidth=4
setlocal omnifunc=
setlocal path=
setlocal nopreserveindent
setlocal nopreviewwindow
setlocal quoteescape=\\
setlocal noreadonly
setlocal norightleft
setlocal rightleftcmd=search
setlocal scrollbind
setlocal shiftwidth=4
setlocal noshortname
setlocal smartindent
setlocal softtabstop=0
setlocal nospell
setlocal spellcapcheck=[.?!]\\_[\\])'\"\    \ ]\\+
setlocal spellfile=
setlocal spelllang=en
setlocal statusline=
setlocal suffixesadd=
setlocal swapfile
setlocal synmaxcol=3000
if &syntax != 'cpp'
setlocal syntax=cpp
endif
setlocal tabstop=4
setlocal tags=
setlocal textwidth=0
setlocal thesaurus=
setlocal nowinfixheight
setlocal nowinfixwidth
setlocal nowrap
setlocal wrapmargin=0
let s:l = 75 - ((20 * winheight(0) + 29) / 59)
if s:l < 1 | let s:l = 1 | endif
exe s:l
normal! zt
75
normal! 0
let &so = s:so_save | let &siso = s:siso_save
doautoall SessionLoadPost
" vim: set ft=vim 


:set foldcolumn=0


In my case, no others but below was the solution.

set signcolumn=no


It looks like some plugin creates a sign. Try doing

sign unplace *

To find where this plugin is located, try

vim /path/to/file/that/causes/problem -c 'redir! >/tmp/scriptnames' -c scriptnames -c 'redir END' -c 'qa!'
perl -p -i -e 's/^\s*$//g;s/^\s*\d+:\s//g' /tmp/scriptnames
grep -F -w 'sign define' `cat /tmp/scriptnames`


There can be a few reasons for this. One may be a modeline. Modeline is a special line at the beginning or end of a file that sets specific settings for Vim for that file. Look for a comment line (or a line that starts with a blank), followed by the word vim and a space. Any text following that in the line may be of interest in debugging this.

Another option may be that the file has a specific filetype that triggers an autocommand set in your .vimrc file or one of its sourced modules. In particular look for set number, relativenumber, colorcolumn, foldcolumn or maybe even specific highlight settings for blanks. In Vim within the relevant buffer enter :set ft? followed by a carriage-return to know the filetype set for that file; use this to look at the settings for that filetype in your vimrc or the highlight settings in your .vim directory tree.


Just to add you can tell which script set the option by using

:verbose set foldcolumn?

You can replace foldcolumn with any name that you are interested.


The most likely cause for this is something being in a modeline - a line with contents like "vi:" or "vim:" or "ex:" in it, and something is then after it which is being interpreted as an option. See :help modeline for more information. I can't think off the top of my head what options could make it look like that.

Try doing :set nomodeline and reload the file - if that fixes it, the file has a modeline (whether you intended it to have or not). Then you can see about fixing it, or disabling modeline support if you wish in your vimrc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜