~gpanders/dotfiles

7193b476dc1600f64b6c97f69ccc8a06762f38da — Greg Anders 2 years ago 93aff4d
[vim] Touch ups and tweaks

* Remove include files from python complete options
* Add a guard around b:undo_ftplugin in python ftplugin
* Set dispatch compiler to use 'pytest' compiler when 'pytest' is used
  as the command instead of 'py.test'
* Change toggle quickfix hotkey from <C-Q> to \q
* Change tabularize mappings from <leader> to ,
* Use python3 path for include path by default
* Only show cursorline in active window
M vim/.vim/after/ftplugin/python.vim => vim/.vim/after/ftplugin/python.vim +5 -3
@@ 3,8 3,6 @@ if &filetype !=# 'python'
  finish
endif

setlocal complete+=i

" gz opens a split window with a python shell
nmap <buffer> gz <Plug>(PytermOpen)



@@ 14,4 12,8 @@ endif

let &l:path = &path . g:python_include_path

let b:undo_ftplugin .= '|setl cpt<'
if exists('b:undo_ftplugin')
  let b:undo_ftplugin .= '|setl cpt<'
else
  let b:undo_ftplugin = '|setl cpt<'
endif

M vim/.vim/after/plugin/dispatch.vim => vim/.vim/after/plugin/dispatch.vim +8 -0
@@ 2,6 2,14 @@ if !exists('g:loaded_dispatch')
  finish
endif

if !exists('g:dispatch_compilers')
  let g:dispatch_compilers = {}
endif

" The pytest compiler uses `py.test' as its command, so Dispatch won't find it
" when the command is `pytest' (without the dot) unless we add this
let g:dispatch_compilers['pytest'] = 'pytest'

augroup Dispatch
  autocmd!


M vim/.vim/after/plugin/qf.vim => vim/.vim/after/plugin/qf.vim +1 -1
@@ 15,4 15,4 @@ nmap ]q <Plug>(qf_qf_next)
nmap [l <Plug>(qf_loc_previous)
nmap ]l <Plug>(qf_loc_next)

nmap <C-Q> <Plug>(qf_qf_toggle)
nmap \q <Plug>(qf_qf_toggle)

M vim/.vim/after/plugin/startify.vim => vim/.vim/after/plugin/startify.vim +5 -5
@@ 7,9 7,9 @@ let g:startify_bookmarks = [{'c': $MYVIMRC}]

if exists('g:vimwiki_list')
  if len(g:vimwiki_list) > 1
    let count = 1
    let cnt = 1
  else
    let count = ''
    let cnt = ''
  endif

  for wiki in g:vimwiki_list


@@ 24,11 24,11 @@ if exists('g:vimwiki_list')
    else
      let wiki_ext = wiki.ext
    endif
    let wiki_key = 'w' . count
    let diary_key = 'd' . count
    let wiki_key = 'w' . cnt
    let diary_key = 'd' . cnt
    let wiki_path = wiki.path . wiki_index . wiki_ext
    let diary_path = wiki.path . 'diary/diary' . wiki_ext
    let count += 1
    let cnt += 1
    call extend(g:startify_bookmarks, [{wiki_key: wiki_path}, {diary_key: diary_path}])
  endfor
endif

M vim/.vim/after/plugin/tabular.vim => vim/.vim/after/plugin/tabular.vim +4 -4
@@ 5,10 5,10 @@ endif
let s:save_cpo = &cpo
set cpo&vim

nnoremap <leader>a= :Tabularize /=<CR>
vnoremap <leader>a= :Tabularize /=<CR>
nnoremap <leader>a: :Tabularize /:<CR>
vnoremap <leader>a: :Tabularize /:<CR>
nnoremap ,a= :Tabularize /=<CR>
vnoremap ,a= :Tabularize /=<CR>
nnoremap ,a: :Tabularize /:<CR>
vnoremap ,a: :Tabularize /:<CR>

" Source: https://gist.github.com/tpope/287147
inoremap <silent> <Bar>   <Bar><Esc>:call <SID>align()<CR>a

M vim/.vim/autoload/python.vim => vim/.vim/autoload/python.vim +1 -2
@@ 1,8 1,7 @@
" Generate include path for python
function! python#include_path()
  let python_include_path = ''
  echom "Here"
  python << EOF
  python3 << EOF
import os
import sys
import vim

M vim/.vim/vimrc => vim/.vim/vimrc +2 -2
@@ 528,9 528,9 @@ augroup vimrc

  " Highlight the current line in the current window but disable in Insert mode {{{
  let blacklist = ['tex']
  au InsertEnter * if index(blacklist, &ft) < 0
  au InsertEnter,WinLeave * if index(blacklist, &ft) < 0
        \| let b:cul = &cursorline | setl nocursorline | endif
  au InsertLeave * if index(blacklist, &ft) < 0 && exists('b:cul')
  au InsertLeave,WinEnter * if index(blacklist, &ft) < 0 && exists('b:cul')
        \| let &cursorline = b:cul | endif
  " }}}