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.