12 Sublime Text application tips and tricks to know

Source: Internet
Author: User
Tags sublime text editor



This article provides you with 12 tips and tricks for the sublime text editor, digging deeper into this seemingly concise code editor, hidden behind the endless possibilities of implementing various advanced features.


1) Select


Here are some shortcut keys for sublime text selection:


    • Command + DSelect a word
    • Command + LSelect a row
    • Command + ASelect All
      Ctrl + Command + M ' Check all the contents in parentheses (very useful when writing CSS or JS)


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:


    • CommandPressCommandand 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 pressingF5them 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. PressCommand + Shift + Pthe 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 + TList all tabs
    • Command + Shift + ]next tab page
    • Command + Shift + [prev Tab
    • Command + Ctrl + PToggle 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:


    1. PressCommand + Shift + FtheFindbox to enter the code you want to find. You can pressCommand + Ethe code snippet in the quick use selection.
    2. Wherespecify 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.
    3. ReplaceEnter the code you want to replace in the box, and press theReplacebutton to bulk replace it.




6) file crawler


PressCommand + Rto 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. SelectPreferences > Settings – Userthe 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 isF12.


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:


    1. Download and unzip the theme pack
    2. Click menuPreferences > Browse Packages…
    3. Copy the theme folder to thePackagesfolder.
    4. Click onPreferences > Settings – Usersthe 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:


    1. Download an icon that has.icnsthe best format. If not, convert it with IConvert.
    2. Terminal execution:open /Applications/Sublime\ Text.app/Contents/Resources/
    3. ReplacementSublime Text 3.icnsorSublime Text 2.icnsfile.




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/Packages"  
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.



Original: most-wanted Sublime Text Tips and Tricks



12 Sublime Text application tips and tricks to know


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.