Thursday, March 3, 2011

Re: formatlistpat escape \

On 4/03/11 3:44 PM, Bee wrote:
> Best viewed with a monospaced font.
>
> 'formatlistpat' 'flp' string (default: "^\s*\d\+[\]:.)}\t ]\s*")
>
> to get this:
> ^\s*\(\d\|\a\)\+\.\s*
>
> must do this:
> ^\\s*\\(\\d\\\|\\a\\)\\+\\.\\s*
>
> Why?

Because that's the way escaping works for the :set command.

> Is there a way to enter the string without escaping the "\" ?

:let &flp='^\s*\(\d\|\a\)\+\.\s*'

Makes use of single-quoted string and options in expressions.

:help literal-string
:help expr-option

Ben.

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