.vimrc配置备份

""基础设置:
"去掉vi的一致性"
set nocompatible
"显示行号"
set number
" 隐藏滚动条"    
set guioptions-=r 
set guioptions-=L
set guioptions-=b
"隐藏顶部标签栏"
set showtabline=0
"设置字体"
set guifont=Consolas:h13         
syntax on   "开启语法高亮"
let g:solarized_termcolors=256  "solarized主题设置在终端下的设置"
set background=dark     "设置背景色"
"colorscheme solarized
set nowrap  "设置不折行"
set fileformat=unix "设置以unix的格式保存文件"
set cindent     "设置C样式的缩进格式"
set tabstop=4   "设置table长度"
set shiftwidth=4        "同上"
set showmatch   "显示匹配的括号"
set scrolloff=5     "距离顶部和底部5行"
set laststatus=2    "命令行为两行"
set fenc=utf-8      "文件编码"
set backspace=2
set mouse=a     "启用鼠标"
set selection=exclusive
set selectmode=mouse,key
set matchtime=5
set ignorecase      "忽略大小写"
set incsearch
set hlsearch        "高亮搜索项"
set noexpandtab     "不允许扩展table"
set whichwrap+=<,>,h,l
set autoread



"vim颜色设置
"行号颜色设置:
highlight LineNr ctermfg=gray ctermbg=NONE

"set cursorline      "突出显示当前行"
"hi Cursorline cterm=NONE ctermbg=darkGray ctermfg=NONE
set cursorcolumn        "突出显示当前列"
"highlight Pmenu ctermbg=darkgrey  guifg=cyan 
"highlight PmenuSel ctermbg=lightgrey guifg=black
"highlight Pmenu cterm=NONE ctermbg=darkcyan ctermfg=white guifg=white
highlight PmenuSel ctermbg=darkcyan ctermfg=NONE
highlight Pmenu ctermfg=NONE ctermbg=NONE
"hi cursorcolumn ctermfg=DarkGray ctermbg=Yellow       "突出显示当前列"
hi VertSplit guibg=#31312D guifg=#526A83 ctermfg=Yellow ctermbg=darkGray term=none cterm=none gui=none
"hi StatusLineNC guibg=#31312D guifg=#526A83 ctermfg=Cyan ctermbg=darkGray term=none cterm=none gui=none 
hi StatusLine guibg=#31312D guifg=#526A83 ctermfg=LightCyan ctermbg=darkGray term=none cterm=none gui=none 
hi FoldColumn guibg=#31312D guifg=#526A83 ctermfg=Cyan ctermbg=darkGray term=none cterm=none gui=none





"括号,引号等自动补全
:inoremap ( ()<ESC>i
:inoremap ) <c-r>=ClosePair(')')<CR>
:inoremap { {<CR>}<ESC>O
:inoremap } <c-r>=ClosePair('}')<CR>
:inoremap [ []<ESC>i
:inoremap ] <c-r>=ClosePair(']')<CR>
:inoremap " ""<ESC>i
:inoremap ' ''<ESC>i
function! ClosePair(char)
	if getline('.')[col('.') - 1] == a:char
		return "\<Right>"
	else
		return a:char
	endif
endfunction





"按F5运行程序
map <F5> :call CodeRun()<CR>
func! CodeRun()
        exec "w"
        if &filetype == 'c'
                exec "!g++ % -o %<"
                exec "!time ./%<"
        elseif &filetype == 'cpp'
                exec "!g++ % -o %<"
                exec "!time ./%<"
        elseif &filetype == 'java'
                exec "!javac %"
                exec "!time java %<"
        elseif &filetype == 'sh'
                :!time bash %
        elseif &filetype == 'python'
                exec "!clear"
                exec "!time python3 %"
        elseif &filetype == 'html'
                exec "!firefox % &"
        elseif &filetype == 'go'
                " exec "!go build %<"
                exec "!time go run %"
        elseif &filetype == 'mkd'
                exec "!~/.vim/markdown.pl % > %.html &"
                exec "!firefox %.html &"
        endif
endfunc





""Vundle插件配置:

""filetype plugin on
""let g:pydiction_location = '~/.vim/bundle/pydiction/complete-dict'
""let g:pydiction_menu_height = 3



set nocompatible              " required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'davidhalter/jedi-vim'

Plugin 'preservim/nerdtree'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'

  " Optional:
Plugin 'honza/vim-snippets'


" Add all your plugins here (note older versions of Vundle used Bundle instead of Plugin)


" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required






""插件子选项设置
    " NerdTree才插件的配置信息
    ""将F2设置为开关NERDTree的快捷键
map <f2> :NERDTreeToggle<cr>
    ""修改树的显示图标
let g:NERDTreeDirArrowExpandable = '+'
let g:NERDTreeDirArrowCollapsible = '-'
    ""窗口位置
let g:NERDTreeWinPos='right'
    ""窗口尺寸
let g:NERDTreeSize=25
    ""窗口是否显示行号
let g:NERDTreeShowLineNumbers=0
    ""不显示隐藏文件
let g:NERDTreeHidden=1


let g:snipMate = get(g:, 'snipMate', {}) " Allow for vimrc re-sourcing
let g:snipMate.scope_aliases = {}

猜你喜欢

转载自www.cnblogs.com/s0ra365/p/12443948.html