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?
2.2. Vim is a powerful editor. First, in the Normal mode, we move our cursor on the last word “editor” and press yaw to yank the word editor into the unnamed register “”. Next, we move the cursor to an empty line and press p without giving a register name. We'll see the yanked text “editor” is pasted.
vim has a unnamed (or default) register that can be accessed with "" . Any text that you delete (with d , c , s or x ) or yank (with y ) will be placed there, and that's what vim uses to p aste, when no explicit register is given.
To clear the a register, for instance, I type q a q to set the a register to an empty string.
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
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With