6

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.

sites
  • 21,417
  • 17
  • 87
  • 146

1 Answers1

8

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 <C-w><C-o>.

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

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324