Sublime Text Windows及Linux Python环境搭建

sublime是我用过的最好的代码编辑器 没有之一,如下搭建sublime 下python环境

sublime安装与基本配置

sublime Text3下载:
https://www.sublimetext.com/3

安装Package Control
https://packagecontrol.io/installation
自定义快捷键:preferences-> key bindings-user

[
{ "keys": ["ctrl+shift+c"], "command": "copy_path" },
{ "keys": ["alt+c"], "command": "filenametoclipboard" },
{ "keys": ["ctrl+shift+l"], "command": "list_open_files" }
]

函数跳转插件:
sublime安装ctags: http://jingyan.baidu.com/article/656db9189c9761e381249cf5.html
安装完成后需在目录上右键执行 rebuild tags才可用(上述链接中未提到)
跳转快捷键:ctrl+shift+鼠标左键 跳转; ctrl+shift+鼠标右键返回。

支持各种语言自动补充插件:SublimeCodeIntel

ubuntu支持中文输入:
http://jingyan.baidu.com/article/f3ad7d0ff8731609c3345b3b.html

设置utf-8编码
ctrl+shift+p install package
安装CovertToUTF8插件

tab键4个空格和默认utf-8编码:
Preferences-> Setting-User中添加两行内容:

"default_encoding": "UTF-8",
"tab_size": 4,
"translate_tabs_to_spaces": true

配置Python环境 安装插件:Anaconda:

在打开Package Control:Install Pakage 直接输入Anaconda安装即可。
安装完成后,在preferences–package settings–anaconda–Settings-Default里面搜索“python_interpreter”,并将“python_interpreter”:”Python” 改为“python_interpreter”:”/usr/bin/python3.5” #自己python版本的路径。
然后选择Preferences-Package Settings–Anaconda–Settings-Users选项,copy以下字典数据对Anaconda的一些数据进行设置(例如,取消格式的高亮框)

{

"python_interpreter": "/usr/bin/python3.5",
"suppress_word_completions": true,
"suppress_explicit_completions": true,
"complete_parameters": true,
"anaconda_linting":false
}

安装Anaconda插件后无法进行函数跳转
在任意个Mouse Binding-user下添加如下内容即可跳转

[
{
"button": "button1",
"count": 1,
"press_command": "drag_select",
"modifiers": ["ctrl","shift"],
"command": "goto_definition"
},
{
"button": "button2",
"count": 1,
"modifiers": ["ctrl","shift"],
"press_command": "jump_back",
"command": "jump_back"
}
]

Ubuntu下Sublime Text3出问题的情况下如何完全卸载,

删除以前的配置和插件,以便重新安装后可以重新配置各种插件.

1)sudo dpkg -r sublime-text
回车,输入密码,删除Sublime Text3

2)sudo rm -rf /home/$USER/.config/sublime-text-3/
在终端输入下面命令,删除配置文件 其中$USER是你自己的系统用户名,回车

3)sudo find / -name sublime*
查找系统中其他与Sublime Text3相关的文件及路径,并删除

win7下sublime运行python程序:
https://jingyan.baidu.com/article/3065b3b684fdaebecff8a412.html

posted @ 2019-08-29 22:49  古月月月胡  阅读(617)  评论(0编辑  收藏  举报