Sublime Text is great, but a few settings should be enabled as default to make the experience even better. Open your user setting file by pressing command + , on Mac or ctrl + , on windows. Or go to Preferences -> Settings - User:
TL;DR: just copy and paste the following chunk into your user setting file:
and the following to Preferences -> Key Bindings - User:
Got 5 mintues to read?
Show current location on minimap
By default, the minimap does not highlight your current location. Use this setting to turn it on:
Convert tabs to spaces
It is import to convert tabs to white spaces when coding in Python, Ruby, YAML etc. To do that:
Indentation by 4 spaces or 2 spaces depend on the language, it is better off to set the tab_size property separately for different file types. For instance, if I code in Python, I want the tab size to be 4 spaces. If I code in Ruby, I want it to be 2. To do this,
- Open a new document and click the bottom right corner (which says Plain Text) and set the language type to Python for instance
- Go to Preferences -> Settings - More -> Syntax Specific - User
- A file named ** Python.sublime-settings ** should be opened
Add the following lines:
Enable word wrap
Find highlighted text
When you have a phrase highlighted and press command + f to look it up in the document, the highlighted word is not automatically copy and pasted to the Find dialog box. This can be fixed by:
Scroll past the end of the document
It is sometimes awkward to look at lines at the bottom of the screen. You can actually scroll the windows pass the last line of the document:
Highlight indentation level
When writing in a language that requires multiple levels of indentations (like Python), highlighting the current indentation the cursor is in makes finding yourself within the nested code structure easier:
You can find a screenshot of this on Wes Bos' blog.
Adjust line height to increase readability
The default line height is too narrow for the eyes. Change it to a number that looks more comfortable:
Highlight tabs with unsaved changes
Ensure newline at end of file on save
UNIX/Linux convention is to have a newline at the end of the file. When collaboration with people using different OS, this is important:
You may attempt to set this as well:
But this can be hazardous if you write in Markdown. Because two trailing white spaces in Markdown means a newline character. A workaround proposed by this blog is to set the setting to True in the user setting file and set it to false in the Mardown syntax file.
Make folder name bold in the sidebar
Paste code without having to fix indentation
This is definitely an annoying issue that everybody encounters all the time. When you copy and paste a block of indented code, the indentation on certain lines of the copied code is guaranteed to be messed up.
Sublime Text acutally has an Paste and Indent option which fix this issue but it is bind to command+shift+v instead of command+v. To fix this, Open Preferences -> Key Bindings - User and paste the following lines: