" NeoBundle if !1 | finish | endif if has('vim_starting') set nocompatible " Be iMproved set runtimepath+=~/.vim/bundle/neobundle.vim/ endif call neobundle#begin(expand('~/.vim/bundle/')) NeoBundleFetch 'Shougo/neobundle.vim' " my bundles NeoBundle 'L9' NeoBundle 'unimpaired.vim' NeoBundle 'Shougo/unite.vim' NeoBundle 'scrooloose/nerdtree' NeoBundle 'kien/ctrlp.vim' NeoBundle 'scrooloose/nerdcommenter' NeoBundle 'surround.vim' NeoBundle 'SirVer/ultisnips' NeoBundle 'honza/vim-snippets' NeoBundle 'sjl/gundo.vim' NeoBundle 'editorconfig/editorconfig-vim' NeoBundle 'sheerun/vim-polyglot' NeoBundle 'nathanaelkane/vim-indent-guides' NeoBundle 'tpope/vim-fugitive' NeoBundle 'airblade/vim-gitgutter' NeoBundle 'rking/ag.vim' NeoBundle 'vim-airline' NeoBundle 'chriskempson/base16-vim' NeoBundle 'scrooloose/syntastic.git' NeoBundle 'Raimondi/delimitMate' NeoBundle 'jelera/vim-javascript-syntax' NeoBundle 'JavaScript-Indent' NeoBundle 'othree/javascript-libraries-syntax.vim' NeoBundle 'marijnh/tern_for_vim' NeoBundle 'mustache/vim-mustache-handlebars' NeoBundle 'gorodinskiy/vim-coloresque' NeoBundle 'inside/vim-search-pulse' call neobundle#end() filetype plugin indent on NeoBundleCheck " other stuff "" Encoding set encoding=utf-8 set fileencoding=utf-8 set fileencodings=utf-8 "" Unleash all VIM power set nocompatible "" Tabs. May be overriten by autocmd rules set tabstop=4 set softtabstop=0 set shiftwidth=4 set expandtab "" Enable hidden buffers set hidden "" Searching set hlsearch set incsearch set ignorecase set smartcase "" Encoding set bomb set ttyfast set binary "" Directories for swp files set nobackup set noswapfile set fileformats=unix,mac,dos set showcmd "" Mouse set mouse=a set ttymouse=urxvt " " Visual Settings " if has("gui_running") "disable menu, toolsbar, scrollbar set guioptions -=m set guioptions -=T set guioptions -=r endif set ruler set number set t_Co=256 set cursorline syntax enable set background=dark let base16colorspace=256 colorscheme base16-solarized set scrolloff=3 "" Status bar set laststatus=2 "" Use modeline overrides set modeline set modelines=10 set title set titleold="Terminal" set titlestring=%F "" disable visual bell set visualbell set t_vb= "" enable spelling set spelllang=en,de "" long lines set showbreak=~ " " KEY MAPPINGS " "" MAP LEADER noremap , \ let mapleader = "," "let mapleader = "\" "" fast saving nmap w :update "" fast escaping imap jj "" prevent accidental striking of F1 key map imap "" clear highlight nnoremap :noh "" map Y to match C and D behavior nnoremap Y y$ "" yank entire file (global yank) nmap gy ggVGy "" ignore lines when going up or down nnoremap j gj nnoremap k gk "" fast window switching map , w "" open next buffer map . :bn "" cycle between buffers map : :b# "" delete buffer map bd :bd "" change directory to current buffer map cd :cd %:p:h "" indent visual selected code without unselecting and going back to normal mode vmap > >gv vmap < r :%s#\<=expand("")\># "" strip all trailing whitespace in the current file nnoremap W :%s/\s\+$//e:let @/='' "" insert path of current file into a command cmap =expand("%:p:h") . "/" "" fast editing of the .vimrc nmap ev :e $MYVIMRC nmap sv :so $MYVIMRC "" allow saving when you forgot sudo cmap w!! w !sudo tee % >/dev/null "" turn on spell checking map spl :setlocal spell! "" spell checking shortcuts map sn ]s map sp [s map sa zg map s? z= "" toggle states nmap hh :set invhlsearch nmap ll :set invlist nmap pp :set invpaste nmap nn :set invnumber nmap ii :set invrelativenumber if exists('+relativenumber') set relativenumber endif " " Plugin Configuration " "" syntastic let g:syntastic_javascript_checkers = ['jshint','jscs'] let g:syntastic_check_on_open = 1 "" ariline let g:airline_theme = 'bubblegum' let g:airline_left_sep = '»' let g:airline_right_sep = '«' let g:airline_enable_syntastic = 1 let g:airline#extensions#tabline#enabled = 1 "" NERDTree configuration nmap n :NERDTreeToggle "" Unimpaired "" bubble single lines nmap k [e nmap j ]e "" bubble multiple lines vmap k [egv vmap j ]egv "" yankstack nmap p yankstack_substitute_older_paste nmap P yankstack_substitute_newer_paste "" Make Ctrl-P plugin a lot faster for Git projects let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files . -co --exclude-standard', 'find %s -type f'] let g:ctrlp_use_caching = 0 "" Indent Guides nmap g :IndentGuidesToggle "" Gundo nmap u :GundoToggle "" Ultisnips "let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" "let g:UltiSnipsJumpBackwardTrigger="" " Tex let g:tex_flavor = "latex" " " Autocmd Rules " "" do syntax highlight syncing from start autocmd BufEnter * :syntax sync fromstart "" Remember cursor position autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif set autoread "" txt, mail, human, tex au BufNewFile,BufRead *.txt set filetype=human au FileType human,mail,tex set wrap wm=2 textwidth=78 nocindent spell "" Markdown au FileType markdown set spell "" Python au FileType python set noexpandtab "" Json au BufRead,BufNewFile *.json set ft=json "" Mustache au BufRead,BufNewFile *.template set filetype=html syntax=mustache