ctrl-a in windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ctrl-a in windows

brad dahlquist
I'm trying to use CTRL-A to increment the number under
the cursor.  I'm using Windows, which reserves CTRL-A
as a 'select all' command.  This makes it impossible
for me to increment! (CTRL-X works fine for
decrementing).

is there any way around this? the increment operation
is super useful... Is their any way I could remap the
increment operation to a different key?

thanks!
-brad
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ctrl-a in windows

A.J.Mechelynck
brad dahlquist wrote:

> I'm trying to use CTRL-A to increment the number under
> the cursor.  I'm using Windows, which reserves CTRL-A
> as a 'select all' command.  This makes it impossible
> for me to increment! (CTRL-X works fine for
> decrementing).
>
> is there any way around this? the increment operation
> is super useful... Is their any way I could remap the
> increment operation to a different key?
>
> thanks!
> -brad
>
>
>

Method I (Recommended) : Don't source mswin.vim

Your vimrc probably has a line like "source $VIMRUNTIME/mswin.vim" or
"runtime mswin.vim". Remove that line or replace it by something more
innocuous like "set selectmode=mouse,key mousemodel=popup
keymodel=startsel selection=inclusive". Then learn to use

        "*p or "*P (not Ctrl-V) to paste from clipboard
        "*y (not Ctrl-C) to copy to clipboard
        "*d (not Ctrl-X) to cut to clipboard
        ggVG (not Ctrl-A) to select all
        Ctrl-V (not Ctrl-Q) to select blockwise in Normal mode or to literalize
in Insert/Replace/Command-line modes

etc.

Method II: Use a mapping

        :noremap <F3> <C-A>

will use F3 to increment. Optionally you can also ":noremap <C-F3>
<C-X>" to decrement via Ctrl-F3. Ctrl-X will still work.


HTH,
Tony.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ctrl-a in windows

adah
In reply to this post by brad dahlquist
Method III:

Unmap the windows key mappings that you found bothering after sourcing
mswin.vim, like,

source $VIMRUNTIME/mswin.vim
unmap <C-A>
unmap <C-X>
unmap <C-Y>

Best regards,

Yongwei





"A. J. Mechelynck" <[hidden email]>
2005-05-28 02:01

 
        To:     brad dahlquist <[hidden email]>
        CC:     [hidden email]
        Subject:        Re: ctrl-a in windows

brad dahlquist wrote:

> I'm trying to use CTRL-A to increment the number under
> the cursor.  I'm using Windows, which reserves CTRL-A
> as a 'select all' command.  This makes it impossible
> for me to increment! (CTRL-X works fine for
> decrementing).
>
> is there any way around this? the increment operation
> is super useful... Is their any way I could remap the
> increment operation to a different key?
>
> thanks!
> -brad
>
>
>

Method I (Recommended) : Don't source mswin.vim

Your vimrc probably has a line like "source $VIMRUNTIME/mswin.vim" or
"runtime mswin.vim". Remove that line or replace it by something more
innocuous like "set selectmode=mouse,key mousemodel=popup
keymodel=startsel selection=inclusive". Then learn to use

                 "*p or "*P (not Ctrl-V) to paste from clipboard
                 "*y (not Ctrl-C) to copy to clipboard
                 "*d (not Ctrl-X) to cut to clipboard
                 ggVG (not Ctrl-A) to select all
                 Ctrl-V (not Ctrl-Q) to select blockwise in Normal mode or
to literalize
in Insert/Replace/Command-line modes

etc.

Method II: Use a mapping

                 :noremap <F3> <C-A>

will use F3 to increment. Optionally you can also ":noremap <C-F3>
<C-X>" to decrement via Ctrl-F3. Ctrl-X will still work.


HTH,
Tony.

Loading...