Home > Article > Web Front-end > What are the methods to 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:
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 onUse `: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]*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`
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
Now just press `Esc` and type `confe` to edit `~/.vimrc`. Press `Esc` followed by `confr` to reload. Some people like to use the `c33af87806ab39541fc1c364c072d22a` key in `.vimrc`. So the above mapping becomes:
" Edit vimr configuration file nnoremap ve :e $MYVIMRC " Reload vimr configuration file nnoremap vr :source $MYVIMRC
The c33af87806ab39541fc1c364c072d22a` 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!