Today's Vim discovery is the expression register, "=. I wanted to insert the value of a Vim option (namely iskeyword) into a buffer so I could edit / play with it. Normally I'd have done
:set iskeyword?
to display the value, and then typed the result out by hand by reading what it output. But you can use the expression register to paste it directly. In Normal mode:
"=&iskeyword<CR>p
(where means hit Enter). When you do "= in Normal mode, it prompts you to give it an expression. When you hit enter, it will evaluate the expression and use the result as the contents of the register. See also :h quote=.
This entry was posted
on Thursday, June 28th, 2007 at 9:32 am.
You can follow any responses to this entry through the
RSS 2.0 feed. Or subscribe to comments below to receive email notifications.
This post is open for commenting. Pinging is currently not allowed.