I'd like to map C-n and C-p to S-Right and S-Left correspondingly. I tried to put

cmap <C-n> <S-Right>
cmap <C-p> <S-Left>

in ~/.pentadactylrc - but it doesn't work. How can I do it?

link|improve this question

77% accept rate
Putting those in my .pentadactylrc works fine for me. What version are you using? (Mine is Pentadactyl 1.0b8pre-hg6437-default (created 2011/09/02 19:50:06) running on: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.1) Gecko/20100101 Firefox/6.0.1) – frabjous Sep 3 '11 at 1:41
Oh... <C-n> switches to the next tab. I wanted <S-Right> to do it as well. But when I put cmap <C-n> <S-Right> - <S-Right> doesn't work this way (I press Esc several times - and then try <S-Right> - it doesn't switch to the next tab, contrast to <C-n>). – Adobe Sep 3 '11 at 13:15
cmap is for command line mode, not normal mode, and you've got it backwards. I'll post as an answer, however. – frabjous Sep 3 '11 at 14:04
feedback

1 Answer

up vote 0 down vote accepted

There are different mapping commands for different modes. cmap is for command line mode, and wouldn't affect what happens after hitting Escape a few times, since hitting Escape a few times would put you back in normal mode.

Most likely what you want to do is create a mapping for normal mode. When using these commands, the first argument is the map you're creating, and the second argument is what you're mapping it to.

nmap <S-Right> <C-n>
nmap <S-Left> <C-p>

Or better (because you could then remap <C-n> and <C-p> if you wanted:

nnoremap <S-Right> <C-n>
nnoremap <S-Left> <C-p>

For further help for different mapping commands, type :help map in pentadactyl.

link|improve this answer
:help map is what I had to try first... – Adobe Sep 3 '11 at 14:19
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.