VIM在当前行中丢失语法

时间:2016-02-15 12:09:40

标签: macos vim

为什么我在vim中的当前行只会在mac-osx中突然显示?

VIM-7.4.1016 - Mac OSX:

VIM-7.4.1016 - Mac OSX

VIM-7.4.629 Linux:

VIM-7.4.629 Linux

这就是我~/.vimrc文件的两种形式:

" =======================================
" .vimrc file
" =======================================
"
" My default config and plugins for vim :)
" Weslley Araujo <http://github.com/weslleyaraujo>
" =======================================

" Load plugins
"
if filereadable(expand("~/vundle.vim"))
  source ~/vundle.vim
endif

" =======================================
" My default configs
" =======================================
syntax enable
set encoding=utf-8

" tab
set tabstop=2 
set shiftwidth=2
set softtabstop=2
set autoindent
set expandtab 

" interface
set wildmenu        " set vim menu
set ruler           " show cursor position
set cursorline      " hightlight for actual line
set number          " show numbers
set hlsearch        " set highlight for search
set nowrap          " set no wrap for big lines
set nobackup        " set no backup
set incsearch
set background=dark
hi link htmlLink NONE "remove underline from links in html pages

" =======================================
" Files syntax
" =======================================
autocmd BufNewFile,BufRead {*.html.ejs,*.erb} set syntax=html
autocmd BufNewFile,BufRead {Gemfile,Gemfile.lock,*.ru} set syntax=ruby
autocmd BufNewFile,BufRead *.json set syntax=javascript

" =======================================
" Maps
" =======================================
nmap <c-n> :bn<CR> " map (ctrl + n) => :bn // buffer next
nmap <c-p> :bp<CR> " map (ctrl + p) => :bp // buffer prev

" =======================================
" Colorscheme
" =======================================
try
    colorscheme bubblegum-256-dark
catch /^Vim\%((\a\+)\)\=:E185/
    echo 'Cant find colorscheme bubblegum yet!'
endtry

这就是我正在使用的主题: https://github.com/baskerville/bubblegum

任何想法可能导致它或如何解决这类问题?

2 个答案:

答案 0 :(得分:2)

我在主题库中打开了一个问题,结果发现它有一个错误。

它已在最后一个版本中得到修复,更新后它按预期工作。

如下: https://github.com/baskerville/bubblegum/issues/4

感谢您的回复。

答案 1 :(得分:1)

我的Mac上的VIM遇到了类似的问题。然后我发现它正在为Mac加载其他设置。我在<{strong> .vimrc之后的set cursor line 中使用了以下行停用了这些其他设置:

:let macvim_skip_colorscheme=1

一切都很好。