On Mon, Oct 02, 2006 at 01:50:44PM +0200, A.J.Mechelynck wrote:
> >On Sun, Oct 01, 2006 at 01:37:53PM +0800, Eddy Zhao wrote:
> >>Hello all,
> >>
> >>I'm use setting below to disable input method when enter normal mode
> >>
> >> inoremap <ESC> <ESC>:set imd<CR>
> >>
> >>The setting works under window, but under linux the setting don't
> >>take effect.
> >
> >Does ":set imd" take effect in Normal mode of your build? And you could
> >use ":set imd?" to see if this option is avaliable in your build.
> >
> 
> To see if the option is available and working (as opposed to defined but 
> not working in this executable version) use
> 
>       :echo exists("+imd")
> 
> The answer is zero for no (not working), nonzero (normally 1) for yes 
> (working). Similarly in a script:
> 
>       if exists("+imdisable")
>               " do something
>       else
>               " do something else
>       endif
> 
That's right. Thanks.  
The exists() is formal way to achieve this, especially when we
writing scripts. But sometimes dirty trick comes handy. e.g.:

:echo exists("+ruler") " -> 1 , has 'ruler'
:echo exists("+noruler") " -> 0, doesn't has 'ruler'?
:set ruler? " check the 'ruler' option
:set noru? " also check the 'ruler' option. 

-- 
Dasn

Reply via email to