Neovim plugin to sort python imports using isort.
Inspired by vim-isort.
- Isort (
pip install isort
). - The
isort
command must be on yourPATH
. - Make sure that you install the latest version of isort (or at least >=5.7.0)
Install using vim-plug.
Put this on your init.vim
.
Plug 'stsewd/isort.nvim', { 'do': ':UpdateRemotePlugins' }
Call :Isort
and it will sort the imports of the current buffer.
You can also pass a range via the visual mode.
All arguments of the command will be passed to isort.
Alternatively, use :IsortSync
if you need the operation to complete
synchronously (e.g. in a BufWritePre autocmd).
Isort command.
g:isort_command = 'isort'
- No need to install isort on the same python environment.
- Pure python implementation.
- Neovim only.