Skirv's Uber-Config - vim

Summary

vim is initialized by your ~/.vimrc file. To start using these configuration files, just symlink ~/.config/vimrc.default into ~/.vimrc, and make sure ~/.config/vim is populated properly with the below files.

Files

Generic Files

vimrc.default

Offers default loading functions, and starts loading other vimrc files as necessary.

" ############################################################################# " ### Documentation ########################################################### " ############################################################################# " File: vimrc.default " Version: 0.10 " Summary: Loads up additional vimrc files that have decent defaults; also " offers a decent function for loading those files. " Maintainer: Tim Skirvin " License: BSD License " " Link this into your ~/.vimrc file; note that other config files may depend on " this file. " ############################################################################# " ### main #################################################################### " ############################################################################# " Source the given file or fail out. function! LoadFile(filename) let FILE=expand(a:filename) if filereadable(FILE) exe "source " FILE else echo "Can't source " FILE endif endfunction " Load a default vim configuration exec LoadFile("~/.config/vim/vimrc.options") " Load a personalized vim configuration, after finishing with the default exec LoadFile("~/.config/vim/vimrc.local") " ############################################################################# " ### Version Log ############################################################# " ############################################################################# " # 0.10 Thu Mar 24 13:57:23 CST 2005 tskirvin " ### Initial version.

Download

vimrc.options

" ############################################################################# " ### Documentation ########################################################### " ############################################################################# " File: vimrc.options " Version: 0.10 " Summary: Setting and options for the vimrc " Maintainer: Tim Skirvin " License: BSD License " " Taken from Sven Guckes' configuration file. Loaded as part of the default " vimrc file. " ############################################################################# " ### Main Options ############################################################ " ############################################################################# " Clear all auto-commands autocmd! " ############################################################################# " ### Options ################################################################# " ############################################################################# " autoindent: I'm just not that into auto-indentation; it's nice for " coding in some cases, but it's just not my thing in general. set noautoindent " autowrite: Automatically save modifications to files when you use " critical (rxternal) commands. set autowrite " backup: this makes the '~' files, which I hate. Keep it off. set nobackup " backspace: allow backspacing over indentation, end-of-line, and start-of- " line; see 'help bs'. set backspace=indent,eol,start " background: 'light' or 'dark'? set background=dark " Number of lines for the command area; more eliminates many 'hit-enter' " prompts, but is it worth it? set cmdheight=1 " compatible: no, we don't want to act like just 'vi'. set nocompatible " comments: default to sr:/*,mb:*,el:*/,://,b:#,:%,:XCOMM,n:>,fb:- set comments=n:#,:%,fb:-,n:>,n:) set comments+=b:\" " cpoptions: "compatible options" to match Vi behaviour. I guess we'll " stick with the defaults. " set cpoptions="aABceFs" "default! " dictionary: english words first " ftp://ftp.fu-berlin.de/misc/dictionaries/unix-format/ set dictionary=/usr/dict/words set dictionary+=~/.config/vim/dictionary/words-english set dictionary+=~/.config/vim/dictionary/Unabr.dict set dictionary+=~/.config/vim/dictionary/words-skirv " digraph: allows entering special characters by a combination of two " characters; ':help digraph' " set digraph " directory: where to save tmp files. Defaults to ".,~/tmp,/var/tmp,/tmp" " set directory-=. " errorbells- turn off the beep! It's annoying. set noerrorbells " esckeys: allow usage of cursor keys within insert mode set esckeys " expandtab: stop using actual tab characters and use spaces instead. set expandtab " fileformat: choose your EOL format set fileformat=unix " formatcmd: use an external command to format paragraphs instead of " built-in commands. Currently taken care of in text.vim. " set formatcmd=par " formatoptions: options for 'text format' ("gq"). set formatoptions=2cqrt " guioptions: don't fork off an editor copy, no matter the DISPLAY set guioptions='f' " helpheight: zero disables this. set helpheight=0 " hidden: buffers aren't deleted when "abandoned". set hidden " highlight: characters to highlight; this is hard to explain. set highlight=8r,db,es,hs,mb,Mr,nu,rs,sr,tb,vr,ws " hlsearch: show the current search pattern. This is sometimes handy, but " it gets in the way. I'm hoping to get out of the '/asdfasdf' search. set nohlsearch " ignorecase: ignore the case in search patterns? Heh. Yeah, right. set noignorecase " incsearch: show search results as we type them. set incsearch " insertmode: always stay in 'insert'? Umm, no. set noinsertmode " iskeyword: defines what are "keywords". Default: @,48-57,_,192-255 " set iskeyword+=-,.,:,/,@-@ " joinspaces: two spaces after a period after joining. Yes. set joinspaces " keywordprg: program to use for the "K" command. " set keywordprg=man\ -s " laststatus: show status line? Yes, always! set laststatus=2 " lazyredraw: do not update screen while executing macros set lazyredraw " list and listchars: show character for expand tabs, trailing " whitespaces, and EOL. This should probably be set in a toggle. " set list set listchars=tab:>·,trail:·,eol:$ " magic: use extended regular expressions set magic " matchtime: tenths of a second to show a match. set matchtime=4 " modeline, modlines: I don't realy know what these do, I'll ignore them. " set modeline modelines=1 " mouse: recognize the mouse? " set mouse=a " number: print the line number in front of each line? set nonumber " report: show a report when N lines were changed. 0 means 'all' set report=0 " runtimepath: list of dirs to search for runtime files set runtimepath+=~/.config/vim set runtimepath+=~/.config/vim/colors " shell: default shell set shell=tcsh " shiftwidth: Number of spaces to use for each insertion of (auto)indent. set shiftwidth=2 " shortmess: shorten messages where possible, especially to stop annoying " "already open" messages! set shortmess=atIA " showcmd: show current uncompleted command. Umm, yeah. set showcmd " showmatch: show matching '()' pairs . set showmatch " showmode: show the current mode. Definitely. set showmode " spell: graphical spellchecking. Rocking. if v:version >= 700 set spell endif " splitbelow: Create new window below current one. set splitbelow " startofline: jump to first character of next line? No, keep column. set nostartofline " statusline: filename, filetype, row/maxrow, col, % of file, flags set statusline=%-25.45F\ %-2.9y%=%4l/%-4L\ %3.3v\ %3.3p%%%a%r%m " suffixes: these get lower priority with trying to match filenames set suffixes=.aux,.bak,.dvi,.gz,.idx,.log,.ps,.swp,.tar,CVS " tabstop: how big are tabs? set tabstop=8 " tagbsearch: use "binary search" on tags file? Naah, sort 'em myself. set notagbsearch " tags: file for "tags" - search words. I'm not really using this. set tags=~/.config/vim/tags " term: default terminal type should come from shell, I guess set term=$TERM " textwidth: maximum text width. Use text.vim's SetWidth() instead! set textwidth=74 " title: update the title of the window? set title " titlestring: what will actually be displayed set titlestring=VIM:\ %-25.55F\ %a%r%m titlelen=70 " set titlestring=%{hostname()}\ -\ VIM:\ %-25.55F\ %a%r%m titlelen=70 " ttybuiltin: search external termtypes first? Naah. set nottybuiltin " ttymouse: allow mouse use with the right tty types set ttymouse=xterm2 " term: default terminal type? set term=rxvt " ttyfast: are we using a fast terminal? Let's try it for a while. set ttyfast " ttyscroll: redraw instead of scrolling? set ttyscroll=0 " viminfo: What info to store from an editing session in the viminfo " file; can be used at next session. set viminfo=%,'50,\"100,:1000,n~/.viminfo " virtualedit: write in blank columns? On reflection, no. set virtualedit=block " visualbell: keep vim quiet. t_kb: the character that visualbell would use. set visualbell t_vb= " whichwrap: Allow jump commands for left/right motion to wrap to previous/next " line when cursor is on first/last character in the line: set whichwrap=<,>,h,l,[,] " wildchar: the char used for "expansion" on the command line set wildchar= " winminheight: minimum height for all windows set winminheight=0 " wrapmargin: where to start wrapping onto the next line; ignored with 'tw' set wrapmargin=6 " writebackup: we're not doing backups, so ignore this. set nowritebackup " ############################################################################# " ### Version Log ############################################################# " ############################################################################# " # 0.10 Fri Mar 25 08:59:43 CST 2005 tskirvin " ### Initial version.

Download

vimrc.local

" ############################################################################# " ### Documentation ########################################################### " ############################################################################# " File: aliases.vim " Version: 0.10 " Summary: Local vim aliases " Maintainer: Tim Skirvin " License: BSD License " " Local vim aliases; these just want to be separate from the main vimrc.local " file because they're going to be modified more often. " ############################################################################# " ### Development Aliases ##################################################### " ############################################################################# " The alphabet and other lists of letters ab Yalpha abcdefghijklmnopqrstuvwxyz ab YALPHA ABCDEFGHIJKLMNOPQRSTUVWXYZ ab Ydigit 1234567890 ab Yruler 12345678901234567890123456789012345678901234567890123456789012345678901234567890 " Dates iab YISODATE =strftime("%Y-%M-%d") iab YDATE =strftime("%a %d %b %T %Z %Y") iab YFDATE =strftime("%a %b %d %T %Y") iab YTIME =strftime("%d %b %Y %T") iab YDate =strftime("%d %b %Y") iab Ydate =strftime("%b %d") iab YTime =strftime("%H:%M:%S") iab Ytime =strftime("%H:%M") " File and path name stuff iab YPATH =expand("%:p") iab YFILE =expand("%:t:r") iab YDIR =expand("%:p:h") " ############################################################################# " ### Mail and News ########################################################### " ############################################################################# " For creating a From line in pseudo mail folders, so you can read with " any mailer iab FROM_ From tskirvin =strftime ("%a %b %d %T %Y") " News-based aliases ab Nana news.admin.net-abuse. ab Hpo humanities.philosophy.objectivism ab Ynan news.announce.newgroups ab Yng news.groups ab RefTrim *references trimmed* " ############################################################################# " ### Contact Information ##################################################### " ############################################################################# " Telephone Numbers iab YCELLNUM 217/898-5870 iab YWORKNUM 650/725-9909 " Snailmail Addresses iab YWORKADD 209 Polya Hall 255 Panama St Stanford, CA 94305-4136 iab YHOMEADD 575 S Rengstorff #97 Mountain View, CA 94040 iab YOLDHOME 1303 Maplepark Dr Champaign, IL 61820 " URLs, or at least base URLs (there's always more than this!) ab YKILL http://www.killfile.org/~tskirvin/ ab YKS http://www.ks.uiuc.edu/ ab YSTAN http://www.stanford.edu/ ab YTSP /~tskirvin/pics/ " Email Addresses and other forms of contact ab YAIM nivrikst " ############################################################################# " ### Other ################################################################### " ############################################################################# " < in HTML ab YFISH <FISH>< " ############################################################################# " ### Version Log ############################################################# " ############################################################################# " # 0.10 Thu Mar 24 14:14:55 CST 2005 tskirvin " ### Initial version.

Download

aliases.vim

" ############################################################################# " ### Documentation ########################################################### " ############################################################################# " File: aliases.vim " Version: 0.10 " Summary: Local vim aliases " Maintainer: Tim Skirvin " License: BSD License " " Local vim aliases; these just want to be separate from the main vimrc.local " file because they're going to be modified more often. " ############################################################################# " ### Development Aliases ##################################################### " ############################################################################# " The alphabet and other lists of letters ab Yalpha abcdefghijklmnopqrstuvwxyz ab YALPHA ABCDEFGHIJKLMNOPQRSTUVWXYZ ab Ydigit 1234567890 ab Yruler 12345678901234567890123456789012345678901234567890123456789012345678901234567890 " Dates iab YISODATE =strftime("%Y-%M-%d") iab YDATE =strftime("%a %d %b %T %Z %Y") iab YFDATE =strftime("%a %b %d %T %Y") iab YTIME =strftime("%d %b %Y %T") iab YDate =strftime("%d %b %Y") iab Ydate =strftime("%b %d") iab YTime =strftime("%H:%M:%S") iab Ytime =strftime("%H:%M") " File and path name stuff iab YPATH =expand("%:p") iab YFILE =expand("%:t:r") iab YDIR =expand("%:p:h") " ############################################################################# " ### Mail and News ########################################################### " ############################################################################# " For creating a From line in pseudo mail folders, so you can read with " any mailer iab FROM_ From tskirvin =strftime ("%a %b %d %T %Y") " News-based aliases ab Nana news.admin.net-abuse. ab Hpo humanities.philosophy.objectivism ab Ynan news.announce.newgroups ab Yng news.groups ab RefTrim *references trimmed* " ############################################################################# " ### Contact Information ##################################################### " ############################################################################# " Telephone Numbers iab YCELLNUM 217/898-5870 iab YWORKNUM 650/725-9909 " Snailmail Addresses iab YWORKADD 209 Polya Hall 255 Panama St Stanford, CA 94305-4136 iab YHOMEADD 575 S Rengstorff #97 Mountain View, CA 94040 iab YOLDHOME 1303 Maplepark Dr Champaign, IL 61820 " URLs, or at least base URLs (there's always more than this!) ab YKILL http://www.killfile.org/~tskirvin/ ab YKS http://www.ks.uiuc.edu/ ab YSTAN http://www.stanford.edu/ ab YTSP /~tskirvin/pics/ " Email Addresses and other forms of contact ab YAIM nivrikst " ############################################################################# " ### Other ################################################################### " ############################################################################# " < in HTML ab YFISH <FISH>< " ############################################################################# " ### Version Log ############################################################# " ############################################################################# " # 0.10 Thu Mar 24 14:14:55 CST 2005 tskirvin " ### Initial version.

Download

Functions

The following files offer specific functions, and can be easily used by other vim configurations.

Filename Description
changelog.vim Adds ChangeLog entries. Written by David Necas.
gnupg.vim Load and saved GPG-encrpyted files. Requires the 'gpgq' script, which is just a script that runs 'gpg -q'.
localconfig.vim This package tries to load additional configuration files, based on the hostname of your system. Assuming you are 'host.domain.name', it will try to load the files 'domain.vim' and 'domain.host.vim' (in order) from the directory g:BASEDIR (set in this file). If they're not there, then we'll continue without error. Allows a user to have different configurations based on the hostnames they're working from. Also loads 'aliases.vim', 'aliases.domain.vim', and 'aliases.domain.host.vim'. Written by Tim Skirvin.
text.vim Run ':SetWidth NUMBER' to set the text width to the appropriate number, and change other related functions to match. Written by Tim Skirvin.
vimispell.vim F6 runs the file through ispell.

Network-Specific Files

These files modify aliases or environment variables on a per-network or -system level. I'm not going to distribute these at this point.

Other Files

dictionary/*

This directory contains various dictionaries we can use for spellchecking. See here for some nice defaults.