Vim Learning Path (1)-vim basic operation

Source: Internet
Author: User
Tags save file

Introduction: Speaking of my Learning path from the arm embedded development began, basically in school when the Windows development began, go to Ubuntu embedded development is very not used to start. Without the mouse is very difficult to get, we do not feel the same, but after I contacted the study of Vim, my view was completely changed. I will start with my learning experience from a novice, step-by-step for everyone to bring me the path of vim learning.

If you are not just beginning to learn vim please skip this paragraph.

Install Vim:

Just installing the Ubuntu system is no self-bringing vim required to install the sudo apt-get install vim;

Let's start with some basic operations to learn this powerful code-editing development tool step-by-step!

File operation:: E filename New Open a file: W Save file: Wq Save and exit: Q Exit File:!q Force exit file in Vim, there are different save exits: X writes to the file and exits (writes only when the file is modified and updates the file and modification time; otherwise, the file is not updated Modified time): Wq and ZZ Force write and exit (file not modified also force write, and update file modified time) operation fallback and recovery: U back to last Operation U Bank change recovery ctrl+r do action contrary to u operation Move operation:J Move down one line K move up a row h move left a column L move right one column 0 move to the beginning $ move to end W move to the next word start e move to the next word end FX moves to the first occurrence of the X-letter position after the TX moves to the bank the first occurrence of the X-letter last position GG jumps to the end of file NG moves to nth row, or with: N can also {last paragraph,} Next paragraph (blank line distinction) [function starts,] function ends (c file valid)% jumps to matching parentheses at the scrolling action:

Ctrl-u Scrolls the text down half-screen. The window that corresponds to the display text is rolled up half-screen. The number of lines at which the cursor is positioned changes with the scrolling screen.

Ctrl-d the text to scroll up half-screen. The window that corresponds to the display text rolls down the half screen. The number of lines at which the cursor is positioned changes with the scrolling screen.

Ctrl-e Scrolls the text up one line. The number of lines at which the cursor is located does not change.

Ctrl-y Scrolls the text down one line. The number of lines at which the cursor is located does not change.

Ctrl-f Scrolls forward a full screen. The cursor is in the first row after scrolling.

Ctrl-b Scroll back one full screen. The cursor is on the last line after scrolling.

ZZ puts the current position in the center of the screen.

ZT puts the current position at the top of the screen. Help Note: Top.

ZB the current position at the bottom of the screen. Mnemonic: Bottom.

Text manipulation: D cut, double-click Cut line y copy, double-click Copy row p paste x Delete the current cursor under the character R to replace the current cursor character, followed by the replacement character: s/old/new/g Global replace old to new mode toggle Insert Mode I enter insert mode, the current insertion cursor position insert a Enter insert mode, the next cursor position insert O into insert mode, the next line in the current row insert O into the insert mode, a row on the current line to insert

Configurable vim to mouse cursor positioning mode

Visualization mode: v enters visual mode replacement mode: R enters replacement mode using external commands:! After! Add external command to find:/ After/after adding the content to find, go to find, press N to find the next, n find the previous above is basically we commonly used some operations, there are a lot of features need us to explore, to practice, the road long its repair far XI ... Continuous update ...

Vim Learning Path (1)-vim basic operation

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.