2

I can expand a vertical split screen to occupy most of the area using Ctrl+w+| Now I would like to map that shortcut to Ctrl+m. I tried the following but it failed.

nnoremap <C-m>    <C-W>|

However this does not seem to work I also tried

nnoremap <C-m>    <C-W-l>

However that fails also. Any suggestions?

DJMcMayhem
  • 17,581
  • 5
  • 53
  • 85
James Franco
  • 1,101
  • 1
  • 9
  • 15

1 Answers1

6

| is the command separator, so it terminates the map. You need to escape it:

nnoremap <c-m> <c-w>\|

Or use <bar>:

nnoremap <c-m> <c-w><bar>

See :help :bar and :help map_bar.

Antony
  • 2,570
  • 11
  • 19