~gpanders/dotfiles

ref: 12291d3163062a0a3c879f53a0b0d02541376ca4 dotfiles/vim/.vim/after/ftplugin/python.vim -rw-r--r-- 800 bytes
12291d31Greg Anders [vim] Make git commit buffers in vim always start at line 1 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
" Python specific settings
if &filetype !=# 'python'
  finish
endif

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

" Don't complete from include files (there are too many!)
setlocal complete-=i

" Show boundary at 80 characters
let &l:colorcolumn = join(range(80, 336), ',')

" Populate path from python's sys.path. This is an expensive operation so we
" only call it once and then cache the result
if !exists('g:python_include_path')
  let g:python_include_path = python#include_path()
endif

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

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

if executable('yapf')
  setl formatprg=yapf
  let b:undo_ftplugin .= ' fp<'
endif