Vim

Vim stands for Vi IMproved. It is a greatly enhanced vi clone which includes syntax highlighting, scripting, a GUI, a basic IDE, folding, horizontal and vertical window splits, printing, language based smart indenting, and more. The latest version is Vim (🕑). The official web page for Vim is http://www.vim.org/, where Vim users contribute tips, scripts, and so on.

Vim 7 includes integrated spell checking, tabbed windows, undo branches, extended VimL (Vim's scripting language) to include arrays and dictionaries (named arrays), language based completion, and many other major and minor improvements.

Vim 8 includes significant improvements and enhancements over 7; 8.1 includes terminal window support, and 8.2 includes popup window support and many other improvements.

Vim 9 includes a new, faster scripting engine and 9.1 includes classes and other features.

The code on this page is distributed under the Vim license, unless otherwise noted. See ":help license". Most of the stuff here requires Vim 7.0 or greater. Some of these scripts are also available on www.vim.org.

You may contact me with questions or problems with any of these scripts.

The <runtimepath> notation below indicates "~/.vim/" for Unix and "%USERPROFILE%\vimfiles\" for Windows, and "vimrc" indicates "~/.vimrc" for Unix and "%USERPROFILE%\_vimrc" for Windows. (Or, optionally, "~/.vim/vimrc" / "%USERPROFILE%\vimfiles\vimrc" for Vim 7.3 or later.) See ":help 'runtimepath'" and ":help vimrc".

  • BufClose.vim
    A command and function to close a buffer in a window without closing the window, resulting in the window being open to a blank buffer.
  • BufOnly.vim
    A command and function to delete all the buffers except the current/named buffer.
  • CharSort.vim
    Function and mappings to a sort string of characters.
  • ConvertBase.vim
    A set of functions to convert numerical bases. (Includes CovertToBase(), ConvertFromBase() and ConvertBases().)
  • CreateMenuPath.vim
    A function that creates a menu that mirrors a directory tree.
  • GreedyBackspace.vim
    This script will cause your backspace key to delete all the whitespace characters before the cursor when the cursor is on a whitespace character.
  • HTML/XHTML Editing Macros
    This is a set of HTML/XHTML mappings and menus for Vim 9 or later.
  • html.vim
    For Vim 7.3 or later. Extends the HTML syntax highlighting to enable displaying of the "web safe" color palette in style attributes; concealing of bold, italic, and underline tags; and enable displaying of many HTML character entities as their actual character counterpart. Plase this in <runtimepath>/after/syntax/. (Warning, this can take several seconds to load and make Vim run slower.)
  • mush.vim (syntax folding)
    Syntax based folding for MUSH/MUX code. It includes other syntax additions to work with my mushpp script (see Perl section). Place this in <runtimepath>/after/syntax/ and put ":let mush_fold = 1" in your vimrc.[1]
  • rcs.vim
    Autocmds and menus for RCS files. Place this in <runtimepath>/plugin/. It asks you whether to check out a file if it's readonly and controlled by RCS, then lets you check it back in with a log message when you're done.
  • Rename.vim
    A command and function that basically does a ":saveas <newfile>" then removes the old filename on the disk.
  • RemoveFile.vim
    A command and function that removes a file from the disk.
  • slrnsc.vim (indent)
    An auto-indent file for the slrn score files. Place this in <runtimepath>/indent/.
  • slrnsc.vim (syntax folding)
    Syntax based folding for slrn score files. Place this in <runtimepath>/after/syntax/ and put ":let slrn_fold = 1" in your vimrc.
  • SmartX.vim
    Smart deletion of \X escapes with the x/X/Backspace/Delete keys.
  • Tabmerge.vim
    Merge a tab's windows with the current tab.
  • tf.vim (indent)
    An auto-indent file for the TinyFugue internal scripting language. Place this in <runtimepath>/indent/. [1]
  • tf.vim (syntax folding)
    Syntax based folding for the TinyFugue internal scripting language. Place this in <runtimepath>/after/syntax/ and put ":let tf_fold = 1" in your vimrc. If you want to fold commented blocks of code, put ":let tf_fold_comments = 1" in your vimrc as well. [1]
[1] You may also need to read ":help new-filetype".