5
BadFox
5y

Any interest VSCode tips and tricks I should know about?

Python specific.

Comments
  • 4
  • 5
    You can set the tab size in the bottom ribbon. Be sure to set to one space for maximum readability.

    11 spaces is also preferred by many who wear thick lenses.

    7 spaces improve testability, so you have to decide upfront what's most important to you.
  • 4
    You can install neovim and uninstall vs code, pretty good feature if you ask me 🤔
  • 3
    @FrodoSwaggins the only reason I had to keep vs code around was the completion support. Omnifunc would never play quite right with language servers but I switched to neovim and installed deoplete and it's just awesome, even better than vscode.

    Vscode's uninstall feature is my favorite feature for sure though
  • 4
    You can navigate the structure of some documents (for example YAML) using the breadcrumbs (shift + > on my machine).
    You can jump to a file using ctrl+e, or to the file explorer tab using ctrl+shift+e.
    Once you have built workspace symbols (ctrl+p then search "symbol"), you can jump to any symbol using ctrl+t. Useful in large projects.
    You can move your focus across the different panes using ctrl+<number>. 0 is the side bar, the rest are the panes.
    You can toggle the side bar with ctrl+b and the bottom panel with ctrl+j. Useful when you need to concentrate on a piece of code or if you need to compare two files and your screen is too short.
    You can format your code using ctrl+shift+i. Please do it before each commit.
    You can sort imports, ctrl+p and search "import". Please do it before each commit too.
    Some of these commands might make errors pop up, it's because they need some apt/pip packages to be installed first. It should be explained in the error message.
  • 3
    Install the Python extension pack, install pylint with pip, and enjoy the integration between the two.

    Then get angry at pylint because you don't want to write docstrings to make it stop yelling at you.
  • 2
    Alt+Left Arrow Key to navigate back to the last file, Alt+Right Arrow Key to navigate forward (just like in browsers)
Add Comment