Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
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
add comment

1 Answer 1

up vote 1 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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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