key mapping of vim 7

August 15th, 2006 mysurface Posted in Text Manipulation, vi, vim | Hits: 22494 | 8 Comments »

vim is a very popular editor which it have more than one mode, and it is flexible to allow you for mapping your key to the features. The common map keywork is :map, which the key is map and functional when you are in normal, visual mode. To make a key to edit a file when you are in vim, you can press ESC and type command line as bellow:

: map <F2>  : edit .

So when you are in normal mode, pressing F2 will lead you to current directory for file selection.

We usually create a .vimrc at home diretory to store all the key maps. Bellow are my .vimrc, which some of the key only work under vim 7

syntax enable
colorscheme evening
" correct the backspace
set backspace=2
" tab navigation,
" some how ctrl tab cannot be use, donno why
:map  <F4>:tabprevious<cr>
:map  <F3>:tabnext<cr>
:map  <C-t>:tabnew .<cr>
:imap  <F4>:tabprevious<cr>i
:imap  <F3>:tabnext<cr>i
:imap  <C-t>:tabnew .<cr>
" open file for edit:
:map  <F2>: edit<cr>
:map  <F5>: set nu!<cr>
:map  <F6>: set hlsearch!<cr>
:map  <F9>: shell<cr>

First line, I enable syntax, so that when I work on c/c++ source code, I helps me to identify syntax. Second line, is to turn my background black and word white, there have a lots of scheme, google it for more. My backspace doesn’t work well on erase word, by putting this, it backs to normal, i have no idea what it means.

The six lines later are for tabbing, discuss at previous post

Then F5 is for toggle line numbers, F6 is for highlight search keywords and F9 is for openning a shell.

8 Responses to “key mapping of vim 7”

  1. […] Map this toggle to your fav key binding? check out this. […]

  2. […] For more key binding tips, check out Key mapping of vim 7 .                              […]

  3. Im pleased I found this blog page, I couldnt discover any knowledge on this subject matter prior to. Also operate a niche site and for anyone who is ever interested in doing some guest writing for me if possible feel free to let me know, i’m always look for people to check out my site. Please stop by and leave a comment sometime!

  4. ?? ??? ?? ??? ?????? international?? ?? input menu? ??(?? ??? ????;)? ?? ‘Try to match kbeyoard with text’ ??? ?? ?????.

  5. This design is ilniedrbce! You definitely know how to keepa reader entertained. Between your wit and your videos, I wasalmost moved to start my own blog (well, almost HaHa!) Excellent job. I really loved what you had tosay, and more than that, how you presented it. Too cool!

  6. you will never win remote control wars at home and its sometimes easier to look for alternative tv to watch from your
    PC or laptop and in a different room. Wade hosts two events for charity in Chicago on Dec.

    Pick your NBA team and lead it to greatness with NBA Legend on Facebook.

  7. Buggy accessories and added components are also necessary to think about.
    Most of the features are only added to increase the price.
    But, these models usually have a hard metal frame that surrounds the seats, so they are not as convenient
    to carry around as a double jogger strollers since they don’t collapse as well when you want to put
    them away.

  8. The assigned person should know how to organize all the
    scenes to have a result that would make sense to the viewers.

    Make sure to know when the bride is coming in so you can cover from the moment she steps off the
    car until she gets to the church entrance. I would also consider
    running some type of promotion for the day of the expo.

Leave a Reply