Linux Learning notes seven ———— the Linux common commands editor, server

Source: Internet
Author: User
Tags sublime editor sublime text

<1>gedit Editor

Gedit is a text editor in a Linux environment, like a WordPad program under Windows, which is appropriate for a basic text editor without the need for a particularly complex programming environment.

<2>sublime Editor

Sublime text is a code editor (Sublime text 2 is a paid software, but can be tried indefinitely)

Sublime text was developed by the programmer Jon Skinner in January 2008 and was originally designed as a vim with extensive functionality.

Sublime text has a beautiful user interface and powerful features such as code thumbnails, Python plugins, code snippets, and more.

You can also customize key bindings, menus, and toolbars. The main features of Sublime Text include: Spell checker, bookmarks, full Python API, Goto feature, instant item switching, multiple selection, multiple windows, and more.

Sublime Text is a cross-platform editor that supports operating systems such as Windows, Linux, Mac os X.

<3> God-vim Editor(1) VI Introduction

VI is the abbreviation of "Visual interface", its status on Linux as if the edit program on DOS. It can perform many text operations, such as output, delete, find, replace, block operations, and so on, and users can customize them according to their own needs. VI is not a typesetting program, it is not like word or WPS can be the font, format, paragraph and other properties of the orchestration, it is just a text editing program. VI There are no menus, only commands, and commands are numerous.

Vi有三种基本工作模式:+  命令模式+  文本输入模式+  

    • Command-line mode

At any time, no matter what mode the user is in, just click the ESC key to get VI into the command mode; we enter the Launch VI command under the shell environment (prompt $), which is also in this mode when you enter the editor. In this mode, users can enter a variety of legal VI commands for managing their own documents. Any character entered from the keyboard is interpreted as an edit command, and if the input character is a valid VI command, VI completes the corresponding action after accepting the user command. Note, however, that the commands you enter are not displayed on the screen. If the input character is not a legal command of VI, VI will ring the alarm.

    • Text input mode

Enter the input command in command mode i, attach command A, open command O, modify command C, replace command R or Replace command s can enter the text input mode. In this mode, any characters entered by the user are saved by VI as the contents of the file and displayed on the screen. In the text input process, if you want to return to the command mode, press ESC.

    • Last-line mode

The last line mode is also known as ex escape mode. In command mode, the user presses the ":" Key to enter the last row mode, at which time VI displays a ":" As a prompt in the final row of the display window (usually the last line of the screen), waiting for the user to enter a command. Most file management commands are executed in this mode (such as writing the contents of the edit buffer to a file medium). After the last command is executed, VI automatically returns to the command mode. For example:

:sp newfile

A window is edited to edit the NewFile file. If you want to convert from command mode to edit mode, you can type command a or I, and if you need to return from text mode, press ESC. Enter ":" in command mode to switch to the last line mode and enter the command.

(2) Vim base operation

Vim is a text editor developed from VI. Code completion, compilation and error jump and other convenient programming features are particularly rich

To enter insert mode from the command line:

I: Insert cursor before one character I: Insert line A: Insert cursor after a character a: insert row not o: New line down, insert beginning O: New line up, insert start

  

Enter Command mode:

ESC: Enter command mode from insert mode or last line mode

To move the cursor:

H: Move left J: Move Down K: Move up L: Shift right M: cursor moves to middle row l: Cursor moves to the beginning of the last line of the screen G: move to the specified line, line number-GW: Move backward one word at a time B: Move forward one word at a time {: Move by Segment}: Move Down ctr-d: Down Turn half screen ctr-u: turn up half screen ctr-f: Turn down one screen ctr-b: turn upside down one screen GG: The cursor moves the file at the beginning G: Cursor moves to the end of the file

  

Delete command:

X: Delete the cursor after a character, equivalent to Del X: Delete the first character of the cursor, equivalent to Backspacedd: Delete the cursor line, n DD Delete the specified number of rows D: Delete the cursor after all the contents of the bank, including the character of the cursor D0: Delete all contents of the cursor, do not include the character D W: Delete the word at the beginning of the cursor, containing the character of the cursor

  

Undo command:

U: Step by step undo Ctr-r: Anti-undo

  

Repeat command:

.: The command that repeats the last action

  

Text line movement:

>>: Text line moves right <<: Text line moves left

  

Copy and paste:

YY: Copy the current line, n yy copy n line p: A new line is opened at the cursor position, paste

  

Visual mode:

V: Move by character, select text V: Move by line, select the text visual mode can match D, y, >>, << implement the deletion of the text block, copy, move left and right

  

Replace operation:

R: Replace the current character R: replaces the character after the current line cursor

  

Find command:

/: STR lookup N: Next N: Previous

  

Replace command:

Replace all ABC with 123

末行模式下,将光标所在行的abc替换成123
:%s/abc/123/g

  


 

In Vim, execute the shell command:

末行模式里输入!,后面跟命令

 

-----------------------------------------------

Source: Organize from Network

Linux Learning notes seven ———— the Linux common commands editor, server

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.