On Sun, Nov 05, 2006 at 03:13:20PM +0800, Eddy Zhao wrote: [snip] > Thanks (I forget to set ls). > > I do the following > - gvim -u NONE > - :set stl=%{&imd} ls=2 > - :inoremap <ESC> <ESC>:set imd<CR> > - :nnoremap i :set noimd<CR>i > - :set nocp > - switching back & forth between normal mode & insert mode using "ESC" & "i" > > When I pressing "i", the input focus is on command line & command line > shows ":set noimd<CR>i".
Part of the problem is that you defined the :map commands with <> notation before setting 'nocp'. From another post on this thread, I see that you want to try this with gvim, not terminal vim. So please try $ gvim -u NONE :set nocp :set laststatus=2 stl=%{&imd} :inoremap <ESC> <ESC>:set imd<CR> :nnoremap i :set noimd<CR>i and *then* try going from Normal mode to Insert mode and back with i and <Esc>. The status line should show the current value of the 'imdisable' option. If the 0 or 1 in the status line is too terse, you could be a little fancier. For example, :set laststatus=2 stl=%{&imd?'IM\ disabled':'IM\ enabled'} HTH --Benji Fisher