Skip to content
su21 edited this page Mar 26, 2018 · 1 revision
set termguicolors 
set nocompatible              " be iMproved, 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 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'fatih/vim-go'
Plugin 'majutsushi/tagbar'
Plugin 'chazy/cscope_maps'
Plugin 'scrooloose/syntastic'
Plugin 'dhruvasagar/vim-table-mode'
Plugin 'altercation/vim-colors-solarized'

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" Configuration filDTreeBookmarksFile=expand("$HOME/.vim-NERDTreeBookmarks")
set modelines=0		" CVE-2007-2438

" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible	" Use Vim defaults instead of 100% vi compatibility
set backspace=2		" more powerful backspacing

" Don't write backup file if vim is being called by "crontab -e"
au BufWrite /private/tmp/crontab.* set nowritebackup
" Don't write backup file if vim is being called by "chpass"
au BufWrite /private/etc/pw.* set nowritebackup

au FileChangedShell * echo "Warning: File changed on disk"

au BufNewFile,BufRead SCons* set filetype=scons 


" nginx
au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/conf/* if &ft == '' | setfiletype nginx | endif 


filetype indent plugin on
set ruler
set number 
set showcmd
set background=dark
"set background=light
set nocompatible 
"set cursorline
"colorscheme evening
colorscheme solarized
syntax enable

"set foldmethod=syntax
"autocmd FileType go autocmd BufWritePre <buffer> Fmt

autocmd FileType python,scons setlocal et sta sw=4 sts=4
autocmd FileType python,scons setlocal foldmethod=indent
set foldlevel=99


autocmd FileType html setlocal et sta sw=2 sts=2
autocmd FileType html setlocal foldmethod=indent
"set et sta sw=4 sts=4

""taglist config
"let Tlist_Show_One_File = 1  "只显示当前文件的tag
"let Tlist_Exit_OnlyWindow = 1 "当taglist是最后一个窗口时 自动退出
""let Tlist_Use_Right_Window = 1   
"let Tlist_GainFocus_On_ToggleOpen = 1 
"let Tlist_Close_On_Select = 1
""让taglist支持golang
"let tlist_go_settings = 'go;f:func;v:var;t:type'
"
""F6打开/关闭taglist
"map <silent> <F6> :TlistToggle<cr> 

"F6打开/关闭tagbar
map <silent> <F6> :TagbarToggle<CR>
"let g:tagbar_left = 1
"添加golang支持
let g:tagbar_type_go = {
    \ 'ctagstype' : 'go',
    \ 'kinds'     : [
        \ 'p:package',
        \ 'i:imports:1',
        \ 'c:constants',
        \ 'v:variables',
        \ 't:types',
        \ 'n:interfaces',
        \ 'w:fields',
        \ 'e:embedded',
        \ 'm:methods',
        \ 'r:constructor',
        \ 'f:functions'
    \ ],
    \ 'sro' : '.',
    \ 'kind2scope' : {
        \ 't' : 'ctype',
        \ 'n' : 'ntype'
    \ },
    \ 'scope2kind' : {
        \ 'ctype' : 't',
        \ 'ntype' : 'n'
    \ },
    \ 'ctagsbin'  : 'gotags',
    \ 'ctagsargs' : '-sort -silent'
\ }

"nerdtree config
let NERDTreeShowLineNumbers = 1 "在nerdtree中显示行号
let  NERDTreeQuitOnOpen = 0
let NERDTreeWinSize=40
let NERDTreeBookmarksFile=expand("$HOME/.vim-NERDTreeBookmarks")
let NERDTreeShowBookmarks=1
"F5打开/关闭nerdtree
map <silent> <F5> :NERDTreeToggle<cr>

"golang
set rtp+=$GOROOT/misc/vim
set completeopt=menu
syntax on


set showcmd

let g:indent_guides_auto_colors = 0
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd  guibg=red   ctermbg=3
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=4
let g:indent_guides_start_level = 2
let g:indent_guides_guide_size = 1


"默认开启搜索高亮
set hls

au BufNewFile,BufRead *.goc setf c

let g:solarized_termcolors=256

let g:tagbar_ctags_bin="/bin/ctags"
let g:LargeFile=10

"set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
"set statusline+=%*
"
"let g:syntastic_always_populate_loc_list = 1
"let g:syntastic_auto_loc_list = 1
"let g:syntastic_check_on_open = 0
"let g:syntastic_check_on_wq = 0
"let g:syntastic_shell = "/usr/bin/zsh"
"
"let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
"let g:syntastic_go_checkers = ['errcheck']
"let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }

map <Leader>tm :TableModeToggle<cr>

set visualbell
Clone this wiki locally