diff --git a/autoload/do.vim b/autoload/do.vim new file mode 100644 index 0000000..0c78d93 --- /dev/null +++ b/autoload/do.vim @@ -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 diff --git a/plugin/commands.vim b/plugin/commands.vim new file mode 100644 index 0000000..c1e034f --- /dev/null +++ b/plugin/commands.vim @@ -0,0 +1 @@ +command! ISort call do#isort()