Merge branch 'master' into gutentags

This commit is contained in:
Thomas Ruoff
2016-11-08 09:05:00 +01:00
3 changed files with 255 additions and 168 deletions

162
vimrc
View File

@@ -1,7 +1,5 @@
set encoding=utf-8
scriptencoding utf-8
set fileencoding=utf-8
set fileencodings=utf-8
call plug#begin('~/.vim/plugged')
@@ -15,16 +13,8 @@ Plug 'Raimondi/delimitMate'
Plug 'editorconfig/editorconfig-vim'
Plug 'Shougo/unite.vim'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/nerdcommenter'
Plug 'Valloric/YouCompleteMe', { 'do': './install.sh --tern-completer' }
Plug 'mbbill/undotree'
Plug 'ludovicchabant/vim-gutentags'
Plug 'nathanaelkane/vim-indent-guides'
@@ -32,7 +22,6 @@ Plug 'nathanaelkane/vim-indent-guides'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'sheerun/vim-polyglot'
Plug 'scrooloose/syntastic'
Plug 'tpope/vim-fugitive'
@@ -40,25 +29,25 @@ Plug 'rhysd/conflict-marker.vim'
Plug 'airblade/vim-gitgutter'
Plug 'inside/vim-search-pulse'
Plug 'mileszs/ack.vim'
Plug 'BufOnly.vim'
Plug 'itchyny/lightline.vim'
Plug 'chriskempson/base16-vim'
Plug 'pangloss/vim-javascript', { 'for': 'javascript' }
Plug 'marijnh/tern_for_vim', { 'do': 'npm install', 'for': 'javascript' }
Plug 'mxw/vim-jsx', { 'for': 'javascript' }
Plug 'pangloss/vim-javascript'
Plug 'marijnh/tern_for_vim', { 'do': 'npm install' }
Plug 'mxw/vim-jsx'
Plug 'suan/vim-instant-markdown', { 'for': 'markdown' }
Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' }
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
call plug#end()
"" enable local .vimrc
set exrc " Enable use of directory-specific .vimrc
set exrc " Enable use of directory-specific .vimrc
set secure " Only run autocommands owned by me
"" Tabs. May be overriten by autocmd rules
@@ -74,13 +63,49 @@ set hidden
set hlsearch
set smartcase
"" Directories for swp files
"" find
set path+=**
"" Display all matching files when we tab complete
set wildmenu
"set wildignorecase
set wildignore+=.git,.hg,.svn
set wildignore+=*.aux,*.out,*.toc
set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
set wildignore+=*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
set wildignore+=*.avi,*.m4a,*.mp3,*.oga,*.ogg,*.wav,*.webm
set wildignore+=*.eot,*.otf,*.ttf,*.woff
set wildignore+=*.doc,*.pdf
set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz
set wildignore+=*.swp,.lock,.DS_Store,._*
"" saving
set fileformats=unix,dos,mac
set fileformat=unix
"" backups
" Use backup files when writing (create new file, replace old one with new
" one)
set writebackup
" but do not leave around backup.xyz~ files after that
set nobackup
" backupcopy=yes is the default, just be explicit. We need this for
" webpack-dev-server and hot module reloading -- preserves special file types
" like symlinks
set backupcopy=yes nobackup
" swap files
set noswapfile
set fileformats=unix,dos,mac
" persistent undo
set undodir=~/.vim/undos
set undofile
set undolevels=1000
set undoreload=10000
" session management
"" session management
let g:session_directory = "~/.vim/session"
let g:session_autoload = "no"
let g:session_autosave = "no"
@@ -95,6 +120,10 @@ set modelines=10
"" Visual settings
syntax enable
set synmaxcol=512
set title
set cursorline
set number
@@ -113,46 +142,35 @@ if has("gui_running")
set guioptions -=r
endif
set title
set titleold="Terminal"
set titlestring=%F
" Display unprintable chars
set listchars=tab:▸\ ,extends:,precedes:,nbsp:␣,trail
set showbreak=
"" disable visual bell
set visualbell
set t_vb=
"" enable spelling
"" spelling
set spelllang=en,de
" Spelling highlights. Use underline in term to prevent cursorline highlights
" from interfering
if !has("gui_running")
hi clear SpellBad
hi SpellBad cterm=underline ctermfg=red
hi clear SpellCap
hi SpellCap cterm=underline ctermfg=blue
hi clear SpellLocal
hi SpellLocal cterm=underline ctermfg=blue
hi clear SpellRare
hi SpellRare cterm=underline ctermfg=blue
endif
" Display unprintable chars
set listchars=tab:▸\ ,extends:,precedes:,nbsp:␣
set showbreak=
" Open all folds initially
set foldmethod=indent
set foldlevelstart=99
" Writes to the unnamed register also writes to the * and + registers. This
" makes it easy to interact with the system clipboard
set clipboard^=unnamed
if has ('unnamedplus')
set clipboard=unnamedplus
else
set clipboard=unnamed
set clipboard^=unnamedplus
endif
" diff
set fillchars+=diff:⣿
set diffopt=vertical " Use in vertical diff mode
set diffopt+=filler " blank lines to keep sides aligned
set diffopt+=iwhite " Ignore whitespace changes
"
" KEY MAPPINGS
"
@@ -160,7 +178,7 @@ endif
"" MAP LEADER
noremap , \
let mapleader = ","
"let mapleader = "\<Space>"
set timeoutlen=200
"" fast saving
nmap <leader>w :update<cr>
@@ -195,8 +213,6 @@ map <leader>: :b#<cr>
"" delete buffer
map <leader>bd :bd<cr>
"" change directory to current buffer
map <leader>cd :cd %:p:h<cr>
"" indent visual selected code without unselecting and going back to normal mode
vmap > >gv
vmap < <gv
@@ -206,9 +222,6 @@ nmap gV `[v`]
"" pull word under cursor into lhs of a substitute (for quick search and replace)
nmap <leader>r :%s#\<<C-r>=expand("<cword>")<CR>\>#
"" strip all trailing whitespace in the current file
nnoremap <leader>W :%s/\s\+$//e<cr>:let @/=''<CR>
"" fast editing of the .vimrc
nmap <silent> <leader>ev :e $MYVIMRC<cr>
nmap <silent> <leader>sv :so $MYVIMRC<cr>
@@ -235,10 +248,6 @@ nmap <silent> <leader>ii :set invrelativenumber<CR>
"" <Leader>0: Run the visually selected code in node and replace it with the output
vnoremap <silent> <Leader>0 :!node<cr>
"" +/-: Increment number
nnoremap + <c-a>
nnoremap - <c-x>
" debugging, use leader-DD to start, do a slow action, then leader-DQ to
" finish. Your output will be in profile.log
nnoremap <silent> <leader>DD :exe ":profile start profile.log"<cr>:exe ":profile func *"<cr>:exe ":profile file *"<cr>
@@ -256,17 +265,7 @@ cnoreabbrev W w
cnoreabbrev Q q
cnoreabbrev Qall qall
" session management
nnoremap <leader>so :OpenSession<Space>
nnoremap <leader>ss :SaveSession<Space>
nnoremap <leader>sd :DeleteSession<CR>
nnoremap <leader>sc :CloseSession<CR>
" persistent undo
set undodir=~/.vim/undos
set undofile
set undolevels=1000
set undoreload=10000
iab xnow <c-r>=strftime("%Y-%m-%d %H:%M")<cr>
"
" Plugin Configuration
@@ -280,10 +279,14 @@ let g:gutentags_file_list_command = {
\ },
\ }
"" ACK
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
"" fzf
nmap <leader>b :Buffers<cr>
nmap <leader>f :GFiles<cr>
nmap <leader>F :Files<cr>
nmap <leader>a :Ag<space>
vmap <leader>a y:Ag <c-r>" <cr>
nmap <leader>A :Ag <c-r><c-w><cr>
nmap <leader>c :Commits<cr>
"" syntastic
let g:syntastic_always_populate_loc_list = 1
@@ -292,10 +295,9 @@ let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" local linter support
let g:syntastic_javascript_checkers = []
function CheckJavaScriptLinter(filepath, linter)
function! CheckJavaScriptLinter(filepath, linter)
if exists('b:syntastic_checkers')
return
endif
@@ -305,7 +307,7 @@ function CheckJavaScriptLinter(filepath, linter)
endif
endfunction
function SetupJavaScriptLinter()
function! SetupJavaScriptLinter()
let l:current_folder = expand('%:p:h')
let l:bin_folder = fnamemodify(syntastic#util#findFileInParent('package.json', l:current_folder), ':h')
let l:bin_folder = l:bin_folder . '/node_modules/.bin/'
@@ -331,16 +333,9 @@ nmap <leader>j ]e
vmap <leader>k [egv
vmap <leader>j ]egv
"" 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 <leader>g :IndentGuidesToggle<CR>
"" Gundo
nmap <leader>u :UndotreeToggle<CR>
"" YouCompleteMe
let g:ycm_key_list_select_completion = ['<c-j>', '<Down>']
let g:ycm_key_list_previous_completion = ['<u-k>', '<Up>']
@@ -355,8 +350,11 @@ let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:tex_flavor = "latex"
let g:livepreview_previewer = 'zathura'
" JSX
let g:jsx_ext_required = 0 " Allow JSX in normal JS files
" markdown
let g:markdown_fenced_languages = [
\ 'html',
\ 'javascript', 'js=javascript', 'json=javascript'
\ ]
"
" Autocmd Rules