syntax enable
"set color theme"colorscheme blackboardset hidden " so if u want to go directly to a file, no tips show.set nocompatible " be iMprovedfiletype off " required!set rtp+=~/.vim/bundle/Vundle.vimcall vundle#begin()" let Vundle manage Vundle" required!" let Vundle manage Vundle, required Plugin 'VundleVim/Vundle.vim'" tip on github use username/repo" tip on vim-script use repo" other use git://git.user.com/comand-t.git Plugin 'OmniCppComplete' Plugin 'winmanager' Plugin 'taglist.vim' Plugin 'SuperTab' Plugin 'scrooloose/nerdtree' Plugin 'vim-scripts/c.vim' Plugin 'grep.vim' Plugin 'chazy/cscope_maps' Plugin 'tpope/vim-surround' Plugin 'vim-scripts/a.vim' Plugin 'godlygeek/tabular' Plugin 'plasticboy/vim-markdown' Plugin 'neilagabriel/vim-geeknote' Plugin 'Emmet.vim' Plugin 'altercation/vim-colors-solarized'" " The following are examples of different formats supported." " Keep Plugin commands between vundle#begin/end." " plugin on GitHub repo Plugin 'tpope/vim-fugitive'" " plugin from http://vim-scripts.org/vim/scripts.html Plugin 'L9'" " Git plugin not hosted on GitHub "Plugin 'git://git.wincent.com/command-t.git'" " git repos on your local machine (i.e. when working on your own plugin)" Plugin 'file:///home/gmarik/path/to/plugin'" " The sparkup vim script is in a subdirectory of this repo called vim." " Pass the path to set the runtimepath properly. Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}" " Avoid a name conflict with L9" Plugin 'user/L9', {'name': 'newL9'}"" " All of your Plugins must be added before the following line call vundle#end() " requiredset background=lightlet g:solarized_termcolors=256colorscheme solarizedfiletype plugin indent on"auto completed"RUBYlet g:rubycomplete_buffer_loading = 1let g:rubycomplete_classes_in_global = 1let g:rubycomplete_rails = 1"RUBY pluginautocmd FileType ruby compiler ruby"autocmd vimenter * if !argc() | NERDTree | endif"autocmd VimEnter * NER" 设定文件浏览器目录为当前目录set bsdir=buffer" 设置编码set enc=utf-8" 设置文件编码set fenc=utf-8" 设置文件编码检测类型及支持格式set fencs=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936"显示行号set number"忽略大小写查找set ic" tab宽度set tabstop=2set expandtabretabset cindent shiftwidth=2set autoindent shiftwidth=2set shiftround" set 折叠set foldmethod=indent" 打开文件默认不折叠set foldlevelstart=99let g:vim_markdown_folding_disabled = 1"set my leaderlet mapleader=","let g:mapleader=",""tabsmap <leader>tn :tabnew<cr>map <leader>te :tabeditmap <leader>tc :tabclose<cr>map <leader>tm :tabmove"打开vimrc 文件 edit vimrc:nnoremap <leader>ev :vsplit $MYVIMRC<cr>"source file, the file excute as VimScript:nnoremap <leader>sv :source $MYVIMRC<cr>" 映射NERDTree插件":map <leader>n :NERDTree<CR>"let loaded_nerd_tree = 1let NERDTreeQuitOnOpen = 0let NERDChristmasTree=1let g:NERDTreeWinSize = 18map <leader>f :NERDTreeToggle<CR>"switch window:map <leader>w <C-W>w" 把 CTRL-S 映射为 保存,因为这个操作做得太习惯了imap <C-S> <C-C>:w<CR>"set zen coding let g:user_zen_settings = { \ 'php' : { \ 'extends' : 'html', \ 'filters' : 'c', \ }, \ 'xml' : { \ 'extends' : 'html', \ }, \ 'haml' : { \ 'extends' : 'html', \ }, \ 'erb' : { \ 'extends' : 'html', \ }, \}"set CtrlPlet g:ctrlp_map = '<c-p>'let g:ctrlp_cmd = 'CtrlP'let g:ctrlp_working_path_mode = 2"use in editimap <C-A> <C-C><c-p>"use in none edit:map <leader>t <c-p>:map <leader>b :CtrlPBuffer<CR>set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.jpg,*.png,*.gif,*.jpeg,.DS_Store " MacOSX/Linuxlet g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$'" move lines up or down (command - D)nmap <D-j> mz:m+<cr>`znmap <D-k> mz:m-2<cr>`zvmap <D-j> :m'>+<cr>`<my`>mzgv`yo`zvmap <D-k> :m'<-2<cr>`>my`<mzgv`yo`z" Tab move lines left or right (c-Ctrl,s-Shift)nmap <c-tab> v>nmap <s-tab> v<vmap <c-tab> >gvvmap <s-tab> <gv" tab navigation like zsh:nmap <D-1> :tabprevious<CR>:map <D-1> :tabprevious<CR>imap <D-1> <Esc>:tabprevious<CR>i:nmap <D-2> :tabnext<CR>:map <D-2> :tabnext<CR>imap <D-2> <Esc>:tabnext<CR>i"scss,sassau BufRead,BufNewFile *.scss set filetype=scssau BufRead,BufNewFile *.sass set filetype=scss"coffee scriptau BufNewFile,BufReadPost *.coffee setl foldmethod=indent nofoldenableau BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtabhi link coffeeSpaceError NONEhi link coffeeSemicolonError NONEhi link coffeeReservedError NONEmap <leader>cf :CoffeeCompile watch vert<cr>"let skim use slim syntaxau BufRead,BufNewFile *.skim set filetype=slim"ctagsset tags+=~/gitdb/rails/tags"auto completed" Disable AutoComplPop.let g:acp_enableAtStartup = 0" Enable omni completion.autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSSautocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTagsautocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJSautocmd FileType python setlocal omnifunc=pythoncomplete#Completeautocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags" Enable heavy omni completion.if !exists('g:neocomplcache_omni_patterns') let g:neocomplcache_omni_patterns = {}endiflet g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete" code searchlet g:ackprg = 'ag --nogroup --nocolor --column'"set powerlineset laststatus=2"set guifont=Powerline"set font=Source\ Code\ Pro\:h15set nocompatibleset t_Co=256let g:Powerline_cache_enabled = 1"minitestset completefunc=syntaxcomplete#Complete"process pastset pastetoggle=<F2>nnoremap <F2> :set invpaste paste?<CR>imap <F2> <C-O>:set invpaste paste?<CR>set pastetoggle=<F2>set mouse=a""""""""""""""""""""""""""""""" Tag list (ctags)""""""""""""""""""""""""""""""let Tlist_Ctags_Cmd = '/usr/bin/ctags'let Tlist_Show_One_File = 1 "不同时显示多个文件的tag,只显示当前文件的let Tlist_Exit_OnlyWindow = 1 "如果taglist窗口是最后一个窗口,则退出vimlet Tlist_Show_Menu = 1let Tlist_Auto_Open = 1"let Tlist_Use_Right_Window = 1 "在右侧窗口中显示taglist窗口 "if(executable("cscope") && has("cscope") )" silent! execute "!find . -name "*.h" -o -name "*.c" -o -name "*.cpp" -o -name "*.m" -o -name "*.mm" -o -name "*.java" -o -name "*.py" > cscope.files""endif"silent! execute "!cscope -b""if filereadable("cscope.out")" execute "cs a cscope.out""endif"save the tag when write the filefunction UpdateCtags() let curdir=getcwd() while !filereadable("./tags") cd .. if getcwd() == "/" break endif endwhile if filewritable("./tags") :!ctags -R endif execute ":cd " . curdirendfunctionfunction UpdateCStags() let curdir=getcwd() while !filereadable("./cscope.out") cd .. if getcwd() == "/" break endif endwhile if filewritable("./cscope.out") :!cscope -Rbq execute ":cscope reset" endif execute ":cd " . curdirendfunctionnnoremap <leader>ut :call UpdateCtags()<CR>nnoremap <leader>us :call UpdateCStags()<CR>nmap w= :resize +3<CR>nmap w- :resize -3<CR>nmap w, :vertical resize -3<CR>nmap w. :vertical resize +3<CR>