This commit is contained in:
Loic Nageleisen 2016-11-30 14:39:29 +01:00
parent d872ea4318
commit 47f197fd2a
2 changed files with 103 additions and 79 deletions

View file

@ -1,9 +1,9 @@
call plug#begin('~/.vim/plugged') call plug#begin('~/.vim/plugged')
Plug 'gmarik/vundle' " Sensible defaults
Plug 'tpope/vim-sensible' Plug 'tpope/vim-sensible'
" Themes
Plug 'altercation/vim-colors-solarized' Plug 'altercation/vim-colors-solarized'
Plug 'jnurmine/Zenburn' Plug 'jnurmine/Zenburn'
Plug 'endel/vim-github-colorscheme' Plug 'endel/vim-github-colorscheme'
@ -11,37 +11,46 @@ Plug 'flazz/vim-colorschemes'
Plug 'lloeki/vim-one-colorschemes' Plug 'lloeki/vim-one-colorschemes'
Plug 'https://bitbucket.org/kisom/eink.vim.git' Plug 'https://bitbucket.org/kisom/eink.vim.git'
Plug 'robertmeta/nofrils' Plug 'robertmeta/nofrils'
Plug 'whatyouhide/vim-gotham'
Plug 'tpope/vim-bundler' " External tool integration
Plug 'tpope/vim-fugitive' Plug 'tpope/vim-bundler' " bundler + gem-ctags
Plug 'tpope/vim-fugitive' " git
Plug 'rking/ag.vim' " the silver searcher
Plug 'ciaranm/securemodelines' " UI extensions
Plug 'kien/ctrlp.vim' 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'
Plug 'vim-airline/vim-airline-themes' Plug 'vim-airline/vim-airline-themes'
Plug 'scrooloose/nerdtree' Plug 'scrooloose/nerdtree' , { 'on': 'NERDTreeToggle' }
Plug 'ervandew/supertab' Plug 'ervandew/supertab' " completion
Plug 'scrooloose/syntastic' Plug 'scrooloose/syntastic' " linter checks
Plug 'rking/ag.vim' Plug 'milkypostman/vim-togglelist' " toggle quickfix and location lists
Plug 'kchmck/vim-coffee-script' " Languages
Plug 'vim-scripts/glsl.vim' Plug 'kchmck/vim-coffee-script' , { 'for': 'coffee' }
Plug 'fatih/vim-go' Plug 'vim-scripts/glsl.vim' , { 'for': 'glsl' }
Plug 'groenewege/vim-less' Plug 'fatih/vim-go' ", { 'for': 'go', 'do': ':GoInstallBinaries' }
Plug 'tpope/vim-markdown' "Plug 'nsf/gocode' , { 'for': 'go', 'rtp': 'vim' }
Plug 'slim-template/vim-slim' Plug 'groenewege/vim-less' , { 'for': 'less' }
Plug 'jboyens/vim-protobuf' Plug 'tpope/vim-markdown' ", { 'for': ['md', 'mdown', 'markdown'] }
Plug 'dag/vim-fish' Plug 'slim-template/vim-slim' , { 'for': 'slim' }
Plug 'vim-scripts/rfc-syntax' Plug 'jboyens/vim-protobuf' , { 'for': 'proto' }
Plug 'rust-lang/rust.vim' 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' " Text objects
Plug 'michaeljsmith/vim-indent-object' Plug 'vim-scripts/argtextobj.vim' " arguments
Plug 'michaeljsmith/vim-indent-object' " indentation
Plug 'tpope/vim-repeat' " Extensions
Plug 'tpope/vim-surround' Plug 'junegunn/vim-easy-align' " alignment
Plug 'tpope/vim-endwise' Plug 'tpope/vim-repeat' " extend `.`
Plug 'tpope/vim-eunuch' Plug 'tpope/vim-surround' " surround
Plug 'tpope/vim-unimpaired' Plug 'tpope/vim-endwise' " extend `%`
Plug 'tpope/vim-eunuch' " unix helpers
Plug 'tpope/vim-unimpaired' " next/prev
call plug#end() call plug#end()

87
vimrc
View file

@ -1,19 +1,19 @@
" lloeki's vimrc " lloeki's vimrc
"bundle loading via vundle " Bundle loading via vim-plug
source ~/.vim/plugged.vim source ~/.vim/plugged.vim
scriptencoding "utf-8" scriptencoding "utf-8"
"security measure " Security measure
set modelines=0 set modelines=0
let g:secure_modelines_leave_modeline=1 let g:secure_modelines_leave_modeline=1
let g:secure_modelines_verbose=1 let g:secure_modelines_verbose=1
" prevent .netrwhist creation " Prevent .netrwhist creation
let g:netrw_dirhistmax = 0 let g:netrw_dirhistmax = 0
"airline " Airline
let g:airline_theme='raven' let g:airline_theme='raven'
if !exists('g:airline_symbols') if !exists('g:airline_symbols')
let g:airline_symbols = {} let g:airline_symbols = {}
@ -24,12 +24,11 @@ let g:airline_symbols.linenr = ''
let g:airline_symbols.branch = '⎇' let g:airline_symbols.branch = '⎇'
let g:airline_symbols.whitespace = '' let g:airline_symbols.whitespace = ''
"terminal behavior and appearance " Terminal behavior and appearance
if !has('gui_running') if !has('gui_running')
set showtabline=1 "automatic tab bar set showtabline=1 "automatic tab bar
set mouse=n "mouse support set mouse=n "mouse support
set background=light set background=light
"let g:nofrils_strbackgrounds=1
colorscheme nofrils-light colorscheme nofrils-light
"use terminal background "use terminal background
@ -39,40 +38,42 @@ if !has('gui_running')
hi LineNr ctermbg=none hi LineNr ctermbg=none
endif endif
"appearance tweaks " Appearance tweaks
hi VertSplit cterm=NONE gui=NONE hi VertSplit cterm=NONE gui=NONE
set fillchars+=vert:│ set fillchars+=vert:│
"ignore some files " Ignore some files
set wildignore+=*.o,*.obj,*.pyc set wildignore+=*.o,*.obj
set wildignore+=.git,.svn set wildignore+=.git,.svn
set wildignore+=env,venv* set wildignore+=,*.pyc,env,venv*
set wildignore+=node_modules set wildignore+=node_modules
set wildignore+=pkg
"display more info " Display more info
set number "show line numbers in left margin set number "show line numbers in left margin
" search tweaks " Search tweaks
set ignorecase "ignore case when searching set ignorecase "ignore case when searching
set smartcase "... but be nice when actually typing caps set smartcase "... but be nice when actually typing caps
" tabbing settings " Tabbing settings
set shiftwidth=4 "indent size set shiftwidth=4 "indent size
set shiftround "round indent to next offset set shiftround "round indent to next offset
set tabstop=4 "size of tab character set tabstop=4 "size of tab character
set expandtab "insert spaces instead of tab set expandtab "insert spaces instead of tab
set softtabstop=4 "... and that much spaces are inserted set softtabstop=4 "... and that much spaces are inserted
"feedback " Feedback
"set cursorline "highlight current line set hlsearch "highlight search matches
set cursorline "highlight current line
set showmatch "highlight both matching parentheses set showmatch "highlight both matching parentheses
set listchars=eol,tab:→\ ,nbsp:•,trail,extends:>,precedes:< set listchars=eol,tab:→\ ,nbsp:•,trail,extends:>,precedes:<
set list set list "display invisible chars
" OS clipboard integration " OS clipboard integration
set clipboard^=unnamed set clipboard^=unnamed
"filetype/language specific settings " Filetype/language specific settings
autocmd FileType make set noexpandtab "makefiles need tabs autocmd FileType make set noexpandtab "makefiles need tabs
autocmd FileType ruby set softtabstop=2 shiftwidth=2 autocmd FileType ruby set softtabstop=2 shiftwidth=2
autocmd FileType eruby set softtabstop=2 shiftwidth=2 autocmd FileType eruby set softtabstop=2 shiftwidth=2
@ -80,33 +81,48 @@ autocmd FileType coffee set softtabstop=4 shiftwidth=4
au BufRead,BufNewFile Guardfile setfiletype ruby au BufRead,BufNewFile Guardfile setfiletype ruby
au BufRead,BufNewFile *.skim setfiletype slim au BufRead,BufNewFile *.skim setfiletype slim
au BufRead,BufNewFile *.opal setfiletype ruby au BufRead,BufNewFile *.opal setfiletype ruby
let g:syntastic_ruby_checkers = ['mri', 'rubocop'] autocmd FileType go set nolist
let g:syntastic_javascript_checkers = ['eslint']
let g:go_fmt_command = "goimports"
if expand('%:t') =~? 'rfc\d\+' || expand('%:t') =~? 'draft-.*-\d\{2,}' if expand('%:t') =~? 'rfc\d\+' || expand('%:t') =~? 'draft-.*-\d\{2,}'
setfiletype rfc setfiletype rfc
set textwidth=72 set textwidth=72
endif endif
"swap/undo files " 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
" Swap and undo files
set dir=~/.vim/tmp/swap//,/var/tmp//,/tmp//,. set dir=~/.vim/tmp/swap//,/var/tmp//,/tmp//,.
"set undodir=~/.vim/tmp/undo//,. "set undodir=~/.vim/tmp/undo//,.
"buffer management " Buffer management
set swb=usetab "make :sb <filename> go to tabs too set swb=usetab "make :sb <filename> go to tabs too
"key mappings " Key mappings
let mapleader = ',' let mapleader = ','
set hlsearch nmap <leader>c :call ToggleQuickfixList()<CR>
map <leader>c :nohlsearch<CR> nmap <leader>l :call ToggleLocationList()<CR>
nmap <leader>e :SyntasticCheck<CR>:SyntasticSetLoclist<CR>:Errors<CR>
nmap <F1> :nohlsearch<CR>
nmap <F4> :SyntasticToggleMode<CR>
nmap <F5> :set number!<CR>
nmap <F6> :set list!<CR>
inoremap <F5> <C-O>:set number!<CR>
inoremap <F6> <C-O>:set list!<CR>
map <leader>t :NERDTreeToggle<CR> map <leader>t :NERDTreeToggle<CR>
map <leader>b :CtrlPBuffer<CR> map <leader>b :CtrlPBuffer<CR>
map <leader>r :CtrlPTag<CR> map <leader>r :CtrlPTag<CR>
map <leader>p :CtrlP<CR> map <leader>p :CtrlP<CR>
" Unimpaired remap for non-US keyboard
nmap ( [ nmap ( [
nmap ) ] nmap ) ]
omap ( [ omap ( [
@ -121,15 +137,14 @@ set completeopt=menu,menuone,longest
" Limit popup menu height " Limit popup menu height
set pumheight=10 set pumheight=10
"OmniComplete " EasyAlign
let g:rubycomplete_buffer_loading = 1 xmap ga <Plug>(EasyAlign)
let g:rubycomplete_classes_in_global = 1 nmap ga <Plug>(EasyAlign)
set completeopt+=longest
" quick task list " quick task list
command Tasks Ag '(TODO|FIX(?:ME|)|HACK|XXX|OPT(?:IMIZE|)|BUG|WTF|NOTE|CHANGED|REVIEW|IDEA):?\s?(.+$)' 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() function! ResCur()
if line("'\"") <= line("$") if line("'\"") <= line("$")
normal! g`" normal! g`"
@ -137,7 +152,7 @@ function! ResCur()
endif endif
endfunction endfunction
" unfold at cursor position " Unfold at cursor position
if has("folding") if has("folding")
function! UnfoldCur() function! UnfoldCur()
if !&foldenable if !&foldenable
@ -157,7 +172,7 @@ if has("folding")
endfunction endfunction
endif endif
" restore last known cursor position on open " Restore last known cursor position on open
augroup resCur augroup resCur
autocmd! autocmd!
if has("folding") if has("folding")
@ -167,7 +182,7 @@ augroup resCur
endif endif
augroup END augroup END
" restore session if Session.vim exists " Restore session if Session.vim exists
function! RestoreSession() function! RestoreSession()
if argc() == 0 && filereadable("Session.vim") "vim called without arguments if argc() == 0 && filereadable("Session.vim") "vim called without arguments
execute 'source Session.vim' execute 'source Session.vim'
@ -175,13 +190,13 @@ function! RestoreSession()
endfunction endfunction
autocmd VimEnter * call RestoreSession() autocmd VimEnter * call RestoreSession()
"matchit " Matchit
source $VIMRUNTIME/macros/matchit.vim source $VIMRUNTIME/macros/matchit.vim
"crontab -e " Fix for crontab -e
au! BufNewFile,BufRead crontab.* set nobackup | set nowritebackup au! BufNewFile,BufRead crontab.* set nobackup | set nowritebackup
"term title " Term title
set title set title
set t_ts=]6; set t_ts=]6;
set t_fs= set t_fs=