---
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<em>%M%</em>%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 <space> @=((foldclosed(line('.')) < -3) ? 'zc' : 'zo')<cr>
colorscheme delek</cr></space>

" 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 <code>!</code> to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append <code>!</code> to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append <code>!</code> 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 <leader>gt :YcmCompleter GoToDefinitionElseDeclaration<cr></cr></leader>

let g:EasyMotion_smartcase = 1
nnoremap <leader><leader>h <plug>(easymotion-linebackward)
nnoremap <leader><leader>j <plug>(easymotion-j)
nnoremap <leader><leader>k <plug>(easymotion-k)
nnoremap <leader><leader>l <plug>(easymotion-lineforward)
nnoremap <leader><leader>. <plug>(easymotion-repeat)</plug></leader></leader></plug></leader></leader></plug></leader></leader></plug></leader></leader></plug></leader></leader>

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 <leader>a= :Tabularize /=<cr>
vnoremap <leader>a= :Tabularize /=<cr>
nnoremap <leader>a: :Tabularize /:\zs<cr>
vnoremap <leader>a: :Tabularize /:\zs<cr></cr></leader></cr></leader></cr></leader></cr></leader>

nnoremap <f2> :NERDTreeToggle<cr>
nnoremap <f3> :TlistToggle<cr>
nnoremap <f4> :TagbarToggle<cr>
nnoremap <f5> :GundoToggle<cr>
nnoremap <f7> :w<cr>:!clang++ -std=c++11 % -o %< && time ./%<<cr>
nnoremap <f9> :MBEbp<cr>
nnoremap <f10> :MBEbn<cr></cr></f10></cr></f9></cr></cr></f7></cr></f5></cr></f4></cr></f3></cr></f2>

inoremap ; ;<esc>a
inoremap ' <c-r>=QuoteDelim("'")<cr><esc>a
inoremap " <c-r>=QuoteDelim('"')<cr><esc>a
inoremap ( ()<esc>i
inoremap ) <c-r>=ClosePair(')')<cr><esc>a
inoremap [ []<esc>i
inoremap ] <c-r>=ClosePair(']')<cr><esc>a
inoremap { {<cr>}<esc>O
"inoremap } <c-r>=CloseBracket()<cr></cr></c-r></esc></cr></esc></cr></c-r></esc></esc></cr></c-r></esc></esc></cr></c-r></esc></cr></c-r></esc>

function ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\<right>"
else
return a:char
endif
endf</right>

function CloseBracket()
if match(getline(line('.') + 1), '\s*}') < 0
return "\<cr>}"
else
return "\<esc>j0f}a"
endif
endf</esc></cr>

function QuoteDelim(char)
let line = getline('.')
let col = col('.')
if line[col - 2] == "\"
return a:char
elseif line[col - 1] == a:char
return "\<right>"
else
return a:char.a:char."\<esc>i"
endif
endf
```
