How to copy vim parameter value to register

In vim, you can set an option with :set . for instance

: set spell

to enable spell management. AND

: set spellfile = / home / custom_spell.txt

to set the location of the custom spell file.

You can print the value of the option with an echo. for instance

echo & spellfile

Now I would like to copy the value of the spellfile parameter to the buffer. How can i do this?

+6
source share
1 answer

Do you have :put

 :put=&spellfile 

Do you have i_CTRL-R_=

 blabla in insertmode ^R=&spellfile^M 

(wherein ^ R is CTRL-R entered in insert mode, and ^ M returns the carriage to confirm the data entry assigned by CTRL-R =)

If you want to put it in the register → :let @a = &spellfile (or any other register name → :h registers )

+15
source

All Articles