Hi Cursor team,
I am using both vscode and cursor and find that in cursor the organize import feature is somehow not even present. CMD + SHIFT + P “organize”, “imports” does not show up at all and I am unable to set up a working shortcut that would actually organize imports.
What exactly am I doing wrong ?
M
2 Likes
I’ve got import sorting working using the following:
- Install Black extension by mikoz
- Install ms-python isort
- Add the following to your settings.json
"[python]": {
"editor.defaultFormatter": "mikoz.black-py",
"editor.tabSize": 4,
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"editor.formatOnSave": false,
"editor.formatOnType": true
},
"isort.args": ["--profile", "black"]
Note I’ve had to turn off formatOnSave at the moment as that seems to be broken but you can still format using the hotkeys. This causes Black to call isort and format too.
2 Likes