1.Package Control
插件管理,必装
2. ChineseLocalizations
中文支持
## 3.ZZZZZZZZ-Localization
不再需要
4.ConvertToUTF8
将当前打开的文件转换为UTF-8编码格式
5.CTags
生成代码标签,以便于快速定位和跳转到代码中的函数、类、变量
6.SublimeLinter
需要先安装一个iverilog:http://bleyer.org/icarus/
在默认安装模式下,似乎并不需要额外的配置?
如果不对iverilog进行配置,会遇到iverilog:Unknown module type: XXX问题
参考iverilog插件官网的描述:https://packagecontrol.io/packages/SublimeLinter-contrib-iverilog
需要对iverilog添加“-i”参数进行抑制(当然,你也可以通过添加include,这里不表)
具体配置如下:
// SublimeLinter Settings - User
{
// "debug": true,
"linters": {
"iverilog": {
"disable": false,
"args": ["-i"], // add the "-i" flag
"working_dir": "${file_path}",
"excludes": [],
},
}
}
7.SublimeLinter-contrib-iverilog
语法检查
8.SystemVerilog
高亮、例化、自动生成代码片段
此外,如果是针对Verilog开发,该插件还需要进行一定修改:
{
"sv.completion.core":
[
["if" , "block" , "if (${1:/* condition */}) begin\n\t${0:/* code */}\nend" , [], []],
["case" , "block" , "case (${1:/* switch */})\n\n\tdefault : ${0:/* default */};\nendcase" , [], []],
["begin" , "block" , "begin\n\t$0\nend" , [], []],
["localparam" , "declaration" , "localparam", ],
["parameter" , "declaration" , "parameter", ],
["generate" , "block" , "generate\n\t$0\nendgenerate" , [], []],
["for" , "loop" , "for (int ${2:i} = 0; $2 < ${1:count}; ${3:$2++}) begin\n\t${0:/* code */}\nend" , [], []],
["foreach" , "loop" , "foreach ($1) begin\n\t$0\nend", [], []],
["class" , "declaration" , "class ${1:${TM_FILENAME/(.+)\\..+|.*/$1/:name}} extends ${2: /* base class*/};\n\t$0\nendclass : ${1}" , [], []],
["uvmclass" , "declaration" , "class ${1:${TM_FILENAME/(.+)\\..+|.*/$1/:name}} extends ${2: /* base class*/};\n\n/*-------------------------------------------------------------------------------\n-- Interface, port, fields\n-------------------------------------------------------------------------------*/\n\t${0}\n\n/*-------------------------------------------------------------------------------\n-- UVM Factory register\n-------------------------------------------------------------------------------*/\n\t// Provide implementations of virtual methods such as get_type_name and create\n\t`uvm_component_utils(${1})\n\n/*-------------------------------------------------------------------------------\n-- Functions\n-------------------------------------------------------------------------------*/\n\t// Constructor\n\tfunction new(string name = \"${1}\", uvm_component parent=null);\n\t\tsuper.new(name, parent);\n\tendfunction : new\n\nendclass : ${1}", [], []],
["constraint" , "declaration" , "constraint ${1:c} {\n\t${0}\n}" , [], []],
["covergroup" , "declaration" , "covergroup ${1:cg}();\n\t${0}\nendgroup : ${1:cg}" , [], []],
["function" , "declaration" , "function ${1:void} ${2:funcname}($3);\n\t$0\nendfunction : ${2}" , [], []],
["interface" , "declaration" , "interface ${1:${TM_FILENAME/(.+)\\..+|.*/$1/:name}} ();\n\t$0\nendinterface : $1", [], []],
["module" , "declaration" , "module ${1:${TM_FILENAME/(.+)\\..+|.*/$1/:name}} (\n\tinput clk, // Clock\n\tinput clk_en, // Clock Enable\n\tinput rst_n, // Asynchronous reset active low\n\t${0}\n);\n\nendmodule " , []],
["package" , "declaration" , "package ${1:${TM_FILENAME/(.+)\\..+|.*/$1/:name}};\n\t$0\nendpackage : $1" , [], []],
["task" , "declaration" , "task ${1:taskname}($2);\n\t$0\nendtask : ${1}", [], []],
["import" , "declaration" , "import ${1:pkgname}::${2:*};\n$0", [], []],
["typdefenum" , "declaration" , "typedef enum logic [$1:0] {$0} e_$2;\n", [], []],
["forkj" , "fork..join" ,"fork\n\t$0\njoin" , [], []],
["forkn" , "fork..none" ,"fork\n\t$0\njoin_none" , [], []],
["forka" , "fork..any" ,"fork\n\t$0\njoin_any" , [], []],
["posedge" , "event" ,"posedge ${0:clk}" , ["sensitivity"], []],
["negedge" , "event" ,"negedge ${0:rst_n}" , ["sensitivity"], []],
],
"sv.always_label" : false,
}
9.Verilog Gadget
提供了自动生成例化模板、自动生成tb模板(Systemverilog)、插头信息、对齐操作等操作
10.Smart VHDL
提供VHDL语言支持
11.首选项-》设置
另外系统配置中还有一些实用功能:鼠标丢失焦点自动保存、更改光标闪烁、缩小光标长度等等
{
"ignored_packages":
[
"Vintage" //关闭Vim模式
/*"CTags",*/
/*"SystemVerilog",*/
/*"CTags",*/
/*"Insert Nums",*/
/*"SublimeLinter",*/
/*"Package Control",*/
],
"save_on_focus_lost": true,
"font_size": 18,
//文件索引解析侧边栏中的所有文件,并构建其符号的索引。这是“转到定义”工作所必需的。
"index_files": true,
//光标闪烁
"caret_style": "smooth",
//光标变小
"caret_extra_top":1,
"caret_extra_bottom":1,
"caret_extra_width":1,
//关闭自动换行
"word_wrap": "none",
// 一个Tab等于4个空格
"tab_size": 4,
// 将Tab键转化为空格
"translate_tabs_to_spaces": true,
}
12.深色主题
偶然在官网发现有深色主题:
1.首选项-》主题-》Default Dark
2.首选项-》配色方案-》Mariana
3.背景色由灰改为黑:
3.1使用压缩工具打开:D:\Program Files\Sublime Text\Packages\Color Scheme - Default.sublime-package
3.2复制一份Mariana.sublime-color-scheme
3.2.1定义一种与侧边栏相同的黑色:
"variables":
{
"black2": "hsl(210, 11%, 15%)",
},
3.2.2 更改背景色
"globals":
{
"background": "var(black2)",
},
13.AutoMatlab
用于支持Matlab语法高亮与关键词索引
注:Matlab2014a之后的版本才支持utf-8
14.Beyond Compare
虽然sublime提供有内部进行对比的插件,但是得益于Beyond Compare强大的对比功能还是推荐使用Beyond Compare插件
使用时需要在插件中配置自行安装的Beyond Compare程序路径:
{
//Define a custom path to beyond compare
“beyond_compare_path”: “D:/Program Files/Beyond Compare/BCompare.exe”
}`
15.Insert Num
用于FPGA开发中列选择后快速插入序号:
快捷键:
ctrl + alt +N
默认从1开始,每次递增1
插入后输入0即可从0开始
16.河蟹
通常,你需要河蟹他:https://www.cnblogs.com/xyida/p/14932186.html
另,分享一个交流论坛
Sublime Text中文论坛:https://sublimetext.iaixue.com/
关闭自动更新:
第一种方法:
首选项-》设置-》
“update_check”:false
第二种方法:
在host文件中插入下面这一行
127.0.0.1 www.sublimetext.com
如果是Linux,则host在 /etc/hosts
如果是Windows,则host在 C:\Windows\System32\Drivers\etc\hosts
如果你想在浏览器上打开sublime官网,需要撤销以上操作,因为以上操作是把官网DNS解析到本机,肯定是找不到的,所以也就不会出现更新提示了。