赞
踩
- # mkdir ~/.vim/VundleVim
- # git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/VundleVim/Vundle.vim
- if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
- set fileencodings=utf-8,latin1
- endif
-
- set nocompatible " Use Vim defaults (much better!)
- set bs=indent,eol,start " allow backspacing over everything in insert mode
- "set ai! " always set autoindenting on
- "set backup " keep a backup file
- set viminfo='20,\"50 " read/write a .viminfo file, don't store more
- " than 50 lines of registers
- set history=50 " keep 50 lines of command line history
- set ruler " show the cursor position all the time
- set nu
- "set cindent
- "set foldlevel=99
- set foldmethod=syntax
- "set cursorline
- "hi cursorline cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
- "hi cursorline cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
- "set cursorline ctermfg=Red ctermbg=Black cterm=bold
- "set cursorcolumn
- set showmatch
- set hlsearch
- set incsearch
- set smartindent
- set autochdir
- set nocp
- set shiftwidth=4
- set tabstop=4
- set expandtab
- set foldlevel=99
- "set autoindent!
- set statusline=
- set numberwidth=5
- set undolevels=5000
- "chuanqi
- "set showmode
- "set ambiwidth=double
-
-
- """"""""""""""""""""""""""""""""""""""""""""""""""""""
- "set softtabstop=4
- "set laststatus=2
- "highlight StatusLine cterm=bold ctermfg=yellow ctermbg=blue
- "highlight StatusLine cterm=bold ctermfg=black ctermbg=white
- "colorscheme molokai
- "colorscheme togglebg
- colorscheme desert
-
- set tags=tags;
- set autochdir
- set encoding=utf-8
- set nocst
- set cspc=6
- "let g:autocscope_menus=0
- filetype off
- set rtp+=~/.vim/bundle/Vundle.vim
- " 这里要注意 begin 里面是空的
- call vundle#begin()
- Plugin 'VundleVim/Vundle.vim'
- "Plugin 'Valloric/YouCompleteMe'
- "Plugin 'gmarik/vundle'
- Bundle 'taglist.vim'
- Plugin 'SuperTab'
- Plugin 'vimwiki'
- ""Plugin 'c.vim'
- Plugin 'fatih/vim-go'
- "Plugin 'gtags.vim'
- Plugin 'dgryski/vim-godef'
- Plugin 'nsf/gocode', {'rtp': 'vim/', 'do':'~/.vim/symlink.sh'}
- Plugin 'Blackrush/vim-gocode'
- Plugin 'The-NERD-tree'
- Plugin 'jstemmer/gotags'
- Plugin 'bradfitz/goimports'
- "Bundle 'cespare/vim-golang'
-
- Plugin 'majutsushi/tagbar'
- Plugin 'derekwyatt/vim-scala'
- call vundle#end()
-
- """""""""""""""""""""""""""""""""""""""""""
- " for gocode
-
- " for close gofmt autosave on save file
- "filetype plugin indent off
- filetype plugin on
- "imap <C-Space> <C-x><C-o>
- imap <C-j> <C-x><C-o>
- let go_version_warning=0
- """"""""""""""""""""
- "set ambiwidth=double
- "set bufhidden=hide
- "set bsdir=buffer
- "source $VIMRUNTIME/delmenu.vim
- "source $VIMRUNTIME/menu.vim
- "set t_co=256
- "let g:SuperTabDefaultCompletionType = "<c-n>"
- "let g:SuperTabDefaultCompletionType="context"
- "let g:SuperTabDefaultCompletionType="<c-x><c-u>"
- "let g:SuperTabMappingTabLiteral="<c-u>"
- "imap <C-u> <C-x><C-u>
- imap <C-p> <C-x><C-p>
-
-
- """"""""""""""""""""""""""""""""""""""""""""""""""
- " for vim-go plugin open
- let g:go_highlight_functions = 1
- let g:go_highlight_methods = 1
- let g:go_highlight_structs = 1
- let g:go_highlight_operators = 1
- let g:go_highlight_build_constraints = 0
- "let g:go_fmt_fail_silently = 1
- let g:go_fmt_autosave = 1
- "let g:go_play_open_browser = 0
- "let g:go_fmt_command="goimports"
-
- """"""""""""""""""""""""""""""""""""""""""""""""""
-
- "" end open
-
- """"""""""""""""""""""""""""""""""""""""""""""""""
- " for gocode gocomplete
- " imap <C-Space> <C-x><C-o>
- "imap <C-j> <C-x><C-o>
- """"""""""""""""""""""""""""""""""""""""""""""""""
- """"""""""""""""""""""""""""""""""""""""""""""""""
- " for golang syntax
- "Bundle 'scrooloose/syntastic'
- " check go code syntax error : >> xxx
- set statusline+=%#warningmsg#
- set statusline+=%{SyntasticStatuslineFlag()}
- set statusline+=%*
- "let g:syntastic_always_populate_loc_list = 1
- "let g:syntastic_auto_loc_list = 0
- "let g:syntastic_check_on_open = 1
- "let g:syntastic_check_on_wq = 1
- "let g:syntastic_aggregate_errors = 1
- """""""""""""""""""""""""""""""""""""""""""""""""
-
- """"""""""""""""""""""""""""""""""""""""""""""""""
- "use gotags binary file; same to go
- "Bundle 'majutsushi/tagbar'
- "use with `gotags -R .`
- "nmap <F3> :TagbarToggle<CR>
- "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'
- " \ }
- """""""""""""""""""""""""""""""""""""
-
- " for go dir list
- map <F2> :NERDTreeToggle<CR>
- map <C-F1> :NERDTreeFind<CR>
- let NERDTreeChDirMode=2
- let NERDTreeQuitOnOpen=1
- let NERDTreeShowBookmarks=1
- let NERDTreeMinimalUI=1
- let NERDTreeDirArrows=1
- "let NERDTreeWinPos="right"
-
- " auto exit win when vim quit
- autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") &&b:NERDTreeType == "primary") | q | endif
- "auto open NERDTree
- "autocmd vimenter * NERDTree
- "
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " godef plugins
- " split windows
- let g:godef_split=1
-
- " open new windows
- let g:godef_split=2
- let g:godef_same_file_in_same_window=1
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-
-
-
- "hi CursorLine cterm=NONE ctermfg=white guibg=darkred guifg=white
- "hi CursorColumn cterm=NONE ctermfg=white guibg=darkred guifg=white
- "ctermbg=darkred ctermbg=darkred
- """"""""""""""""""""""""""""""""""""""""""
- "filetype plugin indent on
- "set completeopt=longest,menu
- "set cscopetag
- "let Tlist_WinHeight
- "set list
- "set lcs=tab:\|\
- "match LeaderTab /^\t/
-
- " for c cscope command
- if has("cscope")
- set csprg=/usr/bin/cscope
- set csto=0
- set cst
- set nocsverb
- if filereadable("cscope.out")
- cs add cscope.out
- elseif $CSCOPE_DB!=""
- cs add $CSCOPE_DB
- endif
- set csverb
- endif
- "
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- "set stal=3
- "vim status line
- set laststatus=2 "显示状态栏(默认值为1, 无法显示状态栏)
- "set statusline=
- set statusline+=%2*%-3.3n%0*\
- set statusline+=%f\ " file name
- set statusline+=%h%1*%m%r%w%0*
- set statusline+=[
- if v:version >= 600
- set statusline+=%{strlen(&ft)?&ft:'none'},
- set statusline+=%{&fileencoding},
- endif
- set statusline+=%{&fileformat}]
- set statusline+=%=
- "set statusline+=%2*0x%-8B\ " current char
- set statusline+=0x%-8B
- set statusline+=%-14.(%l,%c%V%)
- if filereadable(expand("$VIM/vimfiles/plugin/vimbuddy.vim"))
- set statusline+=\ %{VimBuddy()} " vim buddy
- endif
- ""highlight StatusLine guifg=SlateBlue guibg=Yellow
- "highlight StatusLineNC guifg=Gray guibg=White
- "
- ""设置路径,多个路径用逗号分隔
- "set path=.,"E:/Web/htdocs",,
- "
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- ""缺省不产生备份文件
- set nobackup
- ""在输入括号时光标会短暂地跳到与之相匹配的括号处,不影响输入
- "set showmatch
- ""正确地处理中文字符的折行和拼接
- set formatoptions+=mM
- ""置粘贴模式,这样粘贴过来的程序代码就不会错位了。
- "set paste
- "
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- " for c tags cTagList
- "map <F4> :silent! Tlist<CR>
- "let Tlist_Auto_Open=0
- "let Tlist_Use_Right_Window=1
- "let Tlist_WinWidth=25
- "let Tlist_Show_One_File=1 "²»ͬʱÏʾ¶àμþµÄag£¬ֻÏʾµ±ǰμþµÄ
- "let Tlist_Exit_OnlyWindow=1 "ȹûist´°¿ÚÇîһ¸����ڣ¬Ôͳö
- "let Tlist_Ctags_Cmd="/usr/bin/ctags"
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-
- "syntax enable
- syntax on
- "set filetype=on
- "set filetype=go
- "set filetype=python
- "set filetype=c
- au BufReadPost * if line("'\"") > 0| if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
- au BufRead,BufNewFile *.go set filetype=go "" set golang syntax on
- function! CurDir()
- let curdir = substitute(getcwd(), $HOME, "~", "g")
- return curdir
- endfunction
- set statusline=[%n]\ %f%m%r%h\ \|\ \ pwd:\ %{CurDir()}\ \ \|%=\|
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
- "set statusline=[%n]\ %f%m%r%h\ \|\ \ pwd:\ %{CurDir()}\ \ \|%=\|\ %l,%c\ %p%%\ \|\ ascii=%b,hex=%b%{((&fenc==\"\")?\"\":\"\ \|\ \".&fenc)}\ \|\ %{$USER}\ @\ %{hostname()}\
- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""one line
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。