【问题标题】:MacVim colorscheme on load加载时的 MacVim 配色方案
【发布时间】:2015-10-27 14:13:56
【问题描述】:

我安装了一个新的配色方案。我将它添加到我的.vimrc 但是当我加载 macvim 时它没有加载。加载文件后,如果我输入:colorscheme sourcerer,它就会加载。我在这里错过了什么?

" General -----------------------
set nocompatible             " Makes vim better
scriptencoding utf-8         " Setting everything to UTF-8
set encoding=utf-8
set history=256
set timeoutlen=250 
set clipboard+=unnamed
let g:autotagTagsFile = ".git/tags"
set tags=.git/tags;$HOME/.tags

set nobackup
set nowritebackup
set directory=/tmp//
set noswapfile

set hlsearch
set ignorecase
set smartcase
set incsearch

let mapleader = ','
let maplocalleader = '  '
let g:netrw_banner = 0


" Formatting --------------------
set nowrap

set tabstop=4
set softtabstop=4
set shiftwidth=4

set backspace=indent
set backspace+=eol
set backspace+=start

set autoindent
set cindent
set indentkeys-=0#
set cinkeys-=0#
set cinoptions=:s,ps,ts,cs
set cinwords=if,else,while,do
set cinwords+=for,switch,case

" Visual ------------------------
syntax on

set showmatch

colorscheme sourcerer

if has('gui_running')
    set guifont=InputMono:h14

    if has('mac')
    set noantialias
    endif
endif

set novisualbell
set noerrorbells
set vb t_vb=

" Plugins ------------------------
filetype off 

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'gmarik/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'xero/sourcerer.vim'

call vundle#end() 
filetype plugin indent on

【问题讨论】:

  • 看来我的答案已经在这里了,关于如何修复stackoverflow.com/questions/14802689/…
  • 您有错误信息吗?我的猜测是colorscheme sorcerer 应该放在Plugin 'xero/sourcerer.vim' 行之后。 (可能在vundle#end() 之后)

标签: vim vim-plugin color-scheme


【解决方案1】:

您需要将包含 colorscheme sourcerer 的行放在 Vundle 设置内容的下方。似乎它应该给你一些相关的错误。用你原来的.vimrc 给我的信息是:

Error detected while processing /home/xyz/.vimrc:
line   50:
E185: Cannot find color scheme 'sourcerer'No protocol specified

Press ENTER or type command to continue

但是将colorscheme 行移到底部效果很好。

【讨论】:

  • 好吧,我发现 MacVim 会加载它自己的 .gvimrc 文件,该文件会在我的 vimrc 文件之后加载。为了解决这个问题,我创建了 .gvimrc 并将我的颜色方案添加到其中
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-02-01
  • 1970-01-01
  • 2013-05-03
  • 1970-01-01
  • 2011-02-07
  • 1970-01-01
  • 2014-06-21
相关资源
最近更新 更多