To write and edit Python files, you'll need an IDE ([Interactive Development Environment](https://www.codecademy.com/article/what-is-an-ide)). It's basically a fancy text editor for code files. There are many options and as many strong opinions about which is best. VS Code has risen in popularity in recent years with developers. Feel free to try different editors to find what works best for you.
## Tips
### HTML Auto-complete
In an HTML file, type the exclamation mark `!` to get an emmet auto-complete template for the DOM.
Use `.` to create a new element of that class?
### Line Length Rulers
Set up editor rulers: Open Settings and search for ruler. You will be directed to your settings.json file. Update the parameter for editor.rulers with 72 and 79 for lines and docstrings, respectively.
```
"editor.rulers": [
72, 79
],
```
You can also set your default formatter to autopep8
```
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8",
"editor.formatOnSave": true
}
```
### Set Git Bash as default terminal
1. Open Visual Studio Code and press and hold ``` Ctrl + ` ``` to open the terminal.
2. Open the command palette using Ctrl + Shift + P .
3. Type - Select Default Profile.
4. Select Git Bash from the options.
5. Click on the + icon in the terminal window.
6. The new terminal now will be a Git Bash terminal.
## configure user settings
I configured a few settings in the User Preferences JSON file (`Ctrl + Shift + P` to open the command palette and begin typing to find `Preferences: Open User Settings (JSON)`.)
To use Git Bash as my default terminal, automatically open Git Bash to the folder loaded in VS Code, include rulers for documentation (72) and code (79), turn on line numbers for Notebooks, and set pep8 for linting, add these settings:
```json
"terminal.integrated.defaultProfile.windows": "Git Bash"
"terminal.integrated.cwd": "${workspaceFolder}",
"editor.rulers": [
72, 79
],
"notebook.lineNumbers": "on",
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8",
"editor.formatOnSave": true
}
```
Restart VS Code for the changes to take effect.
I also had to add a line to by `.bash_profile` file (located in my Home directory) because (strangely), it was interpreting the `\e` in my home path (my username is `erikt` on my Windows machine) as an escape character `