-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
1697 lines (1665 loc) · 59.6 KB
/
vimrc
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
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
version 5.3
" ==================================================================
" File: $HOME/.vimrc
" Availability: This file is available as
" ~20K <URL:http://www.math.fu-berlin.de/~guckes/setup/vimrc.gz>
" ~56K <URL:http://www.math.fu-berlin.de/~guckes/setup/vimrc>
" <URL:http://www.vim.org/rc> (mirror)
" Size: This file is about 57K in size and has 1,500+ lines.
" Purpose: Setup file for the editor Vim (Vi IMproved)
" Author: Sven Guckes guckes@vim.org (guckes@math.fu-berlin.de)
" <URL:http://www.math.fu-berlin.de/~guckes/sven/>
" Related files:
" 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: Please send comments to me - email preferred! :-)
" Last update: Thu Dec 10 02:02:02 CET 1998
" ===================================================================
" The latest versions of Vim are usually in my signature file:
" http://www.math.fu-berlin.de/~guckes/sig/SIGS Have a look!
" ===================================================================
" Note to Windows users: Get these files from any Vim mirror:
" vim52rt.zip (840K) vim runtime files (docs + syntax files)
" gvimw32.zip (440K) gvim - precompiled binary for Windows 32bit
" These should fit onto one floppy. Just a recommendation.
" ===================================================================
" Installation of this setup file:
"
" To use this setup file, copy it to
" this filename on these systems:
" ~/.vimrc Unix and OS/2
" s:.vimrc Amiga
" $VIM\_vimrc MS-DOS and Win32
"
" NOTE: This setup file uses a lot of features of Vim-5.
" If you are still using Vim-4 (or an even older version)
" then you should upgrade - it is really worth the effort!
" To find out why get Vim-5 and read ":help version5".
"
" 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.
" ===================================================================
" Whitespace meta sequence:
" vim-5.0s introduced the meta sequence "\s" which stands for "whitespace"
" ie either a space or a tab. This makes mappings a lot easier.
" I have therefore updated my mappings to use this sequence.
" But this is incompatible with previous versions and, of course, Vi.
" ===================================================================
" Info on the latest versions is on the Vim HomePage:
" http://www.vim.org/ - which is a daily mirror of the pages at
" http://www.math.fu-berlin.de/~guckes/vim/
" and in Sven's signature file:
" http://www.math.fu-berlin.de/~guckes/sig/SIGS
" ===================================================================
" ===================================================================
" 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:
" <C-M> for control-m
" <C-V> for control-v which quotes the following character
" <ESC> 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 on every UNIX system:
" awk, egrep, grep, ispell, perl, sed.
" If you are using DOS then you should get these for you system!!
" Programs that are supplied with the mailer ELM: elmalias, readmsg.
" To get these look at page
" http://www.math.fu-berlin.de/~guckes/elm/dist.html
" One major advantage of vim-5 (actually, 5.0g) is that there is now
" the internal function "strftime". This allows to insert the current
" date and time in various format. Example: mapping ",L" (see below)
" ===================================================================
" SETtings
" ===================================================================
"
" autoindent: "off" as I usually do not write code.
set autoindent
"
" autowrite: "on" saves a lot of trouble
set autowrite
"
" backup: backups are for wimps ;-)
set nobackup
"
" backspace: '2' is much smarter.
set backspace=2
"
" background: Are we using a "light" or "dark" background?
set background=dark
"
" compatible ....
set nocompatible
"
" comments default: sr:/*,mb:*,el:*/,://,b:#,:%,:XCOMM,n:>,fb:-
set comments=b:#,:%,fb:-,n:>,n:),sr:/*,mb:*,el:*/,://,b:#,:%,:XCOMM,n:>,fb:-
"
" 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/dict/words,/local/lib/german.words
"
" digraph: required for those umlauts
" set digraph
"
" errorbells: damn this beep! ;-)
set noerrorbells
" esckeys: allow usage of cursor keys within insert mode
set esckeys
"
" 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: filename of the helpfile
" set helpfile=c:\\vim-4.6\\docs\\help.txt
" this is where I usually put it on DOS; sometimes is required
" to set as the default installation does not find it :-(
"
" hidden:
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 (Sven doesn't use an icon)
" set iconstring
"
" ignorecase: ignore the case in search patterns? NO!
set ignorecase
"
" insertmode: start in insert mode? Naah.
set noinsertmode
"
"
" iskeyword: Add the dash ('-'), the dot ('.'), and the '@'
" as "letters" to "words".
" iskeyword=@,48-57,_,192-255 (default)
set iskeyword=@,48-57,_,192-255,-,.,@-@
set history=1000
"
" joinspaces: insert two spaces after a period with every
" joining of lines. This is very nice!
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
"
" magic: use some magic in search patterns? Certainly!
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: "~/.P" is a symlink to my dir with www pages
" "$VIM/syntax" is where the syntax files are.
" set path=.,,~/.P/vim,~/.P/vim/syntax,~/.P/vim/source,$VIM/syntax/
" set path=.,,~/.P/vim,~/.P/mutt/,~/.P/elm,~/.P/slrn/,~/.P/nn
"
" 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
"
" 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
" zsh now available at zedat! :-)
" set shell=zsh
" Now that vim-5 has ":if" I am trying to automate the setting:
"
if has("dos16") || has("dos32")
let shell='command.com'
endif
if has("unix")
let shell='zsh'
endif
"
" shiftwidth: Number of spaces to use for each
" insertion of (auto)indent.
set shiftwidth=4
"
" 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
"
" tabstop
set tabstop=4
"
"
" Set the colors for vim on "xterm"
" if &term=="xterm"
" set t_Co=8 " "terminal has eight colors"
" set t_Sb=[4%p1%dm " escape sequence for background
" set t_Sf=[3%p1%dm " escape sequence for foreground
" source ~/.P/vim/syntax/colors.vim
" http://www.math.fu-berlin.de/~guckes/vim/syntax/colors.vim
" [todo] Add this to the Vim FAQ
" endif
set t_Co=256 "set terminal colors to 256 - urxvt"
"
" textmode: no - I am using Vim on UNIX!
set notextmode
"
" textwidth
set textwidth=500
"
" title:
set notitle
"
" ttyfast: are we using a fast terminal?
" seting depends on where I use Vim...
set nottyfast
"
" ttybuiltin:
set nottybuiltin
"
" ttyscroll: turn off scrolling -> faster!
set ttyscroll=0
"
" ttytype:
" 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:
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:
set whichwrap=<,>
"
" wildchar the char used for "expansion" on the command line
" default value is "<C-E>" but I prefer the tab key:
set wildchar=<TAB>
"
" wrapmargin:
set wrapmargin=1
"
" writebackup:
set nowritebackup
"
" git:
set laststatus=2
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%04.8b]\ [HEX=\%04.4B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
" ===================================================================
" ABbreviations
" ===================================================================
" 980701: Moved the abbreviations *before* the mappings as
" some of the abbreviations get used with some mappings.
"
" 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 Donaudampfschiffahrtgesellschaftskapitaenwitwenrentengesetzzusatzparagraph
"
" YLL : The name of a town in Wales. I am not making this up!
iab YLL LLanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch
" http://www.llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch.co.uk
" http://194.159.85.168/ - I am not making this up! :-)
"
" YTauma: The name of a hill in New Zealand.
iab YTauma Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwenuakitanatahu
"
" 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.
iab Yruler 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
"
" Yupsidedown : This describes people from "down under"
" (Hi, Dean!).
iab Yupsidedown umop-ap!sdn
"
" Ysuper: A nice long word from the musical "Mary Poppins".
iab Ysuper supercalifragilisticexpialidocious
" Yanti: The longest proper word in the English language?!
iab Yanti antidisestablishmentarianism
"
" Ypass : Standard answer to Usenet posts
" with the "Subject: HELP" (hehe)
iab Ypass "You are in a maze of twisty little passages, all alike."
"
" Ysesqui : "Sesquipedalophobia" means "fear of big words." ;-)
iab Ysesqui sesquipedalophobia
"
" classic pangrams (which include every letter of the alphabet):
" German:
" sylvia wagt quick den jux bei pforzheim
" bayerische jagdwitze von maxl querkopf
" zwei boxkaempfer jagen eva quer durch sylt
" kaufen sie jede woche vier gute bequeme pelze
" 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
" French:
" voyez le brick geant que j'examine pres du wharf.
"
" 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 [...]
vmap ,ell c[...]<ESC>
"
" 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 charcter character
iab charcters characters
iab exmaple example
iab shoudl should
iab seperate separate
iab teh the
" Some frequent typos in German:
iab nciht nicht
iab doer oder
iab Dreckfuhler Druckfehler
" 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 YRA Rechnerarchitektur
iab YPM Pattern Matching
" see http://elib.zib.de/ICM98 :
iab YICM International Congress of Mathematicians
"
" Some sentences that I really use often in emails about Vim:
iab YAW You are welcome! :-)
iab YEV Enjoy Vim!
"
" 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 Zrc ~/.zsh/.zshrc
cab SIGs ~/.P/sig/SIGS
"
" A list of filenames that are needed to shorten some autocommands:
" cab MAILNEWSFILES .article,.followup,.letter,mutt*[0-9],/postpone/*
" cab MAILNEWSFILES *.article,*.followup,*.letter,*mutt*
let MAILNEWSFILES = "*.article,*.followup,*.letter,mutt*"
"
" see also: http://www.math.fu-berlin.de/~guckes/sig/SIGS
"
" Email Adresses:
" I usually use these when adding addresses to the header
" of emails (mutt) and posts (slrn).
"
" Author of the Good NetKeeping Seal of Approval:
ab Agnksa js@xs4all.nl (Jeroen Scheerder)
"
" Author of Mutt:
ab Amutt me@cs.hmc.edu (Michael Elkins)
"
" Author of Slrn:
ab Aslrn davis@space.mit.edu (John E. Davis)
"
" Author of Vim:
" ab Avim mool@oce.nl (Bram Moolenaar)
ab Avim bram@vim.org (Bram Moolenaar)
"
" Former Maintainer of the Vim FAQ:
ab Avimfaq laurent@Grafnetix.COM (Laurent Duperval)
"
" Mailing Lists (MLs)
"
" The Vim mailing lists: See http://www.vim.org/mail.html for more info!
ab MLvim vim@vim.org (VIM Help List)
ab MLvimdev vim-dev@vim.org (VIM Development List)
ab MLvimmac guckes-vimmac@math.fu-berlin.de (VIM on MacOS Development List)
"
" More mailing lists:
ab MLgnksa gnksa-workers@babayaga.math.fu-berlin.de (GNKSA Workers List)
ab MLmuttdev mutt-dev@mutt.org (Mutt Developer List)
ab MLmuttuser mutt-users@mutt.org (Mutt Users List)
ab MLzsh zsh-users@math.gatech.edu (ZShell Users List)
"
"
" News: newsgroup names
"
" Newsgroup about "warloding" of signatures - see
" also http://www.math.fu-berlin.de/~guckes/afw/
iab Nafw alt.fan.warlord
iab Nahbou alt.humor.best-of-usenet
iab Nzedat bln.announce.fub.zedat.d
iab Ncsd bln.announce.fub.cs.d
iab Nce comp.editors
" Newsgroup about "lynx":
iab Nhtml comp.infosystems.www.authoring.html
" Newsgroup about "elm": Elm is dead - long live Mutt!
iab Nelm comp.mail.elm
" Newsgroup about "pine": When will they release pine-4?
" iab Ncmp comp.mail.pine
iab Npine comp.mail.pine
" iab Ncsmd comp.sys.mac.digest
" Newsgroup about "mobil phone systems":
iab Ndcm de.comm.mobil
iab Nmobil de.comm.mobil
" Newsgroup about "web browsers":
iab Nlynx comp.infosystems.www.browsers.misc
iab Nnetscape comp.infosystems.www.browsers.misc
" Newsgroup about "mutt" [since 980401]: The coolest mail user agent
iab Nmutt comp.mail.mutt
" Newsgroup about "nn": Once was the best newsreader. Still good.
iab Nnn news.software.nn
" Newsgroup for "newbies".
" All you ever wanted to know - but were afraid to ask. ;-)
iab Newbie news.newusers.questions
" Newsgroup about "newsreader *agents*" (netscape and slrn):
iab Nnsr news.software.readers
"
" Usenet header lines (used when composing a post):
"
iab UFT Followup-To:
iab UMCT Mail-Copies-To: MYADDR
iab UNG Newsgroups:
iab URT Reply-To: MYADDR
iab UFUB Organization: Freie Universitaet Berlin
"
" Current version numbers of my favourite programs:
" http://www.math.fu-berlin.de/~guckes/sig/SIGS
" And some abbreviations to type them in mail&news:
"
iab Velm ELM2.4PL25 [951204]
iab VElm ELM2.5b2 [980213]
iab Vlynx lynx-2.8.0 [980310
iab Vmutt mutt-0.92.8 [980514]
iab Vslrn slrn-0.9.5.2 [980503]
iab Vvim vim-5.1 [980407]
iab Vvimdev vim-5.2c [980518]
"
" For current version numbers take a look at my signature file:
" http://www.math.fu-berlin.de/~guckes/sig/SIGS
"
" My snail mail address, phone numbers, and email->pager gateway:
" Postcards and FAXes are welcome (especially with cartoons :-).
" If you want, you can send a message to my pager by email, too.
iab Ypager To: ums@teco.edu<C-M>Subject: PAGE:01777777796
iab Yphone TEL/FAX (+49 30) 8838884<C-M>Cellphone (+49 177) 7777796
iab Ysnail Sven Guckes<C-M>Pariser Str. 52<C-M>D-10719 Berlin
"
" My addresses (Email and WWW)
" makes it easy to type them without typos ;-)
ab Amaili guckes@inf.fu-berlin.de
ab Amailm guckes@math.fu-berlin.de
ab Amailv guckes@vim.org
ab Amailz guckes@zedat.fu-berlin.de
ab MYADDR guckes@math.fu-berlin.de
ab MYNAME Sven Guckes
"
" Setting the reply address when replying as the guy from SKB:
ab ASKB Sprachboerse <sprachboerse@tu-berlin.de>
" See also: http://www.math.fu-berlin.de/~guckes/skb/
"
" My Home Pages at the departments at the FUB
"
ab WWWm http://www.math.fu-berlin.de/~guckes/
ab WWWi http://www.inf.fu-berlin.de/~guckes/
ab WWWz http://userpage.zedat.fu-berlin.de/~guckes/
"
" WWW Pages base URLs
"
ab HPA http://www.math.fu-berlin.de/~guckes/afw/
ab HPa http://www.math.fu-berlin.de/~guckes/ascii/
ab HPc http://www.math.fu-berlin.de/~guckes/calvin/
ab HPD http://www.math.fu-berlin.de/~guckes/dos/
ab HPe http://www.math.fu-berlin.de/~guckes/eplus/ab.faq.html
ab HPE http://www.math.fu-berlin.de/~guckes/elm/
ab HPI http://www.math.fu-berlin.de/~guckes/irc/
ab HPi http://www.math.fu-berlin.de/~guckes/ispell/
ab HPL http://www.math.fu-berlin.de/~guckes/lynx/
ab HPl http://www.math.fu-berlin.de/~guckes/less/
ab HPm http://www.math.fu-berlin.de/~guckes/mail/
ab HPM http://www.math.fu-berlin.de/~guckes/mutt/
ab HPN http://www.math.fu-berlin.de/~guckes/nn/
ab HPP http://www.math.fu-berlin.de/~guckes/pine/
ab HPp http://www.math.fu-berlin.de/~guckes/procmail/
ab HPr http://babayaga.math.fu-berlin.de/~rxvt/
ab HPR http://www.math.fu-berlin.de/~guckes/rfc/
ab HPs http://www.math.fu-berlin.de/~guckes/screen/
ab HPS http://www.math.fu-berlin.de/~guckes/slrn/
ab HPv http://www.math.fu-berlin.de/~guckes/vi/
" HPOV - the "original" URL of the Vim Home Page!
ab HPOV http://www.math.fu-berlin.de/~guckes/vim/
ab HPV http://www.vim.org/
ab HPX http://www.math.fu-berlin.de/~guckes/xmas/
ab HPZ http://www.math.fu-berlin.de/~guckes/zsh/
"
" Other important WWW addresses
"
ab URLutefuchs http://www.math.fu-berlin.de/~utefuchs/
ab URLaltavista http://altavista.digital.com/
ab URLftpsearch http://ftpsearch.ntnu.no/ftpsearch/
ab URLvimfaq http://www.grafnetix.com/~laurent/vim/faq.html
ab URLbambi http://www.math.fu-berlin.de/~leitner/CnH/bambi.html
ab URLsecret http://www.math.fu-berlin.de/~leitner/CnH/secret.html
ab URLwhome http://www.math.fu-berlin.de/~leitner/CnH/who.me.html
ab URLstopspam http://www.math.fu-berlin.de/~guckes/pics/stop.this.spam.jpg
ab FTPFUB ftp://ftp.fu-berlin.de/
ab FTPVIM ftp://ftp.fu-berlin.de/pub/misc/editors/vim/
"
" ===================================================================
" 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 <C-R>=strftime("%y%m%d")<CR>
" Example: 971027
"
iab Ytime <C-R>=strftime("%H:%M")<CR>
" Example: 14:28
"
iab YDT <C-R>=strftime("%y%m%d %T")<CR>
" Example: 971027 12:00:00
"
iab YDATE <C-R>=strftime("%a %b %d %T %Z %Y")<CR>
" Example: Tue Dec 16 12:07:00 CET 1997
"
" On Windows the functions "strftime" seems to have a different
" format. Therefore the following may be necessary: [980730]
" if !has("unix")
" iab YDATE <C-R>=strftime("%c %a")<CR>
" else
" iab YDATE <C-R>=strftime("%D %T %a")<CR>
" endif
"
" ===================================================================
" 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:
"
" 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=<C-R>=col(".")<C-M>
"
" 981210 Whenever I paste some text into VIM I have to
" toggle from "nopaste" to "paste" and back again:
" map <f4> :set paste!<c-m>:set paste?<c-m>
map <esc>[14~ :set paste!<c-m>:set paste?<c-m>
"
" "tal" is the "trailer alignment" filter program
" Hopefully it will ship with Vim one day.
" vmap #t !tal<CR>
" vmap #t !tal -p 0<CR>
"
" Disable the command 'K' (keyword lookup) by mapping it
" to an "empty command". (thanks, Lawrence! :-):
" map K :<CR>
map K :<BS>
"
" 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 <C-Z> :shell
"
" Make CTRL-^ rebound to the *column* in the previous file
noremap <C-^> <C-^>`"
"
" 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
nmap :Q :q
" use <F6> to toggle line numbers
" nmap <silent> <F6> :set number!<CR>
" page down with <Space>
nmap <Space> <PageDown>
"
" 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 <C-G> 2<C-G>
"
" 980311 Sourcing syntax files
" My personal syntax files are in ~/.P/vim/syntax/
" and I need a quick way to edit and source them.
" map ,SO :so ~/.P/vim/syntax/
"
"
" 980706 Sourcing syntax files from the distribution
" A nice and fast way to both source syntax files
" and to take a look at "what's there":
map ,V :so $VIM/syntax/
"
map <F11> :sp tags<CR>:%s/^\([^ :]*:\)\=\([^ ]*\).*/syntax keyword Tag \2/<CR>:wq! tags.vim<CR>/^<CR><F12>
map <F12> :so tags.vim<CR>
" ===================================================================
" Customizing the command line
" ===================================================================
" Valid names for keys are: <Up> <Down> <Left> <Right> <Home> <End>
" <S-Left> <S-Right> <S-Up> <PageUp> <S-Down> <PageDown> <LeftMouse>
"
" 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 <C-A> <Home>
cnoremap <C-F> <Right>
cnoremap <C-B> <Left>
" cnoremap <C-E> <End>
cnoremap <ESC>b <S-Left>
cnoremap <ESC>f <S-Right>
cnoremap <ESC><C-H> <C-W>
"
" Additional codes for that "English" keyboard at the Xterminal
cnoremap <ESC>[D <S-Left>
cnoremap <ESC>[C <S-Right>
"
" Some editing is helpful in insert mode, too:
inoremap <C-F> <Right>
inoremap <C-B> <Left>
"
" Make the up and down movements move by "display/screen lines":
" map j gj
" map <Down> gj
" map k gk
" map <Up> gk
"
" ===================================================================
" VIM - Editing and updating the vimrc:
" As I often make changes to this file I use these commands
" to start editing it and also update it:
if has("unix")
let vimrc='~/.vimrc'
else
" ie: if has("dos16") || has("dos32") || has("win32")
let vimrc='$VIM\_vimrc'
endif
nn ,u :source <C-R>=vimrc<CR><CR>
nn ,v :edit <C-R>=vimrc<CR><CR>
" ,v = vimrc editing (edit this file)
" map ,v :e ~/.vimrc<CR>
" ,u = "update" by reading this file
" map ,u :source ~/.vimrc<CR>
" ===============================================================
"
" General Editing
"
" Define "del" char to be the same backspace (saves a LOT of trouble!)
" As the angle notation cannot be use with the LeftHandSide
" with mappings you must type this in *literally*!
" map <C-V>127 <C-H>
" cmap <C-V>127 <C-H>
" the same for Linux Debian which uses
" imap <Esc>[3~ <C-H>
" imap <C-H>
set t_kb=
set t_kD=[3~
"
" ;rcm = remove "control-m"s - for those mails sent from DOS:
cmap ;rcm %s/<C-M>//g
"
" Make whitespace visible:
" Sws = show whitespace
nmap ,Sws :%s/ /_/g<C-M>
vmap ,Sws :%s/ /_/g<C-M>
"
" Sometimes you just want to *see* that trailing whitespace:
" Stws = show trailing whitespace
nmap ,Stws :%s/ *$/_/g<C-M>
vmap ,Stws :%s/ *$/_/g<C-M>
"
" General Editing - Turning umlauts into ascii (for German keyboards)
"
" imap ä ae
" imap ö oe
" imap ü ue
" imap ß ss
"
" Ä -> Ä :%s/\Ä/Ä/gc -> D
" Ö -> Ö :%s/\Ö/Ö/gc -> V
" Ü -> Ü :%s/\Ü/Ü/gc -> \
" ä -> ä :%s/\ä/ä/gc -> d
" ö -> ö :%s/\ö/ö/gc -> v
" ü -> ü :%s/\ü/ü/gc -> |
"
" ===================================================================
" Inserting Dates and Times / Updating Date+Time Stamps
" ===================================================================
" ,L = "Last updated" - replace old time stamp with a new one
" preserving whitespace and using internal "strftime" command:
" requires the abbreviation "YDATE"
map ,L 1G/Last update:\s*/e+1<CR>CYDATE<ESC>
map ,,L 1G/Last change:\s*/e+1<CR>CYDATE<ESC>
" Example:
" before: "Last update: Thu Apr 6 12:07:00 CET 1967"
" after: "Last update: Tue Dec 16 12:07:00 CET 1997"
"
" ,L = "Last updated" - replace old time stamp with a new one
" using external "date" command (not good for all systems):
" map ,L 1G/Last update: */e+1<CR>D:r!date<CR>kJ
"
" ===================================================================
" General Editing - link to program "screen"
" ===================================================================
"
" ,Et = edit temporary file of "screen" program
map ,Et :e /tmp/screen-exchange
" as a user of Unix systems you *must* have this program!
" see also: http://www.math.fu-berlin.de/~guckes/screen/
"
" Email/News - Editing replies/followups
"
" Part 1 - prepare for editing
"
" Part 2 - getting rid of empty (quoted) lines and space runs.
"
" ,cel = "clear empty lines"
" - delete the *contents* of all lines which contain only whitespace.
" note: this does not delete lines!
" map ,cel :g/^[<C-I> ]*$/d
map ,cel :%s/^\s\+$//
" ,del = "delete 'empty' lines"
" - delete all lines which contain only whitespace
" note: this does *not* delete empty lines!
map ,del :g/^\s\+$/d
"
" ,cqel = "clear quoted empty lines"
" Clears (makes empty) all lines which start with '>'
" and any amount of following spaces.
" nmap ,cqel :%s/^[> ]*$//
" vmap ,cqel :s/^[> ]*$//
" nmap ,cqel :%s/^[><C-I> ]\+$//
" vmap ,cqel :s/^[><C-I> ]\+$//
nmap ,cqel :%s/^[>]\+$//
vmap ,cqel :s/^[><C-I> ]\+$//
" NOTE: If the meta sequence "\s"
" The following do not work as "\s" is not a character
" and thus cannot be part of a "character set".
" map ,cqel :g/^[>\s]\+$/d
"
" Some people have strange habits within their writing.
" But if you cannot educate them - rewrite their text! ;-)
"
" Jason "triple-dots" King elephant@onaustralia.com.au
" does uses ".." or "..." rather than the usual punctuation
" (comma, semicolon, colon, full stop). So...
"
" Turning dot runs with following spaces into an end-of-sentence,
" ie dot-space-space:
vmap ,dot :s/\.\+ \+/. /g
"
" Gary Kline (kline@tera.tera.com) indents his
" own text in replies with TAB or spaces.
" Here's how to get rid of these indentation:
vmap ,gary :s/^>[ <C-I>]\+\([^>]\)/> \1/
"
" ,ksr = "kill space runs"
" substitutes runs of two or more space to a single space:
" nmap ,ksr :%s/ */ /g
" vmap ,ksr :s/ */ /g
nmap ,ksr :%s/ \+/ /g
vmap ,ksr :s/ \+/ /g
" Why can't the removal of space runs be
" an option of "text formatting"? *hrmpf*
"
" ,Sel = "squeeze empty lines"
" Convert blocks of empty lines (not even whitespace included)
" into *one* empty line (within current visual):
map ,Sel :g/^$/,/./-j
"
" ,Sbl = "squeeze blank lines"
" Convert all blocks of blank lines (containing whitespace only)
" into *one* empty line (within current visual):
" map ,Sbl :g/^\s*$/,/[^ <c-i>]/-j
" map ,Sbl :g/^\s*$/,/[^ \t]/-j
map ,Sbl :g/^\s*$/,/\S/-j
"
" ===================================================================
" Editing of email replies and Usenet followups - using autocommands
" ===================================================================
"
" Remove ALL auto-commands. This avoids having the
" autocommands twice when the vimrc file is sourced again.
autocmd!
"
" Let Vim identify itself when editing emails with Mutt:
au! BufNewFile mutt* let @"="X-Editor: Vim-".version." http://www.vim.org\n"|exe 'norm 1G}""P'
"
" set the textwidth to 70 characters for replies (email&usenet)
au BufNewFile,BufRead .letter,mutt*,nn.*,snd.* set tw=78
"
" Try to use the mapping ",D" when doing a followup.
" autocmd BufNewFile ~/.followup ,D|
"
" Part 3 - Change Quoting Level
"
" ,dp = de-quote current inner paragraph
" map ,dp {jma}kmb:'a,'bs/^> //<CR>
map ,dp vip:s/^> //<CR>
vmap ,dp :s/^> //<CR>
"
" ,qp = quote current paragraph
" jump to first inner line, mark with 'a';
" jump to last inner line, mark with 'b';
" then do the quoting as a substitution
" on the line range "'a,'b":
" map ,qp {jma}kmb:'a,'bs/^/> /<CR>
" vim-5 now has selection of "inner" and "all"
" of current text object - mapping commented!
"
" ,qp = quote current paragraph (old version)
" jump to first inner line, Visual,
" jump to last inner line,
" then do the quoting as a substitution:
" map ,qp {jV}k:s/^/> /<CR>
"
" ,qp = quote current inner paragraph (works since vim-5.0q)
" select inner paragraph
" then do the quoting as a substitution:
map ,qp vip:s/^/> /<CR>
"
" ,qp = quote current paragraph
" just do the quoting as a substitution:
vmap ,qp :s/^/> /<CR>
"
" Changing quote style to *the* true quote prefix string "> ":
"
" Fix Supercite aka PowerQuote (Hi, Andi! :-):
" before ,kpq: > Sven> text
" after ,kpq: > > text
" ,kpq kill power quote
vmap ,kpq :s/^> *[a-zA-Z]*>/> >/<C-M>
"
" Fix various other quote characters:
" ,fq "fix quoting"
vmap ,fq :s/^> \([-":}\|][ <C-I>]\)/> > /
"
" Part 4 - Weed Headers of quoted mail/post
"
" These mappings make use of the abbreviation that define a list of
" Email headers (HEMAIL) and News headers (HNEWS):
nmap ,we vip:v/HEMAIL/d
vmap ,we :v/HEMAIL/d
nmap ,wp vip:v/HNEWS/d
vmap ,wp :v/HNEWS/d
"
" Old versions for vim-4.6:
" ,we = "weed email header"
" nmap ,we !ipegrep "^(Date:\|From \|From:\|Subject:\|To:\|$)"
" vmap ,we !egrep "^(Date:\|From \|From:\|Subject:\|To:\|$)"
" ,wp = "weed post header"
" nmap ,wp !ipegrep "^(Date:\|From:\|Subject:\|Newsgroups:\|Followup-To:\|Keywords:\|References:\|Message-ID\|$)"