--- title: My .vimrc tags: - Linux id: "159" categories: - - Coding - Operating System date: 2017-06-02 20:30:19 --- ```ini " Basis "set cul set nowrap set mouse=a "set paste set history=1000 set bg=dark syntax on set ai set cin set sw=2 set sts=2 set ts=2 set nu set si set sm set nobk "set guioptions-=T "set guioptions-=m set ignorecase smartcase set vb t_vb= set ruler set magic set nohls set incsearch set et set sta "set spell "set ww=b,s,h,l,<,>,~,[,] set encoding=utf-8 set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1 set ambiwidth=double set cino=:0g0t0(sus set selection=inclusive set keymodel=startsel,stopsel "set wildmenu "set cmdheight=1 "set laststatus=2 "set statusline=\ %<%F[%1%M%%n%R%H]%=\ %y\ %0(%{&fileformat}\ %{&encoding}\ %l/%L:%c%) "set foldenable "set foldmethod=syntax "set foldcolumn=0 "setlocal foldlevel=1 "set foldclose=all "nnoremap @=((foldclosed(line('.')) < -3) ? 'zc' : 'zo') colorscheme delek " Plugins set nocp filetype off " 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 'Valloric/YouCompleteMe' Plugin 'vim-syntastic/syntastic' Plugin 'easymotion/vim-easymotion' Plugin 'fholgado/minibufexpl.vim' Plugin 'vim-airline/vim-airline' Plugin 'vim-sCRipts/taglist.vim' Plugin 'majutsushi/tagbar' Plugin 'Yggdroot/indentLine' Plugin 'Yggdroot/vim-mark' Plugin 'kien/ctrlp.vim' Plugin 'sCRooloose/nerdcommenter' Plugin 'sjl/gundo.vim' Plugin 'godlygeek/tabular' " 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/'} " Install L9 and avoid a Naming conflict if you've already installed a " different version somewhere else. "Plugin 'ascenator/L9', {'name': 'newL9'} " 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 let mapleader="," let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' nnoremap gt :YcmCompleter GoToDefinitionElseDeclaration let g:EasyMotion_smartcase = 1 nnoremap h (easymotion-linebackward) nnoremap j (easymotion-j) nnoremap k (easymotion-k) nnoremap l (easymotion-lineforward) nnoremap . (easymotion-repeat) let g:syntastic_enable_signs = 1 let g:syntastic_error_symbol = '!' let g:syntastic_warning_symbol = '?' let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 let g:syntastic_enable_highlighting = 1 nnoremap a= :Tabularize /= vnoremap a= :Tabularize /= nnoremap a: :Tabularize /:\zs vnoremap a: :Tabularize /:\zs nnoremap :NERDTreeToggle nnoremap :TlistToggle nnoremap :TagbarToggle nnoremap :GundoToggle nnoremap :w:!clang++ -std=c++11 % -o %< && time ./%< nnoremap :MBEbp nnoremap :MBEbn inoremap ; ;a inoremap ' =QuoteDelim("'")a inoremap " =QuoteDelim('"')a inoremap ( ()i inoremap ) =ClosePair(')')a inoremap [ []i inoremap ] =ClosePair(']')a inoremap { {}O "inoremap } =CloseBracket() function ClosePair(char) if getline('.')[col('.') - 1] == a:char return "\" else return a:char endif endf function CloseBracket() if match(getline(line('.') + 1), '\s*}') < 0 return "\}" else return "\j0f}a" endif endf function QuoteDelim(char) let line = getline('.') let col = col('.') if line[col - 2] == "\" return a:char elseif line[col - 1] == a:char return "\" else return a:char.a:char."\i" endif endf ```