Hi,
Jeri Raye wrote:
> [snip]
>>> " Remove the first column execpt for lines starting with "@0000 "
>>> :v/^...@0000 \+/s/^...@\x\+\ \+//
>>> " Put "@0000" on a separate line
>>> :g/^...@0000/s/ \+/\r/
>>> " Remove three leading zeroes
>>> :v/^...@0000/s/\<000//g
> [snip]
>
> Hi again,
>
> How can you combine these three actions into one mapping?
> When I do it like this it:
>
> nmap <F3> <esc> <F3>
> map <F3> :v/^...@0000 \+/s/^...@\x\+\ \+//<cr>
> " Remove the first column execpt for lines starting with "@0000 "
> \ :g/^...@0000/s/ \+/\r/<cr>
> " Put "@0000" on a separate line
> \ :v/^...@0000/s/\<000//g<cr>
> " Remove three leading zeroes
>
> then only removes the column and highlights @0000.
> It doesn't place a return after the @0000 and it doesn't removes the
> leading zeroes.
don't put the comments between the commands:
" Remove the first column execpt for lines starting with "@0000 "
" Put "@0000" on a separate line
" Remove three leading zeroes
map <F3> :v/^...@0000 \+/s/^...@\x\+\ \+//<cr>
\ :g/^...@0000/s/ \+/\r/<cr>
\ :v/^...@0000/s/\<000//g<cr>
Regards,
Jürgen
--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---