" Current as of 3/5/2008 " Remember that abbreviations include the entire line, so don't use inline comments " Try these for a while: "set cursorline "set cursorcolumn " Let's set up a more informative status line: set statusline=%<%f%h%m%r\ [%{strftime(\"\%b\ \%d,\ \%H:\%M\ \%p\")}]\ [BuffNo=%n]\ [Type=%Y]\ [Line=%l]%=[%{MakeBar(10,\'-\',\'*\')}]\ \ [%P] " An old status line with some other info in it "set statusline=%<%f%h%m%r\ [%{strftime(\"\%b\ \%d,\ \%H:\%M\ \%p\")}]%=[%{MakeBar(10,\'-\',\'*\')}]\ [%b,\ 0x%B]\ \ [%l,%c%V]\ [%p%%,%P] " Normally, status lines are only shown if there are multiple windows (and if " there is only one window, then the ruler and filename, etc, are shown in the " command line. If we want a status line we must set laststatus " (0=none, 1=only if multiple windows, 2=always) set laststatus=2 " My current favorite color scheme colorscheme delek " Matching parens is a nice idea, but it can be hard to tell which end you're on " I'd like to put this in the vimrc, however it is an option for a plugin, " andthe plugins are loaded until after the vimrc is executed. I don't " know how to solve this problem. "NoMatchParen " Sometimes I misspell mak ab amk make " A short way to execute the Calendar command " Now I'd prefer to not have this abbreviation so that I can make other " use of cal " ab cal Calendar " This mapping keeps me from having to type the shift command to get : " Make sure there are no blanks after the : " noremap does not allow recursion noremap ; : " I used to also map : to ; to get back the functionality of ; which " repeats a f command, but I no longer do so because it messes up " user defined menus that contain Ex commands that start with :. " This also saves using the shift key map q; q: " For a while I used these commands to try to be more organized. " The default mapleader is \, so you can invoke by doing \td nmap td :split $HOME/.todo nmap appt :split $HOME/.appt "Here are 3 commands I set up to make life easier, if I can remember "the commands ... "Invoke them by typing :Hints or :Listcolors or :Date " It also works to do :Hi com Hints split $HOME/lib/vitips com Listcolors !ls $VIMRUNTIME/colors $HOME/.vim/colors com Date echo strftime("%Y %b %d %X") "Check for "mkweek" in first line. If found, set makeprg=mkweek au BufReadPost * if getline(1) =~ "mkweek" | set makeprg=mkweek | endif "au BufReadPost * if getline(1) =~ "mkweek" | call SetVar() | endif "Automatically writes buffer when do ;make, ;next, etc set autowrite "Spelling is not available on versions before 7.0 if version >= 700 setlocal spelllang=en_us "Use to toggle spelling and get a message, " inv toggles a toggle option " set option? shows value of option map ;set invspell;set spell? endif set history=50 " number of command line commands to remember set nobackup " backup files are useful, but they create clutter "turns filetype on and enables loading indent/plugin files "when the filetype is detected and an indent/plugin file exists filetype indent on filetype plugin on "syntax enable and syntax on both set up syntax, but enable keeps the "user's color settings. syntax on uses the default color settings syntax enable " Filetype indent on gives indent in programs and I don't want ai in " other circumstances, so let's leave it out set ai " autoindent set wrap " wrap lines that are too long set wrapmargin=6 " wrap 6 characters from the end "set tw=75 " always limit the width of text to 78 " This one is useful when working with text set joinspaces " use two spaces after '.' when joining lines " Backspace behavior set backspace=2 " Behavior of tabs and shifting: set expandtab " expand tabs - replace tabs with spaces " shiftwidth, not tabstop, controls program indentation, and smarttab " causes entering tabs at the start of a line to enter shiftwidth chars. " It also causes backspaces at the start of a line to backup over shiftwidth chars "set tabstop=4 " 8 is too much set shiftwidth=4 " 8 is too much set smarttab " Enters shiftwidth spaces at line start when tab entered set softtabstop=0 set shiftround " indents are rounded to multiples of shiftwidth " Behavior of Searching set ignorecase " Ignore case when searching set smartcase " but, if case is used in the pattern, DON'T ignore it "set incsearch " shows matches as you type a search command "set hlsearch " highlights strings that match a search command that you've entered "Use to toggle highlight search and get a message, " ! toggles a toggle option " set option? shows value of option map ;set hls!;set hls? " set ruler " Show line and column numbers, as well as percent of file set showcmd " show partial command in status line " Sets what causes select mode (ie the mouse) " Select mode is similar to visual mode set selectmode=mouse " Sets some more behaviors different from windows " May interfere with selectmode, defined above behave xterm " The vim 7.1 ada mode seems to assume that " 1. g:ada_default_compiler is specified, " w. g:mapleader is specified, " so I'll specify them here " Apparently, gnat is one of the few values allowed for the compiler " Backslash is the default mapleader, so it should not hurt to set it directly " Now that I've created setup files that handle this, these are no longer needed " but they are left here for historical purposes " let g:ada_default_compiler="gnat" " let g:mapleader="\\" " PC items - console and GUI version: if has("win32") ab xxxx yyyy " Allows testing if this section has been run "May not need this any more "let $HOME="H:\\" " Restorescreen works for the console in windows. " For unix, use t_ti, as defined below set restorescreen " The /C options causes the shell to terminate after execution set shellcmdflag=/C endif " UNIX items (unix printing options are below): if has("unix") ab xxxx zzzz " Allows testing if this section has been run " At one time I tried the closetag command " au Filetype html,xml,xsl source ~/.vim/plugin/closetag.vim set shellcmdflag=-fc " -fc stops execution of a new shell (or .cshrc?) " when doing make "These restore the screen for unix set t_ti=[?47h " Switch to alternate xterm buffer when enter vim set t_te=[?47l " Switch back to regular xterm buffer when exit vim endif """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""" PRINTING """"""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Mpage options: " -t toggles printing both sides of the paper. See man page for toggle states " -dp forces input to be taken as postscript (vs -da force as ascii) " -2 (or whatever is number of logical pages per physical page) " -o toggles no outline (May not be listed) " mrltb set page margins in points, can be negative " Mrltb set logical page margins in points, can be negative " &printdevice separately " UNIX items for printing - not tested on windows: if has("unix") set printoptions=paper:letter " Set a default printer set pdev=DA205 " Print on copy machine set pexpr=system('lpr\ -PDA205\ '\ .\ v:fname_in)\ .\ delete(v:fname_in)\ +\ v:shell_error com DA205 set pexpr=system('lpr\ -PDA205\ '\ .\ v:fname_in)\ .\ delete(v:fname_in)\ +\ v:shell_error " On cantor, the my printer is known as hpdeskjet; on rucs, it's hpdeskje " Use gs to print on hpdeskjet. Needed from rucs. " From cantor, cups can print using mpage. " -sOutputFile=- sends output to stdout com HPDJe set pexpr=system('gs\ -sDEVICE=cdeskjet\ -dBATCH\ -q\ -dNOPAUSE\ -sOutputFile=-\ '\ .\ v:fname_in\ .\ '\|lpr\ -Phpdeskje')\ .\ delete(v:fname_in)\ +\ v:shell_error com HPDJet set pexpr=system('gs\ -sDEVICE=cdeskjet\ -dBATCH\ -q\ -dNOPAUSE\ -sOutputFile=-\ '\ .\ v:fname_in\ .\ '\|lpr\ -Phpdeskjet')\ .\ delete(v:fname_in)\ +\ v:shell_error com MRPS1 set pdev=mrps|set pexpr=system('mpage\ -t\ -dp\ -1\ -o'\ .\ (&printdevice\ ==\ ''\ ?\ ''\ :\ '\ -P'\ .\ &printdevice)\ .\ '\ '\ .\ v:fname_in)\ .\ delete(v:fname_in)\ +\ v:shell_error com MRPS2 set pdev=mrps|set pexpr=system('mpage\ -t\ -dp\ -2'\ .\ (&printdevice\ ==\ ''\ ?\ ''\ :\ '\ -P'\ .\ &printdevice)\ .\ '\ '\ .\ v:fname_in)\ .\ delete(v:fname_in)\ +\ v:shell_error endif