-1

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

1
  • @Saathya , maddham maddham teri gili hassi . . . . . .. :) Jan 3, 2013 at 4:08

1 Answer 1

2

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>
1
  • wow that worked, thanks buddy that was my first mapping. Jan 3, 2013 at 4:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .