set nocompatible " be improved, required filetype off " required set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'gmarik/Vundle.vim' " Main group Plugin 'Yggdroot/indentLine' Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' Plugin 'gorodinskiy/vim-coloresque' Plugin 'bruno-/vim-husk' Plugin 'powerman/vim-plugin-ruscmd' Plugin 'tpope/vim-repeat' Plugin 'tpope/vim-surround' " Navigation Plugin 'rking/ag.vim' Plugin 'corntrace/bufexplorer' Plugin 'kien/ctrlp.vim' Plugin 'dockyard/vim-easydir' Plugin 'scrooloose/nerdtree' " Snippets Plugin 'tomtom/tlib_vim' Plugin 'MarcWeber/vim-addon-mw-utils' Plugin 'garbas/vim-snipmate' " Programming Plugin 'scrooloose/syntastic' Plugin 'vim-scripts/tComment' Plugin 'jbgutierrez/vim-partial' Plugin 'tpope/vim-rsi' Plugin 'elzr/vim-json' " Vim text objects " Markdown Plugin 'tpope/vim-markdown' " Color schemes Plugin 'cocopon/iceberg.vim' Plugin 'junegunn/seoul256.vim' " Ruby group Plugin 'tpope/vim-endwise' Plugin 'slim-template/vim-slim' Plugin 'tpope/vim-rails' Plugin 'vim-ruby/vim-ruby' Plugin 'thoughtbot/vim-rspec' Plugin 'sunaku/vim-ruby-minitest' " tmux group Plugin 'jgdavey/tslime.vim' Plugin 'jpalardy/vim-slime' " js group Plugin 'pangloss/vim-javascript' " elexir group Plugin 'elixir-lang/vim-elixir' " coffee group Plugin 'kchmck/vim-coffee-script' " crystal group Plugin 'rhysd/vim-crystal' " julia group Plugin 'JuliaLang/julia-vim' " clojure group Plugin 'guns/vim-clojure-static' Plugin 'guns/vim-clojure-highlight' Plugin 'tpope/vim-fireplace' Plugin 'kien/rainbow_parentheses.vim' Plugin 'venantius/vim-eastwood' " haskell group Plugin 'eagletmt/ghcmod-vim' Plugin 'eagletmt/neco-ghc' " statistic Plugin 'wakatime/vim-wakatime' " Racket group Plugin 'wlangstroth/vim-racket' " test plugin functionality call vundle#end() " Load plugins and indentation for file types if has('autocmd') filetype indent plugin on " Shortcuts to quickly switch to common file types; handy when using " editing abstractions like sudoedit(8) nnoremap _cs :setlocal filetype=css nnoremap _ht :setlocal filetype=html nnoremap _sl :setlocal filetype=slim nnoremap _js :setlocal filetype=javascript nnoremap _md :setlocal filetype=markdown nnoremap _rb :setlocal filetype=ruby nnoremap _sh :setlocal filetype=sh nnoremap _vi :setlocal filetype=vim endif " Color Scheme set guifont=Droid\ Sans\ Mono\ 12 let g:seoul256_background = 236 colo seoul256 colo iceberg " Use relative line numbers if exists("&relativenumber") set relativenumber au BufReadPost * set relativenumber endif syntax on set tags=.git/tags set iskeyword-=. " use dot for limiter word set iskeyword+=_ set clipboard=unnamed set ttyfast " u got a fast terminal set lazyredraw " to avoid scrolling problems set synmaxcol=200 set mouse=nv set hidden set number set ts=2 set sw=2 set autoindent set smartindent set expandtab set ignorecase set hlsearch set splitbelow " new splits are down set splitright " new vsplits are to the right set smartcase set incsearch set laststatus=2 set visualbell set showcmd set pastetoggle= set iminsert=0 set linebreak set completeopt=longest,menuone set wildmenu set noerrorbells set novisualbell set t_vb= set t_ut= set tm=500 set nobackup set nowb set noswapfile set timeoutlen=500 set langmenu=en_US.UTF-8 set encoding=utf-8 set fileencoding=utf-8 set shm+=I " Startup message is irritating set dictionary=/usr/share/dict/words " Time out on key codes but not mappings. " Basically this makes terminal Vim work sanely. set notimeout set ttimeout set ttimeoutlen=10 if executable('zsh') set shell=zsh endif language mes en_US.UTF-8 let g:markdown_fenced_languages = ['javascript', 'ruby', 'sh', 'yaml', 'javascript', 'html', 'vim', 'coffee', 'json', 'diff'] let g:tube_terminal = "iterm" let g:ruby_path = system('rvm current') let g:airline#extensions#branch#enabled = 1 let g:airline#extensions#branch#empty_message = '' let g:airline#extensions#syntastic#enabled = 1 let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#show_close_button = 0 let g:airline#extensions#tabline#left_alt_sep = '|' let g:airline#extensions#tabline#left_sep = '|' let g:airline#extensions#tabline#show_buffers = 0 let g:airline_left_sep = '' let g:airline_right_sep = '' let g:airline_theme = 'lucius' let g:bufExplorerDefaultHelp=0 let g:bufExplorerShowRelativePath=1 let g:bufExplorerSortBy='mru' let g:bufExplorerSplitRight=0 let g:indentLine_color_term = 239 let g:indentLine_char = '¦' let g:neocomplete#enable_at_startup = 1 let g:ruby_indent_access_modifier_style = 'outdent' let ruby_operators = 1 let g:surround_{char2nr('%')} = "%(\r)" let g:surround_{char2nr('w')} = "%w(\r)" let g:surround_{char2nr('#')} = "#{\r}" let g:surround_{char2nr('|')} = "|\r|" let g:syntastic_enable_signs = 1 let g:syntastic_error_symbol = '✗' let g:syntastic_warning_symbol = '⚠' let g:syntastic_disabled_filetypes = ['html', 'slim', 'erb', 'md'] " change log settings let g:changelog_dateformat = "%c" let g:changelog_timeformat = "%c" let g:changelog_username = "Anton Davydov, " " vim-slime let g:slime_target = 'tmux' " vim rspec let g:rspec_command = 'call Send_to_Tmux("rspec {spec}\n")' map t :call RunCurrentSpecFile() map a :call RunAllSpecs() " Disable Ex mode map Q nmap vmap nmap n :noh nnoremap nnoremap j gj nnoremap k gk vnoremap j gj vnoremap k gk nnoremap gj j nnoremap gk k vnoremap gj j vnoremap gk k " Quicker window movement nnoremap h nnoremap j nnoremap k nnoremap l " experimental mappings------------ nnoremap >> nnoremap << vnoremap > vnoremap < nnoremap th :tabfirst nnoremap tj :tabprev nnoremap tk :tabnext nnoremap tl :tablast nnoremap td :tabclose nnoremap tn :tabnew nnoremap Q nnoremap K nmap o o nmap O Oj nmap < 10< nmap > 10> nmap + 10+ nmap - 10- nmap p :CtrlPBufTag nmap hh :%s/:\([^ ]*\)\(\s*\)=>/\1:/g " Replace mapping nmap ; :%s:::g nmap ;; :%s:::g " vim-partial vmap x :PartialExtract " NERDTree plugin nmap :NERDTree cabbrev CSScomb :!csscomb %:p cnoreabbrev W ((getcmdtype() is# ':' && getcmdline() is# 'W')?('w'):('W')) " bind K to grep word under cursor nnoremap f :grep! "\b\b" --ignore-dir log:cw " Use The Silver Searcher https://github.com/ggreer/the_silver_searcher if executable('ag') " Use Ag over Grep set grepprg=ag\ --nogroup\ --nocolor " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' " ag is fast enough that CtrlP doesn't need to cache let g:ctrlp_use_caching = 0 else " Fall back to using git ls-files if Ag is not available let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$' let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others'] endif function! ClearRegisters() let regs='abcdefghijklmnopqrstuvwxyz0123456789' let i=0 while (iss :call StripWhitespace() " rename current file (thanks Gary Bernhardt) function! RenameFile() let old_name = expand('%') let new_name = input('New file name: ', expand('%'), 'file') if new_name != '' && new_name != old_name exec ':saveas ' . new_name exec ':silent !rm ' . old_name redraw! endif endfunction command! RENAME call RenameFile() " Automatic commands if has("autocmd") " Enable file type detection filetype on " Treat .json files as .js autocmd BufNewFile,BufRead *.json setfiletype json syntax=javascript autocmd BufNewFile,BufRead *.md set filetype=markdown endif autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1 autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1 autocmd FileType ruby,eruby let g:rubycomplete_rails = 1 autocmd FileType css set omnifunc=csscomplete#CompleteCSS autocmd Filetype gitcommit setlocal spell textwidth=72 au BufNewFile,BufRead,BufWrite *.md syntax match Comment /\%^---\_.\{-}---$/ " Turn on spell-checking in markdown and text. " au BufRead,BufNewFile *.md,*.txt setlocal spell " Neovim confixg if has('nvim') let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1 tnoremap tnoremap highlight TermCursor ctermfg=red guifg=red endif if exists('$TMUX') let &t_SI = "\Ptmux;\\]50;CursorShape=1\x7\\\" let &t_EI = "\Ptmux;\\]50;CursorShape=0\x7\\\" else let &t_SI = "\]50;CursorShape=1\x7" let &t_EI = "\]50;CursorShape=0\x7" endif autocmd BufWritePost * set iskeyword-=. autocmd BufWritePost * set clipboard=unnamed autocmd BufWritePost * set path+=** set iskeyword-=. " use dot for limiter word set iskeyword+=_ set path+=** set clipboard=unnamed