Sublime Text Config
So I’m using Sublime Text for more than 10 years already, and still happy doing it today. At some point I even decided to buy the full license, if you don’t know, there is a not-that-annoying limitation of trial version, where you have to close window that asks you to buy full license every 3 saves.
The main thing in config is that I’m using Adobe’s Source Code Pro font and Material Theme. Forced whitespace characters (which was pretty hard to set with Vim), and a bunch of small theme tweaks.
Config:
1{
2 "always_show_minimap_viewport": false,
3 "auto_complete_cycle": true,
4 "caret_style": "phase",
5 "close_windows_when_empty": false,
6 "color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
7 "draw_centered": false,
8 "draw_white_space": "all",
9 "enable_tab_scrolling": false,
10 "findreplace_small": true,
11 "font_face": "Source Code Pro",
12 "font_options":
13 [
14 "subpixel_antialias",
15 "no_round"
16 ],
17 "font_size": 10,
18 "highlight_line": true,
19 "highlight_modified_tabs": true,
20 "ignored_packages":
21 [
22 "Vintage"
23 ],
24 "indent_guide_options":
25 [
26 "draw_normal",
27 "draw_active"
28 ],
29 "open_files_in_new_window": false,
30 "overlay_scroll_bars": "enabled",
31 "preview_on_click": false,
32 "reveal-on-activate": true,
33 "rulers":
34 [
35 120
36 ],
37 "scroll_past_end": false,
38 "scroll_speed": 5.0,
39 "show_encoding": true,
40 "show_full_path": false,
41 "sidebar_small": true,
42 "tab_height_short": true,
43 "tabs_medium": true,
44 "theme": "Material-Theme-Darker.sublime-theme",
45 "trim_trailing_white_space_on_save": true,
46 "word_wrap": false
47}
Plugins:
- AdvancedNewFile - allows to do quick file creation, cutToFile \ copyToFile operations
- BracketHighligter - shows small bracket signs where it opens \ closes
- CompareSideBySide - allows doing diffs directly in sublime between panels
- DashDoc - with Zeal - quickly jump to reference using text under cursor
- Gist - to quickly create github gists from code selection
- GitGutter - highlights and adds information from git (changes, blames..)
- GoToWindow - quick plugin to switch to any openWindow if you use multiple sublime instances
- HexViewer - view hex
- ImageMagick - previews images and their properties directly in sublime
- LoggingControl - useful to check logs, understands different log Levels
- LSP - language server protocol, allows to have all IDE features with remote Language Server Protocols. There are bunch of languages supported, I’m now trying to make D-lang LSP working. Later I plan to use OmniSharp with Roslyn Analyzers instead of old NRefactory one
- MaterialTheme - nice-looking theme, inspired by android material design language
- OmniSharp - a bit modifier version of original OmniSharpServer that uses NRefactory in background, doesn’t support all features of .Net4.5+, but works pretty well and fast.
- serve-d - an LSP part to work with D-lang
- UnityShader - adds a bunch of unity shader snippets and highlight of code
- WordCount - usefull if you’re paid per word-of-code)
- XmlDocs - will generate XML docs for code if you have to do it
And a bit of quick keys I use most of the time
KeyBindings
1[
2 {
3 "command": "lsp_clangd_switch_source_header",
4 "keys": [
5 "option+h"
6 ]
7 },
8 {
9 "keys": [
10 "f1"
11 ],
12 "command": "lsp_toggle_server_panel",
13 "context": [
14 {
15 "key": "setting.lsp_active"
16 }
17 ]
18 },
19 {
20 "keys": [
21 "control+i"
22 ],
23 "command": "reindent"
24 },
25 {
26 "keys": [
27 "alt+c"
28 ],
29 "command": "show_panel",
30 "args": {
31 "panel": "console",
32 "toggle": true
33 }
34 },
35 {
36 "keys": [
37 "alt+h"
38 ],
39 "command": "dash_doc"
40 },
41 {
42 "keys": [
43 "ctrl+alt+p"
44 ],
45 "command": "prompt_select_workspace"
46 },
47 //LSP config
48 // Run Code Action
49 {
50 "keys": [
51 "alt+enter"
52 ],
53 "command": "lsp_code_actions",
54 "context": [
55 {
56 "key": "lsp.session_with_capability",
57 "operand": "codeActionProvider"
58 }
59 ]
60 },
61 //find ref
62 {
63 "keys": [
64 "alt+shift+r"
65 ],
66 "command": "lsp_symbol_references",
67 "args": {
68 "side_by_side": false,
69 "force_group": true,
70 "fallback": false,
71 "group": -1,
72 "include_declaration": false
73 },
74 "context": [
75 {
76 "key": "lsp.session_with_capability",
77 "operand": "referencesProvider"
78 }
79 ]
80 },
81 // Goto Definition
82 {
83 "keys": [
84 "ctrl+d"
85 ],
86 "command": "lsp_symbol_definition",
87 "args": {
88 "side_by_side": false,
89 "force_group": true,
90 "fallback": false,
91 "group": -1
92 },
93 "context": [
94 {
95 "key": "lsp.session_with_capability",
96 "operand": "definitionProvider"
97 },
98 {
99 "key": "auto_complete_visible",
100 "operand": false
101 }
102 ]
103 },
104 // Goto Declaration
105 {
106 "keys": [
107 "ctrl+shift+d"
108 ],
109 "command": "lsp_symbol_declaration",
110 "args": {
111 "side_by_side": false,
112 "force_group": true,
113 "group": -1
114 },
115 "context": [
116 {
117 "key": "lsp.session_with_capability",
118 "operand": "declarationProvider"
119 },
120 {
121 "key": "auto_complete_visible",
122 "operand": false
123 }
124 ]
125 },
126 //Rename
127 {
128 "command": "omni_sharp_rename",
129 "keys": [
130 "alt+r"
131 ]
132 },
133 // Jump to next Diagnostic in Tab
134 {
135 "keys": [
136 "alt+]"
137 ],
138 "command": "lsp_next_diagnostic",
139 "context": [
140 {
141 "key": "setting.lsp_active"
142 }
143 ]
144 },
145 // Jump to previous Diagnostic in Tab
146 {
147 "keys": [
148 "alt+["
149 ],
150 "command": "lsp_prev_diagnostic",
151 "context": [
152 {
153 "key": "setting.lsp_active"
154 }
155 ]
156 },
157 // Rename
158 {
159 "keys": [
160 "alt+r"
161 ],
162 "command": "lsp_symbol_rename",
163 "context": [
164 {
165 "key": "lsp.session_with_capability",
166 "operand": "renameProvider"
167 }
168 ]
169 },
170 // Format File
171 {
172 "keys": [
173 "alt+i"
174 ],
175 "command": "lsp_format_document",
176 "context": [
177 {
178 "key": "lsp.session_with_capability",
179 "operand": "documentFormattingProvider | documentRangeFormattingProvider"
180 }
181 ]
182 },
183 // Show Call Hierarchy
184 {
185 "keys": [
186 "ctrl+;"
187 ],
188 "command": "lsp_call_hierarchy",
189 "context": [
190 {
191 "key": "lsp.session_with_capability",
192 "operand": "callHierarchyProvider"
193 }
194 ]
195 },
196 // Show Type Hierarchy
197 {
198 "keys": [
199 "ctrl+'"
200 ],
201 "command": "lsp_type_hierarchy",
202 "context": [
203 {
204 "key": "lsp.session_with_capability",
205 "operand": "typeHierarchyProvider"
206 }
207 ]
208 },
209 // { "keys": ["ctrl+alt+e"], "command": "open_dir", "args": {"dir": "$file_path", "file": "$file_name"} }
210]
This one is very useful to quickly switch between different projects: prompt_select_workspace
Custom C# syntax setting to trigger autocompletion, when typing ‘. or <’:
1{
2 "auto_complete": true,
3 "auto_complete_selector": "source - comment",
4 "auto_complete_triggers": [ {"selector": "source.cs", "characters": ".<"} ],
5}
Custom Single File C++ build system to use clang:
1{
2 "cmd" : ["clang++", "${file}", "-Wall", "-std=c++17", "-o", "${file_path}/${file_base_name}"],
3 "selector" : "source.cpp",
4 "shell": true,
5 "working_dir" : "$file_path"
6}
The font I prefer: adobe-fonts/source-code-pro
C# project config
1{
2 "folders":
3 [
4 {
5 "follow_symlinks": true,
6 "path": ".",
7 "file_include_patterns":
8 [
9 "*.cs",
10 "*.shader",
11 "*.json",
12 "*.config",
13 "*.bytes",
14 "*.cginc",
15 "*.txt",
16 "*.log"
17 ],
18 "folder_exclude_patterns":
19 [
20 "Logs",
21 "Library",
22 "ProjectSettings",
23 "Temp"
24 ]
25 }
26 ],
27 "solution_file": "./SOLUTION.sln",
28 "settings":
29 {
30 "default_encoding": "UTF8",
31 "tab_size": 4
32 }
33}