ElefEnt
ElefEnt

Reputation: 2127

How can I map ctrl to space in normal mode?

I use heavily scrolling commands like Ctrl+E but Ctrl is not easily reachable on my keyboard. Is it possible to replace these with Space so that I can type Space+E to scroll ? I have tried nnoremap <Space-e> <C-e> and nnoremap <Space> <C> but it doesn't work. Thanks.

Upvotes: 1

Views: 236

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172648

Inside Vim, only the regular modifier keys Shift, Ctrl, and Alt can be used and combined with other keys. Something like <Space-e> doesn't work, cp. :help key-notation.

When the Ctrl key is awkward to use, you have to use features of the operating system to switch keys (usually globally for all applications, though some tools like AutoHotkey on Windows also support application-specific remappings). With that, the key received by Vim will still be Ctrl, but you've triggered that by pressing a different physical key on your keyboard.

These pages from the Vim Tips Wiki should get you started:

Upvotes: 3

Related Questions