Yakov Lerner schrieb:
> On 7/8/06, Andy Wokula <[EMAIL PROTECTED]> wrote:
>> I want to remap Ctrl-A (normal mode) to do something similar with other
>> data, e.g.
>>
>> :nmap <c-a> ciw<c-r>=IncRoman(@-)<cr><esc>
>>
>> Now if a count is provided this will mess up the text, e.g.
>> 10<c-a> does 10ciw...
>>
>> What is a good way to catch the count and make it available to the
>> function call?
> 
> :help v:count
> 
> Yakov

Vim überrascht einen doch immer wieder, ich hab nicht mal versucht, nach
"count" zu suchen ...

Thanks for the tip, now I'm quite happy with

:nmap <silent> <c-a> :<c-u>let c=v:count1<cr>ciw<c-r>=IncRoman(@-,c)<cr><esc>
:nmap <silent> <c-x> :<c-u>let c=v:count1<cr>ciw<c-r>=DecRoman(@-,c)<cr><esc>

The only thing I don't like is the use of a variable.

Thanks for the other replies as well
(still have to look at the solution with <count>).

Andy

        

        
                
___________________________________________________________ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: 
http://mail.yahoo.de

Reply via email to