home *** CD-ROM | disk | FTP | other *** search
- From: mool@oce.nl (Bram Moolenaar)
- Newsgroups: comp.sources.misc
- Subject: v44i039: vim - Vi IMproved editor, v3.0, Part20/26
- Date: 18 Aug 1994 14:03:22 -0500
- Organization: Sterling Software
- Sender: kent@sparky.sterling.com
- Approved: kent@sparky.sterling.com
- Message-ID: <330b9q$e7e@sparky.sterling.com>
- X-Md4-Signature: c7249aeedf0ac6889a8dac0c39ac24f0
-
- Submitted-by: mool@oce.nl (Bram Moolenaar)
- Posting-number: Volume 44, Issue 39
- Archive-name: vim/part20
- Environment: UNIX, AMIGA, MS-DOS, Windows NT
- Supersedes: vim: Volume 41, Issue 50-75
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: vim/doc/windows.doc vim/doc/winnt.doc vim/src/globals.h
- # vim/src/msdos.c vim/todo
- # Wrapped by kent@sparky on Mon Aug 15 21:44:11 1994
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 20 (of 26)."'
- if test -f 'vim/doc/windows.doc' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vim/doc/windows.doc'\"
- else
- echo shar: Extracting \"'vim/doc/windows.doc'\" \(15407 characters\)
- sed "s/^X//" >'vim/doc/windows.doc' <<'END_OF_FILE'
- XEditing with multiple windows and buffers.
- X
- XExplained here are commands have been added to use multiple windows and
- Xbuffers. Additionally there are explanations for commands that work different
- Xwhen used in combination with more than one window.
- X
- X
- XA window is a viewport onto a buffer. You can use multiple windows on one
- Xbuffer. Or several windows on different buffers.
- X
- XA buffer is a file loaded into memory for editing. The original file remains
- Xunchanged until you write the buffer to the file.
- X
- XA buffer can be in one of three states:
- X
- Xactive: The buffer is displayed in a window. If there is a file for this
- X buffer it has been read into the buffer. The buffer may have been
- X modified.
- Xhidden: The buffer is not displayed. If there is a file for this buffer it
- X has been read into the buffer. The buffer may have been modified.
- Xinactive: The buffer is not displayed and does not contain anything. Options
- X for the buffer are remembered if the file was once loaded.
- X
- XIn a table:
- X
- Xstate displayed loaded :buffers
- X in window shows
- Xactive yes yes ' '
- Xhidden no yes 'h'
- Xinactive no no '-'
- X
- X
- XStarting Vim
- X-----------
- X
- XBy default Vim starts with one window, just like vi.
- X
- XThe "-o" command line argument can be used to open a window for each file in
- Xthe argument list: "Vim -o file1 file2 file3" will open three windows.
- X
- X"-oN", where N is a decimal number, opens N windows. If there are more file
- Xnames than windows, only N windows are opened, some files do not get a window.
- XIf there are more windows than file names, the last few windows will be
- Xediting empty buffers.
- X
- XIf there are many file names the windows will become very small. You might
- Xwant to set the 'winheight' option to create a workable situation.
- X
- X
- XOpening a new window
- X--------------------
- X
- XCTRL-W s
- XCTRL-W S
- XCTRL-W CTRL-S
- X:[N]split
- X Split current window in two. The result is two viewports on
- X the same file. Make new window N high (default is to use half
- X the height of the current window). Reduces the current window
- X height to create room (and others, if the 'equalalways' option
- X is set).
- X
- XCTRL-W n
- XCTRL-W CTRL_N
- X:[N]new
- X Create a new window and start editing an empty file in it.
- X Make new window N high (default is to use half the existing
- X height). Reduces the current window height to create room (and
- X others, if the 'equalalways' option is set).
- X
- X:[N]new [+command] fname
- X:[N]split [+command] fname
- X Create a new window and start editing file fname in it. If
- X [+command] is given, execute the command when the file has
- X been loaded. Make new window N high (default is to use half
- X the existing height). Reduces the current window height to
- X create room (and others, if the 'equalalways' option is set).
- X
- X
- XClosing a window
- X----------------
- X
- XCTRL-W q
- XCTRL-W CTRL-Q
- X:quit Quit current window, unless the buffer was changed and there
- X are no other windows for this buffer. When quitting the last
- X window, exit Vim.
- X
- X:quit! Quit current window. If this was the last window for a buffer,
- X any changes to that buffer are lost. When quitting the last
- X window, exit Vim.
- X
- XCTRL-W c
- X:close Quit current window, unless it is the last window on the
- X screen. The buffer becomes hidden (unless there is another
- X window editing it). (Note: CTRL-W CTRL-C does not work).
- X
- XCTRL-W o
- XCTRL-W CTRL-O
- X:only Make the current window the only one on the screen. All other
- X windows are closed. All buffers in the other windows become
- X hidden.
- X
- X
- XMoving the cursor to other windows
- X----------------------------------
- X
- XCTRL-W <CURSOR_DOWN>
- XCTRL-W CTRL-J
- XCTRL-W j move cursor to Nth window below current one.
- X
- XCTRL-W <CURSOR_UP>
- XCTRL-W CTRL-K
- XCTRL-W k move cursor to Nth window above current one.
- X
- XCTRL-W w
- XCTRL-W CTRL-W Without count: move cursor to window below current one. If
- X there is no window below, go to upper window.
- X With count: go to Nth window.
- X
- XCTRL-W p
- XCTRL-W CTRL-P go to previous (last accessed) window.
- X
- X
- XMoving windows around
- X---------------------
- X
- XCTRL-W r
- XCTRL-W CTRL-R Rotate windows downwards. The first window becomes the second
- X one, the second one the third one, etc. The last window
- X becomes the first window. The cursor remains in the same
- X window.
- X
- XCTRL-W R Rotate windows upwards. The second window becomes the first
- X one, the third one the second one, etc. The first window
- X becomes the last window. The cursor remains in the same
- X window.
- X
- XCTRL-W x
- XCTRL-W CTRL-X Without count: Exchange current window with next one. If there
- X is no next window, exchange with previous window. With count:
- X Exchange current window with Nth window (first window is 1).
- X The cursor is put in the other window.
- X
- X
- XWindow resizing
- X---------------
- X
- XCTRL-W = make all windows (almost) equal high.
- X
- X:resize -N
- XCTRL-W - decrease current window height by N
- X
- X:resize +N
- XCTRL-W + increase current window height by N
- X
- X:resize [N]
- XCTRL-W CTRL-_
- XCTRL-W _ set current window height to N (default: highest possible)
- X
- Xz<nr><CR> set current window height to nr
- X
- XThe option 'winheight' ('wh') is used to set the minimal window height of the
- Xcurrent window. This option is used each time another window becomes the
- Xcurrent window. If the option is '0' it is disabled. Set 'winheight' to a very
- Xlarge value, e.g. '9999', to make the current window always fill all available
- Xspace. Set it to a reasonable value, e.g. '10', to make editing in the current
- Xwindow comfortable.
- X
- XWhen the option 'equalalways' ('ea') is set all the windows are automatically
- Xmade the same size after splitting or closing a window. If you don't set this
- Xoption, splitting a window will reduce the size of the current window and
- Xleave the other windows the same. When closing a window the extra lines are
- Xgiven the the window above it.
- X
- XThe option 'commandheight' ('ch') is used to set the height of the command
- Xline. If you are annoyed by the "hit return to continue" questions for long
- Xmessages, set this option to 2 or 3.
- X
- XIf there is only one window, resizing that window will also change the command
- Xline height. If there are several windows, resizing the current window will
- Xalso change the height of the window below it (and sometimes the window above
- Xit).
- X
- X
- XExiting Vim with multiple windows or buffers
- X--------------------------------------------
- X
- X:qall Exit Vim, unless there are some buffers which have been
- X changed. (Use :bmod to go to the next modified buffer).
- X
- X:qall! Exit Vim. Any changes to buffers are lost.
- X
- X:wqall
- X:xall Write all changed buffers and exit Vim. If there are buffers
- X without a file name, which are readonly or cannot be written
- X for another reason, Vim is not quit.
- X
- X:wqall!
- X:xall! Write all changed buffers, also the ones that are readonly,
- X and exit Vim. If there are buffers without a file name or
- X cannot be written for another reason, Vim is not quit.
- X
- X
- XWriting with multiple buffers
- X-----------------------------
- X
- X:wall Write all changed buffers. Buffers without a file name or
- X which are readonly are not written.
- X
- X:wall! Write all changed buffers, also the ones that are readonly.
- X Buffers without a file name are not written.
- X
- X
- XOverview of argument and buffer list commands
- X---------------------------------------------
- X
- X args list buffer list meaning
- X1. :[N]argument [N] 11. :[N]buffer [N] to arg/buf N
- X2. :[N]next [file ..] 12. :[N]bnext [N] to Nth next arg/buf
- X3. :[N]Next [N] 13. :[N]bNext [N] to Nth previous arg/buf
- X4. :[N]previous [N] 14. :[N]bprevious [N] to Nth previous arg/buf
- X5. :rewind 15. :brewind to first arg/buf
- X6. :last 16. :blast to last arg/buf
- X7. :all 17. :ball edit all args/buffers
- X 18. :unhide edit all loaded buffers
- X 19. :[N]bmod [N] to Nth modified buf
- X
- X split & args list split & buffer list meaning
- X21. :[N]sargument [N] 31. :[N]sbuffer [N] split + to arg/buf N
- X22. :[N]snext [file ..] 32. :[N]sbnext [N] split + to Nth next arg/buf
- X23. :[N]sNext [N] 33. :[N]sbNext [N] split + to Nth previous arg/buf
- X24. :[N]sprevious [N] 34. :[N]sbprevious [N] split + to Nth previous arg/buf
- X25. :srewind 35. :sbrewind split + to first arg/buf
- X26. :slast 36. :sblast split + to last arg/buf
- X27. :sall 37: :sball edit all args/buffers
- X 38. :sunhide edit all loaded buffers
- X 39. :[N]sbmod [N] split + to Nth modified buf
- X
- X40. :args list of arguments
- X41. :buffers list of buffers
- X
- XThe meaning of [N] depends on the command:
- X[N] is number of buffers to go forward/backward on ?2, ?3, ?4
- X[N] is an argument number, defaulting to current argument, for 1, 21
- X[N] is a buffer number, defaulting to current buffer, for 11, 31
- X[N] is a count for 17, 39
- X
- XNote: ":next" is an exception, because it must accept a list of file names
- Xfor compatibility with vi.
- X
- X
- XThe argument list and multiple windows
- X--------------------------------------
- X
- XThe current position in the argument list can be different for each window.
- XRemember that when doing ":e file" the position in the argument list stays
- Xthe same, but you are not editing the file at that position. Thus the
- Xmessage (file N of M) may be misleading (this is inherited from vi).
- X
- XAll the entries in the argument list are added to the buffer list. Thus you
- Xcan also get to them with the buffer list commands, like ":bnext".
- X
- X:all
- X:sall Rearrange the screen to open one window for each argument.
- X All other windows are closed (buffers become hidden).
- X
- X:[N]sargument[!] [N]
- X Short for ":split | argument [N]": split window and go to
- X Nth argument. But when there is no such argument, of the
- X current file cannot be abandoned, the window is not split.
- X
- X:[N]snext[!] [file ..]
- X Short for ":split | [N]next": split window and go to Nth
- X next argument. But when there is no next file, or the
- X current file cannot be abandoned, the window is not split.
- X
- X:[N]sprevious[!] [N]
- X:[N]sNext[!] [N]
- X Short for ":split | Next": split window and go to Nth
- X previous argument. But when there is no previous file, or
- X the current file cannot be abandoned, the window is not
- X split.
- X
- X:srewind[!] Short for ":split | rewind": split window and go to first
- X argument. But when the current file cannot be abandoned the
- X window is not split.
- X
- X:slast[!] Short for ":split | last": split window and go to last
- X argument. But when the current file cannot be abandoned the
- X window is not split.
- X
- X
- XTag or file name under the cursor
- X---------------------------------
- X
- XCTRL-W ]
- XCTRL-W CTRL-] split current window in two. Use identifier under cursor as a
- X tag and jump to it in the new upper window. Make new window N
- X high.
- X
- XCTRL-W f
- XCTRL-W CTRL-F split current window in two. Edit file name under cursor. Like
- X ":split ]f", but window isn't split if the file does not exist.
- X
- X
- XUsing hidden buffers
- X--------------------
- X
- XA hidden buffer is not displayed in a window, but is still loaded into memory.
- XThis makes it possible to jump from file to file, without the need to read or
- Xwrite the file every time, and having to keep the file in a window.
- X
- XIf the option 'hidden' ('hid') is set, abandoned buffers are kept for all
- Xcommands that start editing another file: ":edit", ":next", ":tag", etc. The
- Xcommands that move through the buffer list make the current buffer hidden
- Xalthough the 'hidden' option is not set (see below).
- X
- XYou can make a hidden buffer not hidden, by starting to edit it with any
- Xcommand. Or by deleting it with the ":bdelete" command.
- X
- X:files
- X:buffers Show all buffers. Example:
- X
- X 1 #h "/test/text" line 1
- X 2 - "asdf" line 0
- X 3 % + "version.c" line 1
- X
- X Each buffer has a unique number. That number will not change,
- X so you can always go to a specific buffer with ":buffer N" or
- X "N CTRL-^", where N is the buffer number.
- X
- X '-' indicates a buffer that is not loaded. 'h' indicates a
- X hidden buffer: It is loaded, but currently not displayed in a
- X window. '%' indicates the buffer in the current window. '#'
- X indicates the alternate buffer for ":e #" or CTRL-^. '+'
- X indicates a modified buffer.
- X
- X:[N]bdelete
- X:bdelete [N]
- X Unload buffer [N] (default: current buffer) and delete it from
- X the buffer list. If the buffer was changed this fails. The
- X file remains unaffected. If buffer [N] is the current buffer,
- X the next buffer becomes the current buffer.
- X
- X:[N]bdelete!
- X:bdelete! [N]
- X Unload buffer [N] (default: current buffer) and delete it from
- X the buffer list. If the buffer was changed the changes are
- X lost. The file remains unaffected. If buffer [N] is the
- X current buffer, the next buffer becomes the current buffer.
- X
- X:N,Mbdelete[!] do :bdelete[!] for all buffers in the range N to M (inclusive).
- X
- X:bdelete[!] N1 N2 ..
- X do :bdelete[!] for buffer N1, N2, etc.
- X
- X:[N]bunload
- X:bunload [N]
- X Unload buffer [N] (default: current buffer). The memory
- X allocated for this buffer will be freed. The buffer remains in
- X the buffer list. If the buffer was changed this fails. If
- X buffer [N] is the current buffer, the next buffer becomes the
- X current buffer.
- X
- X:[N]bunload!
- X:bunload! [N]
- X Unload buffer [N] (default: current buffer). The memory
- X allocated for this buffer will be freed. The buffer remains in
- X the buffer list. If the buffer was changed the changes are
- X lost. If buffer [N] is the current buffer, the next buffer
- X becomes the current buffer.
- X
- X:N,Mbunload[!] do :bunload[!] for all buffers in the range N to M (inclusive).
- X
- X:bunload[!] N1 N2 ..
- X do :bunload[!] for buffer N1, N2, etc.
- X
- X:[N]buffer [N]
- X Edit buffer [N] from the buffer list. If [N] is not given, the
- X current buffer remains being edited.
- X
- X:[N]bnext [N] Go to [N]th next buffer in buffer list. [N] defaults to one.
- X
- X:[N]bNext [N]
- X:[N]bprev [N] Go to [N]th previous buffer in buffer list. [N] defaults to
- X one.
- X
- X:brewind Go to first buffer in buffer list
- X
- X:blast Go to last buffer in buffer list
- X
- X:[N]bmodified [N]
- X Go to [N]th next modified buffer in buffer list
- X
- X:[N]sbuffer [N]
- X split window and Edit buffer [N] from the buffer list. If [N]
- X is not given, the current buffer is edited.
- X
- X:[N]sbnext [N] split window and go to [N]th next buffer in buffer list
- X
- X:[N]sbNext [N]
- X:[N]sbprev [N] split window and go to [N]th previous buffer in buffer list
- X
- X:sbrewind split window and go to first buffer in buffer list
- X
- X:sblast split window and go to last buffer in buffer list
- X
- X:[N]sbmodified [N]
- X split window and go to [N]th next modified buffer in buffer list
- X
- X:unhide
- X:sunhide Rearrange the screen to open one window for each loaded
- X buffer in the buffer list.
- X
- X:ball
- X:sball Rearrange the screen to open one window for each buffer in
- X the buffer list.
- X
- X
- XMemory usage limits
- X-------------------
- X
- XThe option 'maxmem' ('mm') is used to set the maximal memory used for one
- Xbuffer (in Kbyte). 'maxmemtot' is used to set the maximal memory used for all
- Xbuffers (in Kbyte). The defaults depend on the system used. For the Amiga and
- XMSDOS 'maxmemtot' is set depending on the amount of memory available. If you
- Xdon't like Vim to swap to a file, set 'maxmem' and 'maxmemtot' to a very large
- Xvalue. The swap file will then only be used for recovery. If you don't want a
- Xswap file at all, set 'updatecount' to 0, or use the "-n" argument when
- Xstarting Vim. Note that the 'maxmem' option is only used when a buffer is
- Xcreated. Changing this option does not affect buffers that have already been
- Xloaded. Thus you can set it to different values for different files.
- X'maxmemtot' works always.
- END_OF_FILE
- if test 15407 -ne `wc -c <'vim/doc/windows.doc'`; then
- echo shar: \"'vim/doc/windows.doc'\" unpacked with wrong size!
- fi
- # end of 'vim/doc/windows.doc'
- fi
- if test -f 'vim/doc/winnt.doc' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vim/doc/winnt.doc'\"
- else
- echo shar: Extracting \"'vim/doc/winnt.doc'\" \(419 characters\)
- sed "s/^X//" >'vim/doc/winnt.doc' <<'END_OF_FILE'
- XThe Windows NT port of Vim has not been tested very much. Be prepared to run
- Xinto some problems in the NT specific parts.
- X
- XKnown problems:
- X
- XDisplay is not always correct. Type CTRL-L to fix this.
- X
- XCTRL-C in a child shell (created with ":sh" or CTRL-Z) kills Vim. Hopefully
- Xthe recovery mechanism will get your file back, but don't rely on this.
- X
- XThe Windows NT port was done by Roger Knobbe <RogerK@po.wonderware.com>.
- END_OF_FILE
- if test 419 -ne `wc -c <'vim/doc/winnt.doc'`; then
- echo shar: \"'vim/doc/winnt.doc'\" unpacked with wrong size!
- fi
- # end of 'vim/doc/winnt.doc'
- fi
- if test -f 'vim/src/globals.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vim/src/globals.h'\"
- else
- echo shar: Extracting \"'vim/src/globals.h'\" \(10417 characters\)
- sed "s/^X//" >'vim/src/globals.h' <<'END_OF_FILE'
- X/* vi:ts=4:sw=4
- X *
- X * VIM - Vi IMproved by Bram Moolenaar
- X *
- X * Read the file "credits.txt" for a list of people who contributed.
- X * Read the file "uganda.txt" for copying and usage conditions.
- X */
- X
- X/*
- X * definition of global variables
- X *
- X * EXTERN is only defined in main.c (and in param.h)
- X */
- X
- X#ifndef EXTERN
- X# define EXTERN extern
- X# define INIT(x)
- X#else
- X# ifndef INIT
- X# define INIT(x) x
- X# endif
- X#endif
- X
- X/*
- X * Number of Rows and Columns in the screen.
- X * Must be long to be able to use them as options in param.c.
- X */
- XEXTERN long Rows;
- XEXTERN long Columns;
- X
- X/*
- X * Cmdline_row is the row where the command line starts, just below the
- X * last window.
- X * When the cmdline gets longer than the available space the screen gets
- X * scrolled up. After a CTRL-D (show matches), after hitting ':' after
- X * "hit return", and for the :global command, the command line is
- X * temporaraly moved. The old position is restored with the next call to
- X * updateScreen().
- X */
- XEXTERN int cmdline_row;
- X
- XEXTERN int redraw_cmdline INIT(= FALSE); /* cmdline must be redrawn */
- XEXTERN int clear_cmdline INIT(= FALSE); /* cmdline must be cleared */
- X
- X#ifdef WEBB_COMPLETE
- X/*
- X * used for completion on the command line
- X */
- XEXTERN int expand_context INIT(= CONTEXT_UNKNOWN);
- XEXTERN char_u *expand_pattern INIT(= NULL);
- XEXTERN int expand_interactively INIT(= FALSE);
- X#endif /* WEBB_COMPLETE */
- X
- X/*
- X * Functions for putting characters in the command line,
- X * while keeping NextScreen updated.
- X */
- XEXTERN int msg_col;
- XEXTERN int msg_row;
- XEXTERN int msg_scrolled;
- XEXTERN char_u *keep_msg; /* message to be shown after redraw */
- XEXTERN int msg_highlight INIT(= FALSE);/* message should be highlighted */
- XEXTERN char_u *highlight INIT(= NULL); /* string for start of highlighting */
- XEXTERN char_u *unhighlight INIT(= NULL); /* string for end of highlighting */
- XEXTERN int scroll_region INIT(= FALSE);/* terminal supports scroll region */
- X
- X/*
- X * All windows are linked in a list. firstwin points to the first entry, lastwin
- X * to the last entry (can be the same as firstwin) and curwin to the currently
- X * active window.
- X */
- XEXTERN WIN *firstwin; /* first window */
- XEXTERN WIN *lastwin; /* last window */
- XEXTERN WIN *curwin; /* currently active window */
- X
- X/*
- X * All buffers are linked in a list. 'firstbuf' points to the first entry,
- X * 'lastbuf' to the last entry and 'curbuf' to the currently active buffer.
- X */
- XEXTERN BUF *firstbuf INIT(= NULL); /* first buffer */
- XEXTERN BUF *lastbuf INIT(= NULL); /* last buffer */
- XEXTERN BUF *curbuf INIT(= NULL); /* currently active buffer */
- X
- X/*
- X * list of files being edited (argument list)
- X */
- XEXTERN char_u **arg_files; /* list of files */
- XEXTERN int arg_count; /* number of files */
- XEXTERN int arg_exp; /* when TRUE arg_files must be freed */
- X
- XEXTERN int ru_col; /* column for ruler */
- XEXTERN int sc_col; /* column for shown command */
- X
- X/*
- X * When starting or exiting some things are done differently (e.g. screen
- X * updating).
- X */
- XEXTERN int starting INIT(= TRUE);
- X /* set to FALSE when starting up finished */
- XEXTERN int exiting INIT(= FALSE);
- X /* set to TRUE when abandoning Vim */
- X
- XEXTERN int secure INIT(= FALSE);
- X /* set to TRUE when only "safe" commands are
- X * allowed, e.g. when sourcing .exrc or .vimrc
- X * in current directory */
- X
- XEXTERN FPOS VIsual; /* start position of Visual
- X * (VIsual.lnum == 0 when not active) */
- XEXTERN int Visual_block INIT(= FALSE);
- X /* Visual is blockwise */
- X
- XEXTERN FPOS Insstart; /* This is where the latest insert/append
- X * mode started. */
- X
- X/*
- X * This flag is used to make auto-indent work right on lines where only a
- X * <RETURN> or <ESC> is typed. It is set when an auto-indent is done, and
- X * reset when any other editting is done on the line. If an <ESC> or <RETURN>
- X * is received, and did_ai is TRUE, the line is truncated.
- X */
- XEXTERN int did_ai INIT(= FALSE);
- X
- X/*
- X * This flag is set when a smart indent has been performed. When the next typed
- X * character is a '{' the inserted tab will be deleted again.
- X */
- XEXTERN int did_si INIT(= FALSE);
- X
- X/*
- X * This flag is set after an auto indent. If the next typed character is a '}'
- X * one indent character will be removed.
- X */
- XEXTERN int can_si INIT(= FALSE);
- X
- XEXTERN int old_indent INIT(= 0); /* for ^^D command in insert mode */
- X
- X/*
- X * This flag is set after doing a reverse replace in column 0.
- X * An extra space has been inserted in column 0.
- X */
- XEXTERN int extraspace INIT(= FALSE);
- X
- XEXTERN int State INIT(= NORMAL); /* This is the current state of the command
- X * interpreter. */
- X
- XEXTERN int Recording INIT(= FALSE);/* TRUE when recording into a register */
- XEXTERN int Exec_reg INIT(= FALSE); /* TRUE when executing a register */
- X
- XEXTERN int did_cd INIT(= FALSE); /* TRUE when :cd dir used */
- XEXTERN int no_abbr INIT(= TRUE); /* TRUE when no abbreviations loaded */
- X
- X
- XEXTERN char_u *IObuff; /* sprintf's are done in this buffer */
- XEXTERN char_u *NameBuff; /* file names are expanded in this buffer */
- X
- XEXTERN int RedrawingDisabled INIT(= FALSE);
- X /* Set to TRUE if doing :g */
- X
- XEXTERN int readonlymode INIT(= FALSE); /* Set to TRUE for "view" */
- XEXTERN int recoverymode INIT(= FALSE); /* Set to TRUE for "-r" option */
- X
- XEXTERN int KeyTyped; /* TRUE if user typed the character */
- XEXTERN int must_redraw INIT(= 0); /* type of redraw necessary */
- XEXTERN int skip_redraw INIT(= FALSE); /* skip redraw once */
- X
- X#define NSCRIPT 15
- XEXTERN FILE *scriptin[NSCRIPT]; /* streams to read script from */
- XEXTERN int curscript INIT(= 0); /* index in scriptin[] */
- XEXTERN FILE *scriptout INIT(= NULL); /* stream to write script to */
- X
- XEXTERN int got_int INIT(= FALSE); /* set to TRUE when interrupt
- X signal occurred */
- XEXTERN int term_console INIT(= FALSE); /* set to TRUE when Amiga window used */
- XEXTERN int termcap_active INIT(= FALSE); /* set to TRUE by starttermcap() */
- XEXTERN int bangredo INIT(= FALSE); /* set to TRUE whith ! command */
- XEXTERN int searchcmdlen; /* length of previous search command */
- XEXTERN int reg_ic INIT(= 0); /* p_ic passed to to regexec() */
- X
- XEXTERN int did_outofmem_msg INIT(= FALSE); /* set after out of memory msg */
- XEXTERN int tag_busy INIT(= FALSE); /* doing a search for tag command */
- XEXTERN int global_busy INIT(= 0); /* set when :global is executing */
- XEXTERN int dont_sleep INIT(= FALSE); /* set when sleep() in emsg() not wanted */
- XEXTERN int did_msg; /* set in msg_start, used for :global */
- XEXTERN int no_wait_return INIT(= 0); /* don't wait for return now */
- XEXTERN int need_wait_return INIT(= 0); /* need to wait for return later */
- XEXTERN char_u *last_cmdline INIT(= NULL); /* last command line (for ':' register) */
- XEXTERN char_u *new_last_cmdline INIT(= NULL); /* new value for last_cmdline */
- X
- XEXTERN int postponed_split INIT(= FALSE); /* for CTRL-W CTRL-] command */
- XEXTERN int keep_old_search_pattern INIT(= FALSE); /* for myregcomp() */
- X
- X#ifdef DEBUG
- XEXTERN FILE *debugfp INIT(=NULL);
- X#endif
- X
- Xextern char_u *Version; /* this is in version.c */
- Xextern char_u *longVersion; /* this is in version.c */
- X
- X/*
- X * The error messages that can be shared are included here.
- X * Excluded are very specific errors and debugging messages.
- X */
- XEXTERN char_u e_abbr[] INIT(="No such abbreviation");
- XEXTERN char_u e_abort[] INIT(="Command aborted");
- XEXTERN char_u e_ambmap[] INIT(="Ambiguous mapping");
- XEXTERN char_u e_argreq[] INIT(="Argument required");
- XEXTERN char_u e_backslash[] INIT(="\\ should be followed by /, ? or &");
- XEXTERN char_u e_curdir[] INIT(="Command not allowed from from .exrc/.vimrc in current dir");
- XEXTERN char_u e_errorf[] INIT(="No errorfile name");
- XEXTERN char_u e_exists[] INIT(="File exists (use ! to override)");
- XEXTERN char_u e_failed[] INIT(="Command failed");
- XEXTERN char_u e_internal[] INIT(="Internal error");
- XEXTERN char_u e_interr[] INIT(="Interrupted");
- XEXTERN char_u e_invaddr[] INIT(="Invalid address");
- XEXTERN char_u e_invarg[] INIT(="Invalid argument");
- XEXTERN char_u e_invrange[] INIT(="Invalid range");
- XEXTERN char_u e_invcmd[] INIT(="Invalid command");
- XEXTERN char_u e_invstring[] INIT(="Invalid search string");
- XEXTERN char_u e_nesting[] INIT(="Scripts nested too deep");
- XEXTERN char_u e_noalt[] INIT(="No alternate file");
- XEXTERN char_u e_nolastcmd[] INIT(="No previous command line");
- XEXTERN char_u e_nomap[] INIT(="No such mapping");
- XEXTERN char_u e_nomatch[] INIT(="No match");
- XEXTERN char_u e_nomore[] INIT(="No more files to edit");
- XEXTERN char_u e_noname[] INIT(="No file name");
- XEXTERN char_u e_nopresub[] INIT(="No previous substitute");
- XEXTERN char_u e_noprev[] INIT(="No previous command");
- XEXTERN char_u e_noprevre[] INIT(="No previous regexp");
- XEXTERN char_u e_norange[] INIT(="No range allowed");
- XEXTERN char_u e_noroom[] INIT(="Not enough room");
- XEXTERN char_u e_notcreate[] INIT(="Can't create file %s");
- XEXTERN char_u e_notmp[] INIT(="Can't get temp file name");
- XEXTERN char_u e_notopen[] INIT(="Can't open file %s");
- XEXTERN char_u e_notread[] INIT(="Can't read file %s");
- XEXTERN char_u e_nowrtmsg[] INIT(="No write since last change (use ! to override)");
- XEXTERN char_u e_null[] INIT(="Null argument");
- XEXTERN char_u e_number[] INIT(="Number expected");
- XEXTERN char_u e_openerrf[] INIT(="Can't open errorfile %s");
- XEXTERN char_u e_outofmem[] INIT(="Out of memory!");
- XEXTERN char_u e_patnotf[] INIT(="Pattern not found");
- XEXTERN char_u e_positive[] INIT(="Argument must be positive");
- XEXTERN char_u e_quickfix[] INIT(="No errorfile; use :cf");
- XEXTERN char_u e_re_damg[] INIT(="Damaged match string");
- XEXTERN char_u e_re_corr[] INIT(="Corrupted regexp program");
- XEXTERN char_u e_readonly[] INIT(="File is readonly");
- XEXTERN char_u e_readerrf[] INIT(="Error while reading errorfile");
- XEXTERN char_u e_scroll[] INIT(="Invalid scroll size");
- XEXTERN char_u e_toocompl[] INIT(="Command too complex");
- XEXTERN char_u e_toombra[] INIT(="Too many (");
- XEXTERN char_u e_toomket[] INIT(="Too many )");
- XEXTERN char_u e_toomsbra[] INIT(="Too many [");
- XEXTERN char_u e_toolong[] INIT(="Command too long");
- XEXTERN char_u e_toomany[] INIT(="Too many file names");
- XEXTERN char_u e_trailing[] INIT(="Trailing characters");
- XEXTERN char_u e_umark[] INIT(="Unknown mark");
- XEXTERN char_u e_unknown[] INIT(="Unknown");
- XEXTERN char_u e_write[] INIT(="Error while writing");
- XEXTERN char_u e_zerocount[] INIT(="Zero count");
- END_OF_FILE
- if test 10417 -ne `wc -c <'vim/src/globals.h'`; then
- echo shar: \"'vim/src/globals.h'\" unpacked with wrong size!
- fi
- # end of 'vim/src/globals.h'
- fi
- if test -f 'vim/src/msdos.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vim/src/msdos.c'\"
- else
- echo shar: Extracting \"'vim/src/msdos.c'\" \(19401 characters\)
- sed "s/^X//" >'vim/src/msdos.c' <<'END_OF_FILE'
- X/* vi:ts=4:sw=4
- X *
- X * VIM - Vi IMproved by Bram Moolenaar
- X *
- X * Read the file "credits.txt" for a list of people who contributed.
- X * Read the file "uganda.txt" for copying and usage conditions.
- X */
- X
- X/*
- X * msdos.c
- X *
- X * MSDOS system-dependent routines.
- X * A cheap plastic imitation of the amiga dependent code.
- X * A lot in this file was made by Juergen Weigert (jw).
- X */
- X
- X#include <io.h>
- X#include "vim.h"
- X#include "globals.h"
- X#include "param.h"
- X#include "proto.h"
- X#include <conio.h>
- X#include <fcntl.h>
- X#include <bios.h>
- X#include <alloc.h>
- X
- Xstatic int WaitForChar __ARGS((int));
- Xstatic int change_drive __ARGS((int));
- Xstatic int cbrk_handler __ARGS(());
- X
- Xtypedef struct filelist
- X{
- X char_u **file;
- X int nfiles;
- X int maxfiles;
- X} FileList;
- X
- Xstatic void addfile __ARGS((FileList *, char_u *, int));
- Xstatic int pstrcmp(); /* __ARGS((char **, char **)); BCC does not like this */
- Xstatic void strlowcpy __ARGS((char_u *, char_u *));
- Xstatic int expandpath __ARGS((FileList *, char_u *, int, int, int));
- X
- Xstatic int cbrk_pressed = FALSE; /* set by ctrl-break interrupt */
- Xstatic int ctrlc_pressed = FALSE; /* set when ctrl-C or ctrl-break detected */
- Xstatic int delayed_redraw = FALSE; /* set when ctrl-C detected */
- X
- X long
- Xmch_avail_mem(special)
- X int special;
- X{
- X return coreleft();
- X}
- X
- X void
- Xvim_delay()
- X{
- X delay(500);
- X}
- X
- X/*
- X * this version of remove is not scared by a readonly (backup) file
- X *
- X * returns -1 on error, 0 otherwise (just like remove())
- X */
- X int
- Xvim_remove(name)
- X char_u *name;
- X{
- X (void)setperm(name, 0); /* default permissions */
- X return unlink(name);
- X}
- X
- X/*
- X * mch_write(): write the output buffer to the screen
- X */
- X void
- Xmch_write(s, len)
- X char_u *s;
- X int len;
- X{
- X char_u *p;
- X int row, col;
- X
- X if (term_console) /* translate ESC | sequences into bios calls */
- X while (len--)
- X {
- X if (s[0] == '\n')
- X putch('\r');
- X else if (s[0] == ESC && len > 1 && s[1] == '|')
- X {
- X switch (s[2])
- X {
- X case 'J': clrscr();
- X goto got3;
- X
- X case 'K': clreol();
- X goto got3;
- X
- X case 'L': insline();
- X goto got3;
- X
- X case 'M': delline();
- Xgot3: s += 3;
- X len -= 2;
- X continue;
- X
- X case '0':
- X case '1':
- X case '2':
- X case '3':
- X case '4':
- X case '5':
- X case '6':
- X case '7':
- X case '8':
- X case '9': p = s + 2;
- X row = getdigits(&p); /* no check for length! */
- X if (p > s + len)
- X break;
- X if (*p == ';')
- X {
- X ++p;
- X col = getdigits(&p); /* no check for length! */
- X if (p > s + len)
- X break;
- X if (*p == 'H' || *p == 'r')
- X {
- X if (*p == 'H') /* set cursor position */
- X gotoxy(col, row);
- X else /* set scroll region */
- X window(1, row, Columns, col);
- X len -= p - s;
- X s = p + 1;
- X continue;
- X }
- X }
- X else if (*p == 'm')
- X {
- X if (row == 0)
- X normvideo();
- X else
- X textattr(row);
- X len -= p - s;
- X s = p + 1;
- X continue;
- X }
- X }
- X }
- X putch(*s++);
- X }
- X else
- X write(1, s, (unsigned)len);
- X}
- X
- X#define POLL_SPEED 10 /* milliseconds between polls */
- X
- X/*
- X * Simulate WaitForChar() by slowly polling with bioskey(1) or kbhit().
- X *
- X * If Vim should work over the serial line after a 'ctty com1' we must use
- X * kbhit() and getch(). (jw)
- X * Usually kbhit() is not used, because then CTRL-C and CTRL-P
- X * will be catched by DOS (mool).
- X *
- X * return TRUE if a character is available, FALSE otherwise
- X */
- X
- X static int
- XWaitForChar(msec)
- X int msec;
- X{
- X for (;;)
- X {
- X if ((p_biosk ? bioskey(1) : kbhit()) || cbrk_pressed)
- X return TRUE;
- X if (msec <= 0)
- X break;
- X delay(POLL_SPEED);
- X msec -= POLL_SPEED;
- X }
- X return FALSE;
- X}
- X
- X/*
- X * GetChars(): low level input funcion.
- X * Get a characters from the keyboard.
- X * If time == 0 do not wait for characters.
- X * If time == n wait a short time for characters.
- X * If time == -1 wait forever for characters.
- X *
- X * return the number of characters obtained
- X */
- X int
- XGetChars(buf, maxlen, time)
- X char_u *buf;
- X int maxlen;
- X int time;
- X{
- X int len = 0;
- X int c;
- X
- X/*
- X * if we got a ctrl-C when we were busy, there will be a "^C" somewhere
- X * on the sceen, so we need to redisplay it.
- X */
- X if (delayed_redraw)
- X {
- X delayed_redraw = FALSE;
- X updateScreen(CLEAR);
- X setcursor();
- X flushbuf();
- X }
- X
- X if (time >= 0)
- X {
- X if (WaitForChar(time) == 0) /* no character available */
- X return 0;
- X }
- X else /* time == -1 */
- X {
- X /*
- X * If there is no character available within 2 seconds (default)
- X * write the autoscript file to disk
- X */
- X if (WaitForChar((int)p_ut) == 0)
- X updatescript(0);
- X }
- X
- X/*
- X * Try to read as many characters as there are.
- X * Works for the controlling tty only.
- X */
- X --maxlen; /* may get two chars at once */
- X /*
- X * we will get at least one key. Get more if they are available
- X * After a ctrl-break we have to read a 0 (!) from the buffer.
- X * bioskey(1) will return 0 if no key is available and when a
- X * ctrl-break was typed. When ctrl-break is hit, this does not always
- X * implies a key hit.
- X */
- X cbrk_pressed = FALSE;
- X if (p_biosk)
- X while ((len == 0 || bioskey(1)) && len < maxlen)
- X {
- X c = bioskey(0); /* get the key */
- X if (c == 0) /* ctrl-break */
- X c = 3; /* return a CTRL-C */
- X if ((c & 0xff) == 0)
- X {
- X if (c == 0x0300) /* CTRL-@ is 0x0300, translated into K_ZERO */
- X c = K_ZERO;
- X else /* extended key code 0xnn00 translated into K_NUL, nn */
- X {
- X c >>= 8;
- X *buf++ = K_NUL;
- X ++len;
- X }
- X }
- X
- X *buf++ = c;
- X len++;
- X }
- X else
- X while ((len == 0 || kbhit()) && len < maxlen)
- X {
- X switch (c = getch())
- X {
- X case 0:
- X *buf++ = K_NUL;
- X break;
- X case 3:
- X cbrk_pressed = TRUE;
- X /*FALLTHROUGH*/
- X default:
- X *buf++ = c;
- X }
- X len++;
- X }
- X return len;
- X}
- X
- X/*
- X * return non-zero if a character is available
- X */
- X int
- Xmch_char_avail()
- X{
- X return WaitForChar(0);
- X}
- X
- X/*
- X * We have no job control, fake it by starting a new shell.
- X */
- X void
- Xmch_suspend()
- X{
- X OUTSTR("new shell started\n");
- X (void)call_shell(NULL, 0, TRUE);
- X}
- X
- Xextern int _fmode;
- X/*
- X * we do not use windows, there is not much to do here
- X */
- X void
- Xmch_windinit()
- X{
- X _fmode = O_BINARY; /* we do our own CR-LF translation */
- X flushbuf();
- X (void)mch_get_winsize();
- X}
- X
- X void
- Xcheck_win(argc, argv)
- X int argc;
- X char **argv;
- X{
- X if (!isatty(0) || !isatty(1))
- X {
- X fprintf(stderr, "VIM: no controlling terminal\n");
- X exit(2);
- X }
- X /*
- X * In some cases with DOS 6.0 on a NEC notebook there is a 12 seconds
- X * delay when starting up that can be avoided by the next two lines.
- X * Don't ask me why!
- X * This could be fixed by removing setver.sys from config.sys. Forget it.
- X gotoxy(1,1);
- X cputs(" ");
- X */
- X}
- X
- X/*
- X * fname_case(): Set the case of the filename, if it already exists.
- X * msdos filesystem is far to primitive for that. do nothing.
- X */
- X void
- Xfname_case(name)
- X char_u *name;
- X{
- X}
- X
- X/*
- X * mch_settitle(): set titlebar of our window.
- X * Dos console has no title.
- X */
- X void
- Xmch_settitle(title, icon)
- X char_u *title;
- X char_u *icon;
- X{
- X}
- X
- X/*
- X * Restore the window/icon title. (which we don't have)
- X */
- X void
- Xmch_restore_title(which)
- X int which;
- X{
- X}
- X
- X/*
- X * Get name of current directory into buffer 'buf' of length 'len' bytes.
- X * Return OK for success, FAIL for failure.
- X */
- X int
- Xvim_dirname(buf, len)
- X char_u *buf;
- X int len;
- X{
- X return (getcwd(buf, len) != NULL ? OK : FAIL);
- X}
- X
- X/*
- X * Change default drive (just like _chdrive of Borland C 3.1)
- X */
- X static int
- Xchange_drive(drive)
- X int drive;
- X{
- X unsigned dummy;
- X union REGS regs;
- X
- X regs.h.ah = 0x0e;
- X regs.h.dl = drive - 1;
- X intdos(®s, ®s); /* set default drive */
- X regs.h.ah = 0x19;
- X intdos(®s, ®s); /* get default drive */
- X if (regs.h.al == drive - 1)
- X return 0;
- X else
- X return -1;
- X}
- X
- X/*
- X * get absolute filename into buffer 'buf' of length 'len' bytes
- X *
- X * return FAIL for failure, OK otherwise
- X */
- X int
- XFullName(fname, buf, len)
- X char_u *fname, *buf;
- X int len;
- X{
- X if (fname == NULL) /* always fail */
- X {
- X *buf = NUL;
- X return FAIL;
- X }
- X
- X if (isFullName(fname)) /* allready expanded */
- X {
- X STRNCPY(buf, fname, len);
- X return OK;
- X }
- X
- X#ifdef __BORLANDC__ /* the old Turbo C does not have this */
- X if (_fullpath(buf, fname, len) == NULL)
- X {
- X STRNCPY(buf, fname, len); /* failed, use the relative path name */
- X return FAIL;
- X }
- X return OK;
- X#else /* almost the same as FullName in unix.c */
- X {
- X int l;
- X char_u olddir[MAXPATHL];
- X char_u *p, *q;
- X int c;
- X int retval = OK;
- X
- X *buf = 0;
- X /*
- X * change to the directory for a moment,
- X * and then do the getwd() (and get back to where we were).
- X * This will get the correct path name with "../" things.
- X */
- X p = strrchr(fname, '/');
- X q = strrchr(fname, '\\');
- X if (q && (p == NULL || q > p))
- X p = q;
- X q = strrchr(fname, ':');
- X if (q && (p == NULL || q > p))
- X p = q;
- X if (p != NULL)
- X {
- X if (getcwd(olddir, MAXPATHL) == NULL)
- X {
- X p = NULL; /* can't get current dir: don't chdir */
- X retval = FAIL;
- X }
- X else
- X {
- X if (*p == ':' || (p > fname && p[-1] == ':'))
- X q = p + 1;
- X else
- X q = p;
- X c = *q;
- X *q = NUL;
- X if (chdir(fname))
- X retval = FAIL;
- X else
- X fname = p + 1;
- X *q = c;
- X }
- X }
- X if (getcwd(buf, len) == NULL)
- X {
- X retval = FAIL;
- X *buf = NUL;
- X }
- X l = STRLEN(buf);
- X if (l && buf[l - 1] != '/' && buf[l - 1] != '\\')
- X strcat(buf, "\\");
- X if (p)
- X chdir(olddir);
- X strcat(buf, fname);
- X return retval;
- X }
- X#endif
- X}
- X
- X/*
- X * return TRUE is fname is an absolute path name
- X */
- X int
- XisFullName(fname)
- X char_u *fname;
- X{
- X return (STRCHR(fname, ':') != NULL);
- X}
- X
- X/*
- X * get file permissions for 'name'
- X * -1 : error
- X * else FA_attributes defined in dos.h
- X */
- X long
- Xgetperm(name)
- X char_u *name;
- X{
- X int r;
- X
- X r = _chmod(name, 0, 0); /* get file mode */
- X return r;
- X}
- X
- X/*
- X * set file permission for 'name' to 'perm'
- X *
- X * return FAIL for failure, OK otherwise
- X */
- X int
- Xsetperm(name, perm)
- X char_u *name;
- X long perm;
- X{
- X perm |= FA_ARCH; /* file has changed, set archive bit */
- X return (_chmod((char *)name, 1, (int)perm) == -1 ? FAIL : OK);
- X}
- X
- X/*
- X * return TRUE if "name" is a directory
- X * return FALSE if "name" is not a directory
- X * return -1 for error
- X *
- X * beware of a trailing backslash that may have been added by addfile()
- X */
- X int
- Xisdir(name)
- X char_u *name;
- X{
- X int f;
- X char_u *p;
- X
- X p = name + strlen(name);
- X if (p > name)
- X --p;
- X if (*p == '\\') /* remove trailing backslash for a moment */
- X *p = NUL;
- X else
- X p = NULL;
- X f = _chmod(name, 0, 0);
- X if (p != NULL)
- X *p = '\\';
- X if (f == -1)
- X return -1; /* file does not exist at all */
- X if ((f & FA_DIREC) == 0)
- X return FALSE; /* not a directory */
- X return TRUE;
- X}
- X
- X/*
- X * Careful: mch_windexit() may be called before mch_windinit()!
- X */
- X void
- Xmch_windexit(r)
- X int r;
- X{
- X settmode(0);
- X stoptermcap();
- X flushbuf();
- X ml_close_all(); /* remove all memfiles */
- X exit(r);
- X}
- X
- X/*
- X * function for ctrl-break interrupt
- X */
- X void interrupt
- Xcatch_cbrk()
- X{
- X cbrk_pressed = TRUE;
- X ctrlc_pressed = TRUE;
- X}
- X
- X/*
- X * ctrl-break handler for DOS. Never called when a ctrl-break is typed, because
- X * we catch interrupt 1b. If you type ctrl-C while Vim is waiting for a
- X * character this function is not called. When a ctrl-C is typed while Vim is
- X * busy this function may be called. By that time a ^C has been displayed on
- X * the screen, so we have to redisplay the screen. We can't do that here,
- X * because we may be called by DOS. The redraw is in GetChars().
- X */
- X static int
- Xcbrk_handler()
- X{
- X delayed_redraw = TRUE;
- X return 1; /* resume operation after ctrl-break */
- X}
- X
- X/*
- X * function for critical error interrupt
- X * For DOS 1 and 2 return 0 (Ignore).
- X * For DOS 3 and later return 3 (Fail)
- X */
- X void interrupt
- Xcatch_cint(bp, di, si, ds, es, dx, cx, bx, ax)
- X unsigned bp, di, si, ds, es, dx, cx, bx, ax;
- X{
- X ax = (ax & 0xff00); /* set AL to 0 */
- X if (_osmajor >= 3)
- X ax |= 3; /* set AL to 3 */
- X}
- X
- X/*
- X * set the tty in (raw) ? "raw" : "cooked" mode
- X *
- X * Does not change the tty, as bioskey() and kbhit() work raw all the time.
- X */
- X
- Xextern void interrupt CINT_FUNC();
- X
- X void
- Xmch_settmode(raw)
- X int raw;
- X{
- X static int saved_cbrk;
- X static void interrupt (*old_cint)();
- X static void interrupt (*old_cbrk)();
- X
- X if (raw)
- X {
- X saved_cbrk = getcbrk(); /* save old ctrl-break setting */
- X setcbrk(0); /* do not check for ctrl-break */
- X old_cint = getvect(0x24); /* save old critical error interrupt */
- X setvect(0x24, catch_cint); /* install our critical error interrupt */
- X old_cbrk = getvect(0x1B); /* save old ctrl-break interrupt */
- X setvect(0x1B, catch_cbrk); /* install our ctrl-break interrupt */
- X ctrlbrk(cbrk_handler); /* vim's ctrl-break handler */
- X if (term_console)
- X outstr(T_TP); /* set colors */
- X }
- X else
- X {
- X setcbrk(saved_cbrk); /* restore ctrl-break setting */
- X setvect(0x24, old_cint); /* restore critical error interrupt */
- X setvect(0x1B, old_cbrk); /* restore ctrl-break interrupt */
- X /* restore ctrl-break handler, how ??? */
- X if (term_console)
- X normvideo(); /* restore screen colors */
- X }
- X}
- X
- X/*
- X * set screen mode
- X * return FAIL for failure, OK otherwise
- X */
- X int
- Xmch_screenmode(arg)
- X char_u *arg;
- X{
- X int mode;
- X int i;
- X static char_u *(names[]) = {"BW40", "C40", "BW80", "C80", "MONO", "C4350"};
- X static int modes[] = { BW40, C40, BW80, C80, MONO, C4350};
- X
- X mode = -1;
- X if (isdigit(*arg)) /* mode number given */
- X mode = atoi((char *)arg);
- X else
- X {
- X for (i = 0; i < sizeof(names) / sizeof(char_u *); ++i)
- X if (stricmp((char *)names[i], (char *)arg) == 0)
- X {
- X mode = modes[i];
- X break;
- X }
- X }
- X if (mode == -1)
- X {
- X EMSG("Unsupported screen mode");
- X return FAIL;
- X }
- X textmode(mode); /* use Borland function */
- X return OK;
- X}
- X
- X/*
- X * Structure used by Turbo-C/Borland-C to store video parameters.
- X */
- Xextern struct text_info _video;
- X
- X/*
- X * try to get the real window size
- X * return FAIL for failure, OK otherwise
- X */
- X int
- Xmch_get_winsize()
- X{
- X int i;
- X struct text_info ti;
- X/*
- X * The screenwidth is returned by the BIOS OK.
- X * The screenheight is in a location in the bios RAM, if the display is EGA or VGA.
- X */
- X if (!term_console)
- X return FAIL;
- X gettextinfo(&ti);
- X Columns = ti.screenwidth;
- X Rows = ti.screenheight;
- X if (ti.currmode > 10)
- X Rows = *(char far *)MK_FP(0x40, 0x84) + 1;
- X set_window();
- X
- X if (Columns < 5 || Columns > MAX_COLUMNS ||
- X Rows < 2 || Rows > MAX_COLUMNS)
- X {
- X /* these values are overwritten by termcap size or default */
- X Columns = 80;
- X Rows = 25;
- X return FAIL;
- X }
- X check_winsize();
- X
- X return OK;
- X}
- X
- X/*
- X * Set the active window for delline/insline.
- X */
- X void
- Xset_window()
- X{
- X _video.screenheight = Rows;
- X window(1, 1, Columns, Rows);
- X}
- X
- X void
- Xmch_set_winsize()
- X{
- X /* should try to set the window size to Rows and Columns */
- X /* may involve switching display mode.... */
- X}
- X
- X/*
- X * call shell, return FAIL for failure, OK otherwise
- X */
- X int
- Xcall_shell(cmd, filter, cooked)
- X char_u *cmd;
- X int filter; /* if != 0: called by dofilter() */
- X int cooked;
- X{
- X int x;
- X char_u newcmd[200];
- X
- X flushbuf();
- X
- X if (cooked)
- X settmode(0); /* set to cooked mode */
- X
- X if (cmd == NULL)
- X x = system(p_sh);
- X else
- X { /* we use "command" to start the shell, slow but easy */
- X sprintf(newcmd, "%s /c %s", p_sh, cmd);
- X x = system(newcmd);
- X }
- X outchar('\n');
- X if (cooked)
- X settmode(1); /* set to raw mode */
- X
- X#ifdef WEBB_COMPLETE
- X if (x && !expand_interactively)
- X#else
- X if (x)
- X#endif
- X {
- X outnum((long)x);
- X outstrn((char_u *)" returned\n");
- X }
- X
- X resettitle();
- X (void)mch_get_winsize(); /* display mode may have been changed */
- X return (x ? FAIL : OK);
- X}
- X
- X/*
- X * check for an "interrupt signal": CTRL-break or CTRL-C
- X */
- X void
- Xbreakcheck()
- X{
- X if (ctrlc_pressed)
- X {
- X ctrlc_pressed = FALSE;
- X got_int = TRUE;
- X }
- X}
- X
- X#define FL_CHUNK 32
- X
- X static void
- Xaddfile(fl, f, isdir)
- X FileList *fl;
- X char_u *f;
- X int isdir;
- X{
- X char_u *p;
- X
- X if (!fl->file)
- X {
- X fl->file = (char_u **)alloc(sizeof(char_u *) * FL_CHUNK);
- X if (!fl->file)
- X return;
- X fl->nfiles = 0;
- X fl->maxfiles = FL_CHUNK;
- X }
- X if (fl->nfiles >= fl->maxfiles)
- X {
- X char_u **t;
- X int i;
- X
- X t = (char_u **)lalloc((long_u)(sizeof(char_u *) * (fl->maxfiles + FL_CHUNK)), TRUE);
- X if (!t)
- X return;
- X for (i = fl->nfiles - 1; i >= 0; i--)
- X t[i] = fl->file[i];
- X free(fl->file);
- X fl->file = t;
- X fl->maxfiles += FL_CHUNK;
- X }
- X p = alloc((unsigned)(STRLEN(f) + 1 + isdir));
- X if (p)
- X {
- X STRCPY(p, f);
- X if (isdir)
- X strcat(p, "\\");
- X }
- X fl->file[fl->nfiles++] = p;
- X}
- X
- X static int
- Xpstrcmp(a, b)
- X char_u **a, **b;
- X{
- X return (strcmp(*a, *b));
- X}
- X
- X int
- Xhas_wildcard(s)
- X char_u *s;
- X{
- X if (s)
- X for ( ; *s; ++s)
- X if (*s == '?' || *s == '*')
- X return TRUE;
- X return FALSE;
- X}
- X
- X static void
- Xstrlowcpy(d, s)
- X char_u *d, *s;
- X{
- X while (*s)
- X *d++ = tolower(*s++);
- X *d = '\0';
- X}
- X
- X static int
- Xexpandpath(fl, path, fonly, donly, notf)
- X FileList *fl;
- X char_u *path;
- X int fonly, donly, notf;
- X{
- X char_u buf[MAXPATH];
- X char_u *p, *s, *e;
- X int lastn, c, r;
- X struct ffblk fb;
- X
- X lastn = fl->nfiles;
- X
- X/*
- X * Find the first part in the path name that contains a wildcard.
- X * Copy it into buf, including the preceding characters.
- X */
- X p = buf;
- X s = NULL;
- X e = NULL;
- X while (*path)
- X {
- X if (*path == '\\' || *path == ':' || *path == '/')
- X {
- X if (e)
- X break;
- X else
- X s = p;
- X }
- X if (*path == '*' || *path == '?')
- X e = p;
- X *p++ = *path++;
- X }
- X e = p;
- X if (s)
- X s++;
- X else
- X s = buf;
- X
- X /* if the file name ends in "*" and does not contain a ".", addd ".*" */
- X if (e[-1] == '*' && STRCHR(s, '.') == NULL)
- X {
- X *e++ = '.';
- X *e++ = '*';
- X }
- X /* now we have one wildcard component between s and e */
- X *e = '\0';
- X r = 0;
- X /* If we are expanding wildcards we try both files and directories */
- X if ((c = findfirst(buf, &fb, (*path || !notf) ? FA_DIREC : 0)) != 0)
- X {
- X /* not found */
- X STRCPY(e, path);
- X if (notf)
- X addfile(fl, buf, FALSE);
- X return 1; /* unexpanded or empty */
- X }
- X while (!c)
- X {
- X strlowcpy(s, fb.ff_name);
- X /* ignore "." and ".." */
- X if (*s != '.' || (s[1] != '\0' && (s[1] != '.' || s[2] != '\0')))
- X {
- X strcat(buf, path);
- X if (!has_wildcard(path))
- X addfile(fl, buf, (isdir(buf) == TRUE));
- X else
- X r |= expandpath(fl, buf, fonly, donly, notf);
- X }
- X c = findnext(&fb);
- X }
- X qsort(fl->file + lastn, fl->nfiles - lastn, sizeof(char_u *), pstrcmp);
- X return r;
- X}
- X
- X/*
- X * MSDOS rebuilt of Scott Ballantynes ExpandWildCard for amiga/arp.
- X * jw
- X */
- X
- X int
- XExpandWildCards(num_pat, pat, num_file, file, files_only, list_notfound)
- X int num_pat;
- X char_u **pat;
- X int *num_file;
- X char_u ***file;
- X int files_only, list_notfound;
- X{
- X int i, r = 0;
- X FileList f;
- X
- X f.file = NULL;
- X f.nfiles = 0;
- X for (i = 0; i < num_pat; i++)
- X {
- X if (!has_wildcard(pat[i]))
- X addfile(&f, pat[i], files_only ? FALSE : (isdir(pat[i]) == TRUE));
- X else
- X r |= expandpath(&f, pat[i], files_only, 0, list_notfound);
- X }
- X if (r == 0)
- X {
- X *num_file = f.nfiles;
- X *file = f.file;
- X }
- X else
- X {
- X *num_file = 0;
- X *file = NULL;
- X }
- X return (r ? FAIL : OK);
- X}
- X
- X void
- XFreeWild(num, file)
- X int num;
- X char_u **file;
- X{
- X if (file == NULL || num <= 0)
- X return;
- X while (num--)
- X free(file[num]);
- X free(file);
- X}
- X
- X/*
- X * The normal chdir() does not change the default drive.
- X * This one does.
- X */
- X#undef chdir
- X int
- Xvim_chdir(path)
- X char_u *path;
- X{
- X if (path[0] == NUL) /* just checking... */
- X return 0;
- X if (path[1] == ':') /* has a drive name */
- X {
- X if (change_drive(toupper(path[0]) - 'A' + 1))
- X return -1; /* invalid drive name */
- X path += 2;
- X }
- X if (*path == NUL) /* drive name only */
- X return 0;
- X return chdir(path); /* let the normal chdir() do the rest */
- X}
- END_OF_FILE
- if test 19401 -ne `wc -c <'vim/src/msdos.c'`; then
- echo shar: \"'vim/src/msdos.c'\" unpacked with wrong size!
- fi
- # end of 'vim/src/msdos.c'
- fi
- if test -f 'vim/todo' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'vim/todo'\"
- else
- echo shar: Extracting \"'vim/todo'\" \(19200 characters\)
- sed "s/^X//" >'vim/todo' <<'END_OF_FILE'
- XKnown problems:
- X
- XIf file system full and write to swap file failed, get error message for
- X lnum > line_count?
- XWhen editing same file in two xterms, in second type ":" at first wait-return
- X for ".swp file exists", at exit cursor is left at top of window.
- XWindows NT: display is not always correct.
- XWindows NT: CTRL-C in a child shell (created with ":sh" or CTRL-Z) kills Vim.
- XMSDOS: When using smardrive a readonly floppy will cause problems. Test for
- X writable directory first?
- XSome terminals start inverting at the position where the invert code is put.
- X This is not handled correctly. Remove 'weirdinvert' hack.
- X":s/\(.*\)/\1" on line with ^M should not replace ^M by linebreaks.
- XReplace with 'r' should set last inserted text.
- XBS in replace mode does not work correctly with et set and after inserting a TAB.
- XIn insert mode CTRL-O . does not repeat the last CTRL-O command but the insertion.
- XSometimes the time stamp in the memfile is old. May be caused by opening the
- X file r/w when testing for readonly.
- XWhen doing a CTRL-Z and typing a command for the shell, while Vim is busy
- X (e.g. writing a file), the command for the shell is sometimes eaten by Vim.
- XFind out why screen size is changed in unexpected place for Bob Beresh.
- X
- X
- XTo be checked:
- XCheck '\n' at end of some : commands (that do not have TRLBAR).
- XCheck for '\\' at the start of search commands (undocumented vi feature).
- XEnvironment name expansion for 'bdir' default value does not work?
- XUsage of isspace() vi-compatible (compared to iswhite())?
- XTerminal initializations compared to vi. "vs" used to make cursor very visible,
- X or for scrollbars (Webb)?
- XMSDOS: After writing on a network the 'w' bit for others is set.
- XWhen can the 'p' and 'P' command not be redone??
- X
- X
- XProblems that will probably not be solved:
- X
- XProlem with HPterm under X (cosentino/2).
- XAmiga: When using quickfix with the Manx compiler we only get the first 25
- X errors. How do we get the rest?
- XAmiga: The ":cq" command does not always abort the Manx compiler. Why?
- XLinux: A file with protection r--rw-rw- is seen readonly for others. The access()
- X function in GNU libc is probably wrong.
- X
- X
- XFurther extentions and improvements:
- X
- XAdd icon setting for xterm (riehm/69, mulder/iconname.set).
- XMake command line arguments options to be combined after a single dash, eg "-nb".
- XWhen started to edit another file, make message "file 1 of 8" different.
- XWhen entering text, keep other windows on same buffer updated (when a line
- X entered)?
- XAmiga: When 'r' protection bit is not set, file can still be opened
- X but gives read errors. Check protection before opening.
- XBind windows together, scrolling is done in both windows synchronous
- X (horizontally and vertically). Use CTRL-W b?
- XRe-select last Visual selection with "v." (exactly same text, from '[ to ']).
- XDon't write any pages into the swapfile until the buffer has been changed.
- XCatch terminating signals and call ml_sync_all(): SIGHUP, SIGINT, SIGQUIT,
- X SIGILL, SIGABRT, SIGFPE, SIGPIPE, SIGALRM, SIGTERM, SIGBUS, SIGSEGV.
- XChange ".swp" to ".vim", because it give a hint who created the file?
- XUse termcap 'ts' and 'fs' entries for setting the window title. Check 'hs'
- X and use minimum of 'ws' (if present) and Columns to truncate the title.
- XWhen writing check for file exists but no permission, "Permission denied".
- XIn dosub() regexec is called twice for the same line. Try to avoid this.
- XWhen line is too long to fit on screen, don't display it.
- XWhen inserting makes cursor go past end of screen, scroll up in insertchar().
- XWindow updating from memline.c: insert/delete/replace line.
- XOptimize ml_append() for speed, esp. for reading a file.
- XV..c should keep indent when 'ai' is set, just like <count>cc.
- XIn visual select mode: Inclusion or exclusion of char under cursor depends
- X on movement command. "vwd" and "dw" do the same???
- XFind out why macros of Stephen Riehm are working strange.
- X:s///p prints the line after a substitution.
- XMake CTRL-R (insert register contents) also work in command line mode.
- XUpdatescript() can be done faster with a string instead of a char.
- XAdd arguments to ":args", like ":next".
- XWhen searching with 'n' give message when getting back where the search first
- X started. Remember start of search in '/ mark.
- XAdd option that scrolls screen to put cursor in middle of screen after search.
- XAdd \! to search patterns: matches string that does not match previous atom.
- XScreen updating is inefficient with CTRL-F and CTRL-B when there are long lines.
- XUse 'backupdir' for all backup files if it starts with '>'.
- XWhen writing a file, name it "foo.new". Then rename "foo" to "foo.bak" and
- X "foo.new" to "foo". If dir is not writable or on write error copy "foo"
- X to "backupdir/foo.bak" and overwrite "foo". Check for correct group/owner
- X and try to set it if not. NO: this breaks with hard links.
- X INSTEAD: make Amiga and MSDOS work like unix: first make copy of file, then
- X truncate and overwrite original file. Use an option for this, default
- X on for Unix, off for Amiga/MSDOS.
- XUse CTRL-E and CTRL-Y in insert mode for scroll up/down?
- XUppercase characters in ex commands can be made lowercase?
- XAdd t_del, code for delete key (termcap 'kD') and maybe some other keys:
- X 'kI' insert key, 'kL' delete line, t_bs 'bs', etc.
- XFiltering a block should only apply to the block, not to the whole lines. When
- X the number of lines is increased, add lines. When decreased, padd with
- X spaces or delete?
- XCTRL-V > should move the block, not whole lines.
- XAdd commands to move selected text, without deselecting.
- XAdd "p" command to swap selected text with unnamed buffer.
- XAdd "P" command to insert contents of unnamed buffer, move selected text to
- X position of previous deleted (to swap foo and bar in " + foo")
- XIn out-of-memory situations: Free allocated space in undo (after asking).
- X8-bit codes between 0x80 and 0xa0 cannot be typed directly (mostly msdos
- X problem). Need more codes for delete key and more function keys. Use
- X 2-byte code? (see xvim).
- XInsert octal numbers with CTRL-V o, hexadecimal with CTRL-V x and binary
- X with CTRL-V b.
- XList mappings: Once with and without ^ and ~ (meta keys). Use "F1" and "PgUp"
- X for MSDOS default mappings.
- XAdd option that tells which characters to display directly, e.g.
- X ":set gr=32-126,140-244", others are displayed with ^ and ~ and +
- XAdd option to show character value in octal, decimal, hex and screen code.
- XHow does vi detect whether a filter has messed up the screen? Check source.
- X After ":w !command" a wait_return?
- XImprove screen updating code for doput() (use s_ins()).
- XWith 'p' command on last line: scroll screen up (also for terminals without
- X insert line command).
- XAmiga: ExpandWildCards in amiga.c: don't expand if there are no wildcards.
- Xunix: Speedup wildcard expansion of "*", "~" and "$": do it internally, more
- X complicated things can still be done with the shell.
- XOnly do wildcard expansion with 'wildchar' when entering a command that has a
- X file name as argument (:r :w :! :e :f :n)?
- XUnix: When comparing two file names to see if they are the same file use stat()
- X and compare device/inode; much faster than FullPathName()
- XIn regexp.c: "\^" after "\|" or "\(" is start of line, and "\$" before "\|"
- X and "\)" is end of line.
- XRemember the "last changed" time of the edited file and check it before
- X overwriting; another user may have changed it.
- XSupport for command lines longer than 256 characters (for EXINIT).
- XOption for filter when reading/writing a file for compression or crypting.
- XOption to set time for emsg() sleep. Interrupt sleep when key is typed? sleep
- X before second message?
- XDelete message after new command has been entered and have waited for key.
- XAdd "next tag" command for tags that have multiple hits.
- XSupport static tags: first search for tags with current filename: "foo.c:bar",
- X then for global tags (without a filename).
- XHistory stack for . command?
- XUse insert/delete char when terminal supports it.
- XWith undo with simple line delete/insert: optimize screen updating.
- XOptimize screen redraw for slow terminals.
- X"edit" option: when off changing the buffer is not possible.
- XAdd "-d null" for editing from a script file without displaying.
- XAdd "-R" for readonly mode (ex has it).
- XWhen writing to a readonly file, ask for permission to overwrite it (if file can
- X be made writable) and restore file to readonly afterwards.
- XMSDOS: search for _exrc in the directory where the binary is, instead
- X of using $VIM\_exrc.
- XIn insert mode: Remember the characters that were removed with backspace and
- X re-insert them one at a time with <key1>, all together with <key2>.
- XAmiga: Add possibility to set a keymap. The code in amiga.c does not work yet.
- XImplement 'redraw' option.
- XAdd possibility to put the value of an option into the text: "'lines'p
- XUnix: WildExpand: Without csh file name with embedded space will be split in two.
- XWith wildcard expansion after '%' and '#', expand current/alternate file name, so
- X it can be edited.
- XAdd special code to 'sections' option to define something else but '{' or '}'
- X as the start of a section (e.g. one shiftwidth to the right).
- XNopaste option: Mappings with non-printable characters are OK.
- XAdd 'indent' option: Always use this amount of indent when starting a new line
- X and when formatting text.
- XAdd 'crown' option to 'Q' command: preserve indent of second line.
- XWhen formatting with 'Q', break at paragraph boundaries (empty lines).
- XWhen 'textwidth' is negative, use for 'Q' only, no automatic formatting.
- XAdd option 'comment', initally "/*,*,*/,#", giving the characters at start of
- X a line that should be left alone by the internal formatting.
- XAfter formatting with Q the cursor is on the end of the last line; with = and
- X when formatprg is set it is at the start of the first line. Not good.
- XAdd 'scrolloff': scroll when cursor is less then 'scrolloff' lines from top/bottom.
- XAdd option to switch off ignoring braces inside quotes for "%" command??
- XUse pipes for filtering on unix.
- XAllow for +command and -option on any position in argv[].
- XAdd commands like ]] and [[ that do not include the line jumped to.
- XWhen :unab without matching "from" part and several matching "to" parts,
- X delete the entry that was used last, instead of the first in the list.
- XAfter :set nowrap remove superflous redraw with wrong hor. offset if cursor
- X is right of the screen.
- XAdd -x option: crypt/decrypt when writing/reading file.
- XAdd count to ':', gives ":.,.+count-1"
- XImprove online help: Fit into the window (also small ones), hypertext, etc.
- X (See also dh1:text/vi/vi.help). View help just like a file?
- XSupport several errorformats, use the first format that matches.
- XRecognize "$*" in 'makeprg'; replace it by the arguments to :make.
- XAllow multiple arguments to :unmap.
- XAdd option that contains characters which are included in identifiers;
- X default "[a-bA-B0-9]_", for LISP "[a-bA-B0-9]_-".
- XWith :s///c highlight the pattern to be replaced and replace \&, ~, etc. when
- X showing the replacement pattern.
- XAdd mappings for visual mode; use marks for start/end of selected text.
- XWith ambigious mapping, print conflicting entry.
- XIn insert mode add # for CTRL-R (alternate filename).
- XHighlight search string when found?
- XCommand line: cursor up on empty line: go to previous command, on non-empty line:
- X go to previous matching command.
- XAdd command to clear all mappings, "clearmap".
- XAdd text justification option.
- XWhen the edited file is a symlink, try to put the .swp file in the same dir as
- X the actual file. Adjust FullName().
- XAdd new operator: clear, make area white (replace with spaces)
- XAdd put function that replaces the text under it.
- XAfter "inv"ing an option show the value: ":set invpaste" gives "paste is off".
- XAfter ":read" set '[ and '] marks.
- XIn fileio.c replace filemess() by outputting strings after each other (only
- X one wait_return().
- XAfter executing a shell, put tty back in raw mode (for shells that mess with
- X the tty settings)
- XMake program to transform termcap entries into something that fits in tcarr
- X structure.
- XImprove error messages: when expanding '%': "no filename to substitute for '%'"
- X when expanding '#': "no alternate filename to substitute for '#'"
- XPut warnings in some color (errors are inverted, normal messages plain).
- XCheck handling of CTRL-V and '\' for ":" commands that do not have TRLBAR.
- XWhen a file cannot be opened but does exist, give error message.
- XIf file does not exists, check if directory exists.
- XMSDOS: t_cv and t_ci not set, but do invert char under cursor.
- XAdd option to switch off move to start of line (Waggoner/12 and 13).
- XCommand to show keys that are not used and available for mapping.
- XSettings edit mode: make file with ":set opt=xx", edit it, parse it as ex commands.
- XWhen memory gets low, reduce the number of undo levels (with confirmation).
- XAdd 'para_regex' option: regular expression for end of paragraph.
- Xtag-completion command: when tag found, replace it by the prototype, when not
- X found, replace it by the longest match.
- Xmake listings in a more-like way (mappings, files, settings, etc.).
- X":set -w all": list one option per line.
- XBefore overwriting a non-writable file with ":w!" ask for permission.
- XAmiga: test for 'w' flag when reading a file.
- XWhen appending to the last line, causing it to wrap, screen redraw first does it
- X at a wrong position.
- XInclude patches for Russian text (Marinichev/4).
- XEx commands in a mapping should not be put in the command line history.
- XOption not to change the search string when using a :tag command.
- XError message for ambiguous mapping: Include the arguments.
- XAdd ":retab". When "et" set, convert tabs to spaces, when "noet" vice versa.
- X ":retab 8" will replace tabs and spaces with the current "ts" setting
- X to a "ts" of 8.
- X:table command (Webb)
- XAdd command to go to last non-blank in line (like 0 vs. ^, $ vs. ???)
- XAdd 'backupdiralways', 'bda' option for 'bdir', like 'da' for 'dir'.
- XAdd option to recognize identifiers with everything but spaces ('forth'?).
- X Adjust isidchar().
- XMSDOS: How about supporting function keys #11 and #12?
- XWith blockwise visual mode and "c" command, insert same text in every line.
- XSearch filenames for starting with $HOME and replace it with "~" when displaying.
- XFor 'shell' option add possibility to give arguments for fast start (e.g. -f).
- X Not to be used for ":shell".
- XMake ":e file1 file2" work like ":n file1 file2"?
- XGive message "No lines in buffer" when last line in buffer deleted.
- XWhen displaying (file xx of yy), add "not" when curbuf is not file xx.
- XAdd commands to do things in all buffers: ":Substitute", ":searchall", etc.
- XMake ":sleep" accept floating point numbers, like ":sleep 0.01".
- XWhen in replace mode and 'expandtab' set, make tab look like spaces.
- XSupport multiple search buffers, so macros can be made without side effects.
- XWith :read set '[ and '] to start/end of new lines
- XMake builtin termcaps with a configuration file and a program to translate
- X it into a .h file.
- XUse %> and #> for filename without path?
- XAllow multiple arguments for ":edit", add them to the argument list.
- XAllow multiple arguments for ":read", read all the files.
- XMake options from modelines only used in the buffer where the file is read.
- XFor visual mode: "." does a search for the string in the marked area. Only
- X when less than two lines. What key to use for backward search?
- XMatching with "%" should be configurable. 'matchstrings' =
- X (/*,*/),(^#if,^#else,^#endif)
- XExpanding ~ and $VAR in options should be done not only for the first entry.
- XAdd 'resizecmd' option: vi command to be executed when window is resized.
- XDo not accept mappings when waiting for key hit with --more--.
- XAdd option to make settings from modelines valid only in the file where they
- X were set. Reset options when starting to edit another file.
- XKeep output from listings in a window, so you can have a look at it while
- X working in another window. Put cmdline in a separate window?
- XKeyword completion code should use the case from the match.
- XAdd regular expression \{m,n\}: m to n matches. \{m\} is m matches, \{m,\} is
- X at least m matches. Also do \{,n\}: up to n matches.
- XWhen 'backup' is not set and 'writebackup is set, use a unique name for the
- X backup file, don't deleted the ".bak" file.
- X
- XFrom Elvis:
- Xfontchanges recognized "\\fB" etc.
- X:color command
- X:if and friends, conditional statements
- XRead .exfilerc when starting to edit a new file (can be used to load macros for
- X specific file type).
- XChange cursor shape in command/insert mode.
- X'flipcase' variable: upper/lower case pairs.
- X
- XFrom nvi:
- X'cdpath' option.
- X'remapmax' option.
- XAllow editing lines that do not fit in the window.
- X
- XFrom xvim:
- XUse '\' before commands to make them linewise.
- XAllow a newline in search patterns (also for :s, can delete newline).
- X Add BOW, EOW, NEWL, NLORANY, NLBUTANY, magic 'n' and 'r', etc.
- XAdd register for ':', '?' and '/' commands? (yank_buf()).
- XSupport mouse control (also weissman/1). With option to switch it off to
- X enable copy/paste.
- XSearching in help file.
- Xget code for backspace from termcap.
- XRemember last cursor position, optimize setcursor().
- X
- XFrom xvi:
- XCTRL-_ : swap 8th bit of character
- X
- XFrom vile:
- XCTRL-X e: edit file name under the cursor (like ^] and *)
- XShow unprintable characters in hex.
- XUse scrollbar.
- XWhen horizontal scrolling, use '<' and '>' for lines continuing outside of window.
- X
- XFar future extentions:
- X
- XAllow vertical splitting of screen (once).
- XAllow editing beyond end of line, just like there are all spaces. Switch this
- X on with an option or special insert mode command. Also allow editing
- X above start and below end of buffer.
- XMSdos: use extended or expanded memory.
- XWhen executing macro's: Save each line for undo only once.
- XSmart cut/paste: recognize words and adjust spaces before/after them.
- XAdd 'notwsuffixes' option: suffixes for files where 'tw' should be 0.
- XMake files with suffix in 'suffixes' option always appear in list of matched
- X files, but at the end.
- XKeyword completion: first look in the file for a match, then in a dictionary (Webb).
- XOption verbose; when on keep the screen uptodate, when off only redisplay when
- X input needed.
- XChange the output to the message line. Don't redraw the screen until the next
- X vi command. Remember message line for redraw. Integrate the command line
- X in updateScreen().
- XMode to keep text formatted while inserting/deleting. Use soft/hard returns with
- X an option to switch this off.
- XMode to keep C-code formatted (sort of on-line indent). Use colors for
- X keywords, comments, etc.
- XKorn-shell like command line editing (like editing a single line with vi). Use
- X :cmap! for mappings. Can be implemented like a buffer containing command
- X lines.
- XAdd column numbers to ":" commands (:line1:col1,line2:col2 cmd). Block can be
- X selected with CTRL-V.
- XAdd 'hidecomment' option: don't display comments in /* */ and after //.
- XAdd open mode, use it when terminal has no cursor positioning.
- XAdd macro language with real functions.
- XFile in local directory to store contents of named registers and named marks.
- X Write when quitting, read when starting.
- XSpecial "drawing mode": a line is drawn where the cursor is moved to. Backspace
- X deletes along the line (from jvim).
- XSave cursor position (and other things) for a next editing session.
- XPerform commands on multiple windows (:W%s/foo/bar/g), multiple arguments (:A)
- X or multiple buffers (:B).
- END_OF_FILE
- if test 19200 -ne `wc -c <'vim/todo'`; then
- echo shar: \"'vim/todo'\" unpacked with wrong size!
- fi
- # end of 'vim/todo'
- fi
- echo shar: End of archive 20 \(of 26\).
- cp /dev/null ark20isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 26 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-