Common vim operation skills and solutions for problems in linux

Source: Internet
Author: User
Common vim operation skills and solutions to problems in linux 1. common Command % jump to pair brackets [[jump to the beginning of the code block (but require that & amp; #39 ;{& amp; #39; must take a single line) gD jumps to the definition of a local variable & amp; #39; & amp; #39; jumps to the cursor's last stop... common vim operation skills and solutions to problems in linux 1. common Command % jump to pair brackets [[jump to the beginning of the code block (but require '{' in the code block to take a separate line) gD jumps to the definition of a local variable. ''jump to the place where the cursor was last docked. it's two '', not one." mx sets bookmarks, x can only be the 26 letters 'X of a-z to jump to the bookmarks ("'" is the key on the left of 1)> increase indentation, "x>" indicates adding the indentation of the following x rows <reducing indentation, "x <" indicates reducing the indentation of the following x rows 2. when you open a file in vim, edit the file, and save the file, if the following error occurs: eworkflow: Viminfo file is not wr To solve the problem of itable:/home/username/. viminfo, you need to do the following: 1) if it is a sudo vim, but there is no error prompt ~ /. The viminfo file was created with the administrator privilege at the time of creation. What you are using now is used by the current user. if you do not have the write permission at the time, an error will occur. Solution: Delete. viminfo with the administrator privilege. It is usually in the current user's directory. Or sudo rm ~ /. Viminfo 2) this solution is the same as most online solutions because the HOME variable is not set up. What needs to be done is: 1. echo $ HOME, which is not displayed. this is indeed because the HOME is not set. 2. vim ~ /. Modify the logon script for bash_profile, add the HOME variable 3, and add the following content: HOME =/root export HOME 4,: wq
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.