On Apr 19, 10:42 am, stosss <[email protected]> wrote: > There are curly quotes in a text file and I want to replace them with > straight quotes. Since I don't see any way to type a curly quote in > vim. I need to high-light one (visual-mode? select-mode? CTRL > something?) so I can use/put it in my search pattern so they can be > replaced with straight quotes.
You can use Ctrl-R in command-line mode to get the contents of a register or an expression, see :help c_ctrl-r So you can do it like this: - in normal mode move the cursor to be on the quote character - type v to enter visual mode - type y to yank that character into register 0 (see :help registers) (this takes you out of visual mode) - start entering the replace command in the usual way by typing :%s/ - type Ctrl-R, it prompts you with a " character - type 0, it fills in the contents of register 0 i.e. your curly quote - finish off the replace command in the usual way i.e. type /'/g<Enter> regards, Geoff -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php Subscription settings: http://groups.google.com/group/vim_use/subscribe?hl=en
