Neovim: unknown option: noesckeys

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

  • nvim --version: 0.2.2
  • Vim (version: ) behaves differently? yes
  • Operating system/version: macOS 10.12.6
  • Terminal name/version: iTerm
  • $TERM: zsh: command not found: screen-256color

Steps to reproduce using nvim -u NORC

doesn't happen when I open a file with this command. only when I open with nvim foo.txt

nvim -u NORC

Actual behaviour

I get an error: unknown option: noesckeys with the line in my ~/.config/nvim/init.vim where I have set noesckeys

Expected behaviour

no error

I'm a total nvim noob...just trying to make the switch from vim.

question

Most helpful comment

That option doesn't exist because it is pointless. Documented at :help nvim-features-removed.

<esc> is always mappable in Nvim, and "alt" keychords are always mappable (e.g. :nnoremap <m-a> :echo 'foo'<cr>).

If you use tmux check https://github.com/neovim/neovim/wiki/FAQ#esc-in-tmux-or-gnu-screen-is-delayed

All 3 comments

That option doesn't exist because it is pointless. Documented at :help nvim-features-removed.

<esc> is always mappable in Nvim, and "alt" keychords are always mappable (e.g. :nnoremap <m-a> :echo 'foo'<cr>).

If you use tmux check https://github.com/neovim/neovim/wiki/FAQ#esc-in-tmux-or-gnu-screen-is-delayed

That option doesn't exist because it is pointless. Documented at :help nvim-features-removed.

Actually the docs say nothing about why it was removed. Could you please elaborate on this?

From googling I find this question, from which doesn't seem like the option have no use.

Ultimately, I stumbled upon a warning for esckeys for using this plugin, and if esckeys is useless, I need to send a patch removing the line setting the option. But I'd need to explain why am I doing this, and as of now I don't see why that option turned out to be pointless.

So I ended up here because a comment on Reddit linked to this article about eliminating the short delay after pressing esc to get back to normal mode. I opened Neovim and tried :h esckeys and got nothing, which lead me here.

The original reason for esckeys is that function and cursor keys (and a few others) are interpreted by most terminal emulators as ANSI escape control sequences. If you open vim (not Nvim), enter insert mode, and press ctrl-v (:h i_CTRL-V) and then the left arrow key, you'll see the output ^[OD. If you go back to normal mode and hit hh, you'll notice that the cursor is on the ^ character, not the [ character like you would expect. ^[ is the caret notation form of the ASCII escape character. It's a single character, but there's no grapheme for it.

So what esckeys does is introduce a delay when vim receives the escape character while in insert mode. If it didn't, you'd press the left arrow and vim would leave insert mode at ^[, then it would receive O and open a new line above the current line, go back into insert mode and type the letter D. Just like if you sent those three characters separately, but much more slowly than your terminal does.

Neovim doesn't need to do that. It uses some libraries (libtermkey and unibilium) to handle translating from ^[OD to the left cursor key.

If you open Neovim, enter insert mode, press ctrl-v and then the left arrow, you'll see <Left>, which is the Vimscript representation of the left arrow key. That's the vim key notation (:h key-notation) for the left cursor key, which is the most literal interpretation Neovim has for what you pressed on the keyboard.

Anyway, that horrifying plugin does something with esckeys so that you can use esc as the meta prefix key - at least I think that's what it's doing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pencilcheck picture pencilcheck  路  3Comments

nhooyr picture nhooyr  路  3Comments

andreicristianpetcu picture andreicristianpetcu  路  3Comments

amiryal picture amiryal  路  3Comments

Phlosioneer picture Phlosioneer  路  3Comments