Atom Editor Getting Started to Master (iii) text editing basics

Source: Internet
Author: User

As an editor, the function of text editing is naturally placed first, this section will summarize the common methods and techniques of text editing, mastering these skills can greatly improve the efficiency of text editing

Note that the shortcut keys used in this section are under Mac, and if you use a system that is win or Linux, it may be a little different.

Cursor movement

Moving the cursor during the editing of text is a very high-frequency operation.
We should not only be satisfied with the mouse or keyboard of the direction key of this inefficient operation to move the cursor, let us see what can greatly improve the efficiency of the editing method.

Move cursor up or down
    • The cursor moves to the previous line: Ctrl+P or Up
    • The cursor moves to the next line: Ctrl+N or Down
    • The cursor moves to the file header: Cmd+Up
    • The cursor moves to the end of the file:Cmd+Down
Move cursor Around
    • The cursor moves one character to the left: Ctrl+B or Left
    • The cursor moves one character to the right: Ctrl+F or Right
    • The cursor moves one word to the left: Alt+B or Alt+Left
    • The cursor moves one word to the right: Alt+F or Alt+Right
    • Move the cursor to the wardrobe: Ctrl+A or Cmd+Left
    • The cursor moves to the end of the line: Ctrl+E orCmd+Right
Move to a specified row/column

Use the shortcut key Ctrl+G to call out the cursor to move the window, fill in and 行:列 Enter to move the cursor to the specified position

Inter-symbol jump

The symbols here refer Symbols to the function names in the code, variable names, etc.
Search for and jump to symbols in the current document:Cmd+R
Search within the project and jump to the symbol:Cmd+Shift+R

Cmd+Shift+RNeed tags file support, if you have previously used vim and other editors should be familiar with this mechanism

Using bookmarks
    • Cmd+F2: Creates or cancels bookmarks on the current line
    • Ctrl+F2: List all bookmarks
    • F2: Jump to Next Bookmark
    • Shift+F2: Jump to previous Bookmark
Choose

In Atom, if you want to select content while moving the cursor, just add it in the move shortcut Shift .

Up and down selection
    • Select one line up: Ctrl+Shift+P or Shift+Up
    • Select one line down: Ctrl+Shift+N or Shift+Down
    • Select the current location to the file header: Cmd+Shift+Up
    • Select the current location to the end of the file:Cmd+Shift+Down
Left and right choice
    • Select one character to the left: Ctrl+Shift+B or Shift+Left
    • Select one character to the right: Ctrl+Shift+F or Shift+Right
    • Select a word to the left: Alt+Shift+B or Alt+Shift+Left
    • Select a word to the right: Alt+Shift+F or Alt+Shift+Right
    • Select to a wardrobe to the left: Ctrl+Shift+A or Cmd+Shift+Left
    • Select to end of line to the right: Ctrl+Shift+E orCmd+Shift+Right
Other options
    • Cmd+L: Select when forward
    • Cmd+A: Select All
    • Ctrl+Shift+W: Select the current word
Text Edit and delete basic operations
    • Ctrl+T: Exchanging the characters before and after the cursor
    • Cmd+J: The next line to the end of the current row
    • Ctrl+Cmd+Up/ Ctrl+Cmd+Down : Moves the current line up/down one line
    • Cmd+Shift+D: Copy When moving forward
    • Cmd+K, Cmd+U: Enter two shortcut keys consecutively to capitalize the current word
    • Cmd+K, Cmd+L: Enter two shortcut keys consecutively to convert the current word to a lowercase letter
    • Cmd+Alt+Q: Paragraph rearrangement (useful when writing in English)
Delete and cut
    • Ctrl+Shift+K: Delete When moving forward
    • Cmd+Backspace: Delete from current cursor to wardrobe
    • Cmd+Delete: Delete from current cursor to end of line
    • Alt+Backspace/ Alt+H : Delete from current position to Word header
    • Alt+Delete``Alt+D: Delete from current position to end of word
Multiple cursor selection

Multiple cursor selection is a feature of Sublimetext, and Atom can now support it, using the following methods:
* Add a new cursor: press Cmd and hold the key and click or select the location where you want to add a new cursor
* Cmd+Shift+L : Turns the selected multiline into a multi-cursor form
* Cmd+D : Select the next word with the same word as the current cursor (or the same word as the currently selected word)
* Ctrl+Cmd+G : Select all words with the same word as the current cursor (or the same word as the currently selected word)


Multiple cursor selection makes it easy to edit multiple code at the same time

Brackets and quotation marks

Atom has a lot of support for parentheses and quotes, including:
When the cursor is on parentheses (including {}), it highlights the other half of the parentheses. Similarly, Atom also supports highlighting XML and HTML tags
Auto-complete Brackets {},[], (), quotation marks ", ', '
Select a piece of text and enter parentheses or quotation marks to automatically add parentheses or quotation marks around the selected text
Use Ctrl+M allows the cursor to jump to the adjacent parentheses, and then press the shortcut cursor to jump to another corresponding parenthesis
Use Ctrl+Cmd+M to select all content in the current parenthesis
Use Cmd+Alt+. a label that complements the xml/html, such as <body> typing and then Cmd+Alt+. automatically adding </body>

File encoding

When you open a text file, Atom automatically determines how the file is encoded, and if it is not recognized, it defaults to UTF-8.
You can use Ctrl+Shift+U to call out the Encoding Selection window and manually select the encoding of the file

Find and replace

Atom looks the same way as most editors
Use Cmd+F for in-file lookups

Use Cmd+Shift+F for in-project lookups

Enter the text you want to find in the Find window to use a carriage return or Cmd+G jump to the result of the next lookup
In the Find window, you can also set options for using regular expressions, case sensitivity, finding the selected block, finding the entire word, and more.
In multi-file lookups, you can also File/directory pattern restrict queries to only a few files by entering a wildcard in the text box

Atom Editor Getting Started to Master (iii) text editing basics

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.