-
-
Notifications
You must be signed in to change notification settings - Fork 582
isort Plugins
Jeroen de Vries edited this page Jun 7, 2024
·
37 revisions
Several plugins have been written that allow you to use isort to add, remove, and sort imports from the comfort of your favorite text editor:
- Kate: https://github.com/timothycrosley/isort#installing-isorts-kate-plugin -written and maintained by @timothycrosley
-
VIM
- https://github.com/fisadev/vim-isort#installation - written and maintained by @fisadev.
-
ALE (isort fixer) -
let g:ale_fixers = {'python': ['isort']}
-
command! -range=% Isort :<line1>,<line2>! isort -
- just add this to your ~/.vimrc - https://github.com/brentyi/isort.vim#installation - written and maintained by @brentyi.
- Just call
:%!isort -
-
Neovim
- https://github.com/stsewd/isort.nvim#install - written and maintained by @stsewd.
- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#isort - LSP integration, written by @jose-elias-alvarez
- Emacs: https://github.com/paetzke/py-isort.el - written and maintained by @paetzke.
- Sublime
-
Atom:
- https://github.com/bh/atom-python-isort - written by @bh.
- https://atom.io/packages/atom-isort - fork of the above by @lexicalunit.
- https://atom.io/packages/formatters-python - written and maintained by @utkarshgupta137.
- VSCode: https://github.com/Microsoft/vscode-python - written and maintained by @DonJayamanne; now also by @Microsoft
- pre-commit: officially supported through isort repo - see https://pycqa.github.io/isort/docs/configuration/pre-commit.html#seed-isort-config
-
PyCharm
- Option 1: File Watcher
- Make sure you have the File Watchers plugin installed.
- Go to
Preferences or Settings -> Tools -> File Watchers
and click+
to add a new watcher:- Name:
isort
- File Type:
Python
- Scope:
Project Files
- Program:
$PyInterpreterDirectory$/isort
- Arguments:
$FilePath$
- If you are using code formatter such as Black, use
$FilePath$ --profile black
instead to avoid conflicts.
- If you are using code formatter such as Black, use
- Output paths to refresh:
$FilePath$
- Working directory:
$ProjectFileDir$
- In Advanced Options
- Uncheck "Auto-save edited files to trigger the watcher"
- Uncheck "Trigger the watcher on external changes"
- Name:
- Option 2: External Tool
- Option 1: File Watcher
- Your Plugin: If you create a new plugin, please feel free to add a reference to it here.