diff --git a/vim/.vimrc b/vim/.vimrc index 390a445..91632f5 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -1,14 +1,14 @@ set nocompatible filetype off -" init vundle +" --- init vundle set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() -" Let Vundle manage Vundle +" --- Let Vundle manage Vundle Plugin 'VundleVim/Vundle.vim' -" My plugins +" --- My plugins Plugin 'scrooloose/nerdtree' " FileBrowser on the left side Plugin 'ervandew/supertab' "Auto completion Plugin 'jeetsukumaran/vim-buffergator' "Easy buffer switching @@ -18,12 +18,16 @@ Plugin 'MarcWeber/vim-addon-mw-utils' " Dependency for snipmate Plugin 'tomtom/tlib_vim' "Dependency for snipmate Plugin 'garbas/vim-snipmate' "Snippets Plugin 'easymotion/vim-easymotion' "Easy Motion +Plugin 'jiangmiao/auto-pairs' "Auto pairs brackets, parenthesis, etc. +Plugin 'kana/vim-textobj-user' "User defined text objects +Plugin 'kana/vim-textobj-indent' "Indent based text objects +Plugin 'benmills/vimux' "Tmux integration -" End init vundle +" --- End init vundle call vundle#end() filetype plugin indent on -" General configurations +" --- General configurations set whichwrap+=<,>,[,] set autoread "auto read file if changed set wildmenu "Command completion @@ -56,66 +60,99 @@ set tabstop=4 set lbr set tw=500 set t_Co=256 +set hidden "Hidden buffers may exist syntax enable colorscheme desert -" Leader commands +" --- Own functions +function! AddSemicolon() + normal m'A; + normal `' +endfunction + +function! RunCmdVimux() + let l:cmd = input("Run: ") + if l:cmd !~ '\s\+' + call VimuxRunCommand("clear && " . l:cmd) + endif +endfunction + +" --- Bindings let mapleader = "," -nnoremap :noh -nnoremap c :%s/\s\+$//e -nnoremap v :%s/\n\{3,}/\r\r/e +" evil spaces +nnoremap c m':%s/\s\+$//e`' +" double empty lines +nnoremap v m':%s/\n\{3,}/\r\r/e`' +" Toggle paste nnoremap p :set invpaste paste? +" Quick tabularize nnoremap a :Tabularize / vnoremap a :'<,'>Tabularize / -nnoremap w vl +" VimRC +nnoremap oc :e ~/.vimrc +nnoremap sc :so ~/.vimrc +" Vimux +nnoremap rr :call RunCmdVimux() +nnoremap rq :call VimuxCloseRunner() +nnoremap ; :call AddSemicolon() -" Don't need a help +" --- Don't need a help inoremap nnoremap vnoremap -" Just a nuisance +" --- Just a nuisance nnoremap q: -" No moving in insert mode allowed +" --- No moving in insert mode allowed ino ino ino ino -" Different use of undo +" --- Different use of undo nnoremap U -" We don't need useless whitespace at the of the line +" --- We don't need useless whitespace at the of the line highlight WhitespaceEOL ctermbg=Red guibg=Red match WhitespaceEOL /\s\+$/ -" Rice +" --- Rice set statusline=%m set statusline+=\ %f set statusline+=%= set statusline+=%l set statusline+=\ %c hi StatusLine cterm=None ctermfg=green ctermbg=none -hi Search cterm=NONE +hi Search cterm=NONE hi IncSearch cterm=underline ctermbg=none ctermfg=green +hi VertSplit cterm=none ctermbg=none ctermfg=blue -"Supertab +" --- Supertab hi Pmenu ctermfg=green ctermbg=black hi PmenuSel ctermfg=white ctermbg=black hi PmenuSbar ctermfg=white ctermbg=black cterm=none let g:SuperTabNoCompleteAfter = ['^',',','\s'] -"NERDTree tabs +" --- NERDTree tabs nmap e :NERDTreeToggle autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif +autocmd bufenter * if !exists("b:NERDTreeType") | NERDTreeClose | endif +let NERDTreeWinSize = 30 +let NERDChristmasTree = 0 +let NERDTreeChDirMode = 2 +let NERDTreeIgnore=['\~$','\.pyc$','\.swp$'] +let NERDTreeWinPos="left" -"EasyMotion +" --- EasyMotion map / (easymotion-sn) omap / (easymotion-tn) map n (easymotion-next) map N (easymotion-prev) + +" --- Auto pairs +