diff --git a/plugged.vim b/plugged.vim index 03ec60d..3fc9280 100644 --- a/plugged.vim +++ b/plugged.vim @@ -1,9 +1,9 @@ call plug#begin('~/.vim/plugged') -Plug 'gmarik/vundle' - +" Sensible defaults Plug 'tpope/vim-sensible' +" Themes Plug 'altercation/vim-colors-solarized' Plug 'jnurmine/Zenburn' Plug 'endel/vim-github-colorscheme' @@ -11,37 +11,46 @@ Plug 'flazz/vim-colorschemes' Plug 'lloeki/vim-one-colorschemes' Plug 'https://bitbucket.org/kisom/eink.vim.git' Plug 'robertmeta/nofrils' +Plug 'whatyouhide/vim-gotham' -Plug 'tpope/vim-bundler' -Plug 'tpope/vim-fugitive' +" External tool integration +Plug 'tpope/vim-bundler' " bundler + gem-ctags +Plug 'tpope/vim-fugitive' " git +Plug 'rking/ag.vim' " the silver searcher -Plug 'ciaranm/securemodelines' -Plug 'kien/ctrlp.vim' +" UI extensions +Plug 'ciaranm/securemodelines' " safe modelines in files +Plug 'kien/ctrlp.vim' " fuzzy file+buffer search Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' -Plug 'scrooloose/nerdtree' -Plug 'ervandew/supertab' -Plug 'scrooloose/syntastic' -Plug 'rking/ag.vim' +Plug 'scrooloose/nerdtree' , { 'on': 'NERDTreeToggle' } +Plug 'ervandew/supertab' " completion +Plug 'scrooloose/syntastic' " linter checks +Plug 'milkypostman/vim-togglelist' " toggle quickfix and location lists -Plug 'kchmck/vim-coffee-script' -Plug 'vim-scripts/glsl.vim' -Plug 'fatih/vim-go' -Plug 'groenewege/vim-less' -Plug 'tpope/vim-markdown' -Plug 'slim-template/vim-slim' -Plug 'jboyens/vim-protobuf' -Plug 'dag/vim-fish' -Plug 'vim-scripts/rfc-syntax' -Plug 'rust-lang/rust.vim' +" Languages +Plug 'kchmck/vim-coffee-script' , { 'for': 'coffee' } +Plug 'vim-scripts/glsl.vim' , { 'for': 'glsl' } +Plug 'fatih/vim-go' ", { 'for': 'go', 'do': ':GoInstallBinaries' } +"Plug 'nsf/gocode' , { 'for': 'go', 'rtp': 'vim' } +Plug 'groenewege/vim-less' , { 'for': 'less' } +Plug 'tpope/vim-markdown' ", { 'for': ['md', 'mdown', 'markdown'] } +Plug 'slim-template/vim-slim' , { 'for': 'slim' } +Plug 'jboyens/vim-protobuf' , { 'for': 'proto' } +Plug 'dag/vim-fish' , { 'for': 'fish' } +Plug 'vim-scripts/rfc-syntax' , { 'for': 'rfc' } +Plug 'rust-lang/rust.vim' ", { 'for': ['rs', 'rust'] } -Plug 'vim-scripts/argtextobj.vim' -Plug 'michaeljsmith/vim-indent-object' +" Text objects +Plug 'vim-scripts/argtextobj.vim' " arguments +Plug 'michaeljsmith/vim-indent-object' " indentation -Plug 'tpope/vim-repeat' -Plug 'tpope/vim-surround' -Plug 'tpope/vim-endwise' -Plug 'tpope/vim-eunuch' -Plug 'tpope/vim-unimpaired' +" Extensions +Plug 'junegunn/vim-easy-align' " alignment +Plug 'tpope/vim-repeat' " extend `.` +Plug 'tpope/vim-surround' " surround +Plug 'tpope/vim-endwise' " extend `%` +Plug 'tpope/vim-eunuch' " unix helpers +Plug 'tpope/vim-unimpaired' " next/prev call plug#end() diff --git a/vimrc b/vimrc index 7ef9069..9f8965f 100644 --- a/vimrc +++ b/vimrc @@ -1,19 +1,19 @@ " lloeki's vimrc -"bundle loading via vundle +" Bundle loading via vim-plug source ~/.vim/plugged.vim scriptencoding "utf-8" -"security measure +" Security measure set modelines=0 let g:secure_modelines_leave_modeline=1 let g:secure_modelines_verbose=1 -" prevent .netrwhist creation +" Prevent .netrwhist creation let g:netrw_dirhistmax = 0 -"airline +" Airline let g:airline_theme='raven' if !exists('g:airline_symbols') let g:airline_symbols = {} @@ -24,89 +24,105 @@ let g:airline_symbols.linenr = '' let g:airline_symbols.branch = '⎇' let g:airline_symbols.whitespace = '' -"terminal behavior and appearance +" Terminal behavior and appearance if !has('gui_running') - set showtabline=1 "automatic tab bar - set mouse=n "mouse support - set background=light - "let g:nofrils_strbackgrounds=1 - colorscheme nofrils-light + set showtabline=1 "automatic tab bar + set mouse=n "mouse support + set background=light + colorscheme nofrils-light - "use terminal background - hi Normal ctermbg=none - hi todo ctermbg=none - hi statement ctermbg=none - hi LineNr ctermbg=none + "use terminal background + hi Normal ctermbg=none + hi todo ctermbg=none + hi statement ctermbg=none + hi LineNr ctermbg=none endif -"appearance tweaks +" Appearance tweaks hi VertSplit cterm=NONE gui=NONE set fillchars+=vert:│ -"ignore some files -set wildignore+=*.o,*.obj,*.pyc +" Ignore some files +set wildignore+=*.o,*.obj set wildignore+=.git,.svn -set wildignore+=env,venv* +set wildignore+=,*.pyc,env,venv* set wildignore+=node_modules +set wildignore+=pkg -"display more info +" Display more info set number "show line numbers in left margin -" search tweaks +" Search tweaks set ignorecase "ignore case when searching set smartcase "... but be nice when actually typing caps -" tabbing settings +" Tabbing settings set shiftwidth=4 "indent size set shiftround "round indent to next offset set tabstop=4 "size of tab character set expandtab "insert spaces instead of tab set softtabstop=4 "... and that much spaces are inserted -"feedback -"set cursorline "highlight current line +" Feedback +set hlsearch "highlight search matches +set cursorline "highlight current line set showmatch "highlight both matching parentheses set listchars=eol:¬,tab:→\ ,nbsp:•,trail:·,extends:>,precedes:< -set list +set list "display invisible chars -"OS clipboard integration +" OS clipboard integration set clipboard^=unnamed -"filetype/language specific settings +" Filetype/language specific settings autocmd FileType make set noexpandtab "makefiles need tabs autocmd FileType ruby set softtabstop=2 shiftwidth=2 autocmd FileType eruby set softtabstop=2 shiftwidth=2 autocmd FileType coffee set softtabstop=4 shiftwidth=4 -au BufRead,BufNewFile Guardfile setfiletype ruby -au BufRead,BufNewFile *.skim setfiletype slim -au BufRead,BufNewFile *.opal setfiletype ruby +au BufRead,BufNewFile Guardfile setfiletype ruby +au BufRead,BufNewFile *.skim setfiletype slim +au BufRead,BufNewFile *.opal setfiletype ruby +autocmd FileType go set nolist + +if expand('%:t') =~? 'rfc\d\+' || expand('%:t') =~? 'draft-.*-\d\{2,}' + setfiletype rfc + set textwidth=72 +endif + +" Syntastic let g:syntastic_ruby_checkers = ['mri', 'rubocop'] let g:syntastic_javascript_checkers = ['eslint'] let g:go_fmt_command = "goimports" +let g:syntastic_always_populate_loc_list = 1 +let g:syntastic_enable_signs = 1 +let g:syntastic_enable_highlighting = 1 -if expand('%:t') =~? 'rfc\d\+' || expand('%:t') =~? 'draft-.*-\d\{2,}' - setfiletype rfc - set textwidth=72 -endif - -"swap/undo files +" Swap and undo files set dir=~/.vim/tmp/swap//,/var/tmp//,/tmp//,. "set undodir=~/.vim/tmp/undo//,. -"buffer management +" Buffer management set swb=usetab "make :sb go to tabs too -"key mappings +" Key mappings let mapleader = ',' -set hlsearch -map c :nohlsearch +nmap c :call ToggleQuickfixList() +nmap l :call ToggleLocationList() +nmap e :SyntasticCheck:SyntasticSetLoclist:Errors + +nmap :nohlsearch +nmap :SyntasticToggleMode +nmap :set number! +nmap :set list! +inoremap :set number! +inoremap :set list! map t :NERDTreeToggle map b :CtrlPBuffer map r :CtrlPTag map p :CtrlP +" Unimpaired remap for non-US keyboard nmap ( [ nmap ) ] omap ( [ @@ -114,22 +130,21 @@ omap ) ] xmap ( [ xmap ) ] -"SuperTab options +" SuperTab options let g:SuperTabDefaultCompletionType = "context" " Complete options (disable preview scratch window) set completeopt=menu,menuone,longest " Limit popup menu height set pumheight=10 -"OmniComplete -let g:rubycomplete_buffer_loading = 1 -let g:rubycomplete_classes_in_global = 1 -set completeopt+=longest +" EasyAlign +xmap ga (EasyAlign) +nmap ga (EasyAlign) " quick task list command Tasks Ag '(TODO|FIX(?:ME|)|HACK|XXX|OPT(?:IMIZE|)|BUG|WTF|NOTE|CHANGED|REVIEW|IDEA):?\s?(.+$)' -" restore last known cursor position +" Restore last known cursor position function! ResCur() if line("'\"") <= line("$") normal! g`" @@ -137,7 +152,7 @@ function! ResCur() endif endfunction -" unfold at cursor position +" Unfold at cursor position if has("folding") function! UnfoldCur() if !&foldenable @@ -157,7 +172,7 @@ if has("folding") endfunction endif -" restore last known cursor position on open +" Restore last known cursor position on open augroup resCur autocmd! if has("folding") @@ -167,7 +182,7 @@ augroup resCur endif augroup END -" restore session if Session.vim exists +" Restore session if Session.vim exists function! RestoreSession() if argc() == 0 && filereadable("Session.vim") "vim called without arguments execute 'source Session.vim' @@ -175,13 +190,13 @@ function! RestoreSession() endfunction autocmd VimEnter * call RestoreSession() -"matchit +" Matchit source $VIMRUNTIME/macros/matchit.vim -"crontab -e +" Fix for crontab -e au! BufNewFile,BufRead crontab.* set nobackup | set nowritebackup -"term title +" Term title set title set t_ts=]6; set t_fs=