Linux


Meine .vimrc, welche ich unterschiedlichen Systemen nutze.

.vimrc (.vimrc) download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
" don't be compatible with vi
set nocp

" Help-Files
au FileType help nmap <buffer> <Return> <c-]>
au FileType help nmap <buffer> <BS> <c-T>

" set the swap-directory
"set directory=~/.vim/swap
"
set whichwrap=<,>,[,]

" Make backspace and delete lots of things
set backspace=indent,eol,start

" show us the commands we're typing
set showcmd

" Highlight matchin parens
set showmatch

set incsearch
set ignorecase
set infercase
set hlsearch

" indenting
set autoindent
set smartindent
set autoread
set cindent
"set cino+=>2e2n2:2l1j1
"set cino+=>2,e2,n2,:2,l1,b1,p2,(0,j1


" avoid hit-enter
set shortmess=fimnrxAoOsW

" set the ruler
set ruler

set cmdheight=2

" no error-noises
set noerrorbells
set visualbell t_vb=
autocmd GUIEnter * set visualbell t_vb=

" don't highlight searches when entering vim
autocmd VimEnter * nohls

" automatic switch to filetype lpc when insinde the mudlib-directory
autocmd BufNewFile,BufRead ~/mud/mudlib/*.[c|h]
  \ set filetype=lpc

autocmd BufNewFile ~/mud/mudlib/*.c call s:Template("c")

" automatic delete all whitespaces at the end of a line
autocmd BufWritePre ~/mud/mudlib/*.[c|h] :%s/\s\+$//e

set tags+=~/mud/mudlib/tags
set omnifunc=lpccomplete#Complete
map! <F2> //vim:tabstop=8 shiftwidth=2 softtabstop=2 noexpandtab
map <F3> <c-]>

set t_Co=256
set foldmethod=marker

" damit Modelines funktionieren
set modelines=1

" Change the color of the popup-menu
hi Pmenu ctermbg=Blue guibg=SlateBlue
hi PmenuSel ctermbg=DarkRed

syntax on

" retrieve the current indent level
fu ShowIndent()
    return (indent('.') / &sw )
endf

" set the statusline like ruler does, but include the current indent level
set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ \IL:\ %{ShowIndent()}\ %P
set laststatus=2

" set the cursorline
set cursorline
highlight CursorLine guibg=lightblue ctermbg=DarkGrey

let g:getLatestVimScripts_allowautoinstall=1

" let supertab.vim do omni-completion as default
let g:SuperTabDefaultCompletionType ="<C-X><C-O>"

" use par to format text nicely
set formatprg=par\ -w78

" use indent for formatting source
set equalprg=indent\ -br\ -npcs\ -nut\ -brs\ -bad\ -bap\ -hnl\ -bbo\ -nv\ -npsl\ -i2\ -nprs\ -nsai\ -nsaf\ -nsaw\ -nsob\ -bbb\ -bls\ -nbc\ -l\ 77\ -c2\ -cli2\ -lc\ 78\ -ncs\ -ip2\ -cdb\ -sc\ -brf
"set equalprg=indent

" various keybindings
"map z <<h
map Z >>l

map <C-right> <Esc>:bn<CR>
map <C-left> <Esc>:bp<CR>
"source ~/.vim/scripts/vimrc.vim
highlight TrailWhitespace ctermbg=red guibg=red
autocmd Syntax * syn match TrailWhitespace /\s\+$\| \+\ze\t/

filetype plugin on

function s:Template(argument)
  if(a:argument == "help")
    echo "Currently available templates:"
    echo "C - LPC-Templatefile"
  else
    "First delete the current buffer
    %d
    if(a:argument == "c")
      0r ~/.vim/templates/lpc.c
      set filetype=lpc
    endif

"    silent %!~/.vim/do_header
    %!~/.vim/do_header
  endif
endfunction

command! -nargs=1 Template call s:Template(<f-args>)