vim/autoload/do.vim

12 lines
257 B
VimL

" 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