" vim: set filetype=vim set nocompatible filetype off set rtp+=~/.vim/bundle/Vundle.vim/ call vundle#begin() Plugin 'gmarik/vundle' Plugin 'sickill/vim-monokai' "Plugin 'mbbill/undotree' "Plugin 'scrooloose/nerdtree' Plugin 'tpope/vim-surround' Plugin 'tpope/vim-commentary' Plugin 'Valloric/YouCompleteMe' Plugin 'godlygeek/tabular' Plugin 'bling/vim-airline' Plugin 'tpope/vim-speeddating' " Plugin 'tpope/vim-fugitive' Plugin 'klen/python-mode' Plugin 'nblock/vim-dokuwiki' Plugin 'saltstack/salt-vim' Plugin 'lepture/vim-jinja' "Plugin 'terryma/vim-expand-region' "Plugin 'wincent/Command-T' "Plugin 'sjl/gundo.vim' Plugin 'kien/ctrlp.vim' "Plugin 'PeterRincker/vim-argumentative' "Plugin 'wellle/targets.vim' "Plugin 'Lokaltog/vim-easymotion' "Plugin 'terryma/vim-multiple-cursors' "Plugin 'flazz/vim-colorschemes' Plugin 'reedes/vim-pencil' call vundle#end() filetype plugin indent on set t_Co=256 set autochdir set autoindent set autoread set backspace=indent,eol,start set backupcopy=no set colorcolumn=79 set colorcolumn=80 set confirm set cursorline set directory=/var/tmp,/tmp set encoding=utf-8 set esckeys set expandtab set foldenable set foldmethod=indent set foldnestmax=2 set gdefault set hidden set history=1000 set hlsearch set ignorecase set incsearch set laststatus=2 set linebreak set matchpairs="(:),{:},[:],<:>" set modeline set modelines=5 set mouse=a set mousehide set nobackup set noerrorbells set nofoldenable set noshowmode set notildeop set notimeout set nowritebackup set number set numberwidth=2 set pastetoggle= set relativenumber set ruler set scrolloff=7 set shiftround set shiftwidth=4 set shortmess=rti set showcmd set showmatch set matchtime=5 set showmode set smartcase set lazyredraw set smarttab set softtabstop=4 set swapfile set tabstop=4 set title set titlestring="" set ttimeout set ttimeoutlen=50 set ttyfast set undodir=~/.vim/undo set undofile set undolevels=1000 set undoreload=10000 set updatecount=200 set updatetime=10000 set viewdir=~/.vim/view set virtualedit+="block" set virtualedit="onemore,all" set whichwrap+=h,l set wildignore=*.swp,*.bak,*.pyc,*~,*.o set wildmenu set wildmode=list:longest set wrap set wrapscan set magic let mapleader = "\" map w: w! nnoremap w :w vmap y "+y vmap d "+d nmap p "+p nmap P "+P vmap p "+p vmap P "+P nmap za map , : vmap v (expand_region_expand) vmap (expand_region_shrink) vnoremap y y`] vnoremap p p`] nnoremap p p`] " enable 'very-magic' in regex "nnoremap / /\v "vnoremap / /\v nnoremap , :nohlsearch noremap gV `[v`] " make Y behave like other capitals, otherwise Y would work like yy map Y y$ map j gj map k gk "function! TrimWhiteSpace() " %s/\s\+$//e "endfunction " automatically reload .vimrc when it's saved autocmd BufWritePost .vimrc source ~/.vimrc "autocmd FileWritePre * :call TrimWhiteSpace() "autocmd FileAppendPre * :call TrimWhiteSpace() "autocmd FilterWritePre * :call TrimWhiteSpace() "autocmd BufWritePre * :call TrimWhiteSpace() " Start NERDTree when starting vim "autocmd vimenter * NERDTree "autocmd VimEnter * wincmd p let NERDTreeQuitOnOpen = 1 " close NERDTree when it's the only window left "autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif "call togglebg#map("") nnoremap h nnoremap j nnoremap k nnoremap l nnoremap :NERDTreeToggle nnoremap :TagbarToggle " Autosave views when closing and restoring when opening again. autocmd BufWinLeave *.* mkview autocmd BufWinEnter *.* silent loadview ":inoremap pumvisible() ? '' : '' ":au WinEnter * :setlocal number relativenumber ":au WinLeave * :setlocal nonumber norelativenumber ""nnoremap ""nnoremap ""nnoremap ""nnoremap ""inoremap ""inoremap ""inoremap ""inoremap nmap :bnext nmap :bprev " default emacs movements for command line cnoremap cnoremap cnoremap cnoremap cnoremap cnoremap cnoremap cnoremap b cnoremap f cnoremap d cnoremap inoremap jj nnoremap v vl nmap ; :CtrlPBuffer " no more ex mode nnoremap Q nnoremap r :%s/// autocmd BufWritePre *.rst silent :%s/\s\+$//e " setup for pymode let g:pymode_trim_whitespaces = 1 let g:pymode_lint_on_write = 0 let g:pymode_lint_unmodified = 0 let g:pymode_lint_on_fly = 0 let g:pymode_rope = 0 let g:pymode_rope_completion = 0 "let g:pymode_rope_completion_on_dot = 1 let g:pymode_rope_goto_definition_cmd = "new" let g:pymode_syntax_all = 1 let g:pymode_options = 1 " setup for the solarized color theme set background=dark let g:solarized_termcolors=16 let g:solarized_termtrans=1 let g:solarized_contrast="normal" let g:solarized_visibility="normal" syntax enable colorscheme monokai " setup for vim-airline let g:airline_theme='powerlineish' let g:airline_left_sep='' let g:airline_right_sep='' let g:airline_section_x = '%{PencilMode()}' let g:pencil#mode_indicators = {'hard': 'H', 'auto': 'A', 'soft': 'S', 'off': '',} "let g:airline_section_z='' " enable tabline at the top showing all buffers "let g:airline#extensions#tabline#enabled = 1 let g:ycm_complete_in_comments = 0 let g:ycm_complete_in_strings = 1 let g:ycm_collect_identifiers_from_comments_and_strings = 0 let g:ycm_seed_identifiers_with_syntax = 1 let g:ycm_add_preview_to_completeopt = 1 let g:ycm_autoclose_preview_window_after_completion = 1 let g:ycm_autoclose_preview_window_after_insertion = 1