Skip to content

nnoremap <Esc> :nohlsearch<CR> causes unexpected behavior in Vim 8.2 #3

@theopn

Description

@theopn

vim/vim#9430

<C-[>/ is used at the start of various escape sequences which let Vim communicate with the terminal. Mapping any of these keysyms is a bad idea.

The only reliable solution is to not map it.

Because Vim uses <esc>/<C-[> to communicate with the terminal, mapping <Esc> too early in .vimrc caused issues where Vim would start in Replace mode, and certain keymaps like <C-u>, <C-e> would not properly work.

This seems to be fixed in later versions of Vim, for example, my personal system with Vim 9.1 exhibits no issues, but in my school Linux server running 8.2, the issue persists.

I assume this is also a non-issue in Neovim, since the mapping is directly from Kickstart.nvim. The consensus seems to be to avoid mapping <ESC> altogether, so I am not sure how to resolve this without introducing (seemingly) avoidable discrepancy between Kickstart.vim and Kickstart.nvim.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions