Vim
The wonderful everywhere editor!
I'm a huge fan of Vim (with the Mac specific page here). This was not always so; even though I've used Vim — or more correctly perhaps gVim — for as long as I've used UNIX, it's only been recently that I've come to appreciate the power and flexibility it offers.
I'm not a vim expert, so if anything here is in error, please let me know. Also note that I use vim and gvim interchangably.
Configuration files
There are two main configuration files for Vim:
- .vimrc - used for all non-graphical configuration settings
- .gvimrc - used for all graphical related configuration settings
One or the other is not automatically sourced based on if vim is executed versus gvim. Logic in the file determines that. The file names are mearly convention.
I've added my configuration files as examples.
- .vimrc - My main configuration file.
- .gvimrc - My GUI based configuration file.
- mac.vim - Configuration information specific to a Mac.
- tim.vim - My colors file. I've chosen colors that are available both in GUI and terminal mode.
Configuration directory layout
There are several directories that are part of the install, that house files that manage the configuration of vim. Not all of these directories will exist in your ~/.vim directory; only ones where you have over-rides or additions to the system equivilent.
A lot of the real power of Vim isn't realized until you start adding in the scripts; many other text editors have followed this model, but not all of them are as out-of-the-box useful. Here is a list of the scripts I use, and the directories they go in.
- autoload - These files are auto-loaded at startup.
- javacomplete : Omni Completion for Java. This is not shipped as part of Vim.
- pythoncomplete : Python Omni Completion. This is an updated version of what ships with 7.0. (needs 'filetype plugin on')
- Vimball : vim-based archiver: builds, extracts, and previews.
- colors - This directory holds the files that define color schemes. To load one, execute the command :color {name}, where name is the name of the file without the .vim extension.
- compiler -
- pylint.vim : compiler plugin for python style checking tool.
- doc - Files in this directory are loaded and accessed through the :help command. So a script can include a file in this directory for the help system to access & display.
- ftdetect - Files in this directory are used to determine what type of file a file is, when it is opened. The files in this directory are vim macro commands that do what ever the author wants to do to determine if an opened file is of a type they recognize. They use the result to set the filetype variable.
- xhtml.vim : this is my own file, created so that Plone .pt files would be recognized as XHTML files.
- ftplugin - These are vim macro files. A file in this directory is loaded when a file of a recognized type is opened.
- python.vim : A set of menus/shortcuts to work with Python files.
- python_fold.vim : Folding expression for python.
- xml.vim : helps editing xml (and [x]html, sgml, xslt) files
- indent -
- keymap -
- plugin - These are vim macro files that get loaded automatically, and extend commands available from within vim.
- AutoTag : Updates entries in a tags file automatically when saving.
- colornames : Show named colors / cterm colors with hex code and name colorized in a window.
- Cream-ShowInvisibles - this script toggles the display of tabs, newlines, spaces, and other invisible characters.
- cscope_maps :
- hexman : displays binary files as a hex editor would.
- quicksession.vim : Easily switch between a multitude of session files.
- sessions.vim : named shortcuts to groups of files. This is a kind of light-weight session manager. With the typical Vim sessions, everything about the current environment is saved. This script only saves the list of open files. It is a bit dated; I had to change it slightly to re-open the files in tabs instead of as buffers in a single window.
- taglist.vim : Source code browser (supports C/C++, java, perl, python, tcl, sql, php, etc).
- vtreeexplorer : tree based file explorer - the original.
- syntax - Language definition files go here.
- python.vim : Enhanced version of the python syntax highlighting script

