" Vim " An example for a gvimrc file. " The commands in this are executed when the GUI is started. " " To use it, copy it to " for Unix and OS/2: ~/.gvimrc " for Amiga: s:.gvimrc " for MS-DOS and Win32: $VIM\_gvimrc " Make external commands work through a pipe instead of a pseudo-tty "set noguipty " set the X11 font to use " set guifont=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1 " Make command line two lines high "set ch=2 " Only do this for Vim version 5.0 and later. if version >= 500 " I like highlighting strings inside C comments "let c_comment_strings=1 " Switch on syntax highlighting. syntax on " Switch on search pattern highlighting. set hlsearch " Incremental searching - Sometimes useful, but I don't like it to " be the default. Chris Ingram. "set incsearch " Hide the mouse pointer while typing set mousehide " Set nice colors " background for normal text is light grey " Text below the last line is darker grey " Cursor is green " Constants are not underlined but have a slightly lighter background "highlight Normal guibg=grey90 "highlight Cursor guibg=Green guifg=NONE "highlight NonText guibg=grey80 "highlight Constant gui=NONE guibg=grey95 "highlight Special gui=NONE guibg=grey95 """"""""""""""""""""""""""""""""""" " Font, Window size, etc. " Chris Ingram " Updated: 05-AUG-98 """"""""""""""""""""""""""""""""""" " Font and screen size set guifont=Lucida_Console:h8 set columns=88 lines=50 set autoindent number ignorecase " Make sure that tabs always expand to spaces. set tabstop=4 shiftwidth=4 set expandtab smarttab " Bells (as screen flashes) on errors set errorbells visualbell " Briefly show matching paren, etc. when typing. set showmatch " Show a status line at the bottom even when there is only " one buffer open (2=Always). set laststatus=2 " Change the height of the command line at the bottom to 2 " to avoid annoying 'Hit return' prompts. set cmdheight=2 """"""""""""""""""""""""""""""""""" " Set up mappings for commenting or uncommenting " groups of lines in various programming languages. " Chris Ingram " First updated: 21-APR-1999 " Updated: 08-MAR-2001 """"""""""""""""""""""""""""""""""" " Options for formatting comments within code, but not the code itself: " c == Wrap comments but not text (code). " r == Pressing enter within comment continues comment. " q == Allow gq formatting of comments. " l == Already Long lines are not broken in insert mode. " 2 == When formatting, use indent of second line in paragraph for " all remaining lines. set formatoptions=crq2 " Setting textwidth is safe with the "c" formatting option above. set textwidth=72 " SQL au BufNewFile,BufRead *.sql map cmt :s/^/--/ :nohl | map ucmt :s/^--// :nohl | set comments=:-- " Python au BufNewFile,BufRead *.py map cmt :s/^/#/ :nohl | map ucmt :s/^#// :nohl | set comments=:# " Perl au BufNewFile,BufRead *.pl map cmt :s/^/#/ :nohl | map ucmt :s/^#// :nohl | set comments=:# " Perl or XPM au BufNewFile,BufRead *.pm map cmt :s/^/#/ :nohl | map ucmt :s/^#// :nohl | set comments=:# " Perl POD au BufNewFile,BufRead *.pod map cmt :s/^/#/ :nohl | map ucmt :s/^#// :nohl | set comments=:# " Vim script au BufNewFile,BufRead *vimrc*,*.vim,.exrc,_exrc map cmt :s/^/\"/ :nohl | map ucmt :s/^\"// :nohl | set comments=:\" " AML (Arc Macro Language) au BufNewFile,BufRead *.aml map cmt :s/^/\/\*/ :nohl | map ucmt :s/^\/\*// :nohl | set comments=:/* " C, C++ au BufNewFile,BufRead *.c,*.h,*.cpp map cmt :s/^/\/\// :nohl | map ucmt :s/^\/\/// :nohl | set comments=sr:/*,mb:*,ex:*/,:// " INI au BufNewFile,BufRead *.ini map cmt :s/^/;/ :nohl | map ucmt :s/^;// :nohl | set comments=:; """"""""""""""""""""""""""""""""""" " Set up swap file directories multiple undo/redo, etc. " Chris Ingram " Updated: 04-MAY-1999 """"""""""""""""""""""""""""""""""" " Directory for swap file. " This would need to be commented out on Unix. set directory=C:\temp\vim,c:\temp " Show in status line when in insert mode. set showmode " Allow the vim multi level undo (by removing it from the vi compatible " flag list). set cpoptions-=u " Allow command line history. set history=100 """"""""""""""""""""""""""""""""""" " Frank's Idea of how to handle tabs by creating 4 spaces " as you enter them, but if there are any others in the incoming " file, display them as 8 wide. " Note that this overrides 'ts' set earlier in this file. " Updated: 05-MAY-1999 """"""""""""""""""""""""""""""""""" se et ts=8 sw=4 softtabstop=4 smarttab " Show which whitespace is tabs and which is just space: " :se list " Useful for retabbing doc? " :retab """"""""""""""""""""""""""""""""""" " Set up filname completion options so you can press tab to complete " the filename. " Chris Ingram " Updated: 10-APR-2000 """"""""""""""""""""""""""""""""""" set wildchar= set wildmode=longest,list """"""""""""""""""""""""""""""""""" " I hate those stupid dangling backup files that get left hanging " around (with a ~ on the end). Let's turn that irritation off. " " With this particular combination , the backup file will get created, " but after the file is successfully saved, it is deleted. This " should adequately protect your data in the event of a system crash " (e.g. power outage) while saving. " " Chris Ingram " Updated: 08-MAR-2001 """"""""""""""""""""""""""""""""""" " Make the backup. set writebackup " Then delete it after file is successfully written to disk. set nobackup endif " Added 06-OCT-98 for gVim 5.3, Chris Ingram " " Uncomment the following line on a Windows machine to make VIM " behave like other Windows text editors (e.g. Ctrl-X, Ctrl-C, " Ctrl-V, Ctrl-Z, etc. for cut, copy, paste, undo, etc. and " Shift-Arrows for selection, etc.) I personally can't stand " for VIM to behave this way, but lots of other people seem " to like it. " "source $VIM/mswin.vim