diff options
44 files changed, 556 insertions, 131 deletions
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index ac689b6fc..766bcb0fc 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 7.0aa. Last change: 2005 Jan 14 +*change.txt* For Vim version 7.0aa. Last change: 2005 Feb 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -52,6 +52,8 @@ For inserting text see |insert.txt|. of the line and [count]-1 more lines [into register x]; synonym for "d$". (not |linewise|) + When the '#' flag is in 'cpoptions' the count is + ignored. {Visual}["x]x or *v_x* *v_d* *v_<Del>* {Visual}["x]d or @@ -1017,7 +1019,8 @@ except when the command specifies a register with ["x]. 4. Named registers "a to "z or "A to "Z *quote_alpha* *quotea* Vim fills these registers only when you say so. Specify them as lowercase letters to replace their previous contents or as uppercase letters to append -to their previous contents. +to their previous contents. When the '>' flag is present in 'cpoptions' then +a line break is inserted before the appended text. 5. Read-only registers ":, "., "% and "# These are '%', '#', ':' and '.'. You can use them only with the "p", "P", diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 450408c81..736ab793b 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.0aa. Last change: 2005 Feb 07 +*eval.txt* For Vim version 7.0aa. Last change: 2005 Feb 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1899,7 +1899,7 @@ cursor({lnum}, {col}) *cursor()* If {col} is zero, the cursor will stay in the current column. -deepcopy({expr}) *deepcopy()* *E698* +deepcopy({expr}[, {noref}]) *deepcopy()* *E698* Make a copy of {expr}. For Numbers and Strings this isn't different from using {expr} directly. When {expr} is a List a full copy is created. This means @@ -1907,10 +1907,15 @@ deepcopy({expr}) *deepcopy()* *E698* copy, and vise versa. When an item is a List, a copy for it is made, recursively. Thus changing an item in the copy does not change the contents of the original List. + When {noref} is omitted or zero a contained List or Dictionary + is only copied once. All references point to this single + copy. With {noref} set to 1 every occurrence of a List or + Dictionary results in a new copy. This also means that a + cyclic reference causes deepcopy() to fail. *E724* Nesting is possible up to 100 levels. When there is an item - that refers back to a higher level making a deep copy will - fail. + that refers back to a higher level making a deep copy with + {noref} set to 1 will fail. Also see |copy()|. delete({fname}) *delete()* @@ -4399,8 +4404,9 @@ Vim will look for the file "autoload/foo/bar.vim" in 'runtimepath'. The name before the first colon must be at least two characters long, otherwise it looks like a scope, such as "s:". -Note that the script will be sourced again and again if a function is called -that looks like it is defined in the autoload script but it isn't. +Note that when you make a mistake and call a function that is supposed to be +defined in an autoload script, but the script doesn't actually define the +function, the script will be sourced every time you try to call the function. ============================================================================== 6. Curly braces names *curly-braces-names* diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 74b68e16a..fad968f44 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 7.0aa. Last change: 2005 Jan 26 +*insert.txt* For Vim version 7.0aa. Last change: 2005 Feb 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -922,6 +922,9 @@ i Insert text before the cursor [count] times. *I* I Insert text before the first non-blank in the line [count] times. + When the 'H' flag is present in 'cpoptions' and the + line only contains blanks, insert start just before + the last blank. *gI* gI Insert text in column 1 [count] times. {not in Vi} @@ -941,11 +944,15 @@ gi Insert text in the same position as where Insert mode o Begin a new line below the cursor and insert text, repeat [count] times. {Vi: blank [count] screen lines} + When the '#' flag is in 'cpoptions' the count is + ignored. *O* O Begin a new line above the cursor and insert text, repeat [count] times. {Vi: blank [count] screen lines} + When the '#' flag is in 'cpoptions' the count is + ignored. These commands are used to start inserting text. You can end insert mode with <Esc>. See |mode-ins-repl| for the other special characters in Insert mode. diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt index daaa6020e..cfc318bf6 100644 --- a/runtime/doc/motion.txt +++ b/runtime/doc/motion.txt @@ -1,4 +1,4 @@ -*motion.txt* For Vim version 7.0aa. Last change: 2005 Feb 07 +*motion.txt* For Vim version 7.0aa. Last change: 2005 Feb 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -465,9 +465,12 @@ A paragraph begins after each empty line, and also at each of a set of paragraph macros, specified by the pairs of characters in the 'paragraphs' option. The default is "IPLPPPQPP LIpplpipbp", which corresponds to the macros ".IP", ".LP", etc. (These are nroff macros, so the dot must be in the -first column). A section boundary is also a paragraph boundary. Note that -this does not include a '{' or '}' in the first column. Also note that a -blank line (only containing white space) is NOT a paragraph boundary. +first column). A section boundary is also a paragraph boundary. +Note that a blank line (only containing white space) is NOT a paragraph +boundary. +Also note that this does not include a '{' or '}' in the first column. When +the '{' flag is in 'cpoptions' then '{' in the first column is used as a +paragraph boundary |posix|. *section* A section begins after a form-feed (<C-L>) in the first column and at each of diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index e1c6f5ae4..25558d642 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.0aa. Last change: 2005 Feb 07 +*options.txt* For Vim version 7.0aa. Last change: 2005 Feb 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1640,6 +1640,10 @@ A jump table for the options with a short description can be found at |Q_op|. "+=" and "-=" feature of ":set" |add-option-flags|. NOTE: This option is set to the Vi default value when 'compatible' is set and to the Vim default value when 'compatible' is reset. + NOTE: This option is set to the POSIX default value at startup when + the Vi default value would be used and the $VIM_POSIX environment + variable exists |posix|. This means tries to behave like the POSIX + specification. contains behavior ~ *cpo-a* @@ -1708,6 +1712,10 @@ A jump table for the options with a short description can be found at |Q_op|. yet. *cpo-g* g Goto line 1 when using ":edit" without argument. + *cpo-H* + H When using "I" on a line with only blanks, insert + before the last blank. Without this flag insert after + the last blank. *cpo-i* i When included, interrupting the reading of a file will leave it modified. @@ -1768,6 +1776,9 @@ A jump table for the options with a short description can be found at |Q_op|. *cpo-p* p Vi compatible Lisp indenting. When not present, a slightly better algorithm is used. + *cpo-q* + q When joining multiple lines leave the cursor at the + position where it would be when joining two lines. *cpo-r* r Redo ("." command) uses "/" to repeat a search command, instead of the actually used search string. @@ -1816,8 +1827,15 @@ A jump table for the options with a short description can be found at |Q_op|. x <Esc> on the command-line executes the command-line. The default in Vim is to abandon the command-line, because <Esc> normally aborts a command. |c_<Esc>| + *cpo-X* + X When using a count with "R" the replaced text is + deleted only once. Also when repeating "R" with "." + and a count. *cpo-y* y A yank command can be redone with ".". + *cpo-Z* + Z When using "w!" while the 'readonly' option is set, + don't reset 'readonly'. *cpo-!* ! When redoing a filter command, use the last used external command, whatever it was. Otherwise the last @@ -1856,7 +1874,7 @@ A jump table for the options with a short description can be found at |Q_op|. + When included, a ":write file" command will reset the 'modified' flag of the buffer, even though the buffer itself may still be different from its file. - cpo-star* + *cpo-star* * Use ":*" in the same way as ":@". When not included, ":*" is an alias for ":'<,'>", select the Visual area. *cpo-<* @@ -1867,6 +1885,28 @@ A jump table for the options with a short description can be found at |Q_op|. '<' included: "<Tab>" (5 characters) '<' excluded: "^I" (^I is a real <Tab>) Also see the 'k' flag above. + *cpo->* + > When appending to a register, put a line break before + the appended text. + + POSIX flags. These are not included in the Vi default value, except + when $VIM_POSIX was set on startup. |posix| + + contains behavior ~ + *cpo-#* + # A count before "D", "o" and "O" has no effect. + *cpo-{* + { The |{| and |}| commands also stop at a "{" character + at the start of a line. + *cpo-bar* + | The value of the $LINES and $COLUMNS environment + variables overrule the terminal size values obtained + with system specific functions. + *cpo-&* + & When ":preserve" was used keep the swap file when + exiting normally while this buffer is still loaded. + This flag is tested when exiting. + *'cscopepathcomp'* *'cspc'* 'cscopepathcomp' 'cspc' number (default 0) @@ -4684,9 +4724,10 @@ A jump table for the options with a short description can be found at |Q_op|. If on, writes fail unless you use a '!'. Protects you from accidentally overwriting a file. Default on when Vim is started in read-only mode ("vim -R") or when the executable is called "view". + When using ":w!" the 'readonly' option is reset for the current + buffer, unless the 'Z' flag is in 'cpoptions'. {not in Vi:} When using the ":view" command the 'readonly' option is - set for the newly edited buffer. When using ":w!" the 'readonly' - option is reset for the current buffer. + set for the newly edited buffer. *'remap'* *'noremap'* 'remap' boolean (default on) @@ -4835,6 +4876,7 @@ A jump table for the options with a short description can be found at |Q_op|. files: filetype.vim filetypes by file name |new-filetype| scripts.vim filetypes by file contents |new-filetype-scripts| + autoload/ automatically loaded scripts |autoload-functions| colors/ color scheme files |:colorscheme| compiler/ compiler files |:compiler| doc/ documentation |write-local-help| @@ -6741,6 +6783,20 @@ A jump table for the options with a short description can be found at |Q_op|. This option is not used for <F10>; on Win32 and with GTK <F10> will select the menu, unless it has been mapped. + *'window'* *'wi'* +'window' 'wi' number (default screen height - 1) + global + Window height. Do not confuse this with the height of the Vim window, + use 'lines' for that. + Used for |CTRL-F| and |CTRL-B| when the value is smaller than 'lines' + minus one. The screen will scroll 'window' minus two lines, with a + minimum of one. + When 'window' is equal to 'lines' minus one CTRL-F and CTRL-B scroll + in a much smarter way, taking care of wrapping lines. + When resizing the Vim window, the value is smaller than 1 or more than + or equal to 'lines' it will be set to 'lines' minus 1. + {Vi also uses the option to specify the number of displayed lines} + *'winheight'* *'wh'* *E591* 'winheight' 'wh' number (default 1) global diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt index 6913be2e8..ffd150960 100644 --- a/runtime/doc/recover.txt +++ b/runtime/doc/recover.txt @@ -1,4 +1,4 @@ -*recover.txt* For Vim version 7.0aa. Last change: 2004 Jun 16 +*recover.txt* For Vim version 7.0aa. Last change: 2005 Feb 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -116,8 +116,12 @@ command: *:pre* *:preserve* *E313* *E314* :pre[serve] Write all text for all buffers into swap file. The - original file is no longer needed for recovery. {Vi: - emergency exit} + original file is no longer needed for recovery. + This sets a flag in the current buffer. When the '&' + flag is present in 'cpoptions' the swap file will not + be deleted for this buffer when Vim exits and the + buffer is still loaded |cpo-&|. + {Vi: might also exit} A Vim swap file can be recognized by the first six characters: "b0VIM ". After that comes the version number, e.g., "3.0". diff --git a/runtime/doc/scroll.txt b/runtime/doc/scroll.txt index 288552d5c..262753366 100644 --- a/runtime/doc/scroll.txt +++ b/runtime/doc/scroll.txt @@ -1,4 +1,4 @@ -*scroll.txt* For Vim version 7.0aa. Last change: 2004 Jun 08 +*scroll.txt* For Vim version 7.0aa. Last change: 2005 Feb 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -52,6 +52,8 @@ CTRL-D Scroll window Downwards in the buffer. The number of <PageDown> or *<PageDown>* *CTRL-F* CTRL-F Scroll window [count] pages Forwards (downwards) in the buffer. See also 'startofline' option. + When there is only one window the 'window' option + might be used. *z+* z+ Without [count]: Redraw with the line just below the @@ -89,6 +91,8 @@ CTRL-U Scroll window Upwards in the buffer. The number of <PageUp> or *<PageUp>* *CTRL-B* CTRL-B Scroll window [count] pages Backwards (upwards) in the buffer. See also 'startofline' option. + When there is only one window the 'window' option + might be used. *z^* z^ Without [count]: Redraw with the line just above the diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 49b424afb..46a5e0b02 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1,4 +1,4 @@ -*starting.txt* For Vim version 7.0aa. Last change: 2005 Jan 25 +*starting.txt* For Vim version 7.0aa. Last change: 2005 Feb 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -469,22 +469,23 @@ a slash. Thus "-R" means recovery and "-/R" readonly. started in Ex mode, see |-s-ex|. See also |complex-repeat|. {not in Vi} + *-w_nr* +-w {number} +-w{number} Set the 'window' option to {number}. + *-w* -w {scriptout} All the characters that you type are recorded in the file "scriptout", until you exit Vim. This is useful if you want to create a script file to be used with "vim -s" or ":source!". When the "scriptout" file already exists, new characters are appended. See also |complex-repeat|. + {scriptout} cannot start with a digit. {not in Vi} *-W* -W {scriptout} Like -w, but do not append, overwrite an existing file. {not in Vi} - *-w_nr* --w{number} Does nothing. This was included for Vi-compatibility. In Vi - it sets the 'window' option, which is not implemented in Vim. - --remote [+{cmd}] {file} ... Open the {file} in another Vim that functions as a server. Any non-file arguments must come before this. diff --git a/runtime/doc/tags b/runtime/doc/tags index 30611f86f..bc1e9ef0f 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -943,7 +943,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'wfh' options.txt /*'wfh'* 'wh' options.txt /*'wh'* 'whichwrap' options.txt /*'whichwrap'* -'wi' vi_diff.txt /*'wi'* +'wi' options.txt /*'wi'* 'wig' options.txt /*'wig'* 'wildchar' options.txt /*'wildchar'* 'wildcharm' options.txt /*'wildcharm'* @@ -953,7 +953,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'wildoptions' options.txt /*'wildoptions'* 'wim' options.txt /*'wim'* 'winaltkeys' options.txt /*'winaltkeys'* -'window' vi_diff.txt /*'window'* +'window' options.txt /*'window'* 'winfixheight' options.txt /*'winfixheight'* 'winheight' options.txt /*'winheight'* 'winminheight' options.txt /*'winminheight'* @@ -4379,17 +4379,21 @@ count-variable eval.txt /*count-variable* count1-variable eval.txt /*count1-variable* cp-default version5.txt /*cp-default* cpo-! options.txt /*cpo-!* +cpo-# options.txt /*cpo-#* cpo-$ options.txt /*cpo-$* cpo-% options.txt /*cpo-%* +cpo-& options.txt /*cpo-&* cpo-+ options.txt /*cpo-+* cpo-- options.txt /*cpo--* cpo-< options.txt /*cpo-<* +cpo-> options.txt /*cpo->* cpo-A options.txt /*cpo-A* cpo-B options.txt /*cpo-B* cpo-C options.txt /*cpo-C* cpo-D options.txt /*cpo-D* cpo-E options.txt /*cpo-E* cpo-F options.txt /*cpo-F* +cpo-H options.txt /*cpo-H* cpo-I options.txt /*cpo-I* cpo-J options.txt /*cpo-J* cpo-K options.txt /*cpo-K* @@ -4399,8 +4403,10 @@ cpo-O options.txt /*cpo-O* cpo-R options.txt /*cpo-R* cpo-S options.txt /*cpo-S* cpo-W options.txt /*cpo-W* +cpo-X options.txt /*cpo-X* cpo-a options.txt /*cpo-a* cpo-b options.txt /*cpo-b* +cpo-bar options.txt /*cpo-bar* cpo-c options.txt /*cpo-c* cpo-d options.txt /*cpo-d* cpo-e options.txt /*cpo-e* @@ -4414,14 +4420,17 @@ cpo-m options.txt /*cpo-m* cpo-n options.txt /*cpo-n* cpo-o options.txt /*cpo-o* cpo-p options.txt /*cpo-p* +cpo-q options.txt /*cpo-q* cpo-r options.txt /*cpo-r* cpo-s options.txt /*cpo-s* +cpo-star options.txt /*cpo-star* cpo-t options.txt /*cpo-t* cpo-u options.txt /*cpo-u* cpo-v options.txt /*cpo-v* cpo-w options.txt /*cpo-w* cpo-x options.txt /*cpo-x* cpo-y options.txt /*cpo-y* +cpo-{ options.txt /*cpo-{* crash-recovery recover.txt /*crash-recovery* creating-menus gui.txt /*creating-menus* credits intro.txt /*credits* @@ -5693,6 +5702,7 @@ new-options-5.2 version5.txt /*new-options-5.2* new-options-5.4 version5.txt /*new-options-5.4* new-perl-python version5.txt /*new-perl-python* new-plugins version6.txt /*new-plugins* +new-posix version7.txt /*new-posix* new-print-multi-byte version7.txt /*new-print-multi-byte* new-printing version6.txt /*new-printing* new-runtime-dir version5.txt /*new-runtime-dir* @@ -5837,6 +5847,7 @@ popup-menu gui.txt /*popup-menu* popup-menu-added version5.txt /*popup-menu-added* ports-5.2 version5.txt /*ports-5.2* ports-6 version6.txt /*ports-6* +posix vi_diff.txt /*posix* posix-compliance vi_diff.txt /*posix-compliance* posix-screen-size vi_diff.txt /*posix-screen-size* postscr-syntax syntax.txt /*postscr-syntax* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 9497b677b..85f2de662 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.0aa. Last change: 2005 Feb 07 +*todo.txt* For Vim version 7.0aa. Last change: 2005 Feb 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -30,15 +30,34 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. *known-bugs* -------------------- Known bugs and current work ----------------------- -Make list of user functions a hashtable. +"norm! gQ" hangs. Fixes in ex_getln.c and ex_docmd.c also in Vim 6.3? + +autoload: +- Rename directory to from "autoload" to "library"? +- Also autoload when reading a variable with a long:name that doesn't exist. +- Example using short script with user command that triggers loading script + with functionality. +- Remark about one script depending on another, recursively. +- Catch recursive autoloading. +- Add note in docs about HelpExtractor wrapper script. Think about a good way + that the user doesn't need to run ":helptags" manually. POSIX compliance: -- See ~/src/posix/TET//vsc/results/0015e/journal test 130 -- "-w#" and "-w #" argument doesn't work. +- vi test 310 fails; exit code non-zero when any error occurred? +- vi test 33 fails for unknown reasons +- ex test 24 fails because test is wrong? +- ex test 29 fails because exit value is always 0. +- ex tests 47, 48, 49 fail because .exrc file isn't read in silent mode and + $EXINIT isn't used. +- ex test 57 fails, need to look into this. +- check ex test output +- report use of $LINES and $COLUMNS to austin maillist. -Announce autoload functionality. +Make list of user functions a hashtable. -"norm! gQ" hangs. Fixes in ex_getln.c and ex_docmd.c also in Vim 6.3? +Docs for using "syntax/{filetype}/*.vim" syntax files. + +Include Mac unicode patch (Da Woon Jung). New Motif toolbar button from Marcin Dalecki: - When the mouse pointer is over an Agide button the red becomes black. @@ -51,6 +70,13 @@ Awaiting response: - Win32: tearoff menu window should have a scrollbar when it's taller than the screen. +Patch from Yegappan Lakshmanan for redirecting of Ex commands (Feb 9 10:58): +Look into how lval struct is kept for a long time. + :redir => variable + :redir =>> variable (append) + +Improvements for Python indent script: Peter Wilson. + PLANNED FOR VERSION 7.0: @@ -229,6 +255,14 @@ usec. reltime([start, [end]]) reltime(start) current time relative to [start] echo timestring(reltime(start), 3) (3 is nr of digits after dot) reltime(start, end) difference between start and end +Real Profiling: + - :profile start /tmp/somefile (append if exists) + - :profile pause + - :profile resume + - :profile stop + - per function line + - self, Vim and total time (incl system time) + - dump results in file on exit or when stopped. Add more tests for all new functionality in Vim 7. Especially new functions. @@ -2405,6 +2439,8 @@ Virtual edit: Text objects: 8 Add test script for text object commands "aw", "iW", etc. +8 Add text object for part of a CamelHumedWord and under_scored_word. + (Scott Graham) "ac" and "au"? 7 Add text object for current search pattern: "a/" and "i/". Makes it possible to turn text highlighted for 'hlsearch' into a Visual area. 8 Add "gp" and "gP" commands: insert text and make sure there is a single @@ -3208,8 +3244,6 @@ Various improvements: :redir @r> register (append) :redir #> bufname :redir #>> bufname (append) - :redir => variable - :redir =>> variable (append) - Give error message when starting :redir: twice or using END when no redirection was active. - Setting of options, specifically for a buffer or window, with diff --git a/runtime/doc/usr_03.txt b/runtime/doc/usr_03.txt index f2ef2af02..8ff6c392f 100644 --- a/runtime/doc/usr_03.txt +++ b/runtime/doc/usr_03.txt @@ -1,4 +1,4 @@ -*usr_03.txt* For Vim version 7.0aa. Last change: 2004 Jan 17 +*usr_03.txt* For Vim version 7.0aa. Last change: 2005 Feb 08 VIM USER MANUAL - by Bram Moolenaar @@ -13,7 +13,7 @@ these commands below |Q_lr|. |03.1| Word movement |03.2| Moving to the start or end of a line |03.3| Moving to a character -|03.4| Matching a paren +|03.4| Matching a parenthesis |03.5| Moving to a specific line |03.6| Telling where you are |03.7| Scrolling around @@ -145,7 +145,7 @@ aborted forward search and doesn't do anything. Note: <Esc> cancels most operations, not just searches. ============================================================================== -*03.4* Matching a paren +*03.4* Matching a parenthesis When writing a program you often end up with nested () constructs. Then the "%" command is very handy: It moves to the matching paren. If the cursor is diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt index 2aa2b92b8..465986302 100644 --- a/runtime/doc/usr_05.txt +++ b/runtime/doc/usr_05.txt @@ -1,4 +1,4 @@ -*usr_05.txt* For Vim version 7.0aa. Last change: 2004 Dec 29 +*usr_05.txt* For Vim version 7.0aa. Last change: 2005 Feb 08 VIM USER MANUAL - by Bram Moolenaar @@ -7,7 +7,7 @@ Vim can be tuned to work like you want it to. This chapter shows you how to make Vim start with options set to different values. Add plugins to extend -Vims capabilities. Or define your own macros. +Vim's capabilities. Or define your own macros. |05.1| The vimrc file |05.2| The example vimrc file explained @@ -251,8 +251,8 @@ you use an existing Vim command, that command will no longer be available. You better avoid that. One key that can be used with mappings is the backslash. Since you probably want to define more than one mapping, add another character. You -could map "\p" to add parens around a word, and "\c" to add curly braces, for -example: > +could map "\p" to add parentheses around a word, and "\c" to add curly braces, +for example: > :map \p i(<Esc>ea)<Esc> :map \c i{<Esc>ea}<Esc> diff --git a/runtime/doc/usr_27.txt b/runtime/doc/usr_27.txt index 82d17b215..b7836ef38 100644 --- a/runtime/doc/usr_27.txt +++ b/runtime/doc/usr_27.txt @@ -1,4 +1,4 @@ -*usr_27.txt* For Vim version 7.0aa. Last change: 2004 Jun 26 +*usr_27.txt* For Vim version 7.0aa. Last change: 2005 Feb 08 VIM USER MANUAL - by Bram Moolenaar @@ -304,9 +304,9 @@ Will match "ab" in "abbb". Actually, it will never match more than one b, because there is no reason to match more. It requires something else to force it to match more than the lower limit. The same rules apply to removing "n" and "m". It's even possible to remove -both of the numbes, resulting in "\{-}". This matches the item before it zero -or more times, as few as possible. The item by itself always matches zero -times. It is useful when combined with something else. Example: > +both of the numbers, resulting in "\{-}". This matches the item before it +zero or more times, as few as possible. The item by itself always matches +zero times. It is useful when combined with something else. Example: > /a.\{-}b diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 74c74fdb7..638a158e6 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -1,4 +1,4 @@ -*usr_41.txt* For Vim version 7.0aa. Last change: 2005 Feb 07 +*usr_41.txt* For Vim version 7.0aa. Last change: 2005 Feb 08 VIM USER MANUAL - by Bram Moolenaar @@ -1087,7 +1087,7 @@ know the key. A Dictionary is created with curly braces: > :let uk2nl = {'one': 'een', 'two': 'twee', 'three': 'drie'} -Now you can lookup words by putting the key in square brakets: > +Now you can lookup words by putting the key in square brackets: > :echo uk2nl['two'] < twee ~ @@ -1185,7 +1185,7 @@ Is equivalent to: > The get() function checks if a key is present in a Dictionary. If it is, then the value is retrieved. If it isn't, then the default value is returned, in -the example it's '???'. This is a covenient way to handle situations where a +the example it's '???'. This is a convenient way to handle situations where a key may not be present and you don't want an error message. The join() function does the opposite of split(): it joins together a list of diff --git a/runtime/doc/various.txt b/runtime/doc/various.txt index 0f7947073..b9408025a 100644 --- a/runtime/doc/various.txt +++ b/runtime/doc/various.txt @@ -1,4 +1,4 @@ -*various.txt* For Vim version 7.0aa. Last change: 2005 Feb 07 +*various.txt* For Vim version 7.0aa. Last change: 2005 Feb 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -98,8 +98,9 @@ g8 Print the hex values of the bytes used in the :{range}z[+-^.=]{count} Display several lines of text surrounding the line specified with {range}, or around the current line if there is no {range}. If there is a {count}, that's - how many lines you'll see; otherwise, the current - window size is used. + how many lines you'll see; if there is only one window + then the 'window' option is used, otherwise the + current window size is used. :z can be used either alone or followed by any of several punctuation marks. These have the following diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt index 49fae2473..203204e9f 100644 --- a/runtime/doc/version7.txt +++ b/runtime/doc/version7.txt @@ -1,4 +1,4 @@ -*version7.txt* For Vim version 7.0aa. Last change: 2005 Feb 07 +*version7.txt* For Vim version 7.0aa. Last change: 2005 Feb 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -22,6 +22,7 @@ Vim script enhancements |new-vim-script| KDE support |new-KDE| Translated manual pages |new-manpage-trans| Internal grep |new-vimgrep| +POSIX compatibility |new-posix| Various new items |new-items-7| IMPROVEMENTS |improvements-7| @@ -94,6 +95,9 @@ non-latin1 environment, such as Russian. Previously Vim would exit when there are two windows, both of them displaying a help file, and using ":quit". Now only the window is closed. +"-w {scriptout}" only works when {scriptout} doesn't start with a digit. +Otherwise it's used to set the 'window' option. + ============================================================================== NEW FEATURES *new-7* @@ -158,6 +162,31 @@ patterns, this also allows grepping in compressed and remote files. |:vimgrep|. +POSIX compatibility *new-posix* +------------------- + +The POSIX test suite was used to verify POSIX compatibility. A number of +problems have been fixed to make Vim more POSIX compatible. Some of them +conflict with traditional Vi or expected behavior. The $VIM_POSIX environment +variable can be set to get POSIX compatibility. See |posix|. + +Items that were fixed for both Vi and POSIX compatibilty: +- repeating "R" with a count only overwrites text once; added the 'X' flag to + 'cpoptions' |cpo-X| +- a vertical movement command that moves to a non-existing line fails; added + the '-' flag to 'cpoptions' |cpo--| +- when preserving a file and doing ":q!" the file can be recovered; added the + '&' flag to 'cpoptions' |cpo-&| +- The 'window' option is partly implemented. It specifies how much CTRL-F and + CTRL-B scroll when there is one window. The "-w {number}" argument is now + accepted. "-w {scriptout}" only works when {scriptout} doesn't start with a + digit. +- Allow "-c{command}" argument, no space between "-c" and {command}. +- When writing a file with ":w!" don't reset 'readonly' when 'Z' is present in + 'cpoptions'. + + + Various new items *new-items-7* ----------------- @@ -761,4 +790,27 @@ When using ":s" or "&" to repeat the last substitute and "$" was used to put the cursor in the last column, put the cursor in the last column again. This is Vi compatible. +Vim is not fully POSIX compliant but sticks with traditional Vi behavior. +Added a few flags in 'cpoptions' to behave the POSIX way when wanted. The +$VIM_POSIX environment variable is checked to set the default. + +Appending to a register didn't insert a line break like Vi. Added the '>' +flag to 'cpoptions' for this. + +Using "I" in a line with only blanks appended to the line. This is not Vi +compatible. Added the 'H' flag in 'coptions' for this. + +When joining multiple lines the cursor would be at the last joint, but Vi +leaves it at the position where "J" would put it. Added the 'q' flag in +'cpoptions' for this. + +Autoindent didn't work for ":insert" and ":append". + +Using ":append" in an empty buffer kept the dummy line. Now it's deleted to +be Vi compatible. + +When reading commands from a file and stdout goes to a terminal, would still +request the xterm version. Vim can't read it, thus the output went to the +shell and caused trouble there. + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt index 3745b5969..78993f0a3 100644 --- a/runtime/doc/vi_diff.txt +++ b/runtime/doc/vi_diff.txt @@ -1,4 +1,4 @@ -*vi_diff.txt* For Vim version 7.0aa. Last change: 2005 Feb 07 +*vi_diff.txt* For Vim version 7.0aa. Last change: 2005 Feb 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -50,7 +50,6 @@ prompt boolean (default on) *'prompt'* redraw boolean (default off) *'redraw'* slowopen (slow) boolean (default off) *'slowopen'* *'slow'* sourceany boolean (default off) *'sourceany'* -window (wi) number (default 23) *'window'* *'wi'* w300 number (default 23) *'w300'* w1200 number (default 23) *'w1200'* w9600 number (default 23) *'w9600'* @@ -883,19 +882,32 @@ Only Vim is able to accept options in between and after the file names. @{cmdfile} Vile: use {cmdfile} as startup file. ============================================================================== -7. POSIX compliance *posix-compliance* +7. POSIX compliance *posix* *posix-compliance* In 2005 the POSIX test suite was run to check the compatiblity of Vim. Most -of the test was executed properly. Here are the few things where Vim differs: +of the test was executed properly. There are the few things where Vim +is not POSIX compliant. -The -w{number} and -w {number} command line arguments are not supported by -Vim. +Set the $VIM_POSIX environment variable to have 'cpoptions' include the POSIX +flags when Vim starts up. This makes Vim run as POSIX as it can. That's +different from being Vi compatible. + +This is where Vim does not behave as POSIX specifies and why: + + The -w{number} and -w {number} command line arguments are not + supported by Vim. *posix-screen-size* -The $COLUMNS and $LINES environment variables are ignored by Vim if the size -can be obtained from the terminal in a more reliable way. Set the $VIM_POSIX -environment variable to have $COLUMNS and $LINES overrule sizes obtained in -another way. + The $COLUMNS and $LINES environment variables are ignored by Vim if + the size can be obtained from the terminal in a more reliable way. + Add the '|' flag to 'cpoptions' to have $COLUMNS and $LINES overrule + sizes obtained in another way. + + The "{" and "}" commands don't stop at a "{" in the original Vi, but + POSIX specifies it does. Add the '{' flag to 'cpoptions' if you want + it the POSIX way. + The "D", "o" and "O" commands accept a count. Also when repeated. + Add the '#' flag to 'cpoptions' if you want to ignore the count. vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/indent/python.vim b/runtime/indent/python.vim index b5a0849f9..e0e8e71f1 100644 --- a/runtime/indent/python.vim +++ b/runtime/indent/python.vim @@ -1,8 +1,8 @@ " Vim indent file -" Language: Python -" Maintainer: Bram Moolenaar <Bram@vim.org> +" Language: Python +" Maintainer: Bram Moolenaar <Bram@vim.org> " Original Author: David Bustos <bustos@caltech.edu> -" Last Change: 2004 Jul 25 +" Last Change: 2005 Feb 08 " Only load this indent file when no other was loaded. if exists("b:did_indent") diff --git a/runtime/syntax/mail.vim b/runtime/syntax/mail.vim index 6fc0afb9d..98034dff6 100644 --- a/runtime/syntax/mail.vim +++ b/runtime/syntax/mail.vim @@ -2,7 +2,7 @@ " Language: Mail file " Previous Maintainer: Felix von Leitner <leitner@math.fu-berlin.de> " Maintainer: Gautam Iyer <gautam@math.uchicago.edu> -" Last Change: Mon 23 Feb 2004 02:26:16 PM CST +" Last Change: Thu 10 Feb 2005 09:46:26 AM CST " Quit when a syntax file was already loaded if exists("b:current_syntax") @@ -38,8 +38,8 @@ syn match mailSubject contained "\v(^(\> ?)*)@<=subject:.*$" contains=@Spell " Anything in the header between < and > is an email address syn match mailHeaderEmail contained "<.\{-}>" -" Mail Signatures. (Begin with "--", end with change in quote level) -syn region mailSignature keepend contains=@mailLinks,@mailQuoteExps start="^\z(\(> \?\)*\)-- *$" end="^\z1$" end="^\z1\@!"me=s-1 end="^\z1\(> \?\)\+"me=s-1 +" Mail Signatures. (Begin with "-- ", end with change in quote level) +syn region mailSignature keepend contains=@mailLinks,@mailQuoteExps start="^\z(\(> \?\)*\)-- $" end="^\z1$" end="^\z1\@!"me=s-1 end="^\z1\(> \?\)\+"me=s-1 " URLs start with a known protocol or www,web,w3. syn match mailURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-z0-9/]` diff --git a/runtime/syntax/synload.vim b/runtime/syntax/synload.vim index 652cdba82..3e54b6948 100644 --- a/runtime/syntax/synload.vim +++ b/runtime/syntax/synload.vim @@ -1,6 +1,6 @@ " Vim syntax support file " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2004 Aug 28 +" Last Change: 2005 Feb 08 " This file sets up for syntax highlighting. " It is loaded from "syntax.vim" and "manual.vim". @@ -50,7 +50,7 @@ fun! s:SynSet() if s != "" " Load the syntax file(s) - exe "runtime! syntax/" . s . ".vim" + exe "runtime! syntax/" . s . ".vim syntax/" . s . "/*.vim" endif endfun diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 60373bf90..e09b21b8a 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: Vim 7.0 script " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> -" Last Change: January 31, 2005 -" Version: 7.0-03 +" Last Change: February 09, 2005 +" Version: 7.0-04 " Automatically generated keyword lists: {{{1 " Quit when a syntax file was already loaded {{{2 @@ -16,7 +16,7 @@ syn keyword vimTodo contained COMBAK NOT RELEASED TODO WIP syn cluster vimCommentGroup contains=vimTodo " regular vim commands {{{2 -syn keyword vimCommand contained ab[breviate] abc[lear] abo[veleft] al[l] arga[dd] argd[elete] argdo arge[dit] argg[lobal] argl[ocal] ar[gs] argu[ment] as[cii] bad[d] ba[ll] bd[elete] be bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bN[ext] bo[tright] bp[revious] brea[k] breaka[dd] breakd[el] breakl[ist] br[ewind] bro[wse] bufdo b[uffer] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cal[l] cat[ch] cb[uffer] cc ccl[ose] cd ce[nter] cf[ile] cfir[st] cg[etfile] c[hange] changes chd[ir] che[ckpath] checkt[ime] cla[st] cl[ist] clo[se] cmapc[lear] cnew[er] cn[ext] cN[ext] cnf[ile] cNf[ile] cnorea[bbrev] col[der] colo[rscheme] comc[lear] comp[iler] conf[irm] con[tinue] cope[n] co[py] cpf[ile] cp[revious] cq[uit] cr[ewind] cuna[bbrev] cu[nmap] cw[indow] debugg[reedy] delc[ommand] d[elete] DeleteFirst delf[unction] delm[arks] diffg[et] diffoff diffpatch diffpu[t] diffsplit diffthis dig[raphs] di[splay] dj[ump] dl[ist] dr[op] ds[earch] dsp[lit] echoe[rr] echom[sg] echon e[dit] el[se] elsei[f] em[enu] emenu* endfo[r] endf[unction] en[dif] endt[ry] endw[hile] ene[w] ex exi[t] exu[sage] f[ile] files filetype fina[lly] fin[d] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] folddoc[losed] foldd[oopen] foldo[pen] for fu[nction] g[lobal] go[to] gr[ep] grepa[dd] ha[rdcopy] h[elp] helpf[ind] helpg[rep] helpt[ags] hid[e] his[tory] I ia[bbrev] iabc[lear] if ij[ump] il[ist] imapc[lear] inorea[bbrev] is[earch] isp[lit] iuna[bbrev] iu[nmap] j[oin] ju[mps] k keepalt keepj[umps] kee[pmarks] lan[guage] la[st] lc[d] lch[dir] le[ft] lefta[bove] l[ist] lm[ap] lmapc[lear] ln[oremap] lo[adview] loc[kmarks] ls lu[nmap] mak[e] ma[rk] marks mat[ch] menut[ranslate] mk[exrc] mks[ession] mkvie[w] mkv[imrc] mod[e] m[ove] mzf[ile] mz[scheme] new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] Nread nu[mber] nun[map] Nw omapc[lear] on[ly] o[pen] opt[ions] ou[nmap] pc[lose] ped[it] pe[rl] perld[o] po[p] popu popu[p] pp[op] pre[serve] prev[ious] p[rint] P[rint] prompt promptf[ind] promptr[epl] ps[earch] pta[g] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptN[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] pyf[ile] py[thon] qa[ll] q[uit] quita[ll] r[ead] rec[over] redi[r] red[o] redr[aw] redraws[tatus] reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] rub[y] rubyd[o] rubyf[ile] ru[ntime] rv[iminfo] sal[l] sandbox sa[rgument] sav[eas] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbN[ext] sbp[revious] sbr[ewind] sb[uffer] scripte[ncoding] scrip[tnames] se[t] setf[iletype] setg[lobal] setl[ocal] sf[ind] sfir[st sh[ell] sign sil[ent] sim[alt] sla[st] sl[eep] sm[agic] sn[ext] sN[ext] sni[ff] sno[magic] so[urce] sp[lit] spr[evious] sre[wind] sta[g] star[tinsert] startr[eplace] stj[ump] st[op] stopi[nsert] sts[elect] sun[hide] sus[pend] sv[iew] syncbind t ta[g] tags tc[l] tcld[o] tclf[ile] te[aroff] tf[irst] the th[row] tj[ump] tl[ast] tm tm[enu] tn[ext] tN[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu tu[nmenu] una[bbreviate] u[ndo] unh[ide] unm[ap] up[date] verb[ose] ve[rsion] vert[ical] v[global] vie[w] vim[grep] vimgrepa[dd] vi[sual] viu[sage] vmapc[lear] vne[w] vs[plit] vu[nmap] wa[ll] wh[ile] winc[md] windo winp[os] winpos* win[size] wn[ext] wN[ext] wp[revious] wq wqa[ll] w[rite] ws[verb] wv[iminfo] X xa[ll] x[it] y[ank] +syn keyword vimCommand contained ab[breviate] abc[lear] abo[veleft] al[l] arga[dd] argd[elete] argdo arge[dit] argg[lobal] argl[ocal] ar[gs] argu[ment] as[cii] bad[d] ba[ll] bd[elete] be bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bN[ext] bo[tright] bp[revious] brea[k] breaka[dd] breakd[el] breakl[ist] br[ewind] bro[wse] bufdo b[uffer] buffers bun[load] bw[ipeout] ca[bbrev] cabc[lear] cal[l] cat[ch] cb[uffer] cc ccl[ose] cd ce[nter] cf[ile] cfir[st] cg[etfile] c[hange] changes chd[ir] che[ckpath] checkt[ime] cla[st] cl[ist] clo[se] cmapc[lear] cnew[er] cn[ext] cN[ext] cnf[ile] cNf[ile] cnorea[bbrev] col[der] colo[rscheme] comc[lear] comp[iler] conf[irm] con[tinue] cope[n] co[py] cpf[ile] cp[revious] cq[uit] cr[ewind] cuna[bbrev] cu[nmap] cw[indow] debugg[reedy] delc[ommand] d[elete] DeleteFirst delf[unction] delm[arks] diffg[et] diffoff diffpatch diffpu[t] diffsplit diffthis dig[raphs] di[splay] dj[ump] dl[ist] dr[op] ds[earch] dsp[lit] echoe[rr] echom[sg] echon e[dit] el[se] elsei[f] em[enu] emenu* endfo[r] endf[unction] en[dif] endt[ry] endw[hile] ene[w] ex exi[t] exu[sage] f[ile] files filetype fina[lly] fin[d] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] folddoc[losed] foldd[oopen] foldo[pen] for fu[nction] g[lobal] go[to] gr[ep] grepa[dd] ha[rdcopy] h[elp] helpf[ind] helpg[rep] helpt[ags] hid[e] his[tory] I ia[bbrev] iabc[lear] if ij[ump] il[ist] imapc[lear] inorea[bbrev] is[earch] isp[lit] iuna[bbrev] iu[nmap] j[oin] ju[mps] k keepalt keepj[umps] kee[pmarks] lan[guage] la[st] lc[d] lch[dir] le[ft] lefta[bove] l[ist] lm[ap] lmapc[lear] ln[oremap] lo[adview] loc[kmarks] lockv[ar] ls lu[nmap] mak[e] ma[rk] marks mat[ch] menut[ranslate] mk[exrc] mks[ession] mkvie[w] mkv[imrc] mod[e] m[ove] mzf[ile] mz[scheme] nbkey new n[ext] N[ext] nmapc[lear] noh[lsearch] norea[bbrev] Nread nu[mber] nun[map] Nw omapc[lear] on[ly] o[pen] opt[ions] ou[nmap] pc[lose] ped[it] pe[rl] perld[o] po[p] popu popu[p] pp[op] pre[serve] prev[ious] p[rint] P[rint] prompt promptf[ind] promptr[epl] ps[earch] pta[g] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptN[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] pyf[ile] py[thon] qa[ll] q[uit] quita[ll] r[ead] rec[over] redi[r] red[o] redr[aw] redraws[tatus] reg[isters] res[ize] ret[ab] retu[rn] rew[ind] ri[ght] rightb[elow] rub[y] rubyd[o] rubyf[ile] ru[ntime] rv[iminfo] sal[l] sandbox sa[rgument] sav[eas] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbN[ext] sbp[revious] sbr[ewind] sb[uffer] scripte[ncoding] scrip[tnames] se[t] setf[iletype] setg[lobal] setl[ocal] sf[ind] sfir[st sh[ell] sign sil[ent] sim[alt] sla[st] sl[eep] sm[agic] sn[ext] sN[ext] sni[ff] sno[magic] so[urce] sp[lit] spr[evious] sre[wind] sta[g] star[tinsert] startr[eplace] stj[ump] st[op] stopi[nsert] sts[elect] sun[hide] sus[pend] sv[iew] syncbind t ta[g] tags tc[l] tcld[o] tclf[ile] te[aroff] tf[irst] the th[row] tj[ump] tl[ast] tm tm[enu] tn[ext] tN[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] tu tu[nmenu] una[bbreviate] u[ndo] unh[ide] unlo[ckvar] unm[ap] up[date] verb[ose] ve[rsion] vert[ical] v[global] vie[w] vim[grep] vimgrepa[dd] vi[sual] viu[sage] vmapc[lear] vne[w] vs[plit] vu[nmap] wa[ll] wh[ile] winc[md] windo winp[os] winpos* win[size] wn[ext] wN[ext] wp[revious] wq wqa[ll] w[rite] ws[verb] wv[iminfo] X xa[ll] x[it] y[ank] syn match vimCommand contained "\<z[-+^.=]" " vimOptions are caught only when contained in a vimSet {{{2 @@ -44,7 +44,7 @@ syn keyword vimErrSetting contained hardtabs ht w1200 w300 w9600 wi window " AutoBuf Events {{{2 syn case ignore -syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdwinEnter CmdwinLeave ColorScheme CursorHold E135 E143 E200 E201 E203 E204 EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter InsertChange InsertEnter InsertLeave QuickFixCmdPre QuickFixCmdPost RemoteReply StdinReadPost StdinReadPre Syntax TermChanged TermResponse User UserGettingBored VimEnter VimLeave VimLeavePre WinEnter WinLeave +syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre Cmd-event CmdwinEnter CmdwinLeave ColorScheme CursorHold E135 E143 E200 E201 E203 E204 EncodingChanged FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter InsertChange InsertEnter InsertLeave QuickFixCmdPost QuickFixCmdPre RemoteReply StdinReadPost StdinReadPre Syntax TermChanged TermResponse User UserGettingBored VimEnter VimLeave VimLeavePre WinEnter WinLeave " Highlight commonly used Groupnames {{{2 syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo @@ -55,7 +55,7 @@ syn match vimHLGroup contained "Conceal" syn case match " Function Names {{{2 -syn keyword vimFuncName contained add append argc argidx argv browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx call char2nr cindent col confirm copy count cscope_connection cursor deepcopy delete did_filetype diff_filler diff_hlID empty escape eval eventhandler executable exists expand expr8 extend filereadable filewritable filter finddir findfile fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreground function get getbufvar getchar getcharmod getcmdline getcmdpos getcwd getfontname getfperm getfsize getftime getftype getline getreg getregtype getwinposx getwinposy getwinvar glob globpath has has_key hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent index input inputdialog inputrestore inputsave inputsecret insert isdirectory items join keys len libcall libcallnr line line2byte lispindent localtime map maparg mapcheck match matchend matchstr max min mode nextnonblank nr2char prevnonblank range remote_expr remote_foreground remote_peek remote_read remote_send remove rename repeat resolve reverse search searchpair server2client serverlist setbufvar setcmdpos setline setreg setwinvar simplify sort split strftime stridx string strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system tempname tolower toupper tr type values virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winwidth +syn keyword vimFuncName contained add append argc argidx argv browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx call char2nr cindent col confirm copy count cscope_connection cursor deepcopy delete did_filetype diff_filler diff_hlID empty escape eval eventhandler executable exists expand expr8 extend filereadable filewritable filter finddir findfile fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreground function get getbufvar getchar getcharmod getcmdline getcmdpos getcwd getfontname getfperm getfsize getftime getftype getline getreg getregtype getwinposx getwinposy getwinvar glob globpath has has_key hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent index input inputdialog inputrestore inputsave inputsecret insert isdirectory islocked items join keys len libcall libcallnr line line2byte lispindent localtime map maparg mapcheck match matchend matchlist matchstr max min mode nextnonblank nr2char prevnonblank range readfile remote_expr remote_foreground remote_peek remote_read remote_send remove rename repeat resolve reverse search searchpair server2client serverlist setbufvar setcmdpos setline setreg setwinvar simplify sort split strftime stridx string strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system tempname tolower toupper tr type values virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winwidth writefile "--- syntax above generated by mkvimvim --- " Special Vim Highlighting (not automatic) {{{1 diff --git a/src/buffer.c b/src/buffer.c index 6a6ffc65f..a634062cf 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -3008,7 +3008,7 @@ maketitle() /* format: "fname + (path) (1 of 2) - VIM" */ if (curbuf->b_fname == NULL) - STRCPY(buf, _("[No file]")); + STRCPY(buf, _("[No Name]")); else { p = transstr(gettail(curbuf->b_fname)); diff --git a/src/edit.c b/src/edit.c index a8897362d..ae00c2aba 100644 --- a/src/edit.c +++ b/src/edit.c @@ -6270,6 +6270,10 @@ ins_esc(count, cmdchar) if (--*count > 0) /* repeat what was typed */ { + /* Vi repeats the insert without replacing characters. */ + if (vim_strchr(p_cpo, CPO_REPLCNT) != NULL) + State &= ~REPLACE_FLAG; + (void)start_redo_ins(); if (cmdchar == 'r' || cmdchar == 'v') stuffReadbuff(ESC_STR); /* no ESC in redo buffer */ diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 899e4c8f4..d2e933af4 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -6457,6 +6457,7 @@ alist_slash_adjust() ex_preserve(eap) exarg_T *eap; { + curbuf->b_flags |= BF_PRESERVED; ml_preserve(curbuf, TRUE); } diff --git a/src/ex_getln.c b/src/ex_getln.c index a7dfd9a75..05c85b49f 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -205,13 +205,25 @@ getcmdline(firstc, count, indent) * set some variables for redrawcmd() */ ccline.cmdfirstc = (firstc == '@' ? 0 : firstc); - ccline.cmdindent = indent; - alloc_cmdbuff(exmode_active ? 250 : 0); /* alloc initial ccline.cmdbuff */ + ccline.cmdindent = (firstc > 0 ? indent : 0); + + /* alloc initial ccline.cmdbuff */ + alloc_cmdbuff(exmode_active ? 250 : indent + 1); if (ccline.cmdbuff == NULL) return NULL; /* out of memory */ ccline.cmdlen = ccline.cmdpos = 0; ccline.cmdbuff[0] = NUL; + /* autoindent for :insert and :append */ + if (firstc <= 0) + { + copy_spaces(ccline.cmdbuff, indent); + ccline.cmdbuff[indent] = NUL; + ccline.cmdpos = indent; + ccline.cmdspos = indent; + ccline.cmdlen = indent; + } + ExpandInit(&xpc); #ifdef FEAT_RIGHTLEFT @@ -1878,7 +1890,7 @@ getexmodeline(c, dummy, indent) garray_T line_ga; int len; int off = 0; - char_u *p; + char_u *pend; int finished = FALSE; #if defined(FEAT_GUI) || defined(NO_COOKED_INPUT) int startcol = 0; @@ -1897,6 +1909,7 @@ getexmodeline(c, dummy, indent) msg_putchar('\n'); if (c == ':') { + /* indent that is only displayed, not in the line itself */ msg_putchar(':'); while (indent-- > 0) msg_putchar(' '); @@ -1907,6 +1920,25 @@ getexmodeline(c, dummy, indent) ga_init2(&line_ga, 1, 30); + /* autoindent for :insert and :append is in the line itself */ + if (c <= 0) + { +#if defined(FEAT_GUI) || defined(NO_COOKED_INPUT) + vcol = indent; +#endif + while (indent >= 8) + { + ga_append(&line_ga, TAB); + msg_puts((char_u *)" "); + indent -= 8; + } + while (indent-- > 0) + { + ga_append(&line_ga, ' '); + msg_putchar(' '); + } + } + /* * Get the line, one character at a time. */ @@ -1915,14 +1947,14 @@ getexmodeline(c, dummy, indent) { if (ga_grow(&line_ga, 40) == FAIL) break; - p = (char_u *)line_ga.ga_data + line_ga.ga_len; + pend = (char_u *)line_ga.ga_data + line_ga.ga_len; /* Get one character (inchar gets a third of maxlen characters!) */ - len = inchar(p + off, 3, -1L, 0); + len = inchar(pend + off, 3, -1L, 0); if (len < 0) continue; /* end of input script reached */ /* for a special character, we need at least three characters */ - if ((*p == K_SPECIAL || *p == CSI) && off + len < 3) + if ((*pend == K_SPECIAL || *pend == CSI) && off + len < 3) { off += len; continue; @@ -1947,7 +1979,7 @@ getexmodeline(c, dummy, indent) while (len > 0) { - c1 = *p++; + c1 = *pend++; --len; if ((c1 == K_SPECIAL # if !defined(NO_COOKED_INPUT) || defined(FEAT_GUI) @@ -1955,8 +1987,8 @@ getexmodeline(c, dummy, indent) # endif ) && len >= 2) { - c1 = TO_SPECIAL(p[0], p[1]); - p += 2; + c1 = TO_SPECIAL(pend[0], pend[1]); + pend += 2; len -= 2; } @@ -2006,6 +2038,46 @@ getexmodeline(c, dummy, indent) continue; } + if (c1 == Ctrl_T) + c1 = TAB; /* very simplistic... */ + + if (c1 == Ctrl_D) + { + char_u *p; + + /* Delete one shiftwidth. */ + p = (char_u *)line_ga.ga_data; + p[line_ga.ga_len] = NUL; + indent = get_indent_str(p, 8); + --indent; + indent -= indent % 8; + while (get_indent_str(p, 8) > indent) + { + char_u *s = skipwhite(p); + + mch_memmove(s - 1, s, line_ga.ga_len - (s - p) + 1); + --line_ga.ga_len; + } + msg_col = startcol; + for (vcol = 0; *p != NUL; ++p) + { + if (*p == TAB) + { + do + { + msg_putchar(' '); + } while (++vcol % 8); + } + else + { + msg_outtrans_len(p, 1); + vcol += char2cells(*p); + } + } + msg_clr_eos(); + continue; + } + if (c1 == Ctrl_V) { escaped = TRUE; @@ -2046,13 +2118,13 @@ getexmodeline(c, dummy, indent) line_ga.ga_len += len; } #endif - p = (char_u *)(line_ga.ga_data) + line_ga.ga_len; - if (line_ga.ga_len && p[-1] == '\n') + pend = (char_u *)(line_ga.ga_data) + line_ga.ga_len; + if (line_ga.ga_len && pend[-1] == '\n') { finished = TRUE; --line_ga.ga_len; - --p; - *p = NUL; + --pend; + *pend = NUL; } } diff --git a/src/fileio.c b/src/fileio.c index ea7c924d9..9dd1d4975 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -433,7 +433,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags) * Only set/reset b_p_ro when BF_CHECK_RO is set. */ check_readonly = (newfile && (curbuf->b_flags & BF_CHECK_RO)); - if (check_readonly && !readonlymode) /* default: set file not readonly */ + if (check_readonly && !readonlymode) curbuf->b_p_ro = FALSE; if (newfile && !read_stdin && !read_buffer) @@ -3499,8 +3499,8 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit, #endif /* When using ":w!" and writing to the current file, readonly makes no - * sense, reset it */ - if (forceit && overwriting) + * sense, reset it, unless 'Z' appears in 'cpoptions'. */ + if (forceit && overwriting && vim_strchr(p_cpo, CPO_KEEPRO) == NULL) { buf->b_p_ro = FALSE; #ifdef FEAT_TITLE diff --git a/src/main.aap b/src/main.aap index 9356dd9e8..ddaa5c83e 100644 --- a/src/main.aap +++ b/src/main.aap @@ -114,6 +114,7 @@ prefix = `os.path.expanduser(prefix)` MOTIF GUI_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c + gui_xmdlg.c gui_xmebw.c GUI_OBJ = GUI_DEFS = -DFEAT_GUI_MOTIF $NARROW_PROTO GUI_IPATH = $GUI_INC_LOC diff --git a/src/main.c b/src/main.c index 3b888f278..351225c2e 100644 --- a/src/main.c +++ b/src/main.c @@ -826,8 +826,9 @@ main /* "-w {scriptout}" write to script */ if (vim_isdigit(((char_u *)argv[0])[argv_idx])) { - argv_idx = -1; - break; /* not implemented, ignored */ + i = get_number_arg((char_u *)argv[0], &argv_idx, 10); + set_option_value((char_u *)"window", (long)i, NULL, 0); + break; } want_argument = TRUE; break; @@ -848,7 +849,17 @@ main restricted = TRUE; break; - case 'c': /* "-c {command}" execute command */ + case 'c': /* "-c{command}" or "-c {command}" execute + command */ + if (argv[0][argv_idx] != NUL) + { + if (n_commands >= MAX_ARG_CMDS) + mainerr(ME_EXTRA_CMD, NULL); + commands[n_commands++] = (char_u *)argv[0] + argv_idx; + argv_idx = -1; + break; + } + /*FALLTRHOUGH*/ case 'S': /* "-S {file}" execute Vim script */ case 'i': /* "-i {viminfo}" use for viminfo */ #ifndef FEAT_DIFF @@ -990,7 +1001,17 @@ scripterror: #endif break; - case 'w': /* "-w {scriptout}" append to script file */ + case 'w': /* "-w {nr}" 'window' value */ + /* "-w {scriptout}" append to script file */ + if (vim_isdigit(*((char_u *)argv[0]))) + { + argv_idx = 0; + i = get_number_arg((char_u *)argv[0], &argv_idx, 10); + set_option_value((char_u *)"window", (long)i, NULL, 0); + argv_idx = -1; + break; + } + /*FALLTRHOUGH*/ case 'W': /* "-W {scriptout}" overwrite script file */ if (scriptout != NULL) goto scripterror; diff --git a/src/misc1.c b/src/misc1.c index 4d7cf6028..658c30e80 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -23,7 +23,6 @@ static char_u *remove_tail __ARGS((char_u *p, char_u *pend, char_u *name)); #if defined(USE_EXE_NAME) && defined(MACOS_X) static char_u *remove_tail_with_ext __ARGS((char_u *p, char_u *pend, char_u *ext)); #endif -static int get_indent_str __ARGS((char_u *ptr, int ts)); static int copy_indent __ARGS((int size, char_u *src)); /* @@ -63,7 +62,7 @@ get_indent_buf(buf, lnum) * count the size (in window cells) of the indent in line "ptr", with * 'tabstop' at "ts" */ - static int + int get_indent_str(ptr, ts) char_u *ptr; int ts; @@ -79,7 +78,7 @@ get_indent_str(ptr, ts) else break; } - return (count); + return count; } /* diff --git a/src/move.c b/src/move.c index f3d7825f3..ac59320cf 100644 --- a/src/move.c +++ b/src/move.c @@ -2332,9 +2332,20 @@ onepage(dir, count) #endif if (dir == FORWARD) { - /* at end of file */ - if (curwin->w_botline > curbuf->b_ml.ml_line_count) + if (firstwin == lastwin && p_window > 0 && p_window < Rows - 1) { + /* Vi compatible scrolling */ + if (p_window <= 2) + ++curwin->w_topline; + else + curwin->w_topline += p_window - 2; + if (curwin->w_topline > curbuf->b_ml.ml_line_count) + curwin->w_topline = curbuf->b_ml.ml_line_count; + curwin->w_cursor.lnum = curwin->w_topline; + } + else if (curwin->w_botline > curbuf->b_ml.ml_line_count) + { + /* at end of file */ curwin->w_topline = curbuf->b_ml.ml_line_count; #ifdef FEAT_DIFF curwin->w_topfill = 0; @@ -2371,6 +2382,21 @@ onepage(dir, count) continue; } #endif + if (firstwin == lastwin && p_window > 0 && p_window < Rows - 1) + { + /* Vi compatible scrolling (sort of) */ + if (p_window <= 2) + --curwin->w_topline; + else + curwin->w_topline -= p_window - 2; + if (curwin->w_topline < 1) + curwin->w_topline = 1; + curwin->w_cursor.lnum = curwin->w_topline + p_window - 1; + if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) + curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; + continue; + } + /* Find the line at the top of the window that is going to be the * line at the bottom of the window. Make sure this results in * the same line as before doing CTRL-F. */ diff --git a/src/normal.c b/src/normal.c index 16f65be2b..f13b45eec 100644 --- a/src/normal.c +++ b/src/normal.c @@ -1379,6 +1379,7 @@ do_pending_operator(cap, old_col, gui_yank) #ifdef FEAT_VISUAL && (!VIsual_active || oap->motion_force) #endif + && cap->cmdchar != 'D' #ifdef FEAT_FOLDING && oap->op_type != OP_FOLD && oap->op_type != OP_FOLDOPEN @@ -6701,9 +6702,24 @@ nv_optrans(cap) if (!checkclearopq(cap->oap)) { - if (cap->count0) - stuffnumReadbuff(cap->count0); - stuffReadbuff(ar[(int)(vim_strchr(str, cap->cmdchar) - str)]); + /* In Vi "2D" doesn't delete the next line. Can't translate it + * either, because "2." should also not use the count. */ + if (cap->cmdchar == 'D' && vim_strchr(p_cpo, CPO_HASH) != NULL) + { + cap->oap->start = curwin->w_cursor; + cap->oap->op_type = OP_DELETE; + cap->count1 = 1; + nv_dollar(cap); + finish_op = TRUE; + ResetRedobuff(); + AppendCharToRedobuff('D'); + } + else + { + if (cap->count0) + stuffnumReadbuff(cap->count0); + stuffReadbuff(ar[(int)(vim_strchr(str, cap->cmdchar) - str)]); + } } cap->opcount = 0; } @@ -7599,6 +7615,9 @@ n_opencmd(cap) #endif 0, 0)) { + /* When '#' is in 'cpoptions' ignore the count. */ + if (vim_strchr(p_cpo, CPO_HASH) != NULL) + cap->count1 = 1; invoke_edit(cap, FALSE, cap->cmdchar, TRUE); } } @@ -8156,7 +8175,10 @@ nv_edit(cap) break; case 'I': /* "I"nsert before the first non-blank */ - beginline(BL_WHITE); + if (vim_strchr(p_cpo, CPO_INSEND) == NULL) + beginline(BL_WHITE); + else + beginline(BL_WHITE|BL_FIX); break; case 'a': /* "a"ppend is like "i"nsert on the next character. */ @@ -2838,9 +2838,9 @@ op_yank(oap, deleting, mess) if (yanktype == MLINE) /* MLINE overrides MCHAR and MBLOCK */ curr->y_type = MLINE; - /* concatenate the last line of the old block with the first line of - * the new block */ - if (curr->y_type == MCHAR) + /* Concatenate the last line of the old block with the first line of + * the new block, unless being Vi compatible. */ + if (curr->y_type == MCHAR && vim_strchr(p_cpo, CPO_REGAPPEND) == NULL) { pnew = lalloc((long_u)(STRLEN(curr->y_array[curr->y_size - 1]) + STRLEN(y_current->y_array[0]) + 1), TRUE); @@ -3897,6 +3897,8 @@ do_do_join(count, insert_space) long count; int insert_space; { + colnr_T col = MAXCOL; + if (u_save((linenr_T)(curwin->w_cursor.lnum - 1), (linenr_T)(curwin->w_cursor.lnum + count)) == FAIL) return; @@ -3909,8 +3911,14 @@ do_do_join(count, insert_space) beep_flush(); break; } + if (col == MAXCOL && vim_strchr(p_cpo, CPO_JOINCOL) != NULL) + col = curwin->w_cursor.col; } + /* Vi compatible: use the column of the first join */ + if (col != MAXCOL && vim_strchr(p_cpo, CPO_JOINCOL) != NULL) + curwin->w_cursor.col = col; + #if 0 /* * Need to update the screen if the line where the cursor is became too diff --git a/src/option.c b/src/option.c index ffeaf8644..205b21c20 100644 --- a/src/option.c +++ b/src/option.c @@ -665,7 +665,7 @@ static struct vimoption {(char_u *)FALSE, (char_u *)0L}}, {"cpoptions", "cpo", P_STRING|P_VIM|P_RALL|P_FLAGLIST, (char_u *)&p_cpo, PV_NONE, - {(char_u *)CPO_ALL, (char_u *)CPO_DEFAULT}}, + {(char_u *)CPO_VI, (char_u *)CPO_VIM}}, {"cscopepathcomp", "cspc", P_NUM|P_VI_DEF|P_VIM, #ifdef FEAT_CSCOPE (char_u *)&p_cspc, PV_NONE, @@ -2340,7 +2340,7 @@ static struct vimoption #endif }, {"window", "wi", P_NUM|P_VI_DEF, - (char_u *)NULL, PV_NONE, + (char_u *)&p_window, PV_NONE, {(char_u *)0L, (char_u *)0L}}, {"winheight", "wh", P_NUM|P_VI_DEF, #ifdef FEAT_WINDOWS @@ -2591,6 +2591,10 @@ set_init_1() /* Be Vi compatible by default */ p_cp = TRUE; + /* Use POSIX compatibility when $VIM_POSIX is set. */ + if (mch_getenv((char_u *)"VIM_POSIX") != NULL) + set_string_default("cpo", (char_u *)CPO_ALL); + /* * Find default value for 'shell' option. * Don't use it if it is empty. @@ -3082,31 +3086,39 @@ set_number_default(name, val) void set_init_2() { + int idx; + /* * 'scroll' defaults to half the window height. Note that this default is * wrong when the window height changes. */ - options[findoption((char_u *)"scroll")].def_val[VI_DEFAULT] - = (char_u *)((long_u)Rows >> 1); + set_number_default("scroll", (long_u)Rows >> 1); comp_col(); + /* + * 'window' is only for backwards compatibility with Vi. + * Default is Rows - 1. + */ + idx = findoption((char_u *)"wi"); + if (!(options[idx].flags & P_WAS_SET)) + p_window = Rows - 1; + set_number_default("window", Rows - 1); + #if !((defined(MSDOS) || defined(OS2) || defined(WIN3264)) && !defined(FEAT_GUI)) { - int idx4; - /* * If 'background' wasn't set by the user, try guessing the value, * depending on the terminal name. Only need to check for terminals * with a dark background, that can handle color. Only "linux" * console at the moment. */ - idx4 = findoption((char_u *)"bg"); - if (!(options[idx4].flags & P_WAS_SET) && STRCMP(T_NAME, "linux") == 0) + idx = findoption((char_u *)"bg"); + if (!(options[idx].flags & P_WAS_SET) && STRCMP(T_NAME, "linux") == 0) { - set_string_option_direct(NULL, idx4, (char_u *)"dark", OPT_FREE); + set_string_option_direct(NULL, idx, (char_u *)"dark", OPT_FREE); /* don't mark it as set, when starting the GUI it may be changed * again */ - options[idx4].flags &= ~P_WAS_SET; + options[idx].flags &= ~P_WAS_SET; } } #endif @@ -6872,6 +6884,14 @@ set_num_option(opt_idx, varp, value, errbuf, opt_flags) #endif } + else if (pp == &p_window) + { + if (p_window < 1) + p_window = 1; + else if (p_window >= Rows) + p_window = Rows - 1; + } + else if (pp == &curbuf->b_p_imsearch) { if (curbuf->b_p_imsearch < -1 || curbuf->b_p_imsearch > B_IMODE_LAST) @@ -7011,6 +7031,8 @@ set_num_option(opt_idx, varp, value, errbuf, opt_flags) if (cmdline_row > Rows - p_ch && Rows > p_ch) cmdline_row = Rows - p_ch; } + if (p_window >= Rows) + p_window = Rows - 1; } if (curbuf->b_p_sts < 0) diff --git a/src/option.h b/src/option.h index 9be2c4988..674eb4e5d 100644 --- a/src/option.h +++ b/src/option.h @@ -132,6 +132,7 @@ #define CPO_FNAMER 'f' /* set file name for ":r file" */ #define CPO_FNAMEW 'F' /* set file name for ":w file" */ #define CPO_GOTO1 'g' /* goto line 1 for ":edit" */ +#define CPO_INSEND 'H' /* "I" inserts before last blank in line */ #define CPO_INTMOD 'i' /* interrupt a read makes buffer modified */ #define CPO_INDENT 'I' /* remove auto-indent more often */ #define CPO_JOINSP 'j' /* only use two spaces for join after '.' */ @@ -146,6 +147,7 @@ #define CPO_LINEOFF 'o' #define CPO_OVERNEW 'O' /* silently overwrite new file */ #define CPO_LISP 'p' /* 'lisp' indenting */ +#define CPO_JOINCOL 'q' /* with "3J" use column after first join */ #define CPO_REDO 'r' #define CPO_REMMARK 'R' /* remove marks when filtering */ #define CPO_BUFOPT 's' @@ -156,7 +158,9 @@ #define CPO_CW 'w' /* "cw" only changes one blank */ #define CPO_FWRITE 'W' /* "w!" doesn't overwrite readonly files */ #define CPO_ESC 'x' +#define CPO_REPLCNT 'X' /* "R" with a count only delets chars once */ #define CPO_YANK 'y' +#define CPO_KEEPRO 'Z' /* don't reset 'readonly' on ":w!" */ #define CPO_DOLLAR '$' #define CPO_FILTER '!' #define CPO_MATCH '%' @@ -164,8 +168,16 @@ #define CPO_PLUS '+' /* ":write file" resets 'modified' */ #define CPO_MINUS '-' /* "9-" fails at and before line 9 */ #define CPO_SPECI '<' /* don't recognize <> in mappings */ -#define CPO_DEFAULT "aABceFs" -#define CPO_ALL "aAbBcCdDeEfFgiIjJkKlLmMnoOprRsStuvwWxy$!%*-+<" +#define CPO_REGAPPEND '>' /* insert NL when appending to a register */ +/* POSIX flags */ +#define CPO_HASH '#' /* "D", "o" and "O" do not use a count */ +#define CPO_PARA '{' /* "{" is also a paragraph boundary */ +#define CPO_TSIZE '|' /* $LINES and $COLUMNS overrule term size */ +#define CPO_PRESERVE '&' /* keep swap file after :preserve */ +/* default values for Vim, Vi and POSIX */ +#define CPO_VIM "aABceFs" +#define CPO_VI "aAbBcCdDeEfFgHiIjJkKlLmMnoOpqrRsStuvwWxXyZ$!%*-+<>" +#define CPO_ALL "aAbBcCdDeEfFgHiIjJkKlLmMnoOpqrRsStuvwWxXyZ$!%*-+<>#{|&" /* characters for p_ww option: */ #define WW_ALL "bshl<>[],~" @@ -789,6 +801,7 @@ EXTERN int p_warn; /* 'warn' */ #ifdef FEAT_CMDL_COMPL EXTERN char_u *p_wop; /* 'wildoptions' */ #endif +EXTERN long p_window; /* 'window' */ #if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(LINT) \ || defined (FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_KDE) #define FEAT_WAK diff --git a/src/os_unix.c b/src/os_unix.c index c09638f4c..d89636d3a 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3222,9 +3222,10 @@ mch_get_shellsize() /* * 2. get size from environment - * When being POSIX compliant this overrules the ioctl() values! + * When being POSIX compliant ('|' flag in 'cpoptions') this overrules + * the ioctl() values! */ - if (columns == 0 || rows == 0 || getenv("VIM_POSIX") != NULL) + if (columns == 0 || rows == 0 || vim_strchr(p_cpo, CPO_TSIZE) != NULL) { if ((p = (char_u *)getenv("LINES"))) rows = atoi((char *)p); diff --git a/src/proto/misc1.pro b/src/proto/misc1.pro index 2fb74d3bc..5a42c13d1 100644 --- a/src/proto/misc1.pro +++ b/src/proto/misc1.pro @@ -2,6 +2,7 @@ int get_indent __ARGS((void)); int get_indent_lnum __ARGS((linenr_T lnum)); int get_indent_buf __ARGS((buf_T *buf, linenr_T lnum)); +int get_indent_str __ARGS((char_u *ptr, int ts)); int set_indent __ARGS((int size, int flags)); int get_number_indent __ARGS((linenr_T lnum)); int open_line __ARGS((int dir, int flags, int old_indent)); diff --git a/src/search.c b/src/search.c index 2bcdf2400..8520282a9 100644 --- a/src/search.c +++ b/src/search.c @@ -2493,11 +2493,12 @@ found: } /* - * findpar(dir, count, what) - Find the next paragraph in direction 'dir' + * Find the next paragraph or section in direction 'dir'. * Paragraphs are currently supposed to be separated by empty lines. - * Return TRUE if the next paragraph was found. + * If 'what' is NUL we go to the next paragraph. * If 'what' is '{' or '}' we go to the next section. * If 'both' is TRUE also stop at '}'. + * Return TRUE if the next paragraph or section was found. */ int findpar(oap, dir, count, what, both) @@ -2510,6 +2511,7 @@ findpar(oap, dir, count, what, both) linenr_T curr; int did_skip; /* TRUE after separating lines have been skipped */ int first; /* TRUE on first line */ + int posix = (vim_strchr(p_cpo, CPO_PARA) != NULL); #ifdef FEAT_FOLDING linenr_T fold_first; /* first line of a closed fold */ linenr_T fold_last; /* last line of a closed fold */ @@ -2537,7 +2539,11 @@ findpar(oap, dir, count, what, both) } #endif - if (!first && did_skip && startPS(curr, what, both)) + /* POSIX has it's own ideas of what a paragraph boundary is and it + * doesn't match historical Vi: It also stops at a "{" in the + * first column and at an empty line. */ + if (!first && did_skip && (startPS(curr, what, both) + || (posix && what == NUL && *ml_get(curr) == '{'))) break; #ifdef FEAT_FOLDING diff --git a/src/structs.h b/src/structs.h index 8a81611c2..92a8428f1 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1021,6 +1021,8 @@ struct listvar_S listwatch_T *lv_watch; /* first watcher, NULL if none */ int lv_idx; /* cached index of an item */ listitem_T *lv_idx_item; /* when not NULL item at index "lv_idx" */ + int lv_copyID; /* ID used by deepcopy() */ + list_T *lv_copylist; /* copied list used by deepcopy() */ char lv_lock; /* zero, VAR_LOCKED, VAR_FIXED */ }; @@ -1050,6 +1052,8 @@ struct dictvar_S { int dv_refcount; /* reference count */ hashtab_T dv_hashtab; /* hashtab that refers to the items */ + int dv_copyID; /* ID used by deepcopy() */ + dict_T *dv_copydict; /* copied dict used by deepcopy() */ char dv_lock; /* zero, VAR_LOCKED, VAR_FIXED */ }; diff --git a/src/term.c b/src/term.c index a471c1e0c..386b05cf5 100644 --- a/src/term.c +++ b/src/term.c @@ -2991,6 +2991,9 @@ win_new_shellsize() ui_new_shellsize(); if (old_Rows != Rows) { + /* if 'window' uses the whole screen, keep it using that */ + if (p_window == old_Rows - 1) + p_window = Rows - 1; old_Rows = Rows; shell_new_rows(); /* update window sizes */ } @@ -3234,6 +3237,8 @@ stoptermcap() * echoed. * Only do this after termcap mode has been started, otherwise the codes for * the cursor keys may be wrong. + * On Unix only do it when both output and input are a tty (avoid writing + * request to terminal while reading from a file). * The result is caught in check_termcode(). */ static void @@ -3244,6 +3249,7 @@ may_req_termresponse() && termcap_active #ifdef UNIX && isatty(1) + && isatty(read_cmd_fd) #endif && *T_CRV != NUL) { diff --git a/src/testdir/test16.in b/src/testdir/test16.in index 7fc0d50cf..aa00517a3 100644 --- a/src/testdir/test16.in +++ b/src/testdir/test16.in @@ -1,7 +1,11 @@ Tests for resetting "secure" flag after GUI has started. +For KDE set a font, empty 'guifont' may cause a hang. STARTTEST :set exrc secure +:if has("gui_kde") +: set guifont=Courier\ 10\ Pitch/8/-1/5/50/0/0/0/0/0 +:endif :gui -f :.,$w! test.out :qa! diff --git a/src/testdir/test55.in b/src/testdir/test55.in index 89fbaae2d..46a857b12 100644 --- a/src/testdir/test55.in +++ b/src/testdir/test55.in @@ -149,15 +149,20 @@ STARTTEST :endfunc :$put =d.func(string(remove(d, 'func'))) :" -:" Nasty: deepcopy() dict that refers to itself (fails) +:" Nasty: deepcopy() dict that refers to itself (fails when noref used) :let d = {1:1, 2:2} :let l = [4, d, 6] :let d[3] = l +:let dc = deepcopy(d) :try -: let x = deepcopy(d) +: let dc = deepcopy(d, 1) :catch : $put =v:exception[:14] :endtry +:let l2 = [0, l, l, 3] +:let l[1] = l2 +:let l3 = deepcopy(l2) +:$put ='same list: ' . (l3[1] is l3[2]) :" :" Locked variables :for depth in range(5) @@ -253,6 +258,14 @@ STARTTEST : $put ='caught ' . v:exception :endtry :" +:" reverse() and sort() +:let l = ['-0', 'A11', 2, 'xaaa', 4, 'foo', 'foo6', [0, 1, 2], 'x8'] +:$put =string(reverse(l)) +:$put =string(reverse(reverse(l))) +:$put =string(sort(l)) +:$put =string(reverse(sort(l))) +:$put =string(sort(reverse(sort(l)))) +:" :endfun :call Test(1, 2, [3, 4], {5: 6}) " This may take a while :" diff --git a/src/testdir/test55.ok b/src/testdir/test55.ok index 922fdfc40..559cafac5 100644 --- a/src/testdir/test55.ok +++ b/src/testdir/test55.ok @@ -30,6 +30,7 @@ Vim(call):E725: g:dict.func-4 a:function('3') Vim(let):E698: +same list: 1 depth is 0 0000-000 ppppppp @@ -70,3 +71,8 @@ caught a:000[0] caught a:000[2] caught a:000[3] [1, 2, [3, 9, 5, 6], {'a': 12, '5': 8}] +['x8', [0, 1, 2], 'foo6', 'foo', 4, 'xaaa', 2, 'A11', '-0'] +['x8', [0, 1, 2], 'foo6', 'foo', 4, 'xaaa', 2, 'A11', '-0'] +['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 2, 4, [0, 1, 2]] +[[0, 1, 2], 4, 2, 'xaaa', 'x8', 'foo6', 'foo', 'A11', '-0'] +['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 2, 4, [0, 1, 2]] diff --git a/src/version.h b/src/version.h index 6dfc7d5fc..1925a60e6 100644 --- a/src/version.h +++ b/src/version.h @@ -36,5 +36,5 @@ #define VIM_VERSION_NODOT "vim70aa" #define VIM_VERSION_SHORT "7.0aa" #define VIM_VERSION_MEDIUM "7.0aa ALPHA" -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 7)" -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 7, compiled " +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 12)" +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 12, compiled " @@ -604,6 +604,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname); #define BF_NEW_W 0x20 /* Warned for BF_NEW and file created */ #define BF_READERR 0x40 /* got errors while reading the file */ #define BF_DUMMY 0x80 /* dummy buffer, only used internally */ +#define BF_PRESERVED 0x100 /* ":preserve" was used */ /* Mask to check for flags that prevent normal writing */ #define BF_WRITE_MASK (BF_NOTEDITED + BF_NEW + BF_READERR) |