Sublime Text4安装教程

一、下载Sublime Text4

打开Sublime Text官网Download - Sublime Text

选择对应操作系统版本下载,这里我是windows

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-i4txSatp-1646998432690)(D:\typora\Picture\image-20220310195930123.png)]

二、安装

选择安装位置

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-nUDmpahk-1646998432690)(D:\typora\Picture\image-20220310200027588.png)]

默认在C盘,这里我安装到了D盘(点Browse选择安装位置)

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-k6YmZ2H3-1646998432691)(D:\typora\Picture\image-20220310200138401.png)]

打勾的表示添加到右键菜单,某些文本文档或者脚本就可以用Sublime打开,点击next然后install

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-hKeMKaQm-1646998432691)(D:\typora\Picture\image-20220310200228561.png)]

三、汉化

使用快捷键shift+control+P,打开Package Control查找栏。

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-I7dTqP7p-1646998432691)(D:\typora\Picture\image-20220310200534696.png)]

输入Install Package Control ,点击之后安装,稍等一会,会弹出提示

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-mx9Bda91-1646998432692)(D:\typora\Picture\image-20220310200644636.png)]

点击确定

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-JZCoiQpH-1646998432692)(D:\typora\Picture\image-20220310200706973.png)]

选择preferences,点击底端的Package Control,输入Install,选择第一个

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-y1rImpO3-1646998432693)(D:\typora\Picture\image-20220310200813483.png)]

稍等一会,会弹出一个列表,表示插件列表加载完成

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ZcCUAFoS-1646998432694)(D:\typora\Picture\image-20220310200853701.png)]

如果有需要的插件可以在里面搜索安装,这里我们输入Chinese,选择第一个

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-jqObgRmw-1646998432694)(D:\typora\Picture\image-20220310200930803.png)]

点击之后就汉化完成

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-jdvvlwSS-1646998432694)(D:\typora\Picture\image-20220310200954233.png)]

如果想转换成英语可以点击帮助,其中最下面有个Language选择,切换语言

四、注册

在帮助中选择输入注册码,注册码如下(全部复制粘贴)

<pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="bash" cid="n198" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 4px 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">—– BEGIN LICENSE —–

Mifeng User

Single User License

EA7E-1184812

C0DAA9CD 6BE825B5 FF935692 1750523A

EDF59D3F A3BD6C96 F8D33866 3F1CCCEA

1C25BE4D 25B1C4CC 5110C20E 5246CC42

D232C83B C99CCC42 0E32890C B6CBF018

B1D4C178 2F9DDB16 ABAA74E5 95304BEF

9D0CCFA9 8AF8F8E2 1E0A955E 4771A576

50737C65 325B6C32 817DCB83 A7394DFA

27B7E747 736A1198 B3865734 0B434AA5

—— END LICENSE ——</pre>

五、配置Sublime,使用Python

单击 工具 > 编译系统 > 新建编译系统进入如下界面

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-lEMWVHhJ-1646998432695)(D:\typora\Picture\image-20220310201621899.png)]

将其中大括号中内容替换为:

"cmd":["D:\\Python\\python.exe","-u","$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python",
    "encoding": "utf-8" ,
    "env": {"PYTHONIOENCODING": "utf8"},
    "shell":"true"

cmd 中的地址替换为你的 Python3 的程序地址,如我 Python3 的程序地址为:D:\\Python\\python.exe

Ctrl+S保存

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-rH5W2dxK-1646998432695)(D:\typora\Picture\image-20220310203353025.png)]

点击工具中,编译系统,选择python3

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-VCPP2t6m-1646998432696)(D:\typora\Picture\image-20220310203438028.png)]

编写print("Hello"),按Ctrl+S保存(注意保存时要检查文件名后缀是否为.pyCtrl+b运行,下方控制台显示结果[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ySg2Bu6f-1646998432696)(D:\typora\Picture\image-20220310204037318.png)]

六、常用开发插件

Anaconda

关于Anaconda的安装和配置可以参考这两篇文章

(2条消息) anaconda安装-超详细版_in546的博客-CSDN博客_anaconda安装

Anaconda详细安装及使用教程(带图文) - 知乎 (zhihu.com)

Anaconda插件可以检查你的代码是否书写错误符合、是否满足PEP8规范,有效提高开发效率。

Anaconda安装完成并配置完成后,打开Package control ,install package,安装插件 Anaconda 和conda(这是两个插件)

按如下选项打开Anaconda插件,进行环境配置

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-9eSOuyUk-1646998432696)(D:\typora\Picture\image-20220310212001618.png)]

点开后输入代码

{
	"python_interpreter":"D:\\Edit_tools\\Annaconda\\python.exe",     //实际安装路径
	"suppress_word_completions":true,                          
	"suppress_explicit_completions":true,
	"complete_parameters":true, 
	"auto_formatting":true,
	"auto_formatting_timeout":3,
	"enable_signatures_tooltip":true,
	"merge_signatures_and_doc":true,
	"swallow_startup_errors":true,
	"anaconda_linting":false,

}

其中第一行的路径需要找到自己的Anaconda的python路径,代码中的路径是我自己的

接着配置conda环境

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Ro2NL7ca-1646998432697)(D:\typora\Picture\image-20220310212231040.png)]

{
	// Default Windows settings for sublime-text-conda:
    // executable is the path to anaconda's python
    // this python executable is used in order to find conda
    "executable": "D:\\Edit_tools\\Annaconda\\python.exe",
 
    // Directory in which the conda envs are stored
    // Default location is the user's home directory
    "environment_directory": "D:\\Edit_tools\\Annaconda\\envs",
 
    // System architecture for Python installation
    // options: 32 or 64 bit
    "architecture": "64",
 
    // configuration is the path to conda's configuration file
    "configuration": "C:\\Users\\34109\\.condarc",
 
    // when true, the scripts will be run through the shell
    // If your code has a GUI (e.g. a matplotlib plot),
    // this needs to be true, otherwise Windows suppresses it.
    "run_through_shell": true,
 
    // when true, the script execution will be handed over to
    // the pythonw executable, instead of python
    "use_pythonw": false,
 
    // open repl in second row tab below current file,
    // closing any existing tabs in that area
    // assumes files are kept in group 0 (typical)
    "repl_open_row": false,
 
    // when opening a repl using repl_open_row, close any
    // existing conda repls in the second row first
    "repl_row_close_existing": false,
 
    // save the current file (if dirty) when opening repl
    "repl_save_dirty": true,
 
    // syntax highlighting for Open REPL command
    // choice between 'python' and 'plaintext'
    "repl_syntax": "python"
}

其中所有的路径都需要改成自己安装Anaconda的路径

注:配置文件.condarc 是第一次运行conda config时,自动创建在用户目录下的隐藏文件

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-nMwCDr0F-1646998432697)(D:\typora\Picture\image-20220310212430628.png)]

安装完成后即可使用[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-aXgLjxsU-1646998432698)(D:\typora\Picture\image-20220310212515213.png)]

SublimeREPL

使用Sublime默认的快捷键Ctrl+B运行窗口无法实现Python交互(input输入内容),需要通过SublimeREPL插件实现交互等功能。

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-2DtTqynw-1646998432699)(D:\typora\Picture\image-20220310212826256.png)]

按如图所示点击快捷键设置

复制下面这段代码,编写完程序后按F5即可运行

[
    {
    "keys": ["f5"],// 绑定按键F5为运行Python程序
    "caption": "SublimeREPL: Python - RUN current file",
    "command": "run_existing_window_command",
    "args": {
        "id": "repl_python_run",// 设置为使用SublimeREPL打开
        "file": "config/Python/Main.sublime-menu"}
    }
]

  • 36
    点赞
  • 121
    收藏
    觉得还不错? 一键收藏
  • 8
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值