Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to export my current vim maps and functions as a .vimrc?

Tags:

vim

I lost my latest version of my .vimrc and I have no snapshots of it anywhere but I do have a vim still open that has the new functions and mappings. I was hoping that maybe someone would know how to "export" that running vim's maps and functions out to a file so I could recreate the .vimrc?

like image 520
stephenmm Avatar asked Oct 06 '10 22:10

stephenmm


People also ask

How do I create a vimrc file?

Opening vimrc Using file name completion, you could type :e $M then press Tab until you see the desired variable. If you only want to see the path, type :echo $M then press Tab to see the variable, and press Enter. In gvim, the Edit menu includes "Startup Settings" which will use $MYVIMRC to edit your vimrc file.

What is a vimrc file?

A VIMRC file is a settings file used by the Vim text editor. It stores settings for the editor that are loaded when the editor is opened.

Where does Vim look for vimrc?

According to the help menu (see :help $MYVIMRC ), vim will look for a user vimrc in specific places. It look first for ~/. vimrc and then for ~/. vim/vimrc .

Does Neovim use vimrc?

Neovim uses $XDG_CONFIG_HOME/nvim instead of ~/. vim as its main configuration directory and $XDG_CONFIG_HOME/nvim/init. vim instead of ~/. vimrc as its main configuration file.


1 Answers

Use :mkvimrc (or :mksession if you also want to save any buffer-local state too).

like image 91
Pi Delport Avatar answered Oct 24 '22 16:10

Pi Delport