Home > Web Front-end > JS Tutorial > What are the methods to reload .vimrc without restarting Vim?

What are the methods to reload .vimrc without restarting Vim?

php中世界最好的语言
Release: 2018-04-11 14:00:09
Original
2588 people have browsed it

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

This time I will bring you the methods of reloading .vimrc without restarting Vim, and reloading .vimrc without restarting VimNote What are the matters? Below are practical cases. Let’s take a look.

Vim is a free and open source editor that is upward compatible with Vi. It can be used to edit all kinds of text. It is particularly useful when editing programs written in C/Perl/Python. You can use it to edit Linux/Unix configuration files. ~/.vimrc is your personal Vim initialization and customization file.

How to reload .vimrc without restarting the Vim session

filetype
 indent plugin on set number syntax on
Copy after login

Use `:wq` to save the file and exit from the `~/.vimrc` window

Enter any of the following commands to reload `~/.vimrc`: `:so $MYVIMRC` or `:source ~/.vimrc`.

[![How to reload .vimrc file without restarting vim][1]][1]
Copy after login

*Figure 1: Edit ~/.vimrc and reload it if needed without exiting vim, so you can continue editing your program*

`:so[urce]! {file}` This vim command will extract data from a given file such as `~/.vimrc`

Read configuration. These commands are executed in normal mode just as you type them. When you use `:global`, :`argdo`, `:windo`, `:bufdo` Later, in a loop, or following another command, the display no longer updates when the command is executed.

How to set keys to edit and reload ~/.vimrc

Follow your `~/.vimrc` with this:

" Edit vimr configuration file nnoremap confe :e $MYVIMRC " Reload vims configuration file nnoremap confr :source $MYVIMRC
Copy after login

Now just press `Esc` and type `confe` to edit `~/.vimrc`. Press `Esc` followed by `confr` to reload. Some people like to use the `` key in `.vimrc`. So the above mapping becomes:

" Edit vimr configuration file nnoremap ve :e $MYVIMRC " Reload vimr configuration file nnoremap vr :source $MYVIMRC
Copy after login

The ` key is mapped to the `` key by default. So just type `` followed by `ve` to edit the file. Press `` followed by `vr` to reload `~/vimrc`.

That's done, you can reload `.vimrc` without restarting Vim.

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

What are the reasons why using v-show in vuejs does not work

detailed explanation of vue calculated properties

The above is the detailed content of What are the methods to reload .vimrc without restarting Vim?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template