Jürgen Krämer wrote:
> This mapping has a problem if the cursor is on the dash at the
> start of an item -- it deletes the previous item. You might
> want to circumvent this by prepending a $ to the mapping, i.e.
>
>   :nnoremap <buffer> dip $?^\s*-?<cr>d/^\(\s*-\|\s*$\)/-1

Sensational! I had to try that, but I think it needs a little
tweaking to work. I had to double the backslash before the pipe
because the mapping takes one of the backslashes.

I use search highlighting and it is irritating how it leaves the
dashes highlighted. I also added a visual selection thinking
that you could then press gq to format it, but it doesn't really
work because the flowed text is not indented after the second
line. Here is what I ended up with (two lines):

 :nnoremap <buffer> vip $?^\s*-<CR>V/^\(\s*-\\|\s*$\)/-1<CR>:<C-U>noh<CR>gv

 :nnoremap <buffer> dip $?^\s*-<CR>d/^\(\s*-\\|\s*$\)/-1<CR>:<C-U>noh<CR>

John


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to