version 6.1
" See ":help version" to see why this command is in the first line.
"
" #############################################################################
" File: ~/.vimrc - Config file for gvim
" Created by Michael Prokop - www.michael-prokop.at - online@michael-prokop.at
"
" Latest change: Di Aug 06 Westeuropäische Sommerzeit 2002
"
" Purpose: Setup file for the editor Vim (Vi IMproved)
"
" Notice: For using the Miktex-System (LaTeX-System for Windows) you may have
" to adjust some values. Have a look at the category Miktex in
" this file!
"
" This file is based on Sven Guckes -->
" - vimrc.forall. Thanks to Sven!
"
" #############################################################################
" ////////////////////////////////
" / Some notes by Michael Prokop /
" ////////////////////////////////
"
" You don't know vi[m] already?
" Ok, I will tell you - vi chooses his friends on it's own :-)
"
" To learn vi
" 1.) run "vimtutor" from your Unix/Linux-prompt and go through it
" 2.) run ":help" or ":help keyword" in vim
" 3.) RTFM - read the f****** manual ;-)
" 4.) visit the websites mentioned in this document
" and you will become a vim-expert (I at least hope ;-))
"
" Not enough information? Ok, some nice pages with information on vi[m]:
"
" http://www.vim.org/ -> Sven Guckes vim-page -> cool!
" http://www.math.fu-berlin.de:80/~guckes/vim/ |-> mirror of www.vim.org !
" http://www.liacs.nl/~jvhemert/vim/ -> Jano's Vim Macro Page
" http://users.erols.com/astronaut/vim/ -> Dr Chip's Vim Page
" http://www.thomer.com/vi/vi.html -> VI Lover's Homepage :-)
" http://vim.sourceforge.net/ -> nice scripts and tips (many of
" them are used in this
" config-file)
" A good place for questions not answered at the websites listed above is the
" google-archive: http://www.google.com/ and http://groups.google.com/
" If you could not find the answer it's time to contact the geeks in the
" appropriate newsgroup[s] - so have a look at:
"
" news://de.comp.editoren -> german newsgroup with topic editors
" news://comp.editors -> international newsgroup with topic editors
"
" Feeling bored? Need some stats of your vimrc?
" All rows are commented out with a '"' so you can grep it:
" egrep -v '(#|^$)' .vimrc | wc
" to get some values of your .vimrc :-)
"
" Installation of this setup file:
" To use this setup file, copy it to this filename on these systems:
" ~/.vimrc Unix, Linux and OS/2
" s:.vimrc Amiga
" $VIM\_vimrc MS-DOS and Win32
"
" =============================================================================
" TODO [by and for Michael Prokop]
"
" 1.) Search for TODO in source (just run in normal modus "/TODO" [without ""])
" 2.) optimize autoident (some problems when inserting long text with mouse)
" 3.) kill foreign signatures when replying by mail or news and DO NOT prompt
" if there is NO signature
"
" =============================================================================
" Notes by Sven:
" Availability: This file is available as
" 27K
" 78K
" (mirror)
" Size: This file is about 77K in size and has 2,100+ lines.
" only about 400 lines are not commented -
" the rest is documentation with hints.
" So don't be afraid to read through this file.
" It should be quite easy to understand.
" Questions? Send them to me!
" Author: Sven Guckes
"
" Related files:
" http://www.math.fu-berlin.de/~guckes/vim/setup.html
" http://www.math.fu-berlin.de/~guckes/vim/src/emacs.vim
" http://www.math.fu-berlin.de/~guckes/vim/src/latex.vim
" http://www.math.fu-berlin.de/~guckes/vim/src/html.vim
" http://www.math.fu-berlin.de/~guckes/vim/syntax/
" =============================================================================
" NOTE: If your read this then please send me an email!
" I welcome all feedback on this file - especially
" with new ideas such as abbreviations and mappings.
" Thanks! And enjoy Vim! :-)
" --Sven guckes@vim.org and guckes-vimrc@math.fu-berlin.de
" =============================================================================
" Webpages on Vim that you should know about:
" http://www.vim.org/ Vim Home Page (actually a mirror)
" http://www.vim.org/announce/ Vim Announcements
" http://www.vim.org/bina.html sites with vim binaries
" http://www.vim.org/bugs.html Some Vim Bugs
" http://www.vim.org/cvs.html CVS server
" http://www.vim.org/deve.html Current development issues
" http://www.vim.org/dist.html All mirrors in detail
" http://www.vim.org/faq/ Vim FAQ
" http://www.vim.org/hist.html History of ChangeLogs
" http://www.vim.org/html/ Vim Helptexts in HTML
" http://www.vim.org/howto/ Vim HowTo Texts
" http://www.vim.org/iccf/ Vim and the ICCF (see ":help iccf")
" http://www.vim.org/lang.html Language/SyntaxFile Summary
" http://www.vim.org/macs.html Vim on MacOS development
" http://www.vim.org/mail.html Mailing lists and all that
" http://www.vim.org/mirrors.html All mirror sites (ftp and www)
" http://www.vim.org/news.html NEWS about Vim and the pages
" http://www.vim.org/newsgroup.html Vim on comp.editors
" http://www.vim.org/orga.html vim.org background info
" http://www.vim.org/pics.html Pictures: buttons,icons,screenshots
" http://www.vim.org/press/ Articles on Vim in Magazines
" http://www.vim.org/quotes.html Quotes on Vim by users
" http://www.vim.org/sites.html Sites that use Vim officially
" http://www.vim.org/syntax/ Syntax files from current version
" http://www.vim.org/syntax.new/ New Syntax files (not yet in distrib)
" http://www.vim.org/user.html Vim Users and their pages on Vim
" http://www.vim.org/wish.html Wishlist for new features
" http://www.vim.org/why.html Why to use a vi clone (Vim!)
" http://www.vim.org/y2k.html Y2K issues (as if there are any..)
" =============================================================================
" Info on the latest versions of Vim are on the Vim Home Page:
" http://www.vim.org/
" Mind you, those pages are a *mirror* of the pages at
" http://www.math.fu-berlin.de/~guckes/vim/
" =============================================================================
" The latest versions of Vim are usually in my signature file:
" http://www.math.fu-berlin.de/~guckes/sig/SIGS Comments?
" =============================================================================
" =============================================================================
" version check:
" The first line of this setup file contains the information
" "version xxx" which allows VIM to check whether the setup file
" fits the syntax that it understands.
" Versions of VIM other than of version 5 then will give a warning
" as they do not understand this setup file command - a feature:
" Give a warning so the user knows that there is something odd
" about the setup file.
" =============================================================================
" Structure of this file:
" Lines starting with an inverted comma (") are comments.
" Some mappings are commented out. Remove the comment to enable them.
"
" There are three kinds of things which are defined in this file:
" Mapping ("map"), settings ("set"), and abbreviations ("ab").
" Settings affect the behaviour of commands.
" Mappings maps a key sequence to a command.
" Abbreviations define words which are replaced
" right *after* they are typed in.
"
" =============================================================================
" Note on mappings - "angle notation" (see ":help <>"):
" VIM allows you to define mappings with special characters
" with a notation that uses non-special characters:
" The notation encloses decriptive words in angle brackets (<>).
" The characters you will most often are:
" for control-m
" for control-v which quotes the following character
" for the escape character.
" All control characters have been replaced to use the angle notation
" so you should be able to read this file without problems.
" (Well, sometimes I leave some tabs [control-i] in the file. ;-)
" =============================================================================
" External programs:
" Some mappings make use of external programs.
" The following you should find/have on every UNIX system:
" cut, date; awk, egrep, grep, ispell, perl, sed.
" If you are using DOS then you should get these for you system!!
" See http://www.math.fu-berlin.de/~guckes/dos/ for some pointers!
" =============================================================================
" Online Help - jump to help positions with "\\":
" On some keyboards you will have some trouble with C-],
" the command to jump to the current help tag.
" The following mapping allows to use "\\", too:
" =============================================================================
" The command ":version" does not show the current value of
" VIMRUNTIME - dang! So I need a fast way to display that value:
map :V :echo $VIMRUNTIME
" =============================================================================
" HTML - HTML - HTML - HTML - HTML - HTML - HTML - HTML
" =============================================================================
" This has become quite big - so I moved it out to another file:
" http://www.math.fu-berlin.de/~guckes/vim/source/html.vim [980227]
" The "expand" is necessary to evaluate "~mika".
" let FILE=expand("~/.vim/macros/html.vim")
" if filereadable(FILE)
" exe "source " FILE
" endif
"
" =============================================================================
" SETTING OPTIONS
" =============================================================================
" There are many options for Vim - over 200. Here is an overview:
" http://www.vim.org/options54.txt VIM-5.4 [990726] 218 options.
" http://www.vim.org/options57.txt VIM-5.7 [000624] 219 options.
" http://www.vim.org/options60ae.txt VIM-6.0ae [010504] 283 options.
" =============================================================================
"
" autoindent, paste, textwidth:
" I keep changing these values - just as the case may be.
" Now, if functions keys actually worked on all keyboards
" then I'd probably defines a toggle for each of them...
"
" autoindent: "off" as I usually do not write code.
set noautoindent
"
" autowrite: Automatically save modifications to files
" when you use critical (rxternal) commands.
set autowrite
"
" backup: backups are for wimps ;-)
set nobackup
"
" backspace: '2' allows backspacing" over
" indentation, end-of-line, and start-of-line.
" see also "help bs".
set backspace=2
"
" background: Are we using a "light" or "dark" background?
" set background=dark
"
" compatible: Let Vim behave like Vi? Hell, no!
set nocompatible
"
" comments default: sr:/*,mb:*,el:*/,://,b:#,:%,:XCOMM,n:>,fb:-
set comments=b:#,:%,fb:-,n:>,n:)
"
" cpoptions you should get to know - source of many FAQs! ;-)
" cpoptions: "compatible options" to match Vi behaviour
" set cpoptions="aABceFs" "default!
" FAQ: Do NOT include the flag '<' if you WANT angle notation!
"
" dictionary: english words first
" set dictionary=/usr/share/dict/words,/home/mika/.vim/words.german
" Source for dictionaries (in unix-format):
" ftp://ftp.fu-berlin.de/misc/dictionaries/unix-format/
" However, these are quite old. Is there a better source?
"
" digraph: required for those umlauts
set digraph
"
" errorbells: damn this beep! ;-)
set noerrorbells
"
" esckeys: allow usage of cursor keys within insert mode
" You will find this useful when working, eg, on SunOS.
set esckeys
"
" In case you want this for SunOS only:
" if system('uname')=='SunOS'
" set ek
" endif
" expandtab: Expand Tabs? Rather not.
" See 'listchars' to make Tabs visible!
" set noexpandtab
"
" 020625 I do not like Tabs so I set the option, that Tabs are expanded to
" " " :-)
set expandtab
"
" formatoptions: Options for the "text format" command ("gq")
" I need all those options (but 'o')!
set formatoptions=cqrt
"
" helpheight: zero disables this.
set helpheight=0
"
" helpfile: path+filename of the main helpfile, ie "help.txt"
" set helpfile=c:\\vim-4.6\\docs\\help.txt
" set helpfile=c:/vim-4.6/docs/help.txt
" On Windows, I put the Vim helpfiles
" into the directory C:\VIM-version, eg C:\VIM-60ab
"
" Support users of old vim versions on the local net:
" if version==507
" set helpfile=/import/Mweb/guckes/vim/doc/help.txt
" endif
"
" For use from a WindowsNT machine which mounts
" the user's home directory on drive 'Z':
" if has("dos16") || has("dos32") || has("gui_w32")
" set helpfile=Z:\share\vim\runtime\doc\help.txt
" endif
"
" hidden: Allow "hidden" buffers. A must-have!
set hidden
"
" highlight=8b,db,es,hs,mb,Mn,nu,rs,sr,tb,vr,ws
set highlight=8r,db,es,hs,mb,Mr,nu,rs,sr,tb,vr,ws
"
" hlsearch : highlight search - show the current search pattern
" This is a nice feature sometimes - but it sure can get in the
" way sometimes when you edit.
set nohlsearch
"
" icon: ...
set noicon
"
" set iconstring file of icon (icons? on a terminal? pff!)
" set iconstring
"
" ignorecase: ignore the case in search patterns? NO!
set noignorecase
"
" insertmode:
" FAQ: Q: How can I quit insertmode when using this option?
" A: The option "insertmode" was not meant for "start Vim in
" insert mode" only; the idea is to *stay* in insert mode.
" Anyway, you can use the command |i_CTRL-O| to issue commands.
set noinsertmode
"
" 020802 Colorscheme adjusted
syntax on
" 020806 Set the default colorscheme which should be used by gvim
" colorscheme borland
" 020802
" set background=dark
"
" iskeyword:
" iskeyword=@,48-57,_,192-255 (default)
" Add the dash ('-'), the dot ('.'), and the '@' as "letters" to "words".
" This makes it possible to expand email and html addresses,
" eg guckes-www@vim.org and http://www.vim.org/
set iskeyword=@,48-57,_,192-255,-,.,:,/,@-@
"
" joinspaces:
" insert two spaces after a period with every joining of lines.
" I like this as it makes reading texts easier (for me, at least).
set joinspaces
"
" keywordprg: Program to use for the "K" command.
" set keywordprg=man\ -s
"
" laststatus: show status line? Yes, always!
" laststatus: Even for only one buffer.
set laststatus=2
"
" [VIM5]lazyredraw: do not update screen while executing macros
set lazyredraw
"
" 'list' + 'listchars': Great new feature of vim-5.3!
" This tells Vim which characters to show for expanded TABs,
" trailing whitespace, and end-of-lines. VERY useful!!
" Standard settings:
" set list
" set listchars=tab:>-,trail:·,eol:$
"
" However: The '$' at the end of lines is a bit too much, though.
" And I quite like the character that shows a dot in the middle:
" set listchars=tab:>·,trail:·
"
" Some people might prefer a double right angle (>>)
" to show the start of expanded tabs, though:
" set listchars=tab:»·,trail:·
"
" However, this all breaks up when viewing high-bit characters
" through some brain-dead telnet program (there are many).
" Sometimes a change of the font does the trick. Try it!
"
" magic: Use 'magic' patterns (extended regular expressions)
" in search patterns? Certainly! (I just *love* "\s\+"!)
set magic
"
" modeline: ...
" Allow the last line to be a modeline - useful when
" the last line in sig gives the preferred textwidth for replies.
set modeline
set modelines=1
"
" number: ...
set nonumber
"
" path: The list of directories to search when you specify
" a file with an edit command.
" Note: "$VIM/syntax" is where the syntax files are.
" set path=.,,~/,$VIM/syntax/,~/.vim/syntax,~/.vim/macros
set path=.,,$VIM/syntax,$VIM/
"
" pastetoggle
if version>=508
set pastetoggle=
endif
"
" report: show a report when N lines were changed.
" report=0 thus means "show all changes"!
set report=0
"
" ruler: show cursor position? Yep!
set ruler
"
" runtimepath: list of dirs to search for runtime files
" runtimepath is for Vim-6 only!
" if version>=600
" set runtimepath=~/.vim,~/.vim/after
" set runtimepath+=~prokop/.vim
" endif
" had to set this now that Vim won't use "helpfiles"
" to look for runtime files any more.
"
" Setting the "shell" is always tricky - especially when you are
" trying to use the same vimrc on different operatin systems.
" shell for DOS
" set shell=command.com
" shell for UNIX - math.fu-berlin.de BSD
" set shell=zsh
" shell for UNIX - inf.fu-berlin.de BSD&Solaris
" set shell=zsh
" shell for UNIX - zedat.fu-berlin.de BSD&Solaris
" set shell=/bin/tcsh
" Now that vim-5 has ":if" I am trying to automate the setting:
"
if has("dos16") || has("dos32")
" because I only work on "real" windows-machines ;-) I call cmd and not
" command.com :-)))
let shell='cmd'
" maybe you need the following option, then uncomment the above!
" let shell='command.com'
endif
" gui_w32: cmd.exe
"
" start the zsh as a login shell:
" if has("unix")
" let &shell="zsh\ -l"
" endif
" I preffer the bash because I am used to it - just change it if necessary
if has("linux")
let &shell="bash\ -l"
endif
"
" shiftwidth: Number of spaces to use for each
" insertion of (auto)indent.
" set shiftwidth=8
set shiftwidth=2
"
" shortmess: Kind of messages to show. Abbreviate them all!
" New since vim-5.0v: flag 'I' to suppress "intro message".
set shortmess=at
"
" showcmd: Show current uncompleted command? Absolutely!
set showcmd
"
" showmatch: Show the matching bracket for the last ')'?
set showmatch
"
" showmode: Show the current mode? YEEEEEEEEESSSSSSSSSSS!
set showmode
"
" suffixes: Ignore filename with any of these suffixes
" when using the ":edit" command.
" Most of these are files created by LaTeX.
set suffixes=.aux,.bak,.dvi,.gz,.idx,.log,.ps,.swp,.tar
"
" startofline: no: do not jump to first character with page
" commands, ie keep the cursor in the current column.
set nostartofline
"
" splitbelow: Create new window below current one.
set splitbelow
"
" statusline: customize contents of the windows' status line.
" I prefer it this way:
" Show the current buffer number and filename with info on
" modification, read-only, and whether it is a help buffer
" (show only when applied).
" set statusline=[%n]\ %f\ %(\ %M%R%H)%)
"
" Move the rest to the right side, eg a copyright text:
" set statusline=[%n]\ %f\ %(\ %M%R%H)%)%=(c)\ Michael\ Prokop
"
" Show the value of the current character in ASCII and Hex:
" set statusline=[%n]\ %f\ %(\ %M%R%H)%)\=ASCII=%b\ HEX=%B
"
" Show the current position with line+column+virtual_column:
" set statusline=[%n]\ %f\ %(\ %M%R%H)%)\=Pos=<%l\,%c%V>\ %P
" Adding color through UserN groups:
" set statusline=%1*[%02n]%*\ %2*%F%*\ %(\ %M%R%H)%)%=%3*Pos=<%l,%c%V>%*
"
" My favourite statusline is:
set statusline=%<[%n]\ %f\ %y\ %r\ %1*%m%*%w%=%(Column:\ %c%V%)%4(%)%-10(Line:\ %l%)\ %4(%)%p%%\ %P\ \ \ \ \ \ ASCII=%b\ HEX=%B\ \ \ \ \ %=(c)\ Michael\ Prokop
"
" Another favourite:
" set statusline=[%n]\ %f\ %(\ %M%R%H)%)\=Pos=<%l\,%c%V>\ %P\=ASCII=%b\ HEX=%B)%=(c)\ Michael\ Prokop
"
" User1: color for buffer number
" hi User1 ctermfg=red ctermbg=white
" User2: color for filename
" hi User2 ctermfg=green ctermbg=white
" hi User2 ctermfg=green ctermbg=black
" User3: color for position
" hi User3 ctermfg=blue ctermbg=white
"
" tabstop: number of spaces that a in the file counts for
set tabstop=8
"
" tags: file for "tags" - search words
" set tags=~/.vim/vim.tags
"
" 990503: I have to set the "term" explicitly
" because the standard setups are broken.
" set term=builtin_pcansi
" set term=xterm
"
" Set the colors for vim on "xterm"
" if &term=="xterm"
" set t_Co=8
" set t_AB=[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm
" set t_AF=[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm
" endif
"
" textmode: no - I am using Vim on UNIX!
" set notextmode
"
" textwidth
" set textwidth=79
"
" title: default value is off
" When on, the title of the window will be set to the value of
" 'titlestring' (if it is not empty), or to:
" filename [+=-] (path) - VIM
set title
"
" ttyfast: are we using a fast terminal?
" seting depends on where I use Vim...
set nottyfast
"
" ttybuiltin: default value is on
" When on, the builtin termcaps are searched before the external ones.
" When off the builtin termcaps are searched after the external ones.
set nottybuiltin
"
" ttyscroll: turn off scrolling -> faster!
set ttyscroll=0
"
" ttytype: string (default from $TERM)
" set ttytype=rxvt
"
" viminfo: What info to store from an editing session
" in the viminfo file; can be used at next session.
set viminfo=%,'50,\"100,:100,n~/.viminfo
"
" visualbell: Use visual bell instead of beeping. Very usefull if you
" don't like sound or try to keep your neighbours friendly ;-))
set visualbell
"
" t_vb: terminal's visual bell - turned off to make Vim quiet!
" Please use this as to not annoy cow-orkers in the same room.
" Thankyou! :-)
set 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
" default value is "" but I prefer the tab key
set wildchar=
"
" wrapmargin:
" When do you want the line to break? A value of 1 means that 1
" "cursor" before the end of the visible screen.
" if wrapmargin=n, then the wrapping occurs if the distance to the
" right screen-border is "n" spaces
set wrapmargin=1
"
" writebackup: Make a backup before overwriting a file. The backup is
" removed after the file was successfully written, unless the 'backup'
" option is also on.
" I don't like this setting because it's just for losers ;-)
set nowritebackup
"
" 020628 By default, Vim displays the current line of each minimized file,
" which (to me) isn't much help and takes up too much screen real estate.
set wmw=0
"
" =============================================================================
" Abbreviations
" =============================================================================
" Moved the abbreviations *before* the mappings as
" some of the abbreviations get used with some mappings.
"
" Let's start of with some standard strings
" like the alphabet and the digits:
"
" Yalpha : The lower letter alphabet.
iab Yalpha abcdefghijklmnopqrstuvwxyz
"
" YALPHA : The upper letter alphabet.
iab YALPHA ABCDEFGHIJKLMNOPQRSTUVWXYZ
"
" Ydigit: The ten digits.
iab Ydigit 1234567890
"
" Yruler: A "ruler" - nice for counting the length of words.
iab Yruler 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
"
" Abbreviations for some important numbers:
iab Npi 3.1415926535897932384626433832795028841972
iab Ne 2.7182818284590452353602874713526624977573
"
" Abbreviations for some classic long words:
" Donau... is the German word for the (read in reverse)
" "additional paragraph of the law regulating the pension of
" widows to captains of the ship company on (the river) Danube"
" (I am not making this up! ;-)
" iab YDD Donaudampfschifffahrtgesellschaftskapitaenwitwenrentengesetzzusatzparagraph
" New German spelling "schifffahrt", too! (Hi, Doram!)
"
" Some more weird sentences in KrautLang
" using as many umlauts as possible:
" "Jörg möchte fünf Frühstücksbrötchen
" um äußerstes Völlegefühl zu spüren."
" "Äßen Löwen Möwen, zögen Möwen über Löwen rüber."
" "Äße Öko-Jörg große Bärenfüße in äußerst süßer Nußölkäsesoße
" müßte er in ein übermäßig häßliches Güllefaß."
"
" and now a word with all three umlauts and the 'ß', too:
" iab YHRA "Heizölrückstoßabdämpfung"
" Yes, KrautLang *is* weird!
"
" But some languages are even weirder - Welsh, for example:
" YLL : The name of a town in Wales.
" iab YLL LLanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch
" http://www.llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch.co.uk
" http://194.159.85.168/ - I am not making this up! :-)
"
" and now something from down under:
" YTauma: The name of a hill in New Zealand.
" iab YTauma Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwenuakitanatahu
"
" Longest Word in the second edition of the Oxford English Dictionary?
" iab YNNMSVC pneumonoultramicroscopicsilicovolcanoconiosis
"
" Yi18n: .123456789012345678. - yup, 18 characters betwwen 'i' and 'n'
" iab Yi18n internationalization
"
" Ysuper: A nice long word from the musical "Mary Poppins".
" iab Ysuper supercalifragilisticexpialidocious
"
" Phrases.
" Yanfs: Changing the Subject within a message. (Hi, Monty Python!)
" iab Yanfs And now for something completely different...
"
" Yanti: The longest proper word in the English language?!
" iab Yanti antidisestablishmentarianism
"
" Ybtdt: It's been dejavu all over again.
" iab Ybtdt Been there, done that, got the tshirt.
"
" Yicty: Some people should really RTFM!
" iab Yicty I could tell you - but then I'd have to kill you.
"
" Ypass: Standard answer to Usenet posts
" with the "Subject: HELP" (hehe)
" iab Ypass "You are in a maze of twisty little passages, all alike."
"
" Ywttc: One more person using Vim.
" iab Ywttc Welcome to the club!
"
" Ywyot: people who use the browser for email and news...
" iab Ywyot when your only tool is a hammer - every problem looks like a nail.
"
"
" classic pangrams (which include every letter of the alphabet):
" German:
" kaufen sie jede woche vier gute bequeme pelze [missing: 'xy' :-/]
" sylvia wagt quick den jux bei pforzheim
" bayerische jagdwitze von maxl querkopf
" zwei boxkaempfer jagen eva quer durch sylt
" falsches üben von xylophonmusik quält jeden größeren zwerg.
" Bei jedem klugen Wort von Sokrates rief Xanthippe zynisch: Quatsch!
" English:
" the quick brown fox jumps over the lazy dog
" The five boxing wizards jump quickly
" French:
" voyez le brick geant que j'examine pres du wharf.
" Polish:
" Pchn±æ w tê ³ód¼ je¿a lub o¶m skrzyñ fig.
" Koñ i ¿ó³w grali w ko¶ci z piêkn± æm± u ¼ród³a.
" Têgi koñ i ma³y ¿ó³w ¶piewali z piêkn± æm± u ¼ród³a ¿ycia.
"
" And a sentence to break some quoing levels:
" "This man's house (which 's yellow) burned down."
"
" And now for something completely different:
" I couldn't bear to bear bears over the border.
"
" Inserting an ellipsis to indicate deleted text
iab Yell [...]
" 020704 This mapping I often use when posting in newsgroup or writing
" mail-replies
iab Ysc o[schnipp]k$i
vmap ,ell c[...]
"
" some words I type often enough:
iab eig eigentlich
iab merkw merkwuerdig
iab Latex LaTeX
iab Tex TeX
"
" typing smileys slows me down..
" iab BAH :-(
iab BAH :-(
iab SMILE :-)
iab WINK ;-)
"
" Correcting those typos. [I almost never get these right. :-(]
" See also: http://www.igd.fhg.de/~zach/programs/acl/
iab alos also
iab aslo also
iab acuh auch
iab becuase because
iab bianry binary
iab bianries binaries
iab charcter character
iab charcters characters
iab exmaple example
iab exmaples examples
iab shoudl should
iab seperate separate
iab teh the
iab tpyo typo
" Some frequent typos in German:
iab bracuht braucht
iab doer oder
iab nciht nicht
iab Dreckfuhler Druckfehler
iab Micheal Michael
iab Netwokr Network
iab Srever Server
iab SIe Sie
iab ICh Ich
"
" Sorry, Laurent!
iab Laurant Laurent
"
" See http://www.math.fu-berlin.de/~guckes/sig/:
iab YDDS dash-dash-space
"
" For reports and texts on my studies:
" iab YKT Komplexitaetstheorie
" iab YPM Pattern Matching
" see http://elib.zib.de/ICM98 :
" iab YICM International Congress of Mathematicians
" iab YRA Rechnerarchitektur
" iab YRKN Rechner- und Kommunikationsnetze
iab YRO Rechnerorganisation
iab YPP Programmierpraktikum
"
" Often used filenames - only needed these on the command line:
" see also: http://www.math.fu-berlin.de/~guckes/setup/
"
" cab ELMALIAS ~/.elm/aliases.text
" cab Erc ~/.elm/elmrc
cab Mrc ~/.muttrc
cab Src ~/.slrnrc
cab Brc ~/.bashrc
" cab Zrc ~/.zsh/.zshrc
"
" Usenet header lines (used when composing a post):
"
iab UFT Followup-To:
iab UMCT Mail-Copies-To: ng@michael-prokop.at
iab UNG Newsgroups:
iab URT Reply-To: ng@michael-prokop.at
iab UFUB Organization: TU-Graz
"
" Current version numbers of my favourite programs:
" http://www.math.fu-berlin.de/~guckes/faq/program.versions.html
" And some abbreviations to type them in mail&news:
" [Last update: 020401]
" iab Vlynx lynx-2.8.5dev.1 [010725]
" iab Vmuttdev mutt-1.3.28 [2002-03-13]
" iab Vslrn slrn-0.9.7.4 [2002-03-13]
" iab Vvim vim-6.1 [020324]
"
" My phone number:
iab Yphone GSM: (+43) (0)664/1646346
iab Ybuero TEL: +43(316)/873-7504
" My snailmail address. Postcards, anyone?
iab Ysnail Michael ProkopWienerstraße 58a-8A-8020 Graz
" My ICQ number. Chat, anyone?
iab YICQ ICQ: 52179636
"
" My addresses (Email and WWW)
" makes it easy to type them without typos ;-)
ab Umail
ab Uweb
ab Umaili
ab Umails
ab Umfg mfg,:-) Michael
ab Nmfg Mit freundlichen Gruessen,Michael Prokop
ab UMP Michael Prokop
ab HPS
"
" Other important WWW addresses
"
ab HPV +
ab HPG
" ab URLaltavista http://www.altavista.de/textonly.html
" ab URLftpsearch http://ftpsearch.lycos.com/?form=advanced
" ab URLrpmfind http://rpmfind.net/
" ab URLsource http://sourceforge.net/
" ab URLslashdot http://slashdot.org/
" ab URLfreshmeat http://freshmeat.net/
"
" =============================================================================
" Abbreviations - Header Lines for Email and News
" =============================================================================
" Define regexpr for headers to use with mappings
" as it makes reading the mappings much easier:
" cab HADDR From\\|Cc\\|To
cab HEMAIL ^\(From\\|Cc\\|To\\|Date\\|Subject\\|Message-ID\\|Message-Id\\|X-\)
cab HNEWS ^\(From\\|Cc\\|To\\|Date\\|Subject\\|Message-ID\\|X-\\|Newsgroups\)
"
" =============================================================================
" Abbreviations - General Editing - Inserting Dates and Times
" =============================================================================
"
" First, some command to add date stamps (with and without time).
" I use these manually after a substantial change to a webpage.
" [These abbreviations are used with the mapping for ",L".]
"
iab Ydate =strftime("%y%m%d")
" Example: 020523
iab Cdate =strftime("%d.%m.%y - %H:%M")
" Example: 23.05.02 - 17:06
"
iab Ytime =strftime("%H:%M")
" Example: 17:06
"
" man strftime: %T time as %H:%M:%S
" iab YDT =strftime("%y%m%d %T")
" Example: 971027 12:00:00
"
" man strftime: %X locale's appropriate time representation
iab YDT =strftime("%y%m%d %X")
" Example: 020523 17:06:49
"
iab YDATE =strftime("%a %b %d %T %Z %Y")
" Example: Don Mai 23 17:06:56 CEST 2002
"
" On Windows the functions "strftime" seems to have a different
" format. Therefore the following may be necessary: [980730]
" if !has("unix")
" iab YDATE =strftime("%c %a")
" else
" iab YDATE =strftime("%D %T %a")
" endif
"
" 000306: These two lines at the start of a Perl script
" will start the first Perl in your Shell's $PATH.
iab Yperlhead eval 'exec perl -w -S $0 ${1+"$@"}'if 0;
"
"
" =============================================================================
" MAPpings
" =============================================================================
" Caveat: Mapping must be "prefix free", ie no mapping must be the
" prefix of any other mapping. Example: "map ,abc foo" and
" "map ,abcd bar" will give you the error message "Ambigous mapping".
"
" The backslash ('\') is the only(?) unmapped key, so this is the best
" key to start mappings with as this does not take away a command key.
" However, the backslash is never in the same position with keyboards.
" Eg on German keyboards it is AltGr-sz - don't ask.
" Anyway, I have decided to start mappings with the comma as this
" character is always on the same position on almost all keyboards
" and I hardly have a need for that command.
"
" The following maps get rid of some basic problems:
"
" When the backspace key sends a "delete" character
" then you simply map the "delete" to a "backspace" (CTRL-H):
" map
"
" With Vim-4 the format command was just 'Q' and
" I am too used to it. So I need this back!
nnoremap Q gq
vnoremap Q gq
"
" 980527 I often reformat a paragraph to fit some textwidth -
" and I use the following mapping to adjust it to the
" current position of the cursor:
map #tw :set textwidth==col(".")
"
" 981210 Whenever I paste some text into VIM I have to
" toggle from "nopaste" to "paste" and back again:
" map :set paste!:set paste?
" map [14~ :set paste!:set paste?
" --> new option for this: 'pastetoggle'
"
" "tal" is the "trailer alignment" filter program
" Hopefully it will ship with Vim one day.
" vmap #t !tal
" vmap #t !tal -p 0
"
" Disable the command 'K' (keyword lookup) by mapping it
" to an "empty command". (thanks, Lawrence! :-):
" map K :
" map K :
" More elegant: (Hi Aziz! :-)
map K
"
" Disable the suspend for ^Z.
" I use Vim under "screen" where a suspend would lose the
" connection to the " terminal - which is what I want to avoid.
" map :shell
"
" Make CTRL-^ rebound to the *column* in the previous file
noremap `"
"
" Make "gf" rebound to last cursor position (line *and* column)
noremap gf gf`"
"
" When I let Vim write the current buffer I frequently mistype the
" command ":w" as ":W" - so I have to remap it to correct this typo:
nmap :W :w
" TODO: Use the following (after some testing):
" command -nargs=? -bang W w
"
" Are you used to the Unix commands "alias" and "which"?
" I sometimes use these to look up my abbreviations and mappings.
" So I need them available on the command line:
map :alias map
map :which map
"
" The command {number}CTRL-G show the current nuffer number, too.
" This is yet another feature that vi does not have.
" As I always want to see the buffer number I map it to CTRL-G.
" Pleae note that here we need to prevent a loop in the mapping by
" using the comamnd "noremap"!
noremap 2
"
" 001010 Do the Color Test!
map ,CT :sp $VIMRUNTIME/syntax/colortest.vim:so %
"
" 000329 View the file which defines the "filetypes":
map ,F :view $VIMRUNTIME/filetype.vim
"
" 980311 Sourcing syntax files::
map ,SO :source $VIMRUNTIME/syntax/
"
" 980706,000310 View a syntax file:
map ,V :view $VIMRUNTIME/syntax/
"
" 000801 Hilite Test - show all current highlight groups
" see ":help hitest.vim"
map ,HI :so $VIMRUNTIME/syntax/hitest.vim
"
" 990614 Quick insertion of an empty line:
" nmap o
" I find this convenient - but as I am also used to proceed to
" next line by pressing CR this often gives me new empty lines
" when I really do not need them. :-(
" 020523 Create html-file based on text:
map ,t2h :so $VIMRUNTIME/syntax/2html.vim
"
" 020523 Some useful mappings for programming
map ,deb o#ifdef DEBUGMESSAGEfprintf(stderr,ANSI_COLOR_RED)<CR>fprintf(stderr,"\n")<CR>fprintf(stderr,COLOR_OFF)<CR>#endifkk$hhhhi
map ,m :w:!make
map ,Kom o/**/hi*60a*kk60i*jYpPA
map ,kom o/**/hi*^4i+kk4A+jYpPA
map ,if oif(){}kk$i
map ,for ofor(;;){}kk$hhi
map ,els oelse{}O
"
" 020628 Set the compiler for programming in C - typing :make will run the
" command gcc file.c -o file
set makeprg=gcc\ -o\ %<\ %
"
" 020628 I find this a very useful command to use. Use "Make" instead of
" "make" !!!
" Command Make will call make and then cwindow which
" opens a 3 line error window if any errors are found.
" if no errors, it closes any open cwindow.
command -nargs=* Make make | cwindow 3
"
" 020628 This maping simply inserts the current filename, at the cursor position,
" when you are in insert mode:
" imap \fn =expand("%:t:r")
" Notice: An easy alternate is just to press % when in insert mode!
"
" 020628 In order to move to the file in the split above the current window, I
" was typing Ctrl-W, Up (move up a window) Ctrl-W, _ (maximize the menu).
" That's four keystrokes (more if you count Ctrl and Shift), and they are all
" over the keyboard. To help avoid this problem I use this mapping:
map j_
map k_
" Now I can hold down Ctrl and move between windows with the standard Vim
" movement keys. Much, much quicker!
"
" 020628 This does the dual thing from above for vertical splits/window changes:
nmap h
nmap l
"
" 020628 To automatically insert a closing parenthesis when typing an opening
" parenthesis:
" inoremap ( ()i
" inoremap { {}i
" inoremap [ []i
" -> it ends up with the cursor between the opening and the closing parenthesis
" in insert mode.
"
" 020628 If you are ready with filling the parenthesis/brackets, you likely want to
" "escape" from the brackets again to continue coding.
" To make this pretty comfortable, I invented the following kind of mappings,
" which get out of the last expanded parenthesis/bracket, regardless of the actual
" type of it, and enter append mode again. I mapped this kind of "getaway" with CTRL_j
" -> notice: activate all three mappings together!
" inoremap ( ():let leavechar=")"i
" inoremap [ []:let leavechar="]"i
" imap :exec "normal f" . leavechara
" Explanation: The variable "leavechar" contents the actual char which is to
" "escape" from.
"
" 020628 This mapping prompts the current function you are currently in:
map _F ma[[k"xyy`a:echo @x
"
" 020628 This method lets you jump to the beginning ot the function you are currently in:
" map _F ma][%0"xy$`a:echo @x
"
" 020628 The following code will add a function heading and position your
" cursor just after Description so that one can document as one proceeds with
" code.
"
" function FileHeading()
" let s:line=line(".")
" call setline(s:line,"/***************************************************")
" call append(s:line,"* Description - ")
" call append(s:line+1,"* Author - Michael Prokop")
" call append(s:line+2,"* Date - ".strftime("%b %d %Y"))
" call append(s:line+3,"* *************************************************/")
" unlet s:line
" endfunction
" -> define the keymapping:
" imap mz:execute FileHeading()`zjA
" -> notice: where stands for ^V+ESC and for ^V+ENTER
"
" 020628 Some people have a habit of adding the function name as a comment to the end
" of that function, if it is long, so that he/she knows which function the '}'
" ends. Here's a way to automate the process.
" (Notice: doest not work at _all_!) :-(
iab //_ } // END: 10h%$?\w\+\s*("xy/\s*(/{:nohl%$"xpa
" -> if you now end the function with '//_', the following string will be
" automatically generated: '} //END: functionname'
"
" 020628 I'm used to complete words with , however when editing source I
" can't just map that to vim keyword completion because I sometime need to
" insert real tabs, since it mostly happen when at the beginning of the line
" or after a ; and before a one line comma (java, c++ or perl anyone...)
" I've come to find the following really usefull.
" This is how you can map the key in insert mode while still being able
" to use it when at the start of a line or when the preceding char is not a
" keyword character.
"
" Simple function:
" function InsertTabWrapper()
" let col = col('.') - 1
" if !col || getline('.')[col - 1] !~ '\k'
" return "\"
" else
" return "\"
" endif
" endfunction
" -> then define the appropriate mapping:
" inoremap =InsertTabWrapper()
"
" I have found a more complex functions which also works in either direction:
function! InsertTabWrapper(direction)
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\"
elseif "backward" == a:direction
return "\"
else
return "\"
endif
endfunction
" -> then definde the appropriate mappings:
inoremap =InsertTabWrapper ("forward")
inoremap =InsertTabWrapper ("backward")
"
" 020628 Occasionally I later want already written text parts to put in parenthesis.
" I use the following macro, which brackets previously visually selected text.
" I mapped it with _(.
vnoremap _( `>a)`
" Furthermore, a sort of mapping for bracketing a *single word* is
" conceivable.
" Because this is not as general like the kind of visual mode mapping, I use
" this kind of "word bracketing" only for surrounding the word right behind
" the cursor in insert mode with **. I use the following macro to "emphasize"
" the word i just typed, for newsgroup articles.
imap _* bi*ea*
"
" 020628 To check the english spelling I use the engspchk.vim
" map ,sp :so ~/.vim/dictionary/engspchk.vimi
"
" 020628 To check the german spelling I use the following packes:
" wgerman - The German dictionary for /usr/share/dict.
" wngerman - New German orthography dictionary for /usr/share/dict
" -> this packages are provided by apt-get under Debian/GNU Linux :-)
" map ,gp :so ~/.vim/dictionary/gerspchk.vimi
" -> now I can write german and english text together (!) in one file and it
" will get checked :-) cool, ey ;-)
" -> the gerspchk.vim I created with the script available at:
"
"
" 020708 Often I know I'm likely to edit many files. I run 'vim *.extension' and get
" a whole bunch of open files. To make jumping between files to a pleasure, I defined
" two mappings:
map ;C :previous
map ;V :next
"
" 020629 Read in the output of a programm
" map #Z gg}-:r !prog
" 020629 Read in a file
" map #R gg}-:r ~/filename
" 020629 Put there a defined valu
" map #H gg}OX-Header: Value
"
" 020629 VIM can calculate :-) really cool feature
ino yiW==0
" -> then, just type 8*8 and you will get 8*8=64
"
" 020629 To rotate the signature (for example with the best mail-client called
" mutt) just need the binary "autosig" and this mapping:
" nmap ,t mQG:?^-- $:nohlodG:r !~/bin/autosig ~/.quotes \%`Q
"
" 020708 Edit compile speedup (hotkeys)
" --------- start info -----------------
" F2 - update file without confirmation
" F3 - file open dialog
" F6 - list all errors
" F7 - display previous error
" F8 - display next error
" --------- end info -------------------
" map :update
" map :browse confirm e
" map :copen
" map :cp
" map :cn
"
" 020708 A mapping for more effective use of latex und gcc compiling
" Thanks to Thorsten Zerha for providing me this functions!
map : call CompileRunPDF()
map : call CompileGcc()
"
func! CompileRunPDF()
exec "w"
exec "!latex % && dvipdf %<.dvi && acroread %<.pdf"
exec "i"
endfunc
"
func! CompileGcc()
exec "w"
exec "!gcc % -o %< && IF EXIST %< (cr 5 && banner -c # Success) ELSE banner -c # Compile Unsuccessful "
exec "i"
endfunc
"
" 020523 Change files from windoof-format to unix-format
" easy or? ;-)
map ,w2u1 :se ff=unix
" Remove that disturb
map ,w2u2 :1,$s/^M//g
"
" 020523
" ,dir shows the current directory-content
" ,gf edits the file in the current row respectively shows the
" content of the current directory
" map ,dir :sp ~/tmp/vimdirG1dG:r!ls -al:se nomod
" no ,gf $T y$:if isdirectory("""):cd ":bd:norm ,direlse:norm gfendif
"
" 020526 search the current word in all files in the working directory
map ,x vawy:! grep " .* *
"
" 020526 Javamappings -> usefull keymappings for programming Java
" map ,java :so ~/.vim/macros/javamappings.vim
"
" 020526 JavaRun -> very usefull for compiling and running .java-Files
" map ,jrun :so ~/.vim/macros/JavaRun.vim
"
" 020526 Usefull abbreviations for C-Programming
" map ,c :so ~/.vim/macros/c1.vim
"
" 020526 Very usefull mapping for editing C-Programms
" map ,dr :so ~/.vim/macros/drcstubs.vim
"
" 020526 Very nice file-browser - enaable it with _ls
" map ,ls :so ~/.vim/macros/browser.vim
"
" 020526 ROT13 Macro for coding - enable it with gr
" map ,rot :so ~/.vim/macros/rot13.vim
"
" 020526 Enable a nice ruler - enable it with @r
" map ,ru :so ~/.vim/macros/ruler2.vim
"
" 020526 A macro which allows you to open a "shell" in a new window - enable it with :vish
" map ,sh :so ~/.vim/macros/vish.vim
"
" 020526 Abbreviation for the $macro-directory
" map ,mc :so ~/.vim/macros/
"
" 020610 A macro which allows me to write LaTeX-Files without thinking about
" umlauts ;-)
" map ,tex :so ~/.vim/macros/latex.vim
"
" =============================================================================
" Customizing the command line
" =============================================================================
" Valid names for keys are:
"
"
" Many shells allow editing in "Emacs Style".
" Although I love Vi, I am quite used to this kind of editing now.
" So here it is - command line editing commands in emacs style:
cnoremap
cnoremap
" cnoremap
cnoremap
cnoremap
cnoremap
cnoremap
cnoremap b
cnoremap
cnoremap f
cnoremap
cnoremap