key mapping of vim 7

August 15th, 2006 mysurface Posted in Text Manipulation, vi, vim | Hits: 12295 | 4 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.

4 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’ ??? ?? ?????.

Leave a Reply