1) Select
Here are some shortcut keys for sublime text selection:
Sublime text also supports the operation of selecting multiple rows at once: Furthermore, Sublime Text brings lets us select multiple lines at once, which can significantly b Oost your productivity. There is several ways to perform this feature:
Command
Press Command
and hold the key and click the line you want to select
Command + Ctrl + G
(When partial text is selected) Press this key to select all the same text
Command + D
(When partial text is selected) directly selects the next occurrence of the text
2) CSS Sorting
The order of CSS properties is generally not important because the browser is rendered correctly in any order. But sorting all the properties still helps the code to be neat. In sublime text, you can sort by selecting the CSS properties and pressing F5
them in alphabetical order.
You can also use third-party plug-ins such as Csscomb to control the sorting method in more detail.
3) command Panel (Palette)
Use the command panel to quickly accomplish multiple tasks. Press Command + Shift + P
the Bring up panel and type the command you want. Look at a few examples below:
Renaming files
Set file as HTML syntax
Inserting Code Snippets
4) Toggle tab and Project
When you open multiple tabs at the same time, you can switch between them with the following hotkeys:
Command + T
List all tabs
Command + Shift + ]
Next tab page
Command + Shift + [
Prev Tab
Command + Ctrl + P
Toggle Side Bar Display Project
5) Cross-file editing
The same editing operation can be repeated in multiple files at the same time. For example, when you have the same piece of code in multiple files, you can quickly edit it using the following steps:
Press Command + Shift + F
the Find
box to enter the code you want to find. You can press Command + E
the code snippet in the quick use selection.
Where
specify the range of files you want to look up in the box, or fill in the file to find the files that are <open files>
currently open.
Replace
Enter the code you want to replace in the box, and press the Replace
button to bulk replace it.
6) file crawler
Press Command + R
to list all CSS selectors in the document. You can select and jump to view immediately. This operation is much faster than using the general "find" function.
7) spell check
If you often use sublime text for English authoring, it is useful to enable spell checking. Select Preferences > Settings – User
the menu and add the following code:
"Spell_check": true,
8) Enhanced Sidebar
The Sidebarenhancements plugin effectively improves the sidebar of the sublime text. After installing the plugin, right-click on the sidebar to find new features: Open in Explorer, new file, new folder, ... Open, open in the browser.
Note: The hotkey that is opened in the browser is F12
.
9) Change Theme
Sublime text can be replaced by the appearance theme. Soda theme is a good topic that can be installed in the Package manager.
If the topic you want to install is not in the online repositories, you can also install it manually:
Download and unzip the theme pack
Click menuPreferences > Browse Packages…
Copy the theme folder to the Packages
folder.
Click on Preferences > Settings – Users
the menu and add the following code:"theme": "Soda Light.sublime-theme"
10) Replace the sublime text program icon
Not only can the theme be changed, but also the icon. There are plenty of redesigned sublime text icons on the dribbble. Replacement method:
Download an icon that has .icns
the best format. If not, convert it with IConvert.
Terminal execution:open /Applications/Sublime\ Text.app/Contents/Resources/
Replacement Sublime Text 3.icns
or Sublime Text 2.icns
file.
11) Sync Options
If you are working on more than one computer, synchronizing option settings should be a good idea. We use Dropbox to complete this task.
First, run the following command in the terminal to upload the settings file:
mkdir $HOME/dropbox/sublime-text-3/mv "$HOME/library/application support/sublime text 3/packages" "$HOME/dropbox/ sublime-text-3/"MV" $HOME/library/application support/sublime text 3/installed Packages "" $HOME/dropbox/ sublime-text-3/"
Then run the following command on all computers that need synchronization to download the settings:
Dstpath= "$HOME/library/application support/sublime Text 3" dropbox_path= "$HOME/dropbox/sublime-text-3" RM-RF "$ dstpath/installed Packages "RM-RF" $DSTPATH/packages "mkdir-p" $DSTPATH "ln-s" $DROPBOX _path/packages "" $DSTPATH/pac Kages "Ln-s" $DROPBOX _path/installed Packages "" $DSTPATH/installed Packages "
12) Clickable URL
Using the widget Clickableurls allows the URL in the file to be clicked.
12 Sublime Text application tips and tricks to know