Timeline for Mapping using <Esc> writes "<Esc>" in insert mode rather than switching to normal mode
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 24, 2019 at 6:36 | comment | added | Christian Brabandt | See also my comments at this question: vi.stackexchange.com/q/20641/71 | |
Jul 23, 2019 at 18:54 | comment | added | ludog | Let us continue this discussion in chat. | |
Jul 23, 2019 at 18:47 | comment | added | ludog | I included the OS and Vim version info in my most recent edit. I notice that the file at /etc/vimrc is a duplicate of the file at ~/.vimrc (or it was until I added the line you suggested). Could that have had anything to do with the problem? | |
Jul 23, 2019 at 18:34 | comment | added | filbranden |
ludog Huh I just noticed that... On the other hand, your 'cpoptions' is set like if you were in compatible mode. Perhaps try to debug your vimrc to try to understand what's happening? Also, please post more information about your system (Vim version, OS, whether you have the Vim runtimes installed or not, etc.) as that can maybe help explain why this is working the way it is...
|
|
Jul 23, 2019 at 18:22 | comment | added | ludog |
Yes I understand it was the undesirable behaviour. The reason I haven't accepted this answer yet is that it says I was in compatible mode and I wasn't sure that is right. Doesn't the output from set compatible? that I have put in the EDIT to my post indicate that I wasn't in compatible mode?
|
|
Jul 23, 2019 at 17:30 | comment | added | filbranden | ludog also please accept the answer, so this can indicate it solved your issue. This might help others who are looking for the same issue in the future. | |
Jul 23, 2019 at 17:29 | comment | added | filbranden |
ludog It would be interesting to try to understand why you were in compatible mode, did you have a .vimrc when you tested this? As @statox mentioned, having one should make Vim default to nocompatible mode, so wondering why that wasn't working for you... Did you have one at the time? What version of Vim were you running?
|
|
Jul 23, 2019 at 17:27 | comment | added | filbranden |
Having < in 'cpoptions' is the behavior you don't want... Makes the <> keys become literal symbols, instead of specifications for special keys.
|
|
Jul 23, 2019 at 17:21 | comment | added | ludog |
Thanks, this worked. My shortcuts now behave as expected again. However, based on the response to :set compatible? it seems I wasn't in compatible mode, but that somehow the <> characters were still in the list of compatible options. Is that right?
|
|
Jul 23, 2019 at 16:44 | comment | added | statox |
I'm not convinced: :h 'compatible' says off when a vimrc or gvimrc file is found so putting set nocompatible in your .vimrc should not change vim's behavior and since OP's vimrc doesn't contain set compatible I would be curious to understand how they ended up in compatible mode.
|
|
Jul 23, 2019 at 16:33 | history | answered | filbranden | CC BY-SA 4.0 |