Friday, June 25, 2010

Re: How to use visual-mode in a search pattern?

On 19/04/10 11:42, stosss wrote:
> On Mon, Apr 19, 2010 at 4:09 AM, John Beckett<johnb.beckett@gmail.com> wrote:
>> stosss wrote:
>>> I am not understanding how to use visual-mode in my search
>>> pattern. I can't figure out how to make it work.
>>
>> You haven't said what you want to do. A short example is often
>> useful. If you want to search for selected text, see:
>> http://vim.wikia.com/wiki/Search_for_visually_selected_text
>>
>> John
>
> That tip looks like it is probably useful but I still can't figure it
> out either. I am new and still learning.
>
> Here is what I am trying to do.
>
> 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.
>

Especially on non-US keyboards, special characters are often obtained by
means of AltGr with or without Shift, see mine at
http://users.skynet.be/antoine.mechelynck/other/keybbe.htm . In
particular, I have curly brackets {} at AltGr + unshifted 9 and 0,
French quotes «» at AltGr + w and x, opening and closing double quotes
above "" at AltGr + v and b, opening and closing single quotes above ''
at AltGr + Shift + v and b. (This post is in UTF-8, BTW.)

To yank a single character in the text and use it in a search, you don't
need Visual mode: yank the character under the cursor (in Normal mode)
with yl then (in Command-line mode) put the default register (containing
your yank) with Ctrl-R double-quote.


Best regards,
Tony.
--
The Great Bald Swamp Hedgehog:
The Gerat Bald Swamp Hedgehog of Billericay displays, in
courtship, his single prickle and does impressions of Holiday Inn desk
clerks. Since this means him standing motionless for enormous periods
of time he is often eaten in full display by The Great Bald Swamp
Hedgehog Eater.
-- Mike Harding, "The Armchair Anarchist's Almanac"

--
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

No comments: