Add :ISort vim command
This commit is contained in:
parent
c2799dd5de
commit
981cb46c7c
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
|
1
plugin/commands.vim
Normal file
1
plugin/commands.vim
Normal file
@ -0,0 +1 @@
|
|||||||
|
command! ISort call do#isort()
|
Loading…
x
Reference in New Issue
Block a user