guest@dotshare [~/groups/vim/rc] $ ls personam-vimrc/ | cat

personam vimrc (scrot, raw, dl) (+2 likes)

lutherus Jan 28, 2012 (vim/rc)

SCROT

  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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
" = :: =========================================================== :: =
"  Filename: /home/lutherus/.vimrc
"  Filesize: 13459 Bytes on 461 Lines
"   Purpose: My personal vim configuration file
"    Author: lutherus 
"   License: License? uhm, this is a config file; do with it what ever you want!
"   Created: 26.11.2004 18:20 CET (+0100)
"  Modified: 28.04.2011 13:01 CET (+0100)
"   Version: VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Dec  2 2010 10:44:11)
" = :: =========================================================== :: =



" = :: = Esentiallies ===================================== {{{1 = :: =

if version < 700 
    echomsg "Your Vim is somewhat out of date, thus"
	echomsg "update your Editor or don't use this ~/.vimrc"
	finish
endif

set all&
set nocompatible
" set textwidth=0		" Don't wrap 
set textwidth=72        " see formatoptions and :h fo-table

set encoding=utf-8
"autocmd!

" = :: = Variables ======================================== {{{1 = :: =

" - :: - 2html.vim Setup ---------------------------------- {{{2 - :: -

    let g:html_use_css        = 1
    let g:html_use_xhtml      = 1
    unlet g:html_use_xhtml
    let g:html_number_lines   = 1
    let g:html_ignore_folding = 1
    let g:html_hover_unfold   = 0
    unlet g:html_hover_unfold
    let g:html_use_encoding = "UTF-8"

" - :: - Spell check Setup -------------------------------- {{{2 - :: -

    let g:spellfile_url = 'http://ftp.vim.org/pub/vim/runtime/spell'
    let g:SpellLangList = [ "nospell", "de_20", "de_19", "en_us" ]
    language messages C

" - :: - BufExplorer Setup -------------------------------- {{{2 · :: -

    let g:bufExplorerDefaultHelp      = 0  " Do not show default help.
    let g:bufExplorerDetailedHelp     = 0
    let g:bufExplorerShowRelativePath = 1  " Show relative paths.
    let g:bufExplorerSplitRight       = 1  " Split right.
    let g:bufExplorerSplitVertical    = 1  " Split vertically.
    let g:bufExplorerUseCurrentWindow = 1  " Open using current window.

" - :: - MiniBufExplorer Setup ---------------------------- {{{2 - :: -

	let g:miniBufExplVSplit = 20

" - :: - Miscellaneous ------------------------------------ {{{2 - :: -

    let g:BKUPDIR=expand("~/.vim/bkup")
	let g:SWPDIR=expand("~/.vim/swap/")
    let loaded_matchparen = 1
    let mapleader=","
    let g:tex_flavor = "latex"		" :h ft-tex-plugin
    let g:loadFileHeaderPlugin = 0

" = :: = File Format, Backup & Swapfile Settings ========== {{{1 = :: =

filetype plugin indent on

if filewritable(BKUPDIR) == 2
	set backup
	let &backupdir=BKUPDIR
else
	set nobackup
endif

if filewritable(SWPDIR) == 2
	let &directory=SWPDIR	" See `:h dir` and the 'Variables' section in this file for explanation
	set swapfile
	set updatecount=150
	set updatetime=7500
endif

set viminfo='25
set vi+=<0
set vi+=:75
set vi+=@75
set vi+=h
set vi+=n~/.vim/viminfo

set history=75

" = :: = Read, Write Permissions ========================== {{{1 = :: =

set noautoread      " don't automatically read files if they changed outside vim
set noautowrite     " don't automatically write files on ':next, :rewind, :last, ...'
set noautowriteall  " like autowrite, but also used for ':edit, :quit, :exit, ...'

set secure

" = :: = Display Settings ================================= {{{1 = :: =

set showcmd          " Show (partial) command in the last line of the screen.
set showmode         " Display current Modus ( --INSERT --, --REPLACE--, ... )
set report=0         " Show _always_ hints about new/changed/deleted Lines
set ruler            " Show the line and column number of the cursor position
set laststatus=2     " Show _always_ the statusline
"set statusline=[%n]%r%m%-25.25(%y[%{&ff}][%{&fenc}]%)%-40.40(%F%)%<%=[%03.3c,%04.4l]\ (%3P)
set statusline=[%n]%m[%03.3c,%04.4l]%r%-25.25(%y[%{&ff}][%{&fenc}]%)%-40.40(%F%)%<%=(%3P)
set cmdheight=1      " Number of screen lines to use for the command-line.
set helpheight=0     " Minimal initial height of the help window
set scrolloff=2      " Keep (at least) 2 screen lines above/below the cursor
set display=lastline " Display much as possible of the last line
"set linespace=2     " Number of pixel lines to use between characters
set cursorline       " Highlight the screen line of the cursor
set shortmess=a      " a=filmnrwx
set shm+=I           " Start without the intro message
set shm+=s           " Suppress 'search hit BOTTOM, continuing at TOP' message
set shm+=tT          " Truncate long filenames/messages
set shm+=oO          " Overwrite some status messages
"set shm+=A           " get rid off the „ATTENTION“ message when a swap file is found

set warn             " Warning when a shell cmd is used while the buffer has been changed.

set nolist           " Show special chars defined by 'listchars'
                     " Notice the the toggle (function) keys in the
                     " mapping section below.
set listchars=tab:×·
set lcs+=trail:←
set lcs+=eol:$
set lcs+=extends:»
set lcs+=precedes:«
set lcs+=nbsp:¬

set nowrap           " wrap lines longer than windowwidth
set linebreak
set breakat=\ \	!;:,.?
set showbreak=\:\:\ »\ 
set sidescroll=1     " min. number of columns to scroll horizontally.
set sidescrolloff=2  " min. number of columns to keep to the left/right of the cursor

set wrapmargin=0     " Chars from the right window border where wrapping starts

set noerrorbells     " Shut up!
set novisualbell     " Don't flicker!
set t_vb=            " Holy ..., be quite!

" = :: = Window Settings ================================== {{{1 = :: =

set splitbelow
set splitright

" = :: = Completion Settings ============================== {{{1 = :: =

set wildmenu
set wildmode=full
set wildignore+=*.ps
set wig+=*.dvi
set wig+=*.toc
set wig+=*.swp
set wig+=*~

set suffixes+=.pdf
set su+=.aux

" = :: = Tabstop Settings ================================= {{{1 = :: =

set tabstop=4        " ???
set shiftwidth=4     " ???
set expandtab
set shiftround       " ???

"set smartindent
"set softtabstop=4

" = :: = Motion Settings ================================== {{{1 = :: =

set whichwrap=<,>,~,[,]
set backspace=eol,start,indent
set esckeys           " Use cursor keys in Insert Mode
set virtualedit=block " only in Visual Block Mode
set nostartofline     " keep the cursor in the same column

" = :: = Mouse Settings =================================== {{{1 = :: =

set mouse=a
nmap <MiddleMouse> <Nop>
set selectmode=mouse

" = :: = Folding Settings ================================= {{{1 = :: =

set foldmethod=marker
set foldenable

" = :: = Search Settings ================================== {{{1 = :: =

set magic
set wrapscan
set ignorecase
set smartcase
set nohlsearch
set incsearch

" = :: = Printer Settings ================================= {{{1 = :: =

set printheader=%<%F%h%m%=Page\ %N
set printfont=terminus:h11
set printoptions=paper:A4
set popt+=syntax:n
set popt+=jobsplit:y
set popt+=number:y
set popt+=header:2
set popt+=wrap:y
set popt+=duplex:off
set popt+=collate:y

" = :: = Syntax Highlighting ============================== {{{1 = :: =

syntax on

colorscheme darkburn

" = :: = Format Settings ================================== {{{1 = :: =

set noautoindent      " ??? (complex)
set nosmartindent     " ??? (complex)
set nocindent         " ??? (complex)
set nocopyindent      " ??? (complex)

" set formatoptions=tcq " vim standard
" set fo+=r             " insert comment leader after hitting enter
" set fo+=n             " recognize numbered lists
" set fo+=1             " don't break a line after a one-letter word

" set formatoptions=tcq " vim standard
set fo-=t               " Don't auto-wrap text using textwidth

"set formatlistpat=^\s*\d\+[\]:.)}\t ]\s*  " vim standard

set nojoinspaces      " don't insert spaces after '.,?!' with <J>

set switchbuf=usetab,newtab

" = :: = Miscellaneous settings =========================== {{{1 = :: =

set hidden
set ttyfast
set nolazyredraw
set modeline
set modelines=3
set notitle

" = :: = Mappings ========================================= {{{1 = :: =

" - :: - Comments in VISUAL MODE -------------------------- {{{2 - :: -
" Im Visual Mode mehrere Zeilen markieren, dann das gewünschte
" Kommentarzeichen dücken.
" :let @/=""  löscht den letzten Suchbegriff, also den Zeilenanfang
" ansonsten ist bei :set hlsearch in der ganzen Datei der Zeilenan-
" fang hervorgehoben!

vmap # :s/^/# <CR>:let @/=""<CR>
vmap " :s/^/" /<CR>:let @/=""<CR>
vmap % :s/^/% /<CR>:let @/=""<CR>
vmap / :s/^/\/\/ /<CR>:let @/=""<CR>
vmap ; :s/^/; /<CR>:let @/=""<CR>
vmap ! :s/^/! /<CR>:let @/=""<CR>
" und hier löscht man die Kommentarzeichen wieder
vmap - :s/^[#"%\/;!]*<SPACE>//<CR>:let @/=""<CR>

" - :: - Function Keys ------------------------------------ {{{2 - :: -

nmap <F1> :help <C-R>=expand("<cword>")<CR><CR>

map <F2> <ESC>:setlocal hlsearch! <bar> set hlsearch?<CR>
imap <F2> <C-O>:setlocal hlsearch!<CR>

map <F3> <ESC>:setlocal wrap! <bar> set wrap?<CR>
imap <F3> <C-O>:setlocal wrap!<CR>

map <F4> <ESC>:setlocal list! <bar> set list?<CR>
imap <F4> <C-O>:setlocal list!<CR>

map <F5> <ESC>:setlocal number! <bar> set number?<CR>
imap <F5> <C-O>:setlocal number!<CR>

map <F6> <ESC>:setlocal foldenable! <bar> set foldenable?<CR>
imap <F6> <C-O>:setlocal foldenable!<CR>

map <F7> <ESC>:setlocal cursorline! <bar> set cursorline?<CR>

map <F8> <ESC>:call ToggleColorColumne()<CR>

map <F9> <ESC>:call ToggleSpellLang()<CR>
imap <F9> <C-O>:call ToggleSpellLang()<CR>


set pastetoggle=<F12>



" - :: - Misc Mappings ------------------------------------ {{{2 - :: -

map S O#<ESC>a<SPACE>=<SPACE>::<SPACE><ESC>60a=<ESC><CR><ESC>0k9lR

nmap + <C-W>+
nmap - <C-W>-
nmap <S-LEFT> 10<C-W><
nmap <S-RIGHT> 10<C-W>>

nmap <LEADER>e :Texplore<CR>
nmap <LEADER>E :Sexplore<CR>
nmap <LEADER>tn :tabnew<SPACE>
nmap <LEADER>tc :tabclose<CR>

nmap :W :w
nmap :Q :q

nmap <LEADER>HI :so $VIMRUNTIME/syntax/hitest.vim
nmap <LEADER>sv :so ~/.vimrc<CR>

map <LEADER>tm <esc>:r!date +\%R<CR>
map <LEADER>dt <esc>:r!date +'\%A, \%d.\%B \%Y  \%k:\%M'<CR>

nmap <LEADER>s <esc>:%s/ *$//g<CR>
nmap <LEADER>S <esc>:%s/	*$//g<CR>

nmap <LEADER>m <PLUG>MiniBufExplorer
nmap <LEADER>c <PLUG>CMiniBufExplorer

nnoremap j gj
nnoremap k gk
nnoremap Q gq

" = :: = Abbreviations ==================================== {{{1 = :: =

ca hitest so $VIMRUNTIME/syntax/hitest.vim

iab hrul = :: =========================================================== :: =
iab teh the

iab -today- <esc>:r!date \+'\%c'<CR>kJA<esc>

" = :: = Autocommands ===================================== {{{1 = :: =

augroup zsh
	autocmd!
	autocmd BufNewFile,BufRead ~/zsh/*.zsh setlocal ft=zsh
augroup END

augroup note
	autocmd!
	autocmd BufNewFile,BufRead /tmp/sartoo-1000/notes/* setlocal tw=72 fo+=t
augroup END

augroup html
	autocmd!
"	autocmd BufNewFile,BufRead *.html setlocal wrap linebreak matchpairs+=<:>
    autocmd FileType html,xhtml setlocal fo-=t fo-=c
	autocmd FileType html,php,css source ~/.vim/html.vim
augroup END

augroup mutt
	autocmd!
	autocmd BufNewFile,BufRead ~/.mutt/*.muttrc setlocal ft=muttrc
augroup END

augroup mail
	autocmd!
"	autocmd FileType mail setlocal spell spelllang=de_de
"	Das meiste erledigt `ftplugin/mail.vim´
	autocmd BufNewFile,BufRead /tmp/*/mutt-* setlocal comments=n:>,fb:- tw=72 ts=8 sw=8 sts=0 et
"   Entferne leere Kommentarzeilen aus den Mails, also sowas mag ich
"   nicht in meinen Mails:
"   > blabla
"   >
"   >> weiteres blablb
	autocmd BufRead /tmp/*/mutt-* normal :g/^> -- $/,/^$/-1d<CR><C-L>gg
"   in der muttrc wird vim so aufgerufen: set editor="/usr/bin/vim -c '+/^Subject:'
augroup END

augroup tex
	autocmd!
	autocmd BufNewFile *.tex 0r ~/documents/templates/skel.tex
	autocmd BufNewFile,BufRead ~/*.tex setlocal tw=80
augroup END

	autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
	autocmd BufNewFile ~/*.bwb setlocal ft=txt wrap linebreak expandtab list cursorline
	autocmd BufNewFile ~/*.bwb 0r ~/.vim/templates/bwb.tmp
	autocmd BufNewFile ~/*.bwb retab

"	autocmd! FileType vo_base colorscheme 256-sartoo

" = :: = Functions ======================================== {{{1 = :: =

func! ToggleSpellLang()
	if !exists("b:SpellLang")
		let b:SpellLang = 0
	endif

	let b:SpellLang = b:SpellLang + 1

	if b:SpellLang >= len(g:SpellLangList)
		let b:SpellLang = 0
		setlocal nospell
	endif

	if b:SpellLang > 0
		setlocal spell
		setlocal nohls
		let &spelllang=g:SpellLangList[b:SpellLang]
	endif

	echo "language:" g:SpellLangList[b:SpellLang]
endfunc

func! ToggleColorColumne()
    if !exists("b:ColCol")
        let b:ColCol = 0
    endif
    if b:ColCol == 0
        setlocal colorcolumn=+2
        let b:ColCol = 1
        echo "set Colorcolumn"
    else
        setlocal colorcolumn=
        let b:ColCol = 0
        echo "unset Colorcolumn"
    endif

endfunc

" :help :abbreviate-local 14k
func Eatchar(pat)
    let c = nr2char(getchar(0))
    return (c =~ a:pat) ? '' : c
endfunc


" = :: = Plugins ========================================== {{{1 = :: =

runtime! ftplugin/man.vim

filetype plugin indent on
set grepprg=grep\ -nH\ $*
let g:tex_flavor = "latex"

CLICK TO VIEW

x