Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can I use capslock for changing languages in VIM instead of Ctrl + 6 in case of "keymap=russian-jcukenwin"?

How can I do it?

Maybe something like mapping it in the $VIMRC file? How can I map capslock, is it possible?

share|improve this question

If you are using X, you can remap the capslock key with Xmodmap. Add this to a file to be sourced by xmodmap(1):

remove Lock = Caps_Lock
keysym Caps_Lock = F2

You may replace F2 with another key. Now you may add a mapping to your $VIMRC file. For example,

nnoremap <F2> :echo 'it works!'<CR>
share|improve this answer

Well at least according to this SO Q&A titled: How to map CAPS LOCK key in VIM? it doesn't sound like it's possible with the capslock key.


Capslock (and Control, and Shift etc.) is a modifier key, which means that it's used with another normal key to modify the meaning of that key. AFAIK the OS does not pass the modifier keys to the application unless a normal key has also been pressed, e.g. pressing Control will not be seen by the application, but Control + C will be.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.