From: Steve Hall <digitect@da...> - 2007-12-12 16:54:59
From: "Tobbe Lundberg", Tue, December 11, 2007 11:20 pm
> Yes, it seems to work. I had to change both inoremap lines to map to
> <C-\><C-n>. At first I just changed the line involving <Esc>, but then
> I still got "^L" printed to the buffer. Changing both took care of
> I'm a bit confused as to how this keymapping thing works though. It
> looks to me like pressing Ctrl+[ would make Cream go in to insert
> mode when I'm in normal mode, but it doesn't. Nothing happens. And
> when I'm in insert mode and press Ctrl+[ it prints "[" to the
> buffer. What am I doing wrong? What have I misunderstood?
It's probably easiest to just look at the code, check out
cream-expertmode.vim. See also
In summary, Vim's standard is for Ctrl+[ (basically Esc) in Normal
Mode to do nothing. Esc is reserved to get the editor back to Normal
Mode no matter the state.
The option &insertmode (:help 'insertmode) prevents this from
happening, Esc always returns to Insert Mode.
Cream's Expert Mode simply makes the Esc key a toggle between Normal
and Insert Mode. It assumes that you usually want a modeless editor,
but from time to time want to drop into Normal Mode.
What you are attempting to do is somewhere in between all these
possibilities. The "^L" is entered when the editor is in Insert Mode
and the &insertmode option is off. Then the combination is entered
literally. Same with Ctrl+[.
Steve Hall [ digitect dancingpaper com ]
:: Cream... usability for Vim