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 am new new to vim and I have learned tabe n and tabe p I don't know anything about mapping.

Is there any way that in putty in vim if I press f5 --> tabe n And f6 ---> tabe p

Also where to write those map commands .

I looked on Internet and find some commands but was not able to figure out where to write those commands.

Also is there any ready to use script or configuration file where some has already mapped those keys so that I can see what other people are doing on daily basis so that I don't need to spent time on those

share|improve this question
    
@Saathya , maddham maddham teri gili hassi . . . . . .. :) –  user1721949 Jan 3 '13 at 4:08

1 Answer 1

up vote 2 down vote accepted

As long as you understand the Vim modes, writing a mapping is very straightforward.

  1. Choose the mode (cp. :help map-modes), e.g. normal mode = :nnoremap. Using the *noremap is preferred, because it avoids complications from other mappings applying.
  2. Select an unused key. It needs to be written in Vim's notation, e.g. <F5>
  3. The general syntax is :map {lhs} {rhs}, where {rhs} is what you have usually typed manually. :help map.txt has all the details. To make them permanent, place them into your ~/.vimrc file (create it if necessary), which contains your user options and customizations.

For example:

:nnoremap <F5> :tabe n<CR>
:nnoremap <F6> :tabe p<CR>
share|improve this answer
    
wow that worked, thanks buddy that was my first mapping. –  user1721949 Jan 3 '13 at 4:57

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.