Vim Common techniques

Source: Internet
Author: User

In the process of learning vim, the following are recorded for common use tips:
1,: w!sudo tee% when you use ordinary users do not have write permission is very useful.

2,: Earlier 5s restore files to 5s before, you can m,h and so on

3, you learned CTRL + [instead of ESC but CTRL + C is also good

4, Command mode ni-<esc> continuous insertion n-, such as 29i-<esc> continuous insertion of 29-write split line when it is convenient

5, sometimes Ctrl + V paste, actual * and + these two global registers. "+p lets you paste content from the system Clipboard into Vim without losing formatting

6, put Vim:se ft=c ts=2 sw=2: Alone with a line of comments can let vim to not automatically identify the files to make some settings. Where: Between the commands, you can overload the settings in VIMRC. Can be placed at the beginning or end of a file

7, CTRL + X, CTRL + F can identify ~ and $HOME/variable

8, set Wildmenu can help you in the command line complete function, take you into the completion of the civilized era. But ask Laststus >= 2

9, set followed by a variable, followed by one? You can view the value of a variable e.g. SE ls? Output Laststatus=1 is particularly useful when setting options for VIMRC

Vim Common techniques

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.