Add :ISort vim command
This commit is contained in:
11
autoload/do.vim
Normal file
11
autoload/do.vim
Normal 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
|
||||
Reference in New Issue
Block a user