File:  [Paefchen] / home / as / .vimrc
Revision 1.2: download - view: text, annotated - select for diffs - revision graph
Thu Jun 5 08:43:41 2008 UTC (15 years, 11 months ago) by as
Branches: MAIN
CVS tags: HEAD
*** empty log message ***

" $Paefchen: home/as/.vimrc,v 1.2 2008/06/05 08:43:41 as Exp $

if v:progname =~? "evim"
  finish
endif 

"	Kompatibilitaetsmodus zu vi abschalten
set nocompatible

"	Verhalten der Rueckschritttaste
set backspace=indent,eol,start

"	encoding
set encoding=iso-8859-15
set termencoding=iso-8859-15
set fileencodings=latin1,ucs-bom,utf-8

"	immer die Statuszeile mit Dateinamen, 
"	zeile und Position anzeigen.
set ls=2

"	automatischer Zeilenumbruch bei erreichen des
"	Termianlrandes (kein echter Zeilenumbruch)
set wrap

"	die letzen n befehle festhalten
set history=1000

"	zeigt unten links diverse
"	Positionsinformationen der Schreibmarke
set ruler

"	display incomplete commands
set showcmd

"	.. SUCHE ..
"	Suchergebnisse hervorheben
set hlsearch
set incsearch
"	Suchfunktion ignoriert Groß- und Kleinschreibung
set ignorecase
set showmode

set title
set noerrorbells
set wrapscan
"	zeigt beim Schließen von Klammern kurz an, wo sie geöffnet wurde
set showmatch
set matchpairs=(:),[:],{:},<:>

"	die Shell, die beim Starten von Programmen aus dem Editor heraus verwende werden soll
set shell=/bin/tcsh

"	Zeilennummern anzeigen
set number

"	Wieviele Leerzeichen lang ist ein Tabulator?
set tabstop=8
"	Einrückungstiefe
set shiftwidth=8

"	Ersetze Tabulatoren durch Leerzeichen
"set expandtab
"	alternative Einrückungsstile
"set autoindent
"set smartinden

"	use tab for auto-expansion in menus
set wc=<TAB>
"	show a list of all matches when tabbing a command
set wmnu
"	how command line completion works
set wildmode=list:longest,list:full
"	ignore some files for filename completion
set wildignore=*.o,*.r,*.so,*.sl,*.tar,*.tgz
"	some filetypes got lower priority
set su=.h,.bak,~,.o,.info,.swp,.obj

"	Tabs,EOL etc anzeigen
set lcs=tab:».,eol:«,nbsp:%,trail:#
set list


"	schaltet syntaxhervorhebung ein und aus
map <F2> :if has("syntax_items")<CR>syntax off<CR>else<CR>syntax on<CR>endif<CR><CR>
"	tabs,oef aus/an
map <F3> :if &list \| set nolist \| else \| set list \| endif<CR>
"	Zeilennummern an/aus
map <F4> :if &number \| set nonumber \| else \| set number \| endif<CR>

"	Einfg.
map ^[[2~ i
"	Entf.
map ^? x
"	Pos1
map ^[[1~ ^
"	Ende
map ^[[4~ $
"	Bild auf
map ^[[5~ <C-B>
"	Bild ab
map ^[[6~ <C-F>
"	Rückschritt
map ^H X
"	Pfeiltasten
map ^[[B j
map ^[[D h
map ^[[C l
map ^[[A k

"	Date/Time einfügen
imap <F5> <C-R>=strftime("%H:%M %d.%m.%y")<Cr>

"	Durch mehrere Dateien springen
"	(+=nächste Datei, -=vorherige, #=aktuelle schreiben und zu nächster springen)
"map + :n<CR>
"map - :prev<CR>
"map # :w<CR>:n<CR>

"	Wort suchen (erstes STRG-W startet Wort-Eingabe, zweites STRG-W startet Suche)
map <C-W> /\<
map! <C-W> \>/<CR>

"	80 Zeichen breite Kommentar-Linien ziehen (C und Shell)
map C O/*<ESC>76a-<ESC>a*/<ESC><CR><ESC>0
map S O#<ESC>79a-<ESC><CR><ESC>0

if &t_Co > 2 || has("gui_running")
	syntax on
	" weitere Schemata sind im Verzeichnis /usr/local/share/vim/vim63/colors/ aufgelistet
	colors default
	set hlsearch
endif

if has("autocmd")
	" Enable file type detection.
	" Use the default filetype settings, so that mail gets 'tw' set to 72,
	" 'cindent' is on in C files, etc.
	" Also load indent files, to automatically do language-dependent indenting.
	filetype plugin indent on

	" Put these in an autocmd group, so that we can delete them easily.
	augroup vimrcEx
		au!

		" For all text files set 'textwidth' to 78 characters.
		autocmd FileType text setlocal textwidth=78

		" When editing a file, always jump to the last known cursor position.
		" Don't do it when the position is invalid or when inside an event handler
		" (happens when dropping a file on gvim).
		autocmd BufReadPost *
		\ if line("'\"") > 0 && line("'\"") <= line("$") |
		\ 	exe "normal g`\"" |
		\ endif

	augroup END

	" SGML
	augroup sgml
		autocmd FileType sgml set formatoptions=cq2l " Special formatting options
		autocmd FileType sgml set textwidth=70       " Wrap lines at 70 columns
		autocmd FileType sgml set shiftwidth=2       " Automatically indent
		autocmd FileType sgml set softtabstop=2      " Tab key indents 2 spaces
		autocmd FileType sgml set tabstop=8          " Replace 8 spaces with a tab
		autocmd FileType sgml set autoindent         " Automatic indentation
	augroup END

	" Makefile
	augroup make
		autocmd FileType make set tabstop=8
		autocmd FileType make set shiftwidth=8
		autocmd FileType make set softtabstop=8
	augroup END

	" Ruby
	augroup ruby
		autocmd FileType ruby set tabstop=2
		autocmd FileType ruby set shiftwidth=2
		autocmd FileType ruby set softtabstop=2
	augroup END
else
	" always set autoindenting on
	set autoindent 
endif " END: has("autocmd")

"" EOF