I’ve been using Python3 a lot lately, so I’ve cleaned up my environment a bit. This blog is just about constructing my own PYTHon3 environment (Sublime Text 3 version 3176) :
Some of the commonly used plug-in installation and configuration process is as follows: sublime does download address, plug-in installation method reference another blog blog.csdn.net/zxy98787267…
-
TrailingSpaces highlight extra Spaces and tabs
-
BracketHighlighter highlights matching brackets, quotes, and labels
-
ChineseLocalizations language package
-
SublimeREPL can be used to run and debug some interactive programs (you can run the current program directly, or debug the code with Ipython and PDB)
While SublimeREPL is installed, the current program can be run through Tools-Sublimerepl Python. Press CTRL + B to run the program as follows: Before changing the configuration, set up the Python Build System, Tools->Build System->New Build Systems, and change the content to the following
{ "cmd": ["C:/Users/AppData/Local/Programs/Python/Python36-32/python.exe","-u","$file"], "file_regex": "^[ ]*File \"(... *?) \", line ([0-9]*)", "selector": "source.python", "encoding": "cp936", }Copy the code
Python. exe is the python path on your computer. Encoding: Win +R, enter CMD, click properties to enter the following interface:
Name the file python3.sublime-build, save and exit! Go to Tools->Build System and select python3. After configuration is complete, CTRL + B can run the current program.
You can also run the program’s shortcut keys according to the custom configuration, open Preferences->Browse Packages->SublimeREPL->config->Python-> default. subsublime – Commands, the file is as follows:
[
{
"caption": "SublimeREPL: Python",
"command": "run_existing_window_command", "args":
{
"id": "repl_python",
"file": "config/Python/Main.sublime-menu"
}
},
{
"caption": "SublimeREPL: Python - PDB current file",
"command": "run_existing_window_command", "args":
{
"id": "repl_python_pdb",
"file": "config/Python/Main.sublime-menu"
}
},
{
"caption": "SublimeREPL: Python - RUN current file",
"command": "run_existing_window_command", "args":
{
"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"
}
},
{
"command": "python_virtualenv_repl",
"caption": "SublimeREPL: Python - virtualenv"
},
{
"caption": "SublimeREPL: Python - IPython",
"command": "run_existing_window_command", "args":
{
"id": "repl_python_ipython",
"file": "config/Python/Main.sublime-menu"
}
}
]
Copy the code
Copy this configuration to Preferences-> Key Bindings and define your own shortcut keys, such as:
[
{ "keys": ["f5"], "caption": "SublimeREPL: Python - RUN current file",
"command": "run_existing_window_command", "args":
{
"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"
}
},
{ "keys": ["f1"], "caption": "SublimeREPL: Python",
"command": "run_existing_window_command", "args":
{
"id": "repl_python",
"file": "config/Python/Main.sublime-menu"
}
}
]
Copy the code
After the configuration is complete, save the configuration. If you need to configure ipython and other debugging tool shortcut keys, the configuration is similar!
F1 is displayed. The Following Python IDE page is displayed“F5”, the following execution program interface is displayed
-
AutoPep8 adjusts Python code to PEP8 requirements (CTRL + Shift +8)
-
Sidebarenh chimes sidebar enhanced
-
SublimeTmpl plugin to create a preset Python template file, but this plugin is not as powerful as FileHeader
-
FileHeader automatically detects the creation of new files and automatically adds templates. So you can use another plugin to create new files, FileHeader will automatically add templates to your file
- Terminal Displays the Windows console for various command operations
Preferences->Package Settings->Terminal-> Settings user
{
"terminal": "C:\\Windows\\System32\\cmd.exe",
"parameters": ["/START","%CWD%"]
}
Copy the code
To save the Settings, press CTRL + Shift + T to open the CMD command window
- Anaconda code completes automatically
Anaconda -> Settings User
{// Since the Anaconda plugin itself does not know where Python is installed, the actual location of Python's main program needs to be set to "python_interpreter": "C: / Users/AppData/Local/designed/Python/Python36-32 / Python. Exe", / / ignore the various Spaces is wrong, more than 79 words, the import function is not used to remind, "pep8_ignore" : ["E501", "W292", "E303", "W391", "E225", "E302", "W293", "E402"], "pyflakes_explicit_ignore": ["UnusedImport"], // Save files automatically pep8 formatting" auto_formatting": true, "auto_formatting_timeout": // enable_signatures_tooltip: True, "merge_signatures_and_doc":true, //ST3 also has autocomplete prompt, but only prompts the words entered in the file, this function can be used to prompt variables available functions, etc. "suppress_word_completions": true, "suppress_explicit_completions": true, "complete_parameters": True, // The default line length is too short when the code is typeset, set "pep8_max_line_length": 120,}Copy the code
After the configuration is complete, you can use the code automatic prompt function! Detailed configuration can refer to the official documentation: damnwidget. Making. IO/anaconda/ID…
- SublimeGit can use git’s common commands
Before installing Git, you need to install Git on your computer and configure the bin directory of Git in environment variables. Then use Package Control to install SublimeGit! After installation, press CTRL + Shift + P to enter git command.
- Sublime GitHub opens the URL associated with GitHub directly in Sublime
- SublimeHighlight
Open Package Control and type Add Repository in the url bar below:
https://github.com/n1k0/SublimeHighlight/tree/python3
Copy the code
Press Enter to install the SublimeHighlight plugin.
Other configurations:
Preferences -> Settings – User
{
"ignored_packages":
[
"Vintage"
],
"tab_size": 4,
"translate_tabs_to_spaces": true,
"word_wrap": true,
"update_check": false,
"font_size": 12
}
Copy the code
- Delete an installed plug-in
If you have installed some plug-ins and don’t like them, you can delete them by entering the Package Control, searching for Remove Package, and then selecting the plug-in to remove.
Please refer more plug-in python.jobbole.com/81312/, check to see if…