Alex Rivera | Logout

VIM: Mappable (unused) shortcut letters?

Asked 2009-12-11T17:29:06.193
23

I'm trying to create two mappings which are efficient for myself:

map X ddp

Which I'd use to delete and paste in one go.

map X "_dw

Which would delete a word without yanking into a register.

However I don't want to break any existing, useful shortcuts so I'm wondering what keys I could use - any suggestions? Am I being too uptidy?

Edit
Report

1 Answer

2

Uhmm, no, don't. When creating your mappings try not to overwrite anything ... not so much because you don't use the command you're overmapping, but because some plugin which you have/or will have maybe using it.

And then you overmap it, and then you have to worry.

Personally, for commands such as you gave as an example, I like Ctrl+some key combinations. There are a lot of free ones in vim, and the letters on the left side near Ctrl make a nice pair then.

Btw, what are you trying to do with those mappings ... I understand the second one (delete word by word), but the first doesn't make sense to me. What is it supposed to do ? Transpose lines ?

answered 2009-12-12T00:10:14.480

Your Answer