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')
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()

87
vimrc
View file

@ -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,12 +24,11 @@ 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
"use terminal background
@ -39,40 +38,42 @@ if !has('gui_running')
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
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
@ -80,33 +81,48 @@ 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
let g:syntastic_ruby_checkers = ['mri', 'rubocop']
let g:syntastic_javascript_checkers = ['eslint']
let g:go_fmt_command = "goimports"
autocmd FileType go set nolist
if expand('%:t') =~? 'rfc\d\+' || expand('%:t') =~? 'draft-.*-\d\{2,}'
setfiletype rfc
set textwidth=72
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 undodir=~/.vim/tmp/undo//,.
"buffer management
" Buffer management
set swb=usetab "make :sb <filename> go to tabs too
"key mappings
" Key mappings
let mapleader = ','
set hlsearch
map <leader>c :nohlsearch<CR>
nmap <leader>c :call ToggleQuickfixList()<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>b :CtrlPBuffer<CR>
map <leader>r :CtrlPTag<CR>
map <leader>p :CtrlP<CR>
" Unimpaired remap for non-US keyboard
nmap ( [
nmap ) ]
omap ( [
@ -121,15 +137,14 @@ 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 <Plug>(EasyAlign)
nmap ga <Plug>(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=