OnionKnight <[EMAIL PROTECTED]> 写于 2007-04-13 10:05:10:
> Couldn't find anything about command-mode. How is it different from
normal
> mode? Is each line treated as one command? Like g0w is treated as "g0w"
> instead of "g0" and "w"?

Vim is a multi-mode editor, in different mode, it accepts completely
different set of commands.

So, commands accept in insert-mode may have completely different meaning in
normal-mode.
When you use normal-mode commands inside command-mode, vim will be crazy,
since the meaning of the command is completely different in command-mode
and normal-mode.

Inside vim, you can see :help index
then you'll got the idea what is the commands available in different mode.
(use Ctrl-] to follow a link in help, use Ctrl-O to jump back)


> elseif expand("%:p:h") == "C:\\Program Files\\Apache\\htdocs"
> It looks sorta like that right now. I want to check if the left side of
the
> == operator begins with the right side. In Perl or Ruby it would be done
as
> elseif expand("%:p:h") =~ /^C:\\Program Files\\Apache\\htdocs/
>
What you need to see may be :help eval
if you want to do regexp matching, you could use =~ instead of ==
see :help expression-syntax

|expr4| expr5 == expr5          equal
        expr5 != expr5          not equal
        expr5 >  expr5          greater than
        expr5 >= expr5          greater than or equal
        expr5 <  expr5          smaller than
        expr5 <= expr5          smaller than or equal
        expr5 =~ expr5          regexp matches
        expr5 !~ expr5          regexp doesn't match

        expr5 ==? expr5         equal, ignoring case
        expr5 ==# expr5         equal, match case
etc.                    As above, append ? for ignoring case, # for
                        matching case

you can use regexp match to do your match.

--
Sincerely, Pan, Shi Zhu. ext: 2606

Reply via email to