Phase 26 20180620 Vim

Source: Internet
Author: User

June 20 Task
5.1 Vim Introduction
5.2 Vim color display and move cursor
5.3 Vim General mode move cursor
5.4 Vim General mode copy, cut and paste


2018-04-18 17:55:31


Vim color display and move cursor

The same files may be available in different directories or not.

Look at the following example:

vim/etc/passwd

Copy/etc/passwd to/tmp/Open, there is no color

Then try adding a few lines of # comments, and the colors will be there. (GG first line, shift o can be transferred to the first row of the previous row and into the editing mode)

If you change the file name to passwd.sh, look.

So the color of the decision factors, such as change to. PY will be displayed according to Python rules

The address of the Vim configuration file is/ETC/VIMRC


General mode

Hjkl

Lower left top right

The space to the right number + space is to move to the right a few positions the same above HJKL also supports remembering numbers in front


CTRL B Turn backward on one screen

Ctrl f down one screen of the flip forward


Copy cut paste in general mode


DD is actually cutting this line

YY is copying this line

There's no good way to use it.



Go to edit mode now!


I enter edit mode

I (large i) enter edit at the beginning of the line where the cursor is located

o Start editing from the next line of the cursor

A (after) cursor so the character after the start of editing

A Enter the end of the line with I opposite



And finally, into command mode.


When replacing, G is the global meaning, replace all, otherwise it is only the first line found. In addition, the range must be real.


If the content to be replaced has/will conflict with the command. This can be done using the following methods:

Change the original/change to a different special symbol

: 1, $s ^love^pleased^g



: Nohl No high light does not highlight


: X Save exit similar to: WQ

The difference is that when viewed but not manipulated, Wq changes mtime x does not



In fact, there is nothing to say, is to practice more.


Phase 26 20180620 Vim

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.