Migrated vim+vundle config to neovim+plug

This commit is contained in:
crater2150 2016-12-02 15:43:47 +01:00
commit b531014a99
20 changed files with 2861 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
plugged/

1
after/ftplugin/bib.vim Normal file
View file

@ -0,0 +1 @@
map <nowait> <silent> <Leader>f :%!bibformat<CR>

3
after/ftplugin/c.vim Normal file
View file

@ -0,0 +1,3 @@
let c_space_errors = 1
let c_space_errors = 1
let c_no_comment_fold = 1

42
after/ftplugin/java.vim Normal file
View file

@ -0,0 +1,42 @@
iab <buffer> syso System.out.println
setlocal foldmethod=syntax
setlocal foldenable
setlocal textwidth=120
nnoremap <silent> <buffer> <leader>jc :JavaCorrect<cr>
nnoremap <silent> <buffer> <leader>jd :JavaDocComment<cr>
nnoremap <silent> <buffer> <F2> :JavaDocPreview<cr>
nnoremap <silent> <buffer> <F3> :JavaSearchContext<cr>
nnoremap <silent> <buffer> <leader>jf :%JavaFormat<cr>
nnoremap <silent> <buffer> <leader>ji :JavaImportOrganize<cr>
nnoremap <buffer> <leader>jr :JavaRename<space>
inoremap <expr> <C-Space> pumvisible() \|\| &omnifunc == '' ?
\ "\<lt>C-n>" :
\ "\<lt>C-x>\<lt>C-o><c-r>=pumvisible() ?" .
\ "\"\\<lt>c-n>\\<lt>c-p>\\<lt>c-n>\" :" .
\ "\" \\<lt>bs>\\<lt>C-n>\"\<CR>"
imap <C-@> <C-Space>map <silent> <buffer> <C-Space> <C-x><C-o>
function! InsertJavaPackage()
let filename = expand("%")
let filename = substitute(filename, "\.java$", "", "")
let dir = getcwd() . "/" . filename
let dir = substitute(dir, "^.*\/src\/", "", "")
let dir = substitute(dir, "\/[^\/]*$", "", "")
let dir = substitute(dir, "\/", ".", "g")
let filename = substitute(filename, "^.*\/", "", "")
let dir = "package " . dir . ";"
let result = append(0, dir)
let result = append(1, "")
let result = append(2, "class " . filename . " {")
let result = append(4, "}")
endfunction
"java {{{
"if filereadable(bufname("%")) == 0
" call InsertJavaPackage()
"endif
"}}}

View file

@ -0,0 +1,3 @@
inoremap <S-TAB> <TAB>
inoremap <TAB> <C-R>=SmartTab()<CR>
inoremap <BS> <C-R>=SmartDelete()<CR>

12
after/ftplugin/ruby.vim Normal file
View file

@ -0,0 +1,12 @@
setl sts=2
setl sw=2
setl expandtab
setl omnifunc=rubycomplete#Complete
let g:rubycomplete_buffer_loading = 1
let g:rubycomplete_classes_in_global = 1
nmap K :!ri <cword><cr>
hi link rubySymbol Special
source $MYVIMDIR/bundle/ri-browser/ftplugin/ri.vim

52
after/ftplugin/tex.vim Normal file
View file

@ -0,0 +1,52 @@
" set makeprg=latexmk
setlocal errorformat=%f:%l:\ %m,%f:%l-%\\d%\\+:\ %m
if filereadable('Makefile')
setlocal makeprg=make
else
exec "setlocal makeprg=make\\ -f\\ ~/.config/makefiles/latex.mk\\ " . substitute(bufname("%"),"tex$","pdf", "")
endif
let g:LatexBox_completion_environments += [
\ {'word': 'frame', 'menu': 'beamer frame'},
\ {'word': 'block', 'menu': 'beamer block'},
\ {'word': 'alertblock', 'menu': 'beamer block'},
\ {'word': 'tikzpicture', 'menu': 'tikz'},
\ {'word': 'cases', 'menu': 'math cases'},
\ {'word': 'lstlisting', 'menu': 'code listing'},
\ {'word': 'matrix', 'menu': 'matrix'},
\ {'word': 'pmatrix', 'menu': '(matrix)'},
\ {'word': 'bmatrix', 'menu': '[matrix]'},
\ {'word': 'Bmatrix', 'menu': '{matrix}'},
\ {'word': 'subfigure', 'menu': 'subfigure'},
\ {'word': 'split', 'menu': 'math split'},
\]
let g:LatexBox_completion_commands += [
\ {'word': '\ExplSyntaxOn', 'menu': 'start LaTeX3 syntax'},
\ {'word': '\ExplSyntaxOff', 'menu': 'stop LaTeX3 syntax'},
\ {'word': '\frametitle', 'menu': 'beamer title'},
\ {'word': '\alert', 'menu': 'beamer title'},
\ {'word': '\uncover<', 'menu': 'beamer uncover', 'abbr': '\uncover'}
\]
if exists("&cole")
" conceal" Use conceal vim 7.3 feature:
set cole=0 " conceal level
" Conceal in tex file: "admgs", a=accents, d=delimiters, m=math symbols,
" g=Greek, s=superscripts/subscripts:
let g:tex_conceal="agm"
endif
imap <buffer> [[ \begin{<C-x><C-o>
imap <buffer> ]] <Plug>LatexCloseCurEnv
imap <buffer> [( \left(
nmap <buffer> <F5> <Plug>LatexChangeEnv
vmap <buffer> <leader>tw <Plug>LatexWrapSelection
vmap <buffer> <leader>tW <Plug>LatexEnvWrapSelection
map <silent> <buffer> <F10> :exec "silent !xdg-open" expand("%:t:r") . ".pdf &>/dev/null"<cr><C-l>
map <silent> <buffer> <expr> <F9> vimproc#system_bg("latexmk " . expand("%") . " &")
setlocal tw=100

View file

@ -0,0 +1,5 @@
setl sts=2
setl sw=2
setl expandtab
"source $HOME/bundle/ri-browser/ftplugin/ri.vim

1
after/ftplugin/xwiki.vim Normal file
View file

@ -0,0 +1 @@
set tw=0

1
after/ftplugin/zsh.vim Normal file
View file

@ -0,0 +1 @@
set ts=4 sw=4

9
after/plugin/airline.vim Normal file
View file

@ -0,0 +1,9 @@
let g:airline_powerline_fonts = 1
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
let g:airline_section_z = ''

View file

@ -0,0 +1,16 @@
set scrolloff=99999
nnoremap <C-U> 11kzz
nnoremap <C-D> 11jzz
nnoremap j gjzz
nnoremap k gkzz
nnoremap # #zz
nnoremap * *zz
nnoremap n nzz
nnoremap N Nzz
nnoremap gg ggzz
nnoremap G Gzz
nnoremap gj jzz
nnoremap gk kzz
vnoremap < <gv
vnoremap > >gv

9
after/plugin/fswitch.vim Normal file
View file

@ -0,0 +1,9 @@
nmap <silent> <Leader>of :FSHere<cr>
nmap <silent> <Leader>ol :FSRight<cr>
nmap <silent> <Leader>oL :FSSplitRight<cr>
nmap <silent> <Leader>oh :FSLeft<cr>
nmap <silent> <Leader>oH :FSSplitLeft<cr>
nmap <silent> <Leader>ok :FSAbove<cr>
nmap <silent> <Leader>oK :FSSplitAbove<cr>
nmap <silent> <Leader>oj :FSBelow<cr>
nmap <silent> <Leader>oJ :FSSplitBelow<cr>

1
after/plugin/general.vim Normal file
View file

@ -0,0 +1 @@
let g:deoplete#enable_at_startup = 1

View file

@ -0,0 +1,8 @@
" shows syntaxic group of the word under the cursor
command! SynStack :call SynStack()
function! SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc

View file

@ -0,0 +1,7 @@
hi SyntasticErrorLine ctermbg=52 ctermfg=fg cterm=NONE
hi SyntasticWarningLine ctermbg=234 ctermfg=fg cterm=NONE
let g:syntastic_tex_chktex_showmsg = 0
let g:syntastic_tex_chktex_args = '-n 1 -n 11'
let g:syntastic_tex_checkers = ['chktex']

45
after/plugin/tabline.vim Normal file
View file

@ -0,0 +1,45 @@
function MyTabLine()
let s = ''
let t = tabpagenr()
let i = 1
while i <= tabpagenr('$')
let buflist = tabpagebuflist(i)
let winnr = tabpagewinnr(i)
let s .= '%' . i . 'T'
let s .= (i == t ? '%2*' : '%1*')
let s .= ' '
let s .= i . ':'
let s .= winnr . '/' . tabpagewinnr(i,'$')
let bufnrlist = tabpagebuflist(i)
for bufnr in bufnrlist
if getbufvar(bufnr, "&modified")
let s .= '+'
break
endif
endfor
let s .= ' %*'
let s .= (i == t ? '%#TabLineSel#' : '%#TabLine#')
let bufnr = buflist[winnr - 1]
let file = bufname(bufnr)
let buftype = getbufvar(bufnr, 'buftype')
if buftype == 'nofile'
if file =~ '\/.'
let file = substitute(file, '.*\/\ze.', '', '')
endif
else
let file = fnamemodify(file, ':p:t')
endif
if file == ''
let file = '[No Name]'
endif
let s .= file
let i = i + 1
endwhile
let s .= '%T%#TabLineFill#%='
let s .= (tabpagenr('$') > 1 ? '%999XX' : 'X')
return s
endfunction
set stal=2
set tabline=%!MyTabLine()

2415
autoload/plug.vim Normal file

File diff suppressed because it is too large Load diff

167
init.vim Normal file
View file

@ -0,0 +1,167 @@
runtime packages.vim
let $MYVIMDIR=split(&rtp, ',')[0]
set exrc
set background=dark
colo chroma
if exists("&cc")
set cc=+1
endif
set number
set textwidth=80
set tabstop=8
set shiftwidth=8
set whichwrap+=<,>,h,l
set notimeout
set ttimeout
set timeoutlen=50
set foldmethod=syntax
" disables visualbell
set vb t_vb=
set shellcmdflag=-c
set shell=/bin/zsh
set timeoutlen=500
set modeline
set showcmd
set ignorecase smartcase
set completeopt=menu,longest,preview
set wildmode=list:longest,list:full
set wildignore+=*.so,*.swp,*.zip,*.o
set suffixes=.bak,~,.h,.info,.swp,.obj,.info,.aux,.dvi,.bbl,.out,.o,.lo,\.class
set suffixes+=.pdf
set wildmenu
set hidden
set mouse=
set cursorline
set undofile
set undodir=~/.local/share/nvim/undo
set spelllang=de
" custom commands
command! RC edit $MYVIMRC
command! SRC source $MYVIMRC
command! CD :cd %:h
command! PlugEdit edit $MYVIMDIR/packages.vim
command! PlugReload source $MYVIMDIR/packages.vim | PlugInstall
"{{{ latex
" controls filetype setting, therefore not possible to move to ftplugin
let g:tex_flavor = "latex"
"}}}
" {{{ misc Autocommands
augroup Misc
au FileType mail setlocal spell
au FileType man setlocal nonu
augroup END
augroup Cache
autocmd!
autocmd BufRead,BufNewFile ~/Private/* setlocal directory=.
augroup END
"{{{ binary editing
augroup Binary
au!
au BufReadPre *.bin let &bin=1
au BufReadPost *.bin if &bin | %!xxd
au BufReadPost *.bin set ft=xxd | endif
au BufWritePre *.bin if &bin | %!xxd -r
au BufWritePre *.bin endif
au BufWritePost *.bin if &bin | %!xxd
au BufWritePost *.bin set nomod | endif
augroup END
"}}}
"}}}
"{{{ c header gates
function! s:insert_gates()
let gatename = substitute(toupper(expand("%:t")), "\\.", "_", "g")
execute "normal! i#ifndef " . gatename
execute "normal! o#define " . gatename
execute "normal! Go#endif /* " . gatename . " */"
normal! kk
endfunction
autocmd BufNewFile *.{h,hpp} call <SID>insert_gates()
"}}}
" common mappings {{{
nnoremap <space> za
vnoremap <silent> . :normal .<CR>
map <Left> <C-w>h
map <Down> <C-w>j
map <Up> <C-w>k
map <Right> <C-w>l
map <S-Left> <C-w><
map <S-Right> <C-w>>
map <S-Down> <C-w>-
map <S-Up> <C-w>+
inoremap <C-U> <C-G>u<C-U>
nnoremap & :&&<CR>
xnoremap & :&&<CR>
nnoremap Y y$
nmap <C-L> :noh<cr>:redraw!<cr>
nmap <F9> :make<CR>
nmap <silent> <F11> :TagbarToggle<cr>
nmap <silent> <Insert> :TagbarToggle<CR>
nmap <leader>m :make<CR>
nmap <C-Tab> <C-w><C-w>
imap <C-Tab> <esc><C-w><C-w>
vmap <silent> gs :sort<cr>
"}}}
" Denite {{{
call denite#custom#source('file_rec', 'matchers', ['matcher_cpsm'])
map <silent> gb :<C-u>Denite -buffer-name=buffers buffer<cr>
map <silent> gf :<C-u>Denite -buffer-name=files file_rec<cr>
" }}}
"Git {{{
nmap <Leader>gu :GitPush<CR>
nmap <Leader>gvc :!git svn dcommit<CR>
nmap <Leader>gvf :!git svn fetch<CR>
" Git }}}
let g:signify_vcs_list = [ 'git', 'hg' ]
let g:signify_disable_by_default = 1
let g:localvimrc_whitelist='/home/crater2150/code/.*'
let g:localvimrc_sandbox=0
" vi:foldmethod=marker sw=2

63
packages.vim Normal file
View file

@ -0,0 +1,63 @@
call plug#begin(expand('<sfile>:p:h') . '/plugged')
" basic stuff
Plug 'pbrisbin/vim-mkdir'
Plug 'embear/vim-localvimrc'
Plug 'Soares/smarttab.vim'
Plug 'crater2150/vim-theme-chroma'
" tim pope stuff
Plug 'tpope/vim-abolish'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-obsession'
Plug 'tpope/vim-characterize'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-sleuth'
" motions and textobjects
Plug 'kana/vim-textobj-user'
Plug 'glts/vim-textobj-comment'
Plug 'vim-scripts/argtextobj.vim'
Plug 'mhinz/vim-signify'
Plug 'scrooloose/syntastic'
" completion and snippets
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'nixprime/cpsm', { 'do': 'PY3=ON ./install.sh' } | Plug 'Shougo/denite.nvim'
Plug 'bling/vim-airline'
" ruby
Plug 'depuracao/vim-rdoc'
Plug 'vim-ruby/vim-ruby'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-rake'
" git
Plug 'tpope/vim-fugitive'
Plug 'gregsexton/gitv'
" C
Plug 'derekwyatt/vim-fswitch'
" other filetype specific plugins
Plug 'derekwyatt/vim-scala'
Plug 'jamessan/vim-gnupg'
Plug 'powerman/vim-plugin-AnsiEsc'
Plug 'tpope/vim-markdown'
Plug 'LaTeX-Box-Team/LaTeX-Box'
Plug 'ledger/vim-ledger'
call plug#end()
" vim:ft=vim foldmethod=marker