Where is the vim configuration file? (Windows)

Source: Internet
Author: User

If you have been using Vim for a while, you will want to modify some of its configurations, such as displaying the row number by default. Where can I change it?

The answer is:Vimrc

Where is this configuration file?

Open your VI and enter [: Version] in command mode. The following content is displayed:


Therefore, find the vimrc file (or "_ vimrc") in your vim installation directory ("$ Vim" in the image ").


How to use it? For example:

[I want to achieve this-when I use Vim to open a file, the number of lines is displayed by default]

VI does not display the number of rows by default. You must enter [: set number] in command mode ]. This command only applies to the current window. You can open other documents. If you want to display the number of rows, you have to repeat the SET command.

With the configuration file, you don't have to worry about it. Open your [_ vimrc] File, enter [set number] In the last line of the file, and save.

In this way, all the files you open in the future will have a row number.


This is just a small feature, for example.

It can also define its own commands, such as deleting empty lines, so you don't have to remember the hard-to-remember regular expression. Just write it in the configuration file and give it a name (for example: XYZ). Then, enter [: XYZ] to delete empty rows. (I will not repeat this article)


In addition, VIM also comes with a vimrc sample file, vimrc_example.vim

My directory is like this: [$ Vim \ vim73 \]


For other operating systems, see: http://easwy.com/blog/archives/where-is-vimrc/


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.