Mapping vi/vim commands to hotkeys

NERDTree is a great vi plugin which definitely speed up the development time for programmers using vi for file editing. For more information about NERDTree, please refer to NERDTree – The File Explorer in vi/vim.

To further speed up the file editing efficiency, we could map the vi commands to hotkeys in the /etc/vim/vimrc.

map <F2> :NERDTreeToggle<CR>
map <F3> :tabp<CR>
map <F4> :tabn<CR>
map <F5> :tabnew<CR>


Restart vi and now you can open and close the NERDTree Explorer by pressing F2 and manipulate the vi tabs with F3, F4 and F5.

Done =)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.