Linux eighth session-vim editor

Source: Internet
Author: User
Tags line editor

Linux Eighth session

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

42. VIM Basic Concept

Vi:visual Interface, Text editor

Text editing type: line editor: sed, full screen editor: Nano, VI

Vim-vi improved, an upgraded version of the Vi editor

Other editors

Gedit A simple graphical editor that gvim a graphical version of the Vim editor, both of which need to be created in graphical mode.

Vim + Number: The Vim editor jumps directly to the number line after opening the file

vim+ Regular expression: When you open a file, leave the cursor at the beginning of the first line that matches the regular expression

–B file binary mode open files

–d file1 file2 ... Compare multiple Files

-m file read-only open files

Ex file or vim–e directly into ex mode

If the file exists, the file is opened and the content is displayed

If the file does not exist, create it when you save it for the first time after editing


43. Three modes of VIM editor

Three main modes:

Command (Normal) mode: The default mode, move the cursor, cut/paste text, the screen only the cursor flashing;

Insert (insert) or edit mode: Modify text with insert at the bottom of the screen

Extended commands (Extended command) mode: Save, exit, etc., below the screen is:

ESC key to exit the current mode

ESC key always returns to command mode

Extended mode:

: Q exit

: q! Force exit, discard the modifications made

: Wq Save Exit

: X Save exit

Command mode

ZZ: Save exit

ZQ: Do not save exit


44. Extended Mode key operation

Press ":" to enter the extension mode and create a command prompt: On the left side of the screen at the bottom

Command:

W Write (Save) disk File

Wq Write and exit

X Write and exit

Q exit

Q! Do not save the log out, even if the changes are lost

R filename reads the contents of the file into the current file

W FileName writes the current file contents to another file

!command Execute command

R!command read-in command output


Linux eighth session-vim editor

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.