sublime text使用小结

安装

  • 配置 Preferences -> Setting - User
{
    "always_show_minimap_viewport": true,
    "bold_folder_labels": true,
    "color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
    "detect_slow_plugins": false,
    "font_face": "YaHei Consolas Hybrid",
    "font_options":
    [
        "no_bold",
        "no_italic",
        "gray_antialias"
    ],
    "font_size": 11.0,
    "ignored_packages":
    [
        "Markdown",
        "Vintage"
    ],
    "indent_guide_options":
    [
        "draw_normal",
        "draw_active"
    ],
    "material_theme_accent_lime": true,
    "material_theme_small_tab": true,
    "overlay_scroll_bars": "enabled",
    "theme": "Material-Theme-Darker.sublime-theme",
    "translate_tabs_to_spaces": true
}
  • 添加对ocvate的编译 Tools -> Build System - New Build System...
{
    "cmd": ["D:\\GreenSoft\\dev\\octave\\bin\\octave-cli.exe", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.m"
}

使用

  • 最常用快捷键
    ctrl+/ 注释单行

  • 在线颜色主题编辑
    http://tmtheme-editor.herokuapp.com 提供在线主题编辑功能,可以所见即所得的进行详细的语法着色编辑,该网站同时也提供很多漂亮的语法着色文件下载。
    sublime text使用小结_第1张图片
    其中一个强大便利的功能,你可以将自己的.tmTheme语法着色文件上传到网站,然后在已有风格配置文件基础上进行针对性的细节调整,非常方便。
    编辑完并保存后,将生成的.thTheme文件拷贝到安装目录的Data\Packages\Color Scheme - Default文件夹下就可以了.

推荐使用的主题和插件

  • Material Theme 颜色超正的主题和语法配色,支持文件和Tab图标、Tab下划线,可配置Tab下划线的着色

    配置: Preferences -> Setting - User:

{
    "theme": "Material-Theme-Darker.sublime-theme",
    "color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
    "material_theme_accent_lime": true,
    "material_theme_small_tab": true,   
}
  • Primer Theme 扁平化的风格,支持侧边栏图标,可配置Tab颜色

    配置: Preferences -> Settings - User:
{
    "theme": "Primer Dark.sublime-theme",
    "color_scheme": "Packages/Theme - Primer/primer.dark.tmTheme",
    "theme_primer_tab_active_green": true,
}
  • Anaconda Python IDE 秒变好用的python IDE,支持跳转到定义、查找引用、pylint检查、格式化等功能
    sublime text使用小结_第2张图片
    配置: Preferences -> Package Settings -> Anaconda -> Settings - User
{
    "pep8_ignore":
    [
        "E501"
    ]
}
  • Markdown Editing 支持Markdown语法高亮;支持Github Favored Markdown语法;自带3个主题

    配置: Preferences -> Package Settings -> Markdown Editing -> Markdown GFM Settings - User
{
    //"color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Dark.tmTheme"
    "color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme"
}

解决.txt文件打开不自动解析为Makrdown语法的问题, 也通过该方法永久指定以特定语法打开某后缀的文件:

By default, when you install the plugin, files with these extensions will be assigned to Markdown syntax: “md”, “txt”, “mdown”, “markdown”, “markdn”. If you want to prevent any of these extensions to be opened as Markdown, follow these steps:

  1. Click on the language menu at bottom right
  2. Select “Open all with current extension as”
  3. Choose your preferred syntax for that extension
  • MarkdownPreview 按CTRL + B生成网页HTML;在最前面添加[TOC]自动生成目录, 可指定css控制输出格式
    sublime text使用小结_第3张图片
    配置: Preferences -> Package Settings -> Markdown Preview -> Settings - User
{
    "enable_highlight": true,
    "css": "F:/Nova/nova.css"
}

样式下载地址: nova.css

  • Color Highlighter 在编辑器中按Ctrl键点击颜色值,即可现实对应颜色。

  • Plain​Tasks 非常不错的todo管理工具,支持done (ctrl+d)、cancel(alt+c)、due (d, tab)、today(t, tab)等各种标记,配合快捷键使用方便,而且支持一键将已完成任务归档(ctrl+shift+a)

    配置: Preferences -> Package Settings -> PlainTasks -> Settings - User

{
    "done_tasks_bullet": "√", // options: + | ✓ | ✔ | √ | [x]
    "cancelled_tasks_bullet": "x", // options: x | ✘ | [-]
    "color_scheme": "Packages/PlainTasks/tasks-eighties-dark.hidden-tmTheme",
    "margin": 4,
}

该插件默认todo和完成的条目都是斜体,如果不喜欢,需要修改所使用的配色文件(如SublimeText3\Data\Packages\PlainTasks\tasks-eighties-dark.hidden-tmTheme),需要将CommentMeta中的fontStyle修改为normal。如下

......
<dict>
    <key>namekey><string>Commentstring>
    <key>scopekey><string>commentstring>
    <key>settingskey>
    <dict>
        <key>fontStylekey><string>normalstring>
        <key>foregroundkey><string>#747369string>
    dict>
dict>
......
<dict>
    <key>namekey><string>Metastring>
    <key>scopekey><string>metastring>
    <key>settingskey>
    <dict>
        <key>fontStylekey><string>normalstring>
    dict>
dict>
......
  • BracketHighlighter 括号高亮插件,top 100 实用插件

  • Terminal 在当前文件所在文件夹或工程根目录打开终端, 而且可配置成cmder. 通过Preferences -> Package Settings -> Terminal -> Settings - User打开用户配置:

{ 
    // window下终端路径 
    "terminal": "D:\\GreenSoft\\system\\cmder\\Cmder.exe", 
    // window下终端参数 
    "parameters": ["/START", "%CWD%"] 
}

默认快捷键与打开最近关闭的文件冲突,建议通过Preferences -> Package Settings -> Terminal -> Key bindings - User修改,在末尾添加.

    { "keys": ["ctrl+alt+t"], "command": "open_terminal" },
    { "keys": ["ctrl+shift+alt+t"], "command": "open_terminal_project_folder" }

参考

  • Sublime插件:Markdown篇
  • Sublime插件:C语言篇
  • Android Studio 设置 sublime 主题
  • sn

你可能感兴趣的:(软件使用)