Sort Imports

How to invoke the Sort Imports command?

There are a three options to invoke the sort imports command, they are as follows:

Option 1 (Command Palette)

  • Launch the Command Palette via the shortcut (⇧⌘P or Ctrl+Shift+P)
  • Select the ‘Sort Imports’ command

Sample

Option 2 (Quick Fix)

  • Launch the Quick Fix command from the Command Palette (or use the short cut ⌘. or cmd+.)
  • Select the ‘Sort Imports’ command from the menu

Launching the Quick Fix command from the Command Palette
Sample using Quick Fix Command

Launching the Quick Fix command using the keyboard shortcut
Sample using Quick Fix Short Cut

Option 3 (Keyboard Shortcut)

  • Setup a custom keyboard short cut for the command ‘python.sortImports’
  • Open a python file
  • Invoke the above command using the designated keyboard shortcut
Topics:

Sort Imports

How to invoke the Sort Imports command?

There are a three options to invoke the sort imports command, they are as follows:

Option 1 (Command Palette)

  • Launch the Command Palette via the shortcut (⇧⌘P or Ctrl+Shift+P)
  • Select the ‘Sort Imports’ command

Sample

Option 2 (Quick Fix)

  • Launch the Quick Fix command from the Command Palette (or use the short cut ⌘. or cmd+.)
  • Select the ‘Sort Imports’ command from the menu

Launching the Quick Fix command from the Command Palette
Sample using Quick Fix Command

Launching the Quick Fix command using the keyboard shortcut
Sample using Quick Fix Short Cut

Option 3 (Keyboard Shortcut)

  • Setup a custom keyboard short cut for the command ‘python.sortImports’
  • Open a python file
  • Invoke the above command using the designated keyboard shortcut