Which is the best way of doing some mapping reuse?

2010-05-02 Thread Raúl Núñez de Arenas Coronado
Hi all :) Usually in my scripts I use constructs like this (just an example): nnoremap KEY m'gg"+yG'' imap KEY KEY ...maybe more mappings here for other modes... This way I put the logic only in one map (the nnoremap) one, and reuse it in the other mappings. Of course this doesn't work be

Re: Which is the best way of doing some mapping reuse?

2010-05-02 Thread John Little
On May 2, 10:45 pm, Raúl Núñez de Arenas Coronado wrote: > First one is copying and pasting the map... How about a level of indirection using :exe : let mapped = " KEY " let mapping = "m'gg\"+yG\"" exe 'nnoremap ' . mapped . mapping exe 'inoremap ' . mapped . '' . mapping . 'i' I don't know ho

Re: Which is the best way of doing some mapping reuse?

2010-05-02 Thread Raúl Núñez de Arenas Coronado
On Sun, May 2, 2010 at 14:16, John Little wrote: > > On May 2, 10:45 pm, Raúl Núñez de Arenas Coronado > wrote: >> First one is copying and pasting the map... > > How about a level of indirection using :exe : > > let mapped = " KEY " > let mapping = "m'gg\"+yG\"" > exe 'nnoremap ' . mapped . mapp