简体   繁体   中英

How to map several keys in Vim

How would I map ctrl+w+o to execute :Bonly<CR> ?

I have tried

unmap <C-W>o
map <C-W>o :Bonly<CR>

Save file and source it with so % , but does not work.

Your mapping (the :unmap is not necessary) should work with a sequence of Ctrl + W , followed by o .

If you want Ctrl + W followed by Ctrl + O , that'd be <Cw><Co> .

In Vim, one can only map Ctrl / Shift / Alt combinations (and not all of them, unfortunately!) with a single key (like W ). But there's a plugin that may help you achieve a mapping of all keys pressed simultaneously: arpeggio - Key mappings for simultaneously pressed keys

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM