Sublime Text 常用设置

常用命令

安装package control

https://packagecontrol.io/installation,上面有说明,安装完需要重启sublime。
重启后,ctrl+shift+p,输入ctrl + shift + p然后在控制窗口中输入Package Control: Install Package回车,输入要安装的包名即可

常用package

BracketHighlighter

将配对的括号等显示在行数列上

Sublime Code Intel

  • Auto complete awesomeness

All autocomplete

Adds autocomplete for words found in all open files. Works well as a supplement to SublimeCodeIntel

Colorpicker

使用一个取色器改变颜色

markdownediting或者markdownPerview

这个是写Markdown必备的。可以在包管理器中安装。装完之后,写作Markdown时(右下角显示语法为Markdown),可以按ctrl+b,直接就会生成HTML,并在浏览器中显示;

jsformat

JavaScript代码格式化;https://github.com/jdc0589/JsFormat
使用:

  • The default key binding is “ctrl+alt+f”
  • Open the command palette via “ctrl + shift + p”, Jsformat appears as “Format: Javascript”
    注意:必须是.js文件,或者syntax设置为js或者json才可以,否则command palette不显示“Format:Javascript”

sidebarenhancement

这是用来增强左边的侧边栏。左侧边栏可以在View -> Side Bar -> Show Side Bar中打开,可以用Project -> Add Folder to Project…往侧边栏加入常用的文件夹。装完这个插件,侧边栏的右键菜单会多一些功能,挺实用的

自定义快捷键

在行尾添加;并跳到下一行

Best solution for this is recording a macro on Sublime Text and then assigning it to a keyboard shortcut. Follow these steps:

Create a line such as alert(‘hello’) and leave the cursor right after letter ‘o’.
Then go to Tools > Record a Macro to start recording.
Press ‘End’ to go to the end of line.
Press ; and hit Enter
Stop recording the macro by going to Tools > Stop Recording Macro
You can now test your macro by Tools > Playback Macro (optional)
Save your macro by going to Tools > Save Macro (ex: EndOfLine.sublime-macro)
Create a shortcut by adding this between the square brackets in your in your Preferences > Key Bindings - User file:(Ctrl+shift+P,输入kbu,回车)

[
    {"keys": ["ctrl+;"], "command": "run_macro_file", "args": {"file": "Packages/User/EndOfLine.sublime-macro"}}
]

Now, every time you hit Ctrl+;, it will magically place the semicolon at the end of current line and move the cursor to the next line.
Happy coding!

Theme

https://github.com/equinusocio/material-theme
After installing material-theme,add the following to your “Settings - User”file and restart Sublime Text ,当前编辑文件的Tab会高亮显示,我非常喜欢这点

  {
    "theme": "Material-Theme.sublime-theme",
    "color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
  }

也可以换Material-theme里的别的color schema,比如:

{
    "theme": "Material-Theme-Darker.sublime-theme",
    "color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
  }

Recommended UI and font settings for a better experience:

{
    "overlay_scroll_bars": "enabled",
    "line_padding_top": 3,
    "line_padding_bottom": 3,
    "always_show_minimap_viewport": true,
    "bold_folder_labels": true,
    "indent_guide_options": [ "draw_normal", "draw_active" ],   // Highlight active indent
    "font_options": [ "gray_antialias" ],                       // For retina Mac
  }

Settings(设置)

菜单:preferences–》settings-user,输入自定义配置:

  • 解决windows下,中文文件名在tab上显示为方块:”dpi_scale”: 1.0
  • 常用配置
// User/Preferences.sublime-settings
{
    "color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
    "ignored_packages":
    [
    ],
    "material_theme_bold_tab": true,
    "material_theme_compact_panel": true,
    "material_theme_compact_sidebar": true,
    "material_theme_contrast_mode": true,
    "material_theme_disable_tree_indicator": true,
    "material_theme_panel_separator": true,
    "material_theme_small_statusbar": true,
    "material_theme_small_tab": true,
    "material_theme_tabs_autowidth": true,
    "material_theme_tabs_separator": true,
    "theme": "Material-Theme-Darker.sublime-theme",
    "bold_folder_labels": true,
    "font_face": "Consolas",
    "font_size": 15,
    "font_options"                 : [ "gray_antialias", "subpixel_antialias" ],  
    "overlay_scroll_bars"          : "enabled",
    "line_padding_top"             : 3,
    "line_padding_bottom"          : 3,
    "always_show_minimap_viewport" : true,
    "bold_folder_labels"           : true,
    "indent_guide_options"         : [ "draw_normal", "draw_active" ],   // Highlight active indent
    "highlight_line": true,
    "hot_exit": false, //退出时问是否保存
    "rulers":
    [
        80
    ],
    "scroll_past_end": true,
    "tab_size": 4,
    "tab_completion": false,
    "vintage_start_in_command_mode": true,
    "dpi_scale": 1.0
}

我在Sublime中用的是最佳模式。它提供了 vi 编辑命令代替Sublime Text。它不是原vi包的全功能,但它是我目前见过最接近 vi编辑器的文本编辑器。使用你的键盘快捷键和命令包就可以非常快速的开发。
上面的设置会在你打开一个文件时自动开启Vintage模式(叔注:Vintage是Sublime Text的vi模式编辑包。 可以使用组合vi命令来调用Sublime Text的功能,包括多重选择。)。
如果你不喜欢这个功能,只是删除vintage_start_in_command_mode就可以了,如果你想完全禁用Vintage模式,那么删除ignored_packages设置。

user preferences

http_proxy

“http_proxy”: “127.0.0.1:8087”,

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值