tags:

views:

52

answers:

1

In vim, vip selects "inner paragraph" :help v_ip, however it is of limited use.

vim paragraph boundary is hard coded, a paragraph is separated by 2 or more blank lines. :help paragraph

Some archaic marcos like .IP, also seem to be supported as paragraph separators, but it is all hard coded.

I want to specify my own paragraph separators to easily select paragraphs of text in vim.

Like perl in paragraph mode using an regexp splitter.

I tried setting paragraphs to be delimited by blank lines or braces: :set paragraph+={ cpoptions+={ but does NOT work as documented, braces are ignored by 'vip' selection command.

The solution I want should work for all paragraphs commands like vip, vap, dip, dap, {,}.

A: 

I don't know if it's an option for you, but you can change paragraph delimiting in certain way by including the 'w' flag in 'formatoptions'. Check out help for 'fo-table' to read more. Basically it makes it so that lines ending in a space are like 'soft returns' and lines ending in a non-space character mark the end of paragraphs. Empty lines are not markers at all in this case. The 'w' formation flag does work with all vip, vap, etc., if I recall.

If that isn't going to do the trick for you, then I suggest remapping the vip, vap, etc. sequences to a custom function of your own. That way you can set it up to select things exactly as you want.

Herbert Sitz