3.sublime - 配置

作者: 风云雄霸天下123456 | 来源:发表于2017-08-24 20:49 被阅读13次

    参考:


    1. sublime-config.json

    {
         "always_show_minimap_viewport": true,
         // 不显示文件
         "file_exclude_patterns":
         [
          ".DS_Store"
         ],
         // 不显示文件夹
         "folder_exclude_patterns":
         [
          ".git",
          "node_modules",
          "public/static"
         ],
    
         // 设置字体
         "font_size": 10,
    
         // 忽视的插件
         "ignored_packages":
         [
          "Vintage"
         ],
    
         // 行内间距
         "line_padding_bottom": 3,
         "line_padding_top": 3,
    
         // 设置主题
         "color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
         "theme": "Material-Theme.sublime-theme",
         "material_theme_accent_sky": 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,
         "material_theme_tree_headings": true,
         "overlay_scroll_bars": "enabled",
    
         // tab_size 缩进空格
         "tab_size": 2,
    
         // tab转换为空格
         "translate_tabs_to_spaces": true,
    
         // 支持$ 分割变量
         "word_separators": "./\\()\"'-:,.;<>~!@#%^&*|+=[]{}`~?",
         "word_warp": "auto",
    
         // 不检查更新
         "update_check": false,
    
         // 删除行尾的多余空格
         "trim_trailing_white_space_on_save": true,
    
         // 在文件末尾添加一个空行
         "ensure_newline_at_eof_on_save": true,
    }
    

    2. Mac版 —— sublime-keybinds.json

    [
        { "keys": ["f1"], "command": "fold" },
        { "keys": ["f2"], "command": "unfold" },
        // 显示大纲
        { "keys": ["command+shift+o"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
        { "keys": ["command+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
    
        { "keys": ["ctrl+space"], "command": "auto_complete" },
        { "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
        [
        { "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
        { "key": "auto_complete_visible", "operator": "equal", "operand": false },
        { "key": "setting.tab_completion", "operator": "equal", "operand": true }
        ]
        },
        { "keys": ["command+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
        { "keys": ["ctrl+shift+c"], "command": "toggle_comment", "args": { "block": false } },
        { "keys": ["ctrl+shift+c"], "command": "toggle_comment", "args": { "block": true } },
        { "keys": ["alt+up"], "command": "swap_line_up" },
        { "keys": ["alt+down"], "command": "swap_line_down" },
        { "keys": ["ctrl+alt+down"], "command": "duplicate_line" },
        { "keys": ["shift+ctrl+r"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
        { "keys": ["ctrl+shift+s"], "command": "save_all" },
        { "keys": ["shift+ctrl+f4"], "command": "close_all" },
        { "keys": ["shift+ctrl+y"], "command": "lower_case" },
        { "keys": ["shift+ctrl+x"], "command": "upper_case" },
        // { "keys": ["ctrl+k"], "command": "find_under_expand" },
        { "keys": ["ctrl+shift+t"], "command": "open_terminal_project_folder" },
    
        { "keys": ["ctrl+shift+k",], "command": "sublimelinter_lint" },
            { "keys": ["ctrl+k", "n"], "command": "sublimelinter_goto_error", "args": {"direction": "next"} },
            { "keys": ["ctrl+k", "p"], "command": "sublimelinter_goto_error", "args": {"direction": "previous"} },
            { "keys": ["ctrl+k", "a"], "command": "sublimelinter_show_all_errors" },
            { "keys": ["ctrl+k", "t"], "command": "sublimelinter_toggle_linter", "args": {"which": "all"}
        },
    
        { "keys": ["alt+m"], "command": "markdown_preview", "args": {"target": "browser", "parser":"markdown"} },
        {
            "keys": [
                "command+e"
            ],
            "args": {
                "action": "expand_abbreviation"
            },
            "command": "run_emmet_action",
            "context": [
                {
                    "key": "emmet_action_enabled.expand_abbreviation"
                }
            ]
        },
    ]
    

    3. windows版 —— sublime-keybinds.json

    [
        { "keys": ["f1"], "command": "fold" },
        { "keys": ["f2"], "command": "unfold" },
        { "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
    
        { "keys": ["ctrl+space"], "command": "auto_complete" },
        { "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
        [
        { "key": "last_command", "operator": "equal", "operand": "insert_best_completion" },
        { "key": "auto_complete_visible", "operator": "equal", "operand": false },
        { "key": "setting.tab_completion", "operator": "equal", "operand": true }
        ]
        },
        { "keys": ["ctrl+d"], "command": "run_macro_file", "args": {"file": "Packages/Default/Delete Line.sublime-macro"} },
        { "keys": ["ctrl+shift+c"], "command": "toggle_comment", "args": { "block": false } },
        { "keys": ["ctrl+shift+c"], "command": "toggle_comment", "args": { "block": true } },
        { "keys": ["alt+up"], "command": "swap_line_up" },
        { "keys": ["alt+down"], "command": "swap_line_down" },
        { "keys": ["ctrl+alt+down"], "command": "duplicate_line" },
        { "keys": ["shift+ctrl+r"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
        { "keys": ["ctrl+shift+s"], "command": "save_all" },
        { "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} },
        { "keys": ["shift+ctrl+f4"], "command": "close_all" },
        { "keys": ["shift+ctrl+y"], "command": "lower_case" },
        { "keys": ["shift+ctrl+x"], "command": "upper_case" },
        // { "keys": ["ctrl+k"], "command": "find_under_expand" },
        { "keys": ["ctrl+shift+t"], "command": "open_terminal_project_folder" },
    
        { "keys": ["ctrl+shift+k",], "command": "sublimelinter_lint" },
            { "keys": ["ctrl+k", "n"], "command": "sublimelinter_goto_error", "args": {"direction": "next"} },
            { "keys": ["ctrl+k", "p"], "command": "sublimelinter_goto_error", "args": {"direction": "previous"} },
            { "keys": ["ctrl+k", "a"], "command": "sublimelinter_show_all_errors" },
            { "keys": ["ctrl+k", "t"], "command": "sublimelinter_toggle_linter", "args": {"which": "all"}
        },
    
        { "keys": ["alt+m"], "command": "markdown_preview", "args": {"target": "browser", "parser":"markdown"} },
    ]
    

    4. windows 打开Git-bash命令行

    1. 修改Package Settings --> Terminal --> sublime-settings 配置 Git命令行
      {
          // window下终端路径
          "terminal": "C:\\Program Files (x86)\\Git\\bin\\sh.exe",
          // window下终端参数
          "parameters": ["--login", "-i"]
      }
      

    5. Mac下无法打开iterm2问题


    6. windows - 禁止 ctrl+光标 滚动改变字体大小

    1. 位置:
      C:\Users\mingwang\AppData\Roaming\Sublime Text 3\Packages\User
    2. 新建文件 - Default (Windows).sublime-mousemap
      [
          // Change font size with ctrl+scroll wheel
          { "button": "scroll_down", "modifiers": ["ctrl"], "command": "null" },
          { "button": "scroll_up", "modifiers": ["ctrl"], "command": "null" }
      ]
      

    7. Mac - 设置命令行 subl . 命令

    alias subl=\''/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl'\'
    

    相关文章

      网友评论

        本文标题:3.sublime - 配置

        本文链接:https://www.haomeiwen.com/subject/cheedxtx.html