Neovim: tnoremap does not recognize <bar>

Created on 30 Jan 2017  路  3Comments  路  Source: neovim/neovim

  • nvim --version: 0.1.7
  • Operating system/version: Arch Linux 4.9.6-1-ARCH
  • Terminal name/version: Simple Terminal 0.7, fish 2.4.0
  • $TERM: st-256color

Actual behaviour

Neovim execute first command and does not recognize \ and execute second command.

Expected behaviour

Neovim execute the two commands divided by \ one after another.

Steps to reproduce using nvim -u NORC

nvim -u NORC
:tnoremap <F7> <C-\><C-n> <bar> :q <CR>
:term
<F7>
question

Most helpful comment

Or just remove <Bar> altogether. There's no command that's being separated from :q<CR>. The mapping should really just be tnoremap <F7> <C-\><C-n>:q<CR>.

You should also be careful with whitespace in your mappings. Everything in the right-hand side of the mapping is used, so the spaces in <bar> :q <CR> would be used just as if you typed them.

All 3 comments

Neovim execute the two commands divided by one after another.

With the mapping you have, the bar is sent in normal mode. You need : before it.

Or just remove <Bar> altogether. There's no command that's being separated from :q<CR>. The mapping should really just be tnoremap <F7> <C-\><C-n>:q<CR>.

You should also be careful with whitespace in your mappings. Everything in the right-hand side of the mapping is used, so the spaces in <bar> :q <CR> would be used just as if you typed them.

Thank you for explanation.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nhooyr picture nhooyr  路  3Comments

mqudsi picture mqudsi  路  3Comments

janko picture janko  路  3Comments

moonstruck picture moonstruck  路  3Comments

JelteF picture JelteF  路  3Comments