Sublime Configuration and Use Skills

Time:2019-9-11

If you need VIM configuration, you can move on to VIM configuration for web front-end and node developers

Sublime 3 Configuration and Use Skills

The first step is to set settings

Here’s my personal favorite format configuration, in perferences – > Settings

{
  "Color_scheme": "Packages/User/SublimeLinter/MarkdownEditor-Dark (SL). tmTheme", //Color Style
  "Font_size": 16, // font size
  "Indent_using_spaces": true, /// using space indentation
  "Tab_size": 2, // indent 2 spaces at a time
  "Translate_tabs_to_spaces": true, //tab automatically converts to spaces
  "Trim_trailing_white_space_on_save": true, // Remove tail space when saving
  "Expand_tabs_on_save": true, // override tab settings when saving
  "Shift_tab_unindent": true, // make shift + Tab equivalent to command + {shortcut key
  "Spell_check": true, // open spell checking
  "Line_numbers": true, // display line number
  "Folder_exclude_patterns": [". svn", ". git", ". hg", "CVS", "node_modules"], /// Ignore lookup elements
   "Ignored_packages": ["Vintage"], //Ignore the plug-ins used
  "Ensure_newline_at_eof_on_save": true, // ensure that there is a blank line at the end of the file
  "Save_on_focus_lost": true, // stored when the focus is lost
  "Atmic_save": true // automatic storage
}

With respect to expand_tabs_on_save, we need to add additional Python code as follows:
1. Open Sublime’s Reference – > Browser Packages…
2. Create a new directory ExpandTabs On Save
3. New file ExpandTabs OnSave.py
4. Copy and save the following

import sublime, sublime_plugin, os

class ExpandTabsOnSave(sublime_plugin.EventListener):
  def on_pre_save(self, view):
    if view.settings().get('expand_tabs_on_save') == 1:
      view.window().run_command('expand_tabs')

Then attach markdown settings:

{
  "Color_scheme": "Packages/MarkdownEditing/MarkdownEditor-Dark.tmTheme", //Color Style

  "Tab_size": 2, // indent 2 spaces at a time
  "Translate_tabs_to_spaces": true, //tab automatically converts to spaces
  "Trim_trailing_white_space_on_save": true, // Remove tail space when saving
  "Auto_match_enabled": true, // automatic matching label

  // Layout
  "Draw_centered": false, // disable centered alignment
  "Wrap_width": 0, // automatic line wrapping, no default line width

  // Line
  "Line_numbers": true, // display line number
  "Highlight_line": true // highlight the current line
}

Step 2: Install package control

https://packagecontrol.io/ins…

Sublime Configuration and Use Skills

clickctrl + ~(Or click on the menu view – > show console), copy and paste the part of the picture in the link above, and return.

Step 3: Install plug-ins

Installation Method 1: Shortcut Keysctrl+shift+p(mac: command+shift+p) inputinstall packageEnter and enter the name of the package you want to install.

Installation Method 2: Of course, you can also open the Browse Packages folder, and then go to GitHub and other platforms clone under the relevant plug-ins can be placed here.

Regardless of the method, remember to restart sublime after loading (not all plug-ins need to restart, but it’s okay to restart once)

Here are just a few of the plug-ins I usually use. If you know there is a better one, you are welcome to recommend it.

  • * Sublime Linter: The new version does not simply put all Linters in one package, but allows users to select and install their frequently used Linters when upgrading.
  • * Emmet: HTML + CSS plug-in, simplified input, fast matching, front-end development must be installed;
  • * JavaScript Next: ES6 grammar plug-in (of course, you can also use Babel, which is more powerful);
  • Babel: This one is stronger than the last one.
  • Css3_syntax: CSS3 grammar library;
  • Sass Build: Sass plug-in,command + BActivate use;
  • Side Bar Enhancements: Enrich the right-click menu in the sidebar;
  • Git: Integrate Git into Sublime so that you can run Git commands in SublimeText.
  • Markdown Editing: Markdown grammar;
  • Markdown Perview: Markdown preview;
  • MarkdownTOC: Automatically generate directories for Markdown documents
  • Color Highlighter: Colour selection and color preview;
  • DocBlockr: Generate document paradigms to help add standard comment blocks;
  • Less: Les grammar is highlighted;
  • Converting Less 2 CSS less to CSS
  • SublimeCodeIntel: Auto-filling, supporting almost all languages;
  • Autoprefixer: automatically add CSS browser compatible prefix;
  • Angular JS: Angular JS grammar library;
  • JsFormat: JavaScript serialization;
  • CssFormat: CSS serialization;
  • YUI Compressor: Code compression;
  • Fix MAC path: fix the path problem of plug-in packages under mac
  • Tern_for_sublime: Cursor-assisted operation
  • SublimeREPL: Python Compile and Run Plug-ins

Less 2 CSS requires less packages under Mac and can be installed as needed:

> npm install less -gd
> npm install less -g less-plugin-autoprefix
> npm install less -g less-plugin-clean-css

Less 2 CSS needs to install Less C and configure environment variables under Windows

Other

Delete Library

Method 1: Delete the corresponding folder in perferences – > Browse Packages.

Method 2: Keyboard shortcutsctrl+shift+p(mac: command+shift+p) inputremove packageEnter and enter (find) the name of the package you want to delete. Enter.

Regardless of the method, remember to restart sublime after deletion (not all plug-ins need to restart, but it’s okay to restart once)

Shortcut keys

Sublime Configuration and Use Skills

Note: Pictures are from the Internet

  1. File operation
Mac shortcut keys Win/linux shortcuts Function description
⌘N ctrl + N new file
⌘O ctrl + O Open file
⌘S ctrl + S Save file
⌘⇧S ctrl + shift + S Save file
⌘⌥S Save all files
⌘W Ctrl + W close current file
  1. Text editing
Mac shortcut keys Win/linux shortcuts Function description
⌘A ctrl + A All election
⌘C ctrl + C copy
⌘X ctrl + X shear
⌘V ctrl + V paste
⌘/ ctrl + / Notes
⌘⌥/ ctrl + shift + / Block Comments
⌘Z ctrl + Z Revoke
⌘Y ctrl + Y Resumption of cancellation
⌘⇧↩ Ctrl + Shift + Enter Insert a new line before the current line
⌘↩ Ctrl + Enter Insert a new row after the current row
^⇧K Ctrl + Shift + K Delete row
⌘⇧D Ctrl + Shift + D Duplicate (multiple) rows
⌘J ctrl + J Merge (multiple) rows
⌘KK Ctrl + K + K Delete from cursor to end of line
⌘K⌫ Delete from the cursor to the beginning of the line
⌘KU ctrl + K + U Change to capitalization
⌘KL ctrl + K + L Change to lowercase
⌘⇧V Ctrl + Shift + V Paste and indent automatically
⌘⌥V Ctrl + K + V Choose Paste from History
⌘] tab Indent to the right
⌘[ shift + tab Indent to the left
⌘^↑/↓ Ctrl + shift + ↑/↓ Exchange 2 rows
⌘⌥] Ctrl + shift + ] Expand label
⌘⌥[ Ctrl + shift + [ Fold Close Label
⌘⌥KJ Ctrl + K + J Expand all labels
⌘⌥KT Ctrl + K + T Fold Label Properties
⌘⌥Kn Ctrl + K + n Fold Grade n Label

Cursor, selection operation

Mac shortcut keys Win/linux shortcuts Function description
⌘U ctrl + U Soft Undo (Revocable Cursor Move)
⌘⇧U ctrl + shift + U Soft Redo (Redo Cursor Move)
⌘L ctrl + L Select rows (repeatedly press to add the next row to the selection)
⌘D Ctrl + D Choose words (multiple choices of the same word for multiple editing when pressing repeatedly)
⇧↑/↓ shift + ↑/↓ Select multiple lines up/down.
⇧←/→ Shift + ←/→ Select the Chinese text to the left/right.
^⇧M ctrl + shift + M Expand the selection to the corresponding parentheses
^⇧A ctrl + shift + A Expand the selection to the corresponding label
^⇧A ctrl + shift + Space Expanding constituencies to corresponding scopes
^⇧↑/↓ ctrl + ↑/↓ Expand the selection to the beginning/end of the file.
⌘⇧L Ctrl + Shift + L Converting constituencies into multiple single-line constituencies
^⇧←/→ Ctrl + Shift + ←/→ Select the Chinese text in units to the left/right.
^- ctrl + - The cursor jumps back to the previous position
^⇧- ctrl + shift + - Cursor Restoration Position
⌥←/→ Ctrl + ←/→ Move the cursor to the left unit and move the cursor quickly.
⌘⇧↑/↓ Ctrl + Alt + ↑/↓ Add a multi-line cursor up/down to edit multiple lines at the same time.

Find Replacement Operations

Mac shortcut keys Win/linux shortcuts Function description
⌘f ctrl + f lookup
⌘⌥f chrl + h Find and replace
⌘⌥g Find the next one that matches the current selection
⌘^g Find all content that meets the current selection for multiple editing
⌘⇧F ctrl + shift + f Find in all open files

Window operation

Mac shortcut keys Win/linux shortcuts Function description
⌘⇧N Ctrl + Shift + N Open a new sublime window
⌘⇧W Ctrl + Shift + W close window
⌘^F F11 Full screen
⌘⇧^F Shift+F11 Full-screen interference-free mode, edit only current files
⌘⌥[1,2,3,4,5,8,9] Alt + Shift + [1,2,3,4,5] The splitting windows are single column, double column, three column, four column, grid, double row and three row.
^[1,2,3,4] ctrl + [1,2,3,4] Focus moved to the appropriate group (split-screen number)
^⇧[1,2,3,4] ctrl + shift + [1,2,3,4] Move the current file to the appropriate group (split-screen number)

Jump operation

Mac shortcut keys Win/linux shortcuts Function description
⌘[1,2,3,4] alt + [1,2,3,4] Select the appropriate tab
^Tab ctrl + tab Switch back the open file in the window
^⇧Tab ctrl + shift + tab Switch back the open file in the window
⌘P ctrl + P Jump to everything
⌘T Go to document
⌘^P Go to project
⌘R ctrl + R Go to symbol
⌘⇧P ctrl + shift + P Go to Symbol Item Symbol
^G ctrl + G Go to bank
^- Alt + G Back off
^⇧- Alt + shift + G Forward
⌘KB Ctrl + K + B Switch side bar
^~ ctrl + ~ mmc
Esc Esc Exit cursor multi-line selection, exit search box, command box, etc.
^M ctrl + M Jump to the corresponding parentheses