From: Bram Moolenaar To: vim-dev@vim.org Subject: Vim 6.0t alpha available Date: Sun, 21 Jan 2001 22:06:03 +0100 Message-Id: <200101212106.f0LL63r26193@moolenaar.net> Quite a few changes again. Secret buffers should make the buffer list easier to use. This was impossible to do without some incompatibilities. If you suffer from them, perhaps we need to find an alternate solution. Major changes ------------- Introduction of secret buffers: - Make a difference between buffers that don't appear in the buffer list and buffers which are really not in the buffer list. Commands like ":ls", ":bnext", ":blast" and the Buffers menu will skip secret buffers now. ":ls!" does list secret buffers (well, that spoils it... :-). - Several commands that previously added a buffer now add a secret buffer. This means that a ":bnext" or ":ball" will not find these files until they have actually been edited. For example, buffers used for the alternative file by ":w file" and ":r file". Help files are secret too. - Other commands previously completely removed a buffer and now only make the buffer secret. Commands relying on a buffer not to be present might fail. For example, a ":bdelete" command in an autocommand that relied on something following to fail (was used in the automatic tests). Also, option values are not reset when ":bdel" is used. - The BufDelete autocommand event is now triggered when a buffer becomes secret. The BufCreate event is only triggered when a non-secret buffer is created, or when a secret buffer is no longer secret. The new BufSecret and BufWipeout events take over the meaning of really adding a buffer or really deleting it. - When doing Insert mode completion only non-secret buffers are scanned. Added the 'S' flag to 'complete' to do completion from secret buffers. - Secret buffers are not stored in a viminfo file. Consistent use of 'runtimepath': - The "syntax2" directory has been removed. Added an extra directory at the end of 'runtimepath' to replace it. This can also be used for an "ftplugin" file that overrules a distributed default filetype plugin. - All found syntax files in 'runtimepath' are now sourced, instead of only the first one found. A syntax file quits if "b:current_syntax" has already been set. - The distributed syntax files no longer contain "syntax clear". That makes it possible to include one in the other without tricks. - The indent and menu translation files are handled in the same way: All files found in 'runtimepath' are sourced. A variable is used to avoid loading a whole indent or menu file twice. The variable can be ignored to overrule settings. Other changes ------------- Folding: - The foldlevel() function works different. It gets the deepest fold level and ignores whether folds are closed. - Many commands that move the cursor up/down now place the cursor in the first line of a closed fold. Not "G" though. - Added the foldcloseend() function: can be used to find the end of a closed fold. E.g., to skip over the fold. - Added the "zF" command: define a fold for a number of lines. "3zF" works like "3zfzf". - Added the 'foldnestmax' option: Maximum depth of nested folds. Useful when making folds for {} blocks. Saving and restoring views: - Added the ":loadview" command and the 'viewdir' option: Allows for saving and restoring views of a file with simple commands. ":mkview 1" saves view 1 for the current file, ":loadview 1" loads it again. Also allows quickly switching between two views on one file. And saving and restoring manual folds and the folding state. - Added the 'viewoptions' option to specify how ":mkview" works. - Added autocommand event BufReadAfter (after using the modelines). Can be used to load a view. - Added BufWinLeave autocommand event: Triggered when a buffer is no longer in a window. Also triggered when exiting Vim. Can be used to save views. Secret buffers: - Added the 'bufsecret' option. - Added the ":bwipeout" command to really delete a buffer. - Added the BufSecret and BufWipeout autocommand events. When displaying an option value with 'verbose' set will give a message about where the option was last set. Very useful to find out which script did set the value. Use "vim{version}:" for modelines, only to be executed when the version is >= {version}. Also "vim>{version}", "vim<{version}" and "vim={version}". Allow some CTRL-W commands in the command-line window: Quitting the window and resizing. In the command-line window, ":qa" can be used to quit Vim. Regexp patterns: - \%[] can be used to optionally match a list of atoms. This can be used to match words with an optional tail. "/\" matches the ":function" command and its abbreviations. - \%^ matches start-of-file and \%$ matches end-of-file. (Chase Tingley) - \%( \) can be used like \( \), but without creating a back-reference. There can be any number of these. Overcomes the limit of nine \( \) pairs. Added the searchpair() function. Can be used in indent files to find the "if" matching an endif. When doing ":qall" and there is a change in a buffer that is being edited in another window, jump to that window, instead of editing that buffer in the current window. Also trigger the BufUnload event when Vim is going to exit. Perhaps some cleaning up is required. Fixes ----- didn't work like . ui.c required GUI to be defined, should be FEAT_GUI. 'filecharcode' could still become "ucs-bom" when editing a file with zero length. The new location for filetype plugins only worked on Unix. Removed the regexp stuff from runtime/ftplugin.vim. (Paul Moore) In a one-line window with a wrapping line: "l" moved the cursor to the status line every other time. When FEAT_CMDWIN was undefined, a wrapping line was displayed wrong. After dragging a statusline with the mouse, clicking the mouse in the command-line window behaved like the statusline was dragged. MS-Windows: getftime() didn't work when a directory had a trailing slash or backslash. Didn't show the time in the explorer because of this. When doing wildcard completion, a directory "a/" sorted after "a-b". Now recognize path separators when sorting files. Non-Unix systems: When editing "c:/dir/../file" and "c:/file" they were created as different buffers, although it's the same file. Expand to a full file name also when an absolute name contains "..". "g&" didn't repeat the last substitute properly. When 'clipboard' was set to "unnamed", a "Y" command would not write to "0. Now make a copy of register 0 to the clipboard register. The "--No lines in buffer--" message wasn't translated. When the search pattern matches in many ways, it could not always be interrupted with a CTRL-C. And CTRL-C would have to be hit once for every line when 'hlsearch' is on. When 'incsearch' is on and interrupting the search for a match, don't abandon the command line. When using "\zs" 'hlsearch' and 'incsearch' didn't show the match correctly. When turning a directory name into a full path, e.g., with fnamemodify(), sometimes a slash was added. Make this consistent: Don't add a slash. Windows: Disabled LCTranslateMessage() for now, it doesn't work properly. With a vertical split 'rightleft' didn't work properly: The left window messed up the right window and there was no separator. When 'rightleft' is set, syntax-syncing on a comment didn't work, it searched in the wrong direction. When a file name contains a "!", using it in a shell command will cause trouble: ":!cat %". Escape the "!" to avoid that. Escape it another time when 'shell' contains "sh". Folding: 'foldcolumn' was not updated when doing "J" just above an open fold. When syntax highlighting was enabled and a window only displayed closed folds Vim could crash. When a manually created fold includes part of a following fold, the end of the new fold would not be adjusted to include it completely. When putting a line above an existing fold, while using 'foldexpr' which returns "<1" for the end of a fold, folds could be joined in a wrong way. In a one-line window, folding lines 2-5 out of 6: Using "Gkkkk" made the displayed fold start in the wrong line. With manual folding, a linewise "p" in the first line of a fold added the new lines to the fold, instead of below it. When a manual fold contains three lines, doing "ddu" on the second line moved the start of the fold. When a search started in a closed fold, it could find a match in the last line of the same fold. When appending to the last line of a fold and typing the new line wasn't included in the fold. When changing 'foldmarker' a fold with the old marker was not removed. When foldmethod=syntax, syntax highlighting was wrong. The saved state was updated before the display functions checked them. Amiga, MS-DOS, MS-Windows: Crash when opening the command-line window. Was trying to change a not-allocated string in setfname(). When generating a session or view file, "G" commands were used to move the cursor, which changed the jumplist. Now use Ex commands instead. Completing a file name that has a tail that starts with a "~" didn't work: ":e view/~". Epilogue -------- WARNING: This is really an unstable version. Many things have been added without proper testing. It does crash. It may destroy your work. New features may change incompatibly in the next version. This version is for developers, thus it comes as source code only. If you run into something that doesn't work, please try to figure out why, try to solve it and send me a patch. If you can't do that, at least send me precise information to save me time. More info for the new 6.0 features with ":help version6". If you don't like the syntax of a command, the name of an option or how the new features work, let's discuss this in the vim-dev maillist. Lots of things are not working yet. Check ":help todo" for known items. I NEED YOUR HELP: There is still a lot of work to be done. If I have to do it all by myself it will take a very long time until Vim.6.0 is ready. Please give a hand by implementing one of the items in the todo list. You can find Vim 6.0 here: ftp://ftp.vim.org/pub/vim/unreleased/ unix/vim-6.0t-rt.tar.gz runtime files unix/vim-6.0t-src.tar.gz sources extra/vim-6.0t-extra.tar.gz extra files extra/vim-6.0t-lang.tar.gz multi-language files Happy Vimming!