Add :ISort vim command

This commit is contained in:
Kenneth Benzie 2017-09-20 12:00:00 -05:00
parent c2799dd5de
commit 981cb46c7c
2 changed files with 12 additions and 0 deletions

11
autoload/do.vim Normal file
View File

@ -0,0 +1,11 @@
" Save, call isort on, then reload a python file.
function! do#isort()
if &filetype !=# 'python'
echohl ErrorMsg
echomsg 'isort only supports python files'
echohl None
endif
write!
call system('isort '.expand('%:p'))
edit!
endfunction

1
plugin/commands.vim Normal file
View File

@ -0,0 +1 @@
command! ISort call do#isort()