~gpanders/dotfiles

2de1d198ef8ae0b88afa9b0434168394b2d4b3a5 — Greg Anders 2 years ago a7946a7
Add/update load guards on vim plugins
R vim/.vim/after/plugin/python.vim => neovim/.config/nvim/plugin/python.vim +0 -0
M vim/.vim/after/ftplugin/mail.vim => vim/.vim/after/ftplugin/mail.vim +1 -2
@@ 1,8 1,7 @@
setlocal formatoptions+=wa
setlocal wrapmargin=0
setlocal textwidth=78
setlocal nonumber
setlocal digraph
setlocal nolist

let b:undo_ftplugin .= '|setlocal fo< wm< tw< nu< dg< list<'
let b:undo_ftplugin .= '|setlocal fo< wm< nu< dg< list<'

M vim/.vim/after/plugin/dirvish.vim => vim/.vim/after/plugin/dirvish.vim +6 -4
@@ 1,5 1,7 @@
if exists('g:loaded_dirvish')
  command! -bar -nargs=? -complete=dir Explore call dirvish#open(<q-args>)
  command! -nargs=? -complete=dir Sexplore belowright split | silent Dirvish <args>
  command! -nargs=? -complete=dir Vexplore leftabove vsplit | silent Dirvish <args>
if !exists('g:loaded_dirvish')
  finish
endif

command! -bar -nargs=? -complete=dir Explore call dirvish#open(<q-args>)
command! -nargs=? -complete=dir Sexplore belowright split | silent Dirvish <args>
command! -nargs=? -complete=dir Vexplore leftabove vsplit | silent Dirvish <args>

M vim/.vim/after/plugin/dispatch.vim => vim/.vim/after/plugin/dispatch.vim +4 -0
@@ 1,3 1,7 @@
if !exists('g:loaded_dispatch')
  finish
endif

" C/C++
autocmd FileType c,cpp let b:dispatch = 'cppcheck %'


M vim/.vim/after/plugin/fugitive.vim => vim/.vim/after/plugin/fugitive.vim +4 -0
@@ 1,2 1,6 @@
if !exists('g:loaded_fugitive')
  finish
endif

autocmd BufReadPost fugitive://* setlocal bufhidden=delete
autocmd User Fugitive noremap <Bslash>g :Gstatus<CR>

M vim/.vim/after/plugin/fzf.vim => vim/.vim/after/plugin/fzf.vim +11 -9
@@ 1,12 1,14 @@
" FZF must be installed to ~/.fzf
if isdirectory($HOME . '/.fzf')
  source ~/.fzf/plugin/fzf.vim
if !isdirectory($HOME . '/.fzf') || !exists(':FZF')
  finish
endif

  nnoremap <silent> <C-P> :Files<CR>
  nnoremap <silent> <leader>t :Tags<CR>
  nnoremap <silent> <leader>B :Buffers<CR>
source ~/.fzf/plugin/fzf.vim

  autocmd! FileType fzf
  autocmd FileType fzf set laststatus=0 noshowmode noruler
        \| autocmd BufLeave <buffer> set laststatus=2 showmode ruler
endif
nnoremap <silent> <C-P> :Files<CR>
nnoremap <silent> <leader>t :Tags<CR>
nnoremap <silent> <leader>B :Buffers<CR>

autocmd! FileType fzf
autocmd FileType fzf set laststatus=0 noshowmode noruler
      \| autocmd BufLeave <buffer> set laststatus=2 showmode ruler

M vim/.vim/after/plugin/gutentags.vim => vim/.vim/after/plugin/gutentags.vim +11 -9
@@ 1,11 1,13 @@
if exists('g:loaded_gutentags')
  if executable('rg')
    let g:gutentags_file_list_command = 'rg --files'
  elseif executable('ag')
    let g:gutentags_file_list_command = 'ag -l'
  endif
if !exists('g:loaded_gutentags')
  finish
endif

  " Don't create tags for git projects since they are created in hooks
  " https://tbaggery.com/2011/08/08/effortless-ctags-with-git.html
  call remove(g:gutentags_project_root, index(g:gutentags_project_root, '.git'))
if executable('rg')
  let g:gutentags_file_list_command = 'rg --files'
elseif executable('ag')
  let g:gutentags_file_list_command = 'ag -l'
endif

" Don't create tags for git projects since they are created in hooks
" https://tbaggery.com/2011/08/08/effortless-ctags-with-git.html
call remove(g:gutentags_project_root, index(g:gutentags_project_root, '.git'))

M vim/.vim/after/plugin/lsp.vim => vim/.vim/after/plugin/lsp.vim +4 -0
@@ 1,3 1,7 @@
if !exists('g:lsp_loaded')
  finish
endif

" cquery
if executable('cquery')
   au User lsp_setup call lsp#register_server({

M vim/.vim/after/plugin/qf.vim => vim/.vim/after/plugin/qf.vim +2 -0
@@ 8,3 8,5 @@ let g:qf_mapping_ack_style = 1
" Redefine mappings from vim-unimpaired
nmap [q <Plug>(qf_qf_previous)
nmap ]q <Plug>(qf_qf_next)
nmap [l <Plug>(qf_loc_previous)
nmap ]l <Plug>(qf_loc_next)

M vim/.vim/after/plugin/sneak.vim => vim/.vim/after/plugin/sneak.vim +8 -6
@@ 1,7 1,9 @@
if exists('g:loaded_sneak_plugin')
  " vim-sneak tries to map this to , but since that is the leader, it won't do
  " it. So use - instead
  " nmap - <Plug>Sneak_,
  " omap - <Plug>Sneak_,
  " xmap - <Plug>Sneak_,
if !exists('g:loaded_sneak_plugin')
  finish
endif

" vim-sneak tries to map this to , but since that is the leader, it won't do
" it. So use ,, instead
nmap ,, <Plug>Sneak_,
omap ,, <Plug>Sneak_,
xmap ,, <Plug>Sneak_,

M vim/.vim/after/plugin/vimtex.vim => vim/.vim/after/plugin/vimtex.vim +18 -16
@@ 1,21 1,23 @@
if exists('g:loaded_vimtex')
  let g:vimtex_compiler_progname = 'nvr'
  let g:vimtex_matchparen_enabled = 0
if !exists('g:loaded_vimtex')
  finish
endif

  if has('mac')
    let g:vimtex_view_method = 'skim'
  endif
let g:vimtex_compiler_progname = 'nvr'
let g:vimtex_matchparen_enabled = 0

  let g:vimtex_fold_enabled = 1
if executable('skim')
  let g:vimtex_view_method = 'skim'
endif

  set fillchars=vert:\|,fold:\\
let g:vimtex_fold_enabled = 1

  let g:vimtex_labels_refresh_always = 0
  let g:vimtex_toc_refresh_always = 0
set fillchars=vert:\|,fold:\\

  augroup vimtex
    autocmd!
    autocmd BufWritePost *.tex call vimtex#labels#refresh()
    autocmd BufWritePost *.tex call vimtex#toc#refresh()
  augroup END
end
let g:vimtex_labels_refresh_always = 0
let g:vimtex_toc_refresh_always = 0

augroup vimtex
  autocmd!
  autocmd BufWritePost *.tex call vimtex#labels#refresh()
  autocmd BufWritePost *.tex call vimtex#toc#refresh()
augroup END