I am trying to open a new terminal (size of 10) inside of neovim. I use the command, :split|resize20|term. It works well, but I want to make a hotkey to do this in my init.vim

nnoremap <C-P> :split|resize20|term<CR>

For some reason, when I actually run it, I get an error saying, parse error near >. Sometimes, when I add spaces between the pipes in the above command, it runs split only, and gives a weird error.

How do I create keybindings for the above command?

  • Welcome to Vi and Vim! The answer is probably in :help map-bar
    – D. Ben Knoble
    Jan 22, 2021 at 15:16
  • @D.BenKnoble Thank you so much, I was able to find the solution by replacing each | with <Bar>
    – Dsdfdfsd
    Jan 22, 2021 at 15:22
  • Not the best dupe-target, so if anyone has better suggestions, please suggest them.
    – D. Ben Knoble
    Jan 22, 2021 at 16:13


Browse other questions tagged or ask your own question.