John Cordes wrote:

I have *very* little experience writing 'map' commands for my
.vimrc (Linux). For some years I've had the following two
commands for reformatting with the par utility.

" reformat paragraph with no arguments:
map ** {!}par^M}
"
" reformat paragraph with arguments:
map *^V  {!}par

They both work well, but I frequently would like to run par
on a visual selection. I naively tried

vmap *^V  {!}par

but this fails with the message (when I try "* 55" on a
selected area)

:'<,'>!}par 55
shell returned 127

I would appreciate a suggestion here.

Well, I don't appear to have par on my FC5 box; so my suggestion will have been untested.
However, here it is anyway:

1. Get vis.vim from:

   http://mysite.verizon.net/astronaut/vim/index.html#VIS

or a more stable version from:

   http://vim.sourceforge.net/scripts/script.php?script_id=1195

2. Select your block of text
  ctrl-v
 move
 :B !par

The "vis.vim" plugin provides the :B command, which allows visual blocks/character/line selected
regions to be handled by ex-mode commands (such as :!par).

Regards,
Chip Campbell


Reply via email to