Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

2 Answers 2

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.

excerpt

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

 
discard

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.