Tim Chase <[email protected]> writes:
> But yes, this is the "big gun" for commenting. To answer your
> original question, you can use visual mode:
>
> :vnoremap <f9> :s/^##//<cr>
> :nnoremap <f9> :.,$s/^##//<cr>
>
> :vnoremap <f8> :s/^/##/<cr>
> :nnoremap <f8> :.,$s/^/##/<cr>
Thanks... I haven looked into Luc's suggestion as yet but will shortly.
But for my current coding job I might like something I can do in a few
minutes. The tool Luc points to sound like it takes some learning.
But those above look quite useful. However I asked for a way to
replace the `$' in your :nnoremap <f9> :.,$s/^##//<cr>
I just about never use the visual modes.. probably a bad habit. But
can you show me how to send vim a numeric argument ($1) along with
:.,$1s/^##// Where $1 contains a line number.
So that the end result does what this might suggest:
:.,$1s/^/## /
Is that something that would be horribly complicated to do? You no
doubt guessed that `low level' hardly begins to describes my grasp of
things vim.
===== * ===== * ===== * =====
Oh and I wondered if the simple notation I used:
nmap <F9> :.,$s/^## //
in ~/.vimrc, is lacking in some way. I mean you have more notation
around it:
:nnoremap <f9> :.,$s/^##//<cr>
Am I likely to run into problems with the syntax I used?
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---