Sublime text3安装

时间:2022-10-21 05:58:32

一、Sublime text3下载

[20190506]下载

官网下载:https://www.sublimetext.com/

https://download.sublimetext.com/Sublime%20Text%20Build%203207%20x64%20Setup.exe

中文官网下载:http://www.sublimetext.cn/

https://download.sublimetext.com/Sublime%20Text%20Build%203200%20x64%20Setup.exe

二、Sublime text3安装

默认安装,一直点下一步即可

三、安装器激活

import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())

官网下载  https://packagecontrol.io/

中文官网下载  http://packagecontrol.cn/installation

import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.cn/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)

访问该网站拷贝python脚步

下载完成之后重启Sublime Text 3。
如果在Perferences->中看到package control这一项,则安装成功

参见:http://packagecontrol.cn/installation

四、安装插件

Emmet          #html css js代码生成
Sublime CodeIntel       #代码提示
Bracket Highlighter      #类似于代码匹配,可以匹配括号,引号等符号内的范围

ConvertToUTF8                输出乱码时请安装这个

Color Highlight    颜色选择及颜色高亮  Ctrl+shift+c

SublimeREPL              在REPL窗口运行python,下面设置F5快捷键运行

SublimeTmpl              新建文件模板

AutoFileName            自动提示文件名

python PEP8 autoformat   Ctrl+shift+r可以格式化文件代码

五、设置:

run mysql

Tools-->build system-->new build system...--> save

{
  "cmd":["这里是数据库的绝对路径/mysql.exe",
  "-uroot",
  "-p123",
  "-h192.168.1.4",
  "-e","source $file", "-t" ],
  "selector":"source.sql",
  "encoding": "cp936",
  "shell" : true
}

Sublime Text 3配置与vim模式:

打开Preference --> Package Settings-->Package Control --Settings User

"channels": [ "http://packagecontrol.cn/channel_v3.json" ]

打开Preference --> Seting-User -->

{
  "color_scheme": "Packages/Color Scheme - Default/Breakers.sublime-color-scheme",
  "font_size": 14,
  "ignored_packages":[],
  "theme": "Default.sublime-theme",
  "save_on_focus_lost": true, //失去焦点自动保存
  "trim_trailing_white_space_on_save": true, //保存时删除行后无用的空格
  "tab_size": 4, //tab转为4个空格
  "trim_trailing_white_tab_on_save": true, //保存时删除行后无用的空格
  "rulers": [80], //列宽80

}

以下保存到venv\Scripts\venv_path.bat 执行后会在操作系统里追加系统环境变量PATH后

@echo off
::设置要永久加入到path环境变量中的路径
set vnv_PATH=%cd%
set PATH=%PATH%;%vnv_PATH%
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v "Path" /t REG_EXPAND_SZ /d "%PATH%" /f
exit

设置快捷键Preferences-->Key-bindings

{
  "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"
  }

},

{
  "keys":["f7"],
  "caption": "SublimeREPL: Shell",
  "command": "run_existing_window_command", "args":
  {
    "id": "repl_shell",
    "file": "config/Shell/Main.sublime-menu"
  }
},

,
{
  "keys": ["f8"],
  "caption": "SublimeREPL: Python - PDB current file",
  "command": "run_existing_window_command",
  "args": {
    "id": "repl_python_pdb",
    "file": "config/Python/Main.sublime-menu"

  }
}

修改 Perferences->Browse Packages  -->SublimeREPL\config\Python\Main.sublime-menu

ipython处 "windows": ["python", "-u", "绝对路经/ipython.exe"]

这样在打开ipython时不会报错   在ipython中执行!CHCP 65001可以显示中文

注册

打开Sublime菜单 > help > enter License

ZYNGA INC.

50 User License
EA7E-811825
927BA117 84C9300F 4A0CCBC4 34A56B44
985E4562 59F2B63B CCCFF92F 0E646B83
0FD6487D 1507AE29 9CC4F9F5 0A6F32E3
0343D868 C18E2CD5 27641A71 25475648
309705B3 E468DDC4 1B766A18 7952D28C
E627DDBA 960A2153 69A2D98A C87C0607
45DC6049 8C04EC29 D18DFA40 442C680B
1342224D 44D90641 33A3B9F2 46AADB8F