Question

In vim you can set option with :set. For example

:set spell

to enable spell control. And

:set spellfile=/home/custom_spell.txt

to set the location of the custom spell file.

You can print the value of an option with echo. For example

echo &spellfile

Now I would like to copy the value of the option spellfile to a buffer. How can I do that?

Was it helpful?

Solution

You have :put

:put=&spellfile

You have i_CTRL-R_=

blabla in insertmode ^R=&spellfile^M

(with ^R being CTRL-R typed in insert-mode, and ^M the carriage return you'll type to validate the input given to CTRL-R=)

If you want to put it into a register -> :let @a = &spellfile (or any other register name -> :h registers)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top