Skip to content

Instantly share code, notes, and snippets.

@dortamiguel
Last active June 14, 2021 22:13
Show Gist options
  • Save dortamiguel/830a868f509fc0dc6b159e667317ce78 to your computer and use it in GitHub Desktop.
Save dortamiguel/830a868f509fc0dc6b159e667317ce78 to your computer and use it in GitHub Desktop.
Sublime Text 4 setup

Sublime Text 4 Setup

plugins

FileIcons
PackageResourceViewer
Open URL
GitSavvy
Sidebar Tools
SyncedSideBar
Color Highlight
RainbowBrackets
Search in Project
File History
Find++
Open Finder
BetterFindBuffer
Delete Current File
GitGutter
DotENV

<!-- c++ -->
EasyClangComplete
CMakeEditor
Clang Format
OpenGL Shading Language (GLSL)

<!-- javascript -->
<!-- TODO: https://gist.github.com/ellipticaldoor/043e1b171535f12402e22e470160b216 -->
typescript
prettier
eslint
eslint formater
styled components, css -> Naomi
GraphQL syntax and prettier formatter
HyperClick // needed with typescript plugin?

<!-- themes -->
Theme - Spacegray
Solarized Color Scheme
Nord
Dracula
GitHub Theme
Earthbound Themes
Dank Neon
One Half Color Schemes
Theme - Pacific
Monokai - Spacegray

custom plugins

cd ~/Library/Application\ Support/Sublime\ Text/Packages
git clone https://github.com/ellipticaldoor/minimap-hider

settings json

{
  "font_size": 15,
  "theme": "Adaptive.sublime-theme",
  "color_scheme":
    "auto",
  "light_color_scheme": "Packages/Theme - Spacegray/base16-ocean.light.tmTheme",
  "dark_color_scheme": "Packages/Theme - Pacific/Pacific Dark.tmTheme",
  "font_face": "SF Mono",
  "ui_scale": 1.2,
  "always_show_minimap_viewport": true,
  "animation_enabled": false,
  "caret_style": "blink",
  "default_line_ending": "unix",
  "drag_text": false,
  "draw_white_space": "selection",
  "shift_tab_unindent": true,
  "enable_tab_scrolling": false,
  "ensure_newline_at_eof_on_save": true,
  "fade_fold_buttons": false,
  "highlight_line": true,
  "tab_size": 2,
  "tab_completion": false,
  "auto_complete": false,
  "auto_complete_use_index": false,
  "auto_complete_include_snippets": false,
  "auto_complete_include_snippets_when_typing": false,
  "auto_complete_size_limit": 0,
  "translate_tabs_to_spaces": true,
  "ignored_packages": [
    "Vintage",
  ],
  "indent_guide_options": [
    "draw_normal",
    "draw_active"
  ],
  "open_files_in_new_window": false,
  "rulers": [80],
  "wrap_width": 80,
  "draw_centered": true,
  "save_on_focus_lost": true,
  "show_rel_path": true,
  "show_git_status": false,
  "tree_animation_enabled": false,
  "trim_trailing_white_space_on_save": true,
  "word_wrap": true,
  "show_definitions": false,
  "bold_folder_labels": true,
  "mini_diff": false,
  "file_exclude_patterns": [
    "*.pyc",
    "*.pyo",
    "*.exe",
    "*.dll",
    "*.obj",
    "*.o",
    "*.a",
    "*.lib",
    "*.so",
    "*.ncb",
    "*.sdf",
    "*.suo",
    "*.pdb",
    "*.idb",
    ".DS_Store",
    ".directory",
    "desktop.ini",
    "*.class",
    "*.psd",
    "*.db"
  ],
  "binary_file_patterns": [
    "*.jpg",
    "*.jpeg",
    "*.png",
    "*.gif",
    "*.ttf",
    "*.tga",
    "*.dds",
    "*.ico",
    "*.eot",
    "*.pdf",
    "*.swf",
    "*.jar",
    "*.zip",
    "*.log",
    "*.csv",
    "*.pyc",
    "*.gz",
    "*.wav",
    "*.ttf",
    "node_modules/**",
    "build/**",
    "bin/**"
  ],
}

keymap json

[
  // Sublime
  { "keys": ["super+b"], "command": "toggle_side_bar" },
  { "keys": ["alt+up"], "command": "swap_line_up" },
  { "keys": ["alt+down"], "command": "swap_line_down" },
  { "keys": ["super+i"], "command": "show_overlay", "args": {"overlay": "goto", "show_files": true} },
  { "keys": ["super+t"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
  { "keys": ["super+p"], "command": "show_overlay", "args": {"overlay": "command_palette"} },
  { "keys": ["super+r"], "command": "rename_file" },
  { "keys": ["super+shift+d"], "command": "delete_current_file" },
  { "keys": ["alt+c"], "command": "select_color_scheme" },
  { "keys": ["alt+q"], "command": "close_all" },
  { "keys": ["super+;"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },
  { "keys": ["home"], "command": "_" },
  { "keys": ["end"], "command": "_" },
  { "keys": ["pageup"], "command": "_" },
  { "keys": ["pagedown"], "command": "_" },
  { "keys": ["super+shift+p"], "command": "_" },

  // Indent single lines
  {
    "keys": ["tab"],
    "command": "indent",
    "context": [
      {
        "key": "selection_empty",
        "operator": "equal",
        "operand": false,
        "match_all": true
      }
    ]
  },
  {
    "keys": ["shift+tab"],
    "command": "unindent",
    "context": [
      {
        "key": "selection_empty",
        "operator": "equal",
        "operand": false,
        "match_all": true
      }
    ]
  },

  // Open URL
  {
    "keys": ["alt+o"],
    "command": "open_url",
    "args": { "show_menu": false }
  },

  // Open Finder
  { "keys": ["alt+f"], "command": "open_finder" },

  // SideBarTools
  {
    "keys": ["super+shift+r"],
    "command": "side_bar_move",
    "args": { "paths": [] }
  },

  // Open settings in a new tab
  {
    "keys": ["super+,"],
    "command": "open_file",
    "args": {
      "file": "$packages/User/Preferences.sublime-settings"
    }
  },
  {
    "keys": ["super+shift+,"],
    "command": "open_file",
    "args": {
      "file": "$packages/User/Default (OSX).sublime-keymap"
    }
  },

  // GitSavvy
  { "keys": ["§"], "command": "gs_show_status" },
  { "keys": ["±"], "command": "gs_show_branch" },
  { "keys": ["ctrl+p"], "command": "gs_pull" },
  { "keys": ["ctrl+shift+p"], "command": "gs_push" },
  { "keys": ["alt+shift+s"], "command": "gs_quick_stage" },
  {
    "keys": ["alt+s"],
    "command": "gs_custom",
    "args": { "args": ["add", "{FILE_PATH}"] }
  },

  // EasyClangComplete
  { "keys": ["super+."], "command": "ecc_goto_declaration"},
  { "keys": ["super+shift+."], "command": "goto_definition"},
  { "keys": ["super+e"], "command": "ecc_show_all_errors"},

  // Search in project
  { "keys": ["super+shift+g"], "command": "search_in_project" },

  // File History
  {
    "keys": ["super+o"],
    "command": "open_recently_closed_file",
    "args": {"current_project_only": true}
  },
]

plugin setup - User preferences

Clang Format

{
  "format_on_save": true,
  "style": "File",
  "languages": ["C", "C++", "GLSL"]
}

EasyClangComplete

{
  "progress_style": "None",
  "autocomplete_includes": false,
  "hide_default_completions": true
}

SyncedSideBar

{
  "reveal-all-tabs": false
}

GitSavvy

{
  "hide_help_menu": true,
  "tab_order": ["status", "branch"]
}

Color Highlight

{
  "user": {
    "gutter_icon": false
  }
}

Search in Project

brew install the_silver_searcher
{
  "search_in_project_engine": "the_silver_searcher",
  "search_in_project_TheSilverSearcher_common_options":
    "-Q --ignore node_modules/** --ignore build/** --ignore bin/**"
}

File History

{
  "show_file_preview": false,
  "use_saved_position": false,
  "new_tab_position": "last"
}

GitGutter

{
  "debounce_delay": 0,
  "show_markers_on_untracked_file": false,
  "enable_hover_diff_popup": false,
  "show_line_annotation": false,
  "status_bar_text": [
    "{{repo}}",
    // Show author name
    // "{% if line_commit and line_commit[:7] != '0000000' %}, {{line_author}} ({{line_author_age}}){% endif %}",
  ],
}

RainbowBrackets

{
  "brackets":{
    "pairs":{
      "(":")",
      "[":"]",
      "{":"}"
    },
    "filetypes":{
      "json":{
        "opening":[
          "(",
          "[",
          "{"
        ],
        "ignored_scopes":[
          "comment",
          "string"
        ],
        "extensions":[
          "c",
          "h",
          "cpp",
          "hpp",
          "frag",
          "vert",
          "md",
          "js",
          "ts",
          "tsx",
          "txt",
          "json"
        ]
      }
    }
  },
  "rainbow_colors":{
    "matched":[
      "#bf5af2",
      "#0a84ff",
      "#ff9f0a"
    ]
  }
}

PackageResourceViewer

  1. Remove "Sublime merge" from the bottom sidebar.
  • PackageResourceViewer: Open Resource
  • Default -> Side Bar.sublime-menu
  • comment all lines containing sublime_merge_
  1. UI tweaks
  • PackageResourceViewer: Open Resource
  • Theme - Default > Adaptive.sublime-theme
// Reduce indent spacing on sidebar
{
  "class": "sidebar_tree",
  "row_padding": [10, 4, 4, 5],
  "indent": 10,
  "indent_offset": 10,
}

// Hide sidebar heading
{
  "class": "sidebar_heading",
  "font.size": -1,
  "font.bold": false,
  "opacity": 0
}

// Increase bottom sidebar font size
{
  "class": "label_control",
  "parents": [{"class": "status_bar"}],
  "font.size": 13
}

// Status Bar
{
  "class": "status_bar",
  "content_margin": [8, 0, 8, 1]
}

// Transparent quick panel
{
  "class": "overlay_control",
  "layer0.tint": "color(var(--background) blend(black 60%))",
  "layer0.opacity": 0.9
}
{
  "class": "quick_panel",
  "layer0.opacity": 0
}

// Bigger font quick panel
{
  "class": "quick_panel_label",
  "font.size": 17,
}
{
  "class": "quick_panel_path_label",
  "font.size": 14,
}

// Hide scrollbar
{
  "viewport_always_visible_color": "hsla(0, 0%, 50%, 0.4)",
}
{
  "class": "scroll_track_control",
  "layer0.tint": "black",
  "layer0.opacity": 0,
}
{
  "class": "puck_control",
  "layer0.opacity": 0
}
  1. Custom BetterFindBuffer theme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment