2007-04-16 12:46:25 +00:00

213 lines
5.3 KiB
VimL

" Setzen des Runtimepath, in dem die Vimfiles gesucht werden:
let &runtimepath = $VIMRUNTIME
let &runtimepath = &runtimepath . ',' . g:vimsuite . '/vimfiles'
let &runtimepath = &runtimepath . ',' . g:vimsuite . '/vimfiles.latex'
let &runtimepath = &runtimepath . ',' . g:vimsuite . '/HTML'
let &runtimepath = &runtimepath . ',' . g:vimsuite . '/vimfiles.damos'
let &runtimepath = &runtimepath . ',' . g:vimsuite . '/vimfiles.cvim'
let &runtimepath = &runtimepath . ',' . g:vimsuite . '/vimfiles.vjde'
let &runtimepath = &runtimepath . ',' . g:vimfiles
" Laden weiterer Einstellungen:
if has("win32")
let g:os ='dos'
execute 'source ' . expand(g:vimfiles . '/vimrc.dos')
else
let g:os = 'linux'
execute 'source ' . expand(g:vimfiles . '/vimrc.linux')
endif
if !exists('nobmsk')
execute 'source ' . expand(g:vimfiles . '/vimrc.bmsk')
endif
" global settings
" ---------------
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
set nobackup " keep no backup file
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
" filetype detection
filetype on
filetype plugin on
filetype plugin indent on
"syntax highlighing
"syntax on
syntax enable
" no syntax highliting when printing
set printoptions+=syntax:n
"highlite search
set incsearch
set hlsearch
" set global option for substitute
set gdefault
" case sensitive search
set noignorecase
" set very intelligent formatting
set formatoptions=croqwan2
" swap and backup directory
let &directory = g:swapdir
if !(isdirectory(g:swapdir))
try
call mkdir(g:swapdir, 'p')
echo 'swapdir ' . g:swapdir . ' wurde erzeugt'
catch
echo 'swapdir ' . g:swapdir . ' existiert nicht und konnte nicht erzeugt werden'
echo 'bitte erzeugen oder in ' . $VIMRUNTIME . '/../_vimrc ändern'
echo '---'
set directory&
endtry
endif
let &backupdir = g:backupdir
if !(isdirectory(g:backupdir))
try
call mkdir(g:backupdir, 'p')
echo 'backupdir ' . g:backupdir . ' wurde erzeugt'
catch
echo 'backupdir ' . g:backupdir . ' existiert nicht und konnte nicht erzeugt werden'
echo 'bitte erzeugen oder in ' . $VIMRUNTIME . '/../_vimrc ändern'
echo '---'
set backupdir&
endtry
endif
" --------
" Changing
" --------
" Don't use Ex mode, use Q for formatting
"map Q gq
" overwrite selected text
vnoremap p s<C-R>0<ESC>
vnoremap P s<C-R>0<ESC>
" list tags
inoremap <C-T> <ESC>:tselect /^<C-R><C-W><CR>
" search for visual block
vnoremap <silent> g/ y/\V<C-R>=substitute(escape(@@,"/\\"),"\n","\\\\n","ge")<CR><CR>
vnoremap <silent> g? y?\V<C-R>=substitute(escape(@@,"?\\"),"\n","\\\\n","ge")<CR><CR>
" -------
" Display
" -------
" switchbuffer: use open window, split if new
"set switchbuf=useopen,split
set switchbuf=useopen
" wrap long lines
set wrap
" show line-numbers
set number
" show title
set title
" show matching bracket
set showmatch
" matchtime in 1/10 seconds
set matchtime=5
" show wrapped line
set showbreak=-->
" show position of cursor
set ruler
" show incomplete command
set showcmd
" match braces
"nnoremap g4 /[\(\{\[]<CR>:nohls<CR>v%o
"vnoremap g4 vg4
" set textwidth to 78
set textwidth=78
" special characters
" list special characters
set list
" special characters:
set listchars=eol:$,tab:>\ ,trail:_,extends,precedes
" special characters for keywords
" set iskeyword+=
" horizontal scrollbar in diff-mode
if &diff
set guioptions+=b
endif
" ------
" Moving
" ------
" scrollwith at ^U and ^D
set scroll=5
" lines around the cursor
set scrolloff=10
" wrap line at (b=<BS>, s=<space>, h, l, <, >, [, ])
set whichwrap=
" backspace deletes: (indent,eol,start)
set backspace=indent,start
" find word under cursor
nnoremap + /<C-R><C-W><CR>
" mark word under cursor
nnoremap gm :let @/ = "<C-R><C-W>"<CR>:set hlsearch<CR>
" go to tag under cursor
nnoremap <TAB> g<C-]>
"nnoremap <CR> g<C-]>
nnoremap <CR> :tag <C-R><C-W><CR>
" return to previous position
nnoremap <S-TAB> <C-T>
nnoremap <BS> <C-T>
nnoremap <S-CR> <C-T>
" find next error
nnoremap <C-N> :cn<CR>
" go back to previous edited file
nnoremap gb :edit #<CR>
" -----------
" come and go
" -----------
set sessionoptions=blank,buffers,curdir,globals,winsize
" open window size
autocmd GUIEnter * winsize 100 60
" read and write files automatically
set autoread
set autowrite
set autowriteall
" keep original files for these filetypes
set patchmode=
" jump to '" when reading a file
"autocmd BufEnter *
"autocmd BufReadPost *
" \ if line("'\"") > 0 && line("'\"") <= line("$") |
" \ execute "normal g'\"" |
" \ endif
" set nomodifiable on writeprotected files
autocmd BufReadPost *
\ if &readonly == 1 |
\ execute ':set nomodifiable' |
\ else |
\ execute ':set modifiable' |
\ endif
" read all files on got of focus
" autocmd FocusGained * execute
" save all files on loss of focus
autocmd FocusLost * execute ':wa'
" -----------
" spell check
" -----------
set spelllang=de
set spellfile=$VIM/myspell.add
let &spellfile=&spellfile . ',' . g:vimfiles . '/spell/bmsk.add'
if exists('g:debug')
if (g:debug > 0)
echo 'loaded vimrc'
endif
endif