Larry Alkoff wrote:
A.J.Mechelynck wrote:

Thanks Tim, Yakov and Martin.
I'll just ASSume from now on that, if it starts with a colon,
it may as be an ex command.
Very interesting information on the use of ex.

Larry


Vhat Vim calls "ex-commands" are prefixed by a colon when typed at the command-line (the colon is actually used to go from Normal mode to Command-line mode). There are more of them than what was originally valid in the "ex" program; and you can even define your own (using the ":command" command).

In scripts, or after another command like ":vertical", ":botright", ":browse", ":verbose", ":autocommand EventName *", etc., the colon is not necessary: e.g.

    :vert split foobar.txt
    :bot help pattern-overview
    :verbose set guifont?
    :browse edit
    :au VimLeave * set verbose=0
    :if has("gui_running") | set lines=9999 columns=9999 | endif

The commands

    split foobar.txt
    help pattern-overview
    set guifont?
    edit
    set verbose=0
    set lines=9999 columns=9999
    endif

are ex-commands, which don't need a colon because there is something before them on the same command-line. (Note that ":if" and ":endif", when typed at the command-line, should be on the same line as above)


Best regards,
Tony.

Thanks for your (as usual) very good information Tony.

I had thought Normal and Command mode was two names for the same thing.
Are you saying that Command mode is ex mode?

What do you mean by "something before them" when using the split command? I have always typed ':sp foobar'. Are you saying that is not necessary or (shudder) wrong?

How can I redirect the very long list of ex commands to a file?
:he ex-cmd-index >file doesn't work.


Larry

Normal mode (sometimes called Command mode) is when hittinh h j k l will go one character cell left, down, up or right, respectively.

Command-LINE mode is what you enter by hitting : and quit by hitting <Enter> (to execute a command) or <Esc> (to abandon what you were typing on the command-line at the bottom of the Vim screen).

":nmap" or ":nabbrev" apply to Normal mode, ":cmap" or ":cabbrev" to Command-line mode.

Ex mode is a special mode, where you type ex-commands one after another, without going back to Normal mode. That's what you get if you invoke Vim as "ex" or "exim", or with the -e or -E command-line switch. You can enter Ex mode with Q or gQ (if not remapped) and leave it by using the ":visual" ex-command.


Best regards,
Tony.
--
"At least they're ___________EXPERIENCED incompetents"

Reply via email to