Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How change short keys in Vim?

I am a new user in Vim. How change these keys in Zen Coding,

ctr+y+,

To

ctr+e


And also change in omni,

ctr+x ctr+o

To

ctr+j

How can I do that?

like image 603
Tarek Saied Avatar asked Jan 02 '11 21:01

Tarek Saied


People also ask

How do I change keyboard shortcuts in unity?

Step 1: Locate the Shortcuts Manager in Unity's main menu. For Windows, go to "Edit," then select "Shortcuts." For Mac, go to "Unity," then select "Shortcuts."

What is Ctrl W in Vim?

CTRL+w CTRL+w - switch between windows CTRL+w UP - Move to the top window from current window CTRL+w DOWN - Move to the bottom window from current window CTRL+w LEFT - Move to the left window from current window CTRL+w RIGHT - Move to the right window from current window.


2 Answers

I suggest you to type:

:help map.txt

inside vim, you'll find all the explanation to understand how to do it.

You can't use the same shortcut for 'zencoding' plugin and for an omnicomplete function; anyway you could add to your .vimrc:

imap <C-j> <C-y>

But I suggest not to use 'C-j' as 'j' is always related to movement in vim; use 'leader' (:help leader) which is targeted to user shortcuts, instead.

like image 95
eolo999 Avatar answered Sep 20 '22 11:09

eolo999


You may follow the answer provided by @eolo999, but I suggest you to read zencoding documentation and add the following to the vimrc:

" Note the `nore'. You must use it where possible "
" in order not to get remapping problems when your vimrc grows up "
inoremap <C-j> <C-x><C-o>

" from :h zencoding-customize-keymappings "
let g:user_zen_expandabbr_key='<C-e>'
like image 20
ZyX Avatar answered Sep 21 '22 11:09

ZyX