tags:

views:

138

answers:

3

I wanted to remap (for normal mode) <C-a> to <C-=> and <C-x> to <C--> but it didn't work.

Is there another way to write this?

A: 

I'm not sure about <C-=>, but for <C-->, try <C-_> instead (replace hyphen with underscore).

Dave Ray
+1  A: 

I had a problem using and because my shell uses those to resize my window and font size. I was able to map '+' and '-' to the commands so pressing them in normal mode incremented and decremented values.

map + <C-a>
map - <C-x>

Is that what you were trying to accomplish? I don't know if that will work for you, since they probably have different uses that I don't use.

You could also use a mapleader instead of control to do this and not mess with any default uses:

let mapleader=","
map <Leader>+ <C-a>
map <Leader>- <C-x>

Instead of C-+ and C--, you would use ,+ and ,-.

gpojd
Voted up because of the user of mapleader. The whole point of using Vim is to get away from those damn control buttons.
Whaledawg
A: 

Works for me.

map <C-a> <C-=>
map <C-=> :echo 'ken'<CR>

map <C-x> <C-->
map <C--> :echo 'barbie'<CR>

Then <C-a> should echo ken and <C--> should echo barbie

Eric Johnson
doesn't work for me and I used the exact mappings you posted... any ideas why?