" -> \(lq ... " -> \(rq

17 views
Skip to first unread message

tu...@posteo.de

unread,
Mar 4, 2021, 5:36:17 PM3/4/21
to vim...@googlegroups.com
Hi,

The troff has infected me! :)

Troff distinquishes between the "opening"
double-quote and the "closing" double
quote by using \(lq nad \(rq instead.

I could think of a non-100% safe regex
to detect opening and closing ", but
this would miss in one or the other
case.

Is their a function or anything else,
which would allow me to write someting
which get closer to 100% error free
detection of opening and closing "
in vim?

...or may be, my regex fu isn't that
bright?

Cheers!
mcc


Stan Brown

unread,
Mar 4, 2021, 6:10:56 PM3/4/21
to vim...@googlegroups.com

On 2021-03-04 14:36, tu...@posteo.de wrote:
> Troff distinquishes between the "opening"
> double-quote and the "closing" double
> quote by using \(lq nad \(rq instead.
>
> Is their a function or anything else,
> which would allow me to write someting
> which get closer to 100% error free
> detection of opening and closing "
> in vim?

If you want the actual characters, this will take you to the next
occurrence:

/[“”]/

In other words, put the two quote marks within square brackets.

If you want the troff sequences, use

/\\([lr]q/

The help text is at

:h /[]

--
Stan Brown
Tehachapi, CA, USA
https://BrownMath.com
https://OakRoadSystems.com

tu...@posteo.de

unread,
Mar 5, 2021, 9:13:07 AM3/5/21
to vim...@googlegroups.com

Hi Stan,

thanks a lot! :) Helps me a lot!

Cheers!
mcc
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/cda161d8-3ee0-2ed7-9ca2-3879dc3dab75%40fastmail.fm.
>
Reply all
Reply to author
Forward
0 new messages