"set tabstop=4
set tabstop=8 set cindent set shiftwidth=4 set softtabstop=4 set hlsearch set number set list set listchars=tab:>-,trail:- scriptencoding utf-8 set encoding=utf-8 "clipboard set clipboard=unnamed set cursorline " 高亮显示当前行 "set cursorcolumn " 高亮显示当前列 set ruler " 开启行号显示 "show matching brackets set showmatch" 显示状态栏
set laststatus=2" linux , 80 character limit
set colorcolumn=81"Mark plugin 高亮
"source ~/.vim/plugin/mark.vimsyntax enable "开启语法高亮
syntax on ""依赖于Indent Guides插件
"let g:indent_guides_enable_on_vim_startup=1 "随vim自启动 "let g:indent_guides_start_level=2 " 从第二层开始可视化显示缩进 "let g:indent_guides_guide_size=1 "色块宽度" Color scheme
colorscheme molokai highlight NonText guibg=#060606 highlight Folded guibg=#0A0A0A guifg=#9090D0 let g:molokai_original = 1 set t_Co=256 let g:rehash256 = 1set rtp+=~/.vim/bundle/vundle/
call vundle#rc() " Set syntax highlighting for specific file types autocmd BufRead,BufNewFile Appraisals set filetype=ruby autocmd BufRead,BufNewFile .md set filetype=markdown autocmd Syntax javascript set syntax=jquery Bundle 'The-NERD-tree' let NERDTreeWinSize=35 let NERDTreeMouseMode=2 let NERDTreeShowLineNumbers=1 "let NERDTreeDirArrows=0 "vim 启动则自动打开NERDTree autocmd StdinReadPre let s:std_in=1 autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endifBundle 'taglist.vim'
let Tlist_Ctags_Cmd='ctags' let Tlist_Show_One_File=1 "不同时显示多个文件的tag,只显示当前文件的 let Tlist_WinWidt =45 "设置taglist的宽度 let Tlist_Exit_OnlyWindow=1 "如果taglist窗口是最后一个窗口,则退出vim "let Tlist_Use_Right_Window=1 "在右侧窗口中显示taglist窗口 let Tlist_Use_Left_Windo =1 "在左侧窗口中显示taglist窗口" cscope settings
if has("cscope") set csprg=/usr/bin/cscope set csto=0 set cst set nocsverb " add any database in current directory if filereadable("cscope.out") cs add cscope.out " else add database pointed to by environment elseif $CSCOPE_DB != "" cs add $CSCOPE_DB endif set csverb endif"ctrl+] search func name
map g<C-]> :cs find 3 =expand(“”) "ctul+/ search c symbols map g :cs find 0 =expand(“”) nmap <C-@>s :cs find s =expand("") nmap <C-@>g :cs find g =expand("") nmap <C-@>c :cs find c =expand("") nmap <C-@>t :cs find t =expand("") nmap <C-@>e :cs find e =expand("") nmap <C-@>f :cs find f =expand("") nmap <C-@>i :cs find i ^=expand("")$ nmap <C-@>d :cs find d =expand("")"easymotion
Bundle 'EasyMotion' let g:EasyMotion_smartcase = 1 let g:EasyMotion_leader_key = '1' "let g:EasyMotion_startofline = 0 " keep cursor colum when JK motion map h (easymotion-linebackward) map j (easymotion-j) map k (easymotion-k) map l (easymotion-lineforward) " 重复上一次操作, 类似repeat插件, 很强大 map . (easymotion-repeat)"PowerLine
Bundle 'Lokaltog/vim-powerline' "let g:Powerline_symbols = 'fancy'"remember last update or view postion"
" Only do this part when compiled with support for autocommands if has("autocmd") " In text files, always limit the width of text to 78 characters autocmd BufRead .txt set tw=78 " When editing a file, always jump to the last cursor position autocmd BufReadPost if line("'"") > 0 && line ("'"") <= line("$") | exe "normal g'"" | endif endif