set gfn=-b&h-lucidatypewriter-medium-r-normal-*-*-120-*-*-m-*-iso8859-1 "set ts=2 "set sw=2 set go=agimrt set mouse=a set tags=./tags,./../tags,./../../tags,~/tags,~/dev/tags version 55.0 " set t_mr= set t_mr= set keywordprg=ispell set history=50 " keep 50 lines of command line history set ruler " show the cursor position all the time " Suffixes that get lower priority when doing tab completion for filenames. " These are files we are not likely to want to edit or read. set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc " We know xterm-debian is a color terminal if &term =~ "xterm-debian" || &term =~ "xterm-xfree86" set t_Co=16 set t_Sf=^[[3%dm set t_Sb=^[[4%dm endif " Set up the color extensions if version < 600 "source ~/.vim/colors/mycolors.vim else "colorscheme mycolors endif set helpfile=$VIMRUNTIME/doc/help.txt.gz if has("autocmd") " Set some sensible defaults for editing C-files augroup cprog " Remove all cprog autocommands au! " When starting to edit a file: " For *.c and *.h files set formatting of comments and set C-indenting on. " For other files switch it off. " Don't change the order, it's important that the line with * comes first. autocmd BufRead * set formatoptions=tcql nocindent comments& autocmd BufRead *.c,*.h set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,:// augroup END "augroup gzip "" Remove all gzip autocommands "au! " "" Enable editing of gzipped files "" read: set binary mode before reading the file "" uncompress text in buffer after reading "" write: compress file after writing "" append: uncompress file, append, compress file "autocmd BufReadPre,FileReadPre *.gz set bin "autocmd BufReadPre,FileReadPre *.gz let ch_save = &ch|set ch=2 "autocmd BufReadPost,FileReadPost *.gz '[,']!gunzip "autocmd BufReadPost,FileReadPost *.gz set nobin "autocmd BufReadPost,FileReadPost *.gz let &ch = ch_save|unlet ch_save "autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " . expand("%:r") " "autocmd BufWritePost,FileWritePost *.gz !mv :r "autocmd BufWritePost,FileWritePost *.gz !gzip :r " "autocmd FileAppendPre *.gz !gunzip "autocmd FileAppendPre *.gz !mv :r "autocmd FileAppendPost *.gz !mv :r "autocmd FileAppendPost *.gz !gzip :r "augroup END augroup bzip2 " Remove all bzip2 autocommands au! " Enable editing of bzipped files " read: set binary mode before reading the file " uncompress text in buffer after reading " write: compress file after writing " append: uncompress file, append, compress file autocmd BufReadPre,FileReadPre *.bz2 set bin autocmd BufReadPre,FileReadPre *.bz2 let ch_save = &ch|set ch=2 autocmd BufReadPost,FileReadPost *.bz2 |'[,']!bunzip2 autocmd BufReadPost,FileReadPost *.bz2 let &ch = ch_save|unlet ch_save autocmd BufReadPost,FileReadPost *.bz2 execute ":doautocmd BufReadPost " . expand("%:r") autocmd BufWritePost,FileWritePost *.bz2 !mv :r autocmd BufWritePost,FileWritePost *.bz2 !bzip2 :r autocmd FileAppendPre *.bz2 !bunzip2 autocmd FileAppendPre *.bz2 !mv :r autocmd FileAppendPost *.bz2 !mv :r autocmd FileAppendPost *.bz2 !bzip2 -9 --repetitive-best :r augroup END endif " has ("autocmd") " Some Debian-specific things augroup filetype au BufRead reportbug.* set ft=mail augroup END " The following are commented out as they cause vim to behave a lot " different from regular vi. They are highly recommended though. set showcmd " Show (partial) command in status line. set showmatch " Show matching brackets. set ignorecase " Do case insensitive matching set incsearch " Incremental search set autowrite " Automatically save before commands like :next and :make " ======================================================================== " SETtings " ======================================================================== " " autoindent: "on" as I usually write code. set autoindent " " autowrite: "on" saves a lot of trouble set noautowrite " " backup: backups are for wimps ;-) set nobackup " " backspace: '2' is much smarter. "set backspace=2 set backspace=2 " " compatible .... set nocompatible " " comments default: sr:/*,mb:*,el:*/,://,b:#,:%,:XCOMM,n:>,fb:- set comments=b:#,:%,fb:-,n:>,n:) " " dictionary: english words first set dictionary=/usr/dict/words,/local/lib/words " " digraph: required for those umlauts set nodigraph " " errorbells: damn this beep! ;-) set noerrorbells " " esckeys: I don't use no steekeen function keys! " set noesckeys " " formatoptions: tcq2 is all I need "set formatoptions=tcq2 " " helpheight: zero disables this. set helpheight=2 " " 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 " " icon: ... set icon " " set iconstring file of icon (not necessary as I don't use an icon) " set iconstring " " insertmode: start in insert mode? Naah. set noinsertmode " " joinspaces: insert two spaces after a period with a join command. Yes! set joinspaces " " laststatus: show status line? Yes, always! Even for only one buffer. set laststatus=2 " " [VIM5]lazyredraw: update screen while executing macros? Nope. " set nolazyredraw " " magic: use some magic in search patterns? Why, of course! set magic " " modeline: ... set modeline " " number: ... set nonumber " " path: list of directories to search for files with edit commands " Note: "~/.P" is a symlink to my dir with www pages set path=.,,~/inc,/~public_html,~/alpha,~/.P/vim,~/.P/mutt/,~/.P/elm,~/.P/slrn/,~/.P/nn,~/.P/persons/**,~/dev " " report: show report when N lines were changed. report all changes! set report=0 " " ruler: show cursor position? Yep! set ruler " " shell for DOS " set shell=command.com " shell for UNIX - math.fu-berlin.de BSD set shell=bash " 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 " " shiftwidth: Number of spaces to use for each step of (auto)indent. set shiftwidth=2 " " shortmess: Kind of messages to show. Abbreviate them all! set shortmess=at " " showcmd: Show current uncompleted command? Oh, yes, please! set showcmd " " showmatch: Show the matching bracket for the last ')'? Make my day! set showmatch " " showmode: Show the current mode? YEEEEEEEEESSSSSSSSSSS! set showmode " " suffixes set suffixes=.bak.swp " " tabstop set tabstop=2 " " term " set term=rxvt " " textwidth " set textwidth=79 " " title: set title " " ttyfast: set ttyfast " " ttybuiltin: set nottybuiltin " " visualbell: set visualbell " " t_vb: terminal's visual bell - turned off to make Vim quiet! " set t_vb= " " whichwrap: set whichwrap=<,> " " wildchar the character used for "expansion" on the command line " the default value is "" but I prefer the tab key: set wildchar= " " wrapmargin: set wrapmargin=1 " " writebackup: set nowritebackup " " ======================================================================== " 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". " " With Vim-4 the format command was just 'Q' and " I am too used to it. So I need this back! nmap Q gq vmap Q gq " " Disable the command 'K' (keyword lookup) by making it start visual mode. " Unfortunately there is no way to map something to nothing. :-( " map K " " 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 :shell " " Make CTRL-^ rebound to the *column* in the previous file noremap `" " " When I let Vim write the current buffer I freuently mistype the command ":w" " as ":W" - so this mapping will correct this typo right at the start: map :W :w map :Q :q " " 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 " " Command line (colon mode) mappings " valid names are: " " " 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 cnoremap cnoremap cnoremap b cnoremap f cnoremap " " ======================================================================== " 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: " ,v = vimrc editing (edit this file) map ,v :e ~/.vimrc " ,u = "update" by reading this file map ,u :source ~/.vimrc " CD = cd to www directories cmap CD cd ~/public_html/ " ======================================================================== " ABbreviations " ======================================================================== " " Abbreviation for some classic long words: " " 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 : Describing the folks from down under (Hi, Dean!). iab Yupsidedown umop-ap!sdn " " Ysuper : Supposedly the longest word in the English language (long ago): iab Ysuper supercalifragilisticexpialidocious " " Ypass : Standard answer to Usenet posts with "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 " " Inserting an ellipsis to indicate deleted text iab Yell [...] vmap ,ell c[...] " " Damn typos - I almost never get these right. :-( " iab charcter character iab charcters characters iab shoudl should iab teh the " " " ======================================================================== " HTML - HTML - HTML - HTML - HTML - HTML - HTML - HTML " ======================================================================== " " HTML - HyperText Markup Language - the language of the World Wide Web " " =========================================================================== " HTML - inserting text from standard text files " =========================================================================== " " Whenever I edit a web page I use ",e" to start the edit command. " Then I use ",rn" to read in the web page template. As simple as that. " " ,e = edit www file nmap ,e :e ~/public_html/ cmap ;e e ~/public_html/ " I use ",e" here before, but this was part of the default string " for "highlight", so while entering the default string the ",e" " it got expanded. Darn! " " ,rm = read mailto map ,rm :r ~/public_html/txt/mailto.html " ,rn = read new page form map ,rn :r ~/public_html/txt/New.page.form.html " ,rp = read prelude map ,rp :r ~/public_html/txt/prelude.html " " " =========================================================================== " HTML - reading in the current date " =========================================================================== " " ,X = add extra short date map ,X :r!date +\%y\%m\%dI
[A] " ,L = "Last updated" - insert time stamp and delete old time stamp map ,L mz1G/Last update: */e+1D:r!datekJ " ,dt = "date and time insert" map ,dt :r!date +\%y\%m\%d\%t\%T " ,cr = "created" - create the "Created" line in HTML files map ,cr OCreated: :r!datekJWWWdWi00:00:00 A
" ,da = date insert map ,da :r!date " " HTML - make current word an HTML environment map ,me yapa>Ea>Bi</>< " map! ,c =1Bb"aywi<=1Bea>=1Bbba " " HTML - Inserting "single" tags " iab Ybr
iab Yhr
iab Yp

" " HTML - Inserting Environments " " Insert environment iab Yb T>i vmap ,b "zdiz2F> " " Insert environment

iab Ybl
T>i " vmap ,bl "zdi
z
2F> " " Insert environment
iab Ycen
T>i vmap ,ce "zdi
z
T>i " " Insert environment iab Ycod T>i vmap ,cod "zdi<C-M><C-R>z<C-M>T>i " " Insert environment iab Yi T>i vmap ,i "zdizT> " " Insert environment

  iab  Ypre 
T>i
  vmap ,pre "zdi
z
T> " " Insert environment iab Ytt T>i vmap ,tt "zdizT>i " " Insert environment iab Yxmp T>i vmap ,xmp "zdi<C-M><C-R>z<C-M>T>i " " HTML - Insert Header Lines (h1 to h6) " iab Yh1

T>i vmap ,h1 "zdi

z

2F> iab Yh2

T>i vmap ,h2 "zdi

z

2F> iab Yh3

T>i vmap ,h3 "zdi

z

2F> iab Yh4

T>i vmap ,h4 "zdi

z

2F> iab Yh5
T>i vmap ,h5 "zdi
z
2F> iab Yh6
T>i vmap ,h6 "zdi
z
2F> " " HTML - Inserting Lists " " Insert "ordered list" with one list element iab Yol
k " Insert "unordered list" with one list element iab Yul
k " Insert "decsription list" with one list element " iab Ydl

4kA iab Ydl

5kA " " HTML - Inserting List Items " " Insert "list" item (for both ordered and unordered list) iab Yli
  • " Insert "description list" item iab Ydt

    kA iab Ydp

    kkkA " " HTML - Inserting Links " " Insert/make reference link iab Yhref ?""a vmap ,href "zdiz2F> " " Insert/make reference link to overview list (short "cut") iab Ycut \| >F#a vmap ,cut "zdi>z2F> " " Insert/make reference link with complete URL iab Ylink >?""a vmap ,link "zdi>z2F> " " Insert/make name tag iab Yname ?""a vmap ,name "zdi>z2F> " " Insert/make link to image iab Yimg [picture: title] align= src="">?""a " " Insert/make mailto link iab Ymail ?:a vmap ,mail "zdiz2F> " " Insert/make link to newsgroup iab Ynews ?:a vmap ,news "zdiz2F> " " Ypage Insert page description with a possible link and text iab Ypage page:link:text:kkA " " " HTML - Converting umlauts to digraphs [960430] " " cnoremap ,ae %s/ae/228/gc " cnoremap ,oe %s/oe/246/gc " cnoremap ,ue %s/ue/252/gc " cnoremap ,Ae %s/Ae/196/gc " cnoremap ,Oe %s/Oe/124/gc " cnoremap ,Ue %s/Ue/220/gc " cnoremap ,ss %s/ss/223/gc " " HTML - Add closing tags to name tag (which I forgot when I started HTML): " map ,,,, :g/^$/s/$/<\/a>/ " " HTML - Useful external commands " " ,p = make current file public readable nmap ,p :!chmod 644 % " " ,= = turn "===" into headline of size 1 " nmap ,= :%s/^===\(.*\)$/

    ^M^I\1^M<\/h1>/ " " For adding descriptions and keywords to important pages: " " " " ======================================================================== " PGP - encryption and decryption " ======================================================================== " " encrypt nmap ;e :%!/bin/sh -c 'pgp -feast 2>/dev/tty' vmap ;e :%!/bin/sh -c 'pgp -feast 2>/dev/tty' " decrypt nmap ;d :/^-----BEG/,/^-----END/!/bin/sh -c 'pgp -f 2>/dev/tty' vmap ;d :/^-----BEG/,/^-----END/!/bin/sh -c 'pgp -f 2>/dev/tty' " sign nmap ;s :,$! /bin/sh -c 'pgp -fast +clear 2>/dev/tty' " nmap ;v :,/^-----END/w !pgp -m " " PGP - original mappings " " encrypt and sign (useful for mailing to someone else) "csh: map #1 :,$! /bin/sh -c 'pgp -feast 2>/dev/tty^V|^V|sleep 4' " sh: map #1 :,$! pgp -feast 2>/dev/tty^V|^V|sleep 4 " " sign (useful for mailing to someone else) "csh: map #2 :,$! /bin/sh -c 'pgp -fast +clear 2>/dev/tty' " sh: map #2 :,$! pgp -fast +clear 2>/dev/tty " " decrypt "csh: map #3 :/^-----BEG/,/^-----END/! /bin/sh -c 'pgp -f 2>/dev/tty^V|^V|sleep 4' " sh: map #3 :/^-----BEG/,/^-----END/! pgp -f 2>/dev/tty^V|^V|sleep 4 " " view (pages output, like more) "csh: map #4 :,/^-----END/w !pgp -m " sh: map #4 :,/^-----END/w !pgp -m " " encrypt alone (useful for encrypting for oneself) "csh: map #5 :,$! /bin/sh -c 'pgp -feat 2>/dev/tty^V|^V|sleep 4' " sh: map #5 :,$! pgp -feat 2>/dev/tty^V|^V|sleep 4 " " Elijah http://www.mathlab.sunysb.edu/~elijah/pgppub.html says : " The significant feature is that stderr is redirected independently of " stdout, and it is redirected to /dev/tty which is a synonym for the current " terminal on Unix. I don't know why the ||sleep 4 stuff is there, but it is " harmless so I left it. Since csh is such junk, special rules are used if you " are using it (tcsh, too). ksh and bash should use the sh form. zsh, et al: " consult your manual. The # format is used to map function keys. If you " terminal does not support the requested function key, use a literal #. " Not all of the clones correctly support this. " " ======================================================================== " Useful stuff. At least these are nice examples. :-) " ======================================================================== " " ,t = transpose two characters next to cursor position from aXb -> bXa " map ,t XplxhhPl " " make space move the cursor to the right - much better than a *beep* " nmap \ l " " ,E = execute line " map ,E 0/\$w"yy$:yr! " This command excutes a shell command from the current line and reads in " its output into the buffer. " It assumes that the command starts with " the fist word after the first '$' (the shell prompt of /bin/sh). " Try ",E" on this line, ie place the cursor on it and then press ",E": " $ ls -la " Note: The command line commands have been remapped to tcsh style!! " " put parentheses around "visual text" " vmap ,, v`>a)` " " ,dr = decode/encode rot13 text vmap ,dr :!tr A-Za-z N-ZA-Mn-za-m " Use this with an external "rot13" script: " " ,13 - rot13 the visual text " vmap ,13 :!rot13 " " Give the URL under the cursor to Netscape " map ,net yA:!netscape -remote "openurl "" " " " ======================================================================== " ASCII tables - you may need them some day. Save them to a file! " ======================================================================== " " ASCII Table - | octal value - name/char | " " |000 nul|001 soh|002 stx|003 etx|004 eot|005 enq|006 ack|007 bel| " |010 bs |011 ht |012 nl |013 vt |014 np |015 cr |016 so |017 si | " |020 dle|021 dc1|022 dc2|023 dc3|024 dc4|025 nak|026 syn|027 etb| " |030 can|031 em |032 sub|033 esc|034 fs |035 gs |036 rs |037 us | " |040 sp |041 ! |042 " |043 # |044 $ |045 % |046 & |047 ' | " |050 ( |051 ) |052 * |053 + |054 , |055 - |056 . |057 / | " |060 0 |061 1 |062 2 |063 3 |064 4 |065 5 |066 6 |067 7 | " |070 8 |071 9 |072 : |073 ; |074 < |075 = |076 > |077 ? | " |100 @ |101 A |102 B |103 C |104 D |105 E |106 F |107 G | " |110 H |111 I |112 J |113 K |114 L |115 M |116 N |117 O | " |120 P |121 Q |122 R |123 S |124 T |125 U |126 V |127 W | " |130 X |131 Y |132 Z |133 [ |134 \ |135 ] |136 ^ |137 _ | " |140 ` |141 a |142 b |143 c |144 d |145 e |146 f |147 g | " |150 h |151 i |152 j |153 k |154 l |155 m |156 n |157 o | " |160 p |161 q |162 r |163 s |164 t |165 u |166 v |167 w | " |170 x |171 y |172 z |173 { |174 | |175 } |176 ~ |177 del| " " ======================================================================== " ASCII Table - | decimal value - name/char | " " |000 nul|001 soh|002 stx|003 etx|004 eot|005 enq|006 ack|007 bel| " |008 bs |009 ht |010 nl |011 vt |012 np |013 cr |014 so |015 si | " |016 dle|017 dc1|018 dc2|019 dc3|020 dc4|021 nak|022 syn|023 etb| " |024 can|025 em |026 sub|027 esc|028 fs |029 gs |030 rs |031 us | " |032 sp |033 ! |034 " |035 # |036 $ |037 % |038 & |039 ' | " |040 ( |041 ) |042 * |043 + |044 , |045 - |046 . |047 / | " |048 0 |049 1 |050 2 |051 3 |052 4 |053 5 |054 6 |055 7 | " |056 8 |057 9 |058 : |059 ; |060 < |061 = |062 > |063 ? | " |064 @ |065 A |066 B |067 C |068 D |069 E |070 F |071 G | " |072 H |073 I |074 J |075 K |076 L |077 M |078 N |079 O | " |080 P |081 Q |082 R |083 S |084 T |085 U |086 V |087 W | " |088 X |089 Y |090 Z |091 [ |092 \ |093 ] |094 ^ |095 _ | " |096 ` |097 a |098 b |099 c |100 d |101 e |102 f |103 g | " |104 h |105 i |106 j |107 k |108 l |109 m |110 n |111 o | " |112 p |113 q |114 r |115 s |116 t |117 u |118 v |119 w | " |120 x |121 y |122 z |123 { |124 | |125 } |126 ~ |127 del| " " ======================================================================== " ASCII Table - | hex value - name/char | " " | 00 nul| 01 soh| 02 stx| 03 etx| 04 eot| 05 enq| 06 ack| 07 bel| " | 08 bs | 09 ht | 0a nl | 0b vt | 0c np | 0d cr | 0e so | 0f si | " | 10 dle| 11 dc1| 12 dc2| 13 dc3| 14 dc4| 15 nak| 16 syn| 17 etb| " | 18 can| 19 em | 1a sub| 1b esc| 1c fs | 1d gs | 1e rs | 1f us | " | 20 sp | 21 ! | 22 " | 23 # | 24 $ | 25 % | 26 & | 27 ' | " | 28 ( | 29 ) | 2a * | 2b + | 2c , | 2d - | 2e . | 2f / | " | 30 0 | 31 1 | 32 2 | 33 3 | 34 4 | 35 5 | 36 6 | 37 7 | " | 38 8 | 39 9 | 3a : | 3b ; | 3c < | 3d = | 3e > | 3f ? | " | 40 @ | 41 A | 42 B | 43 C | 44 D | 45 E | 46 F | 47 G | " | 48 H | 49 I | 4a J | 4b K | 4c L | 4d M | 4e N | 4f O | " | 50 P | 51 Q | 52 R | 53 S | 54 T | 55 U | 56 V | 57 W | " | 58 X | 59 Y | 5a Z | 5b [ | 5c \ | 5d ] | 5e ^ | 5f _ | " | 60 ` | 61 a | 62 b | 63 c | 64 d | 65 e | 66 f | 67 g | " | 68 h | 69 i | 6a j | 6b k | 6c l | 6d m | 6e n | 6f o | " | 70 p | 71 q | 72 r | 73 s | 74 t | 75 u | 76 v | 77 w | " | 78 x | 79 y | 7a z | 7b { | 7c | | 7d } | 7e ~ | 7f del| " ======================================================================== " " ======================================================================== " Mapping of special keys - arrow keys and function keys. " ======================================================================== " Buffer commands (split,move,delete) - " this makes a little more easy to deal with buffers. " (works for Linux PCs in room 030) map :split map :bp map :bn map :bd " " Buffer commands (split,move,delete) - " for Mac keyboard (Performa 5200, US keyboard) " map [19~ :split map [20~ :bp map [23~ :bn map [31~ :bd " " Obvious mappings " " map " map " " Emacs style editing in insert mode " This is something I tried for a minute " and forgot about the minute after. ;-) " imap 0i " imap hi " imap xi imap A " imap lli " imap jli " imap kli " imap b bi " imap f lWi " " Normal mode - tcsh style movements [960425] " " nmap 0 " nmap h " nmap x " nmap $ " nmap l " nmap b b " nmap f w " " DOS keyboard mapping for cursor keys " " map [A " map [B " map [C " map [D " imap [A " imap [B " imap [C " imap [D " " DOS keyboard " "insert" " map [1~ i " map [1~ " "home" " map [2~ ^ " map [2~ 0 " map [2~ " "pgup" " map [3~ " map [3~ " "delete" " map [4~ x " map [4~ " "end" " map [5~ $ " map [5~ " "pgdn" " map [6~ " map [6~ " " Keyboard mapping for cursor keys " [works for SUNs in Solarium (room 030) - 970815] " map OA map OB map OC map OD imap OA imap OB imap OC imap OD " " Keyboard mapping for cursor keys " [works for XTerminals - 970818] map [A map [B map [C map [D imap [A imap [B imap [C imap [D " " ======================================================================== " TEMPORARY STUFF " ======================================================================== " " With this abbreviation I once added a link to all my pages about ELM: " iab YEHP
  • ELM Pages - Home Page " " map ,U %s###gc " map ,F {jma}kmb:'a,'b!sed -e "s/^>//"|sed -f public_html/elm/scripts/weedout.sed " map ,mb ebiEadw " " " stripping netscape bookmarks and making them list items " vmap ,ns :.,$s/^ *
    <\(A.*"\) ADD.*">\(.*\)$/
  • <\1>\2/ " " ======================================================================== " TEST of AutoCommands " ======================================================================== " Enable editing of gzipped files. This comes straight from the vim " distribution and it served me well. " uncompress them after reading " compress them before writing, undone after writing " binary mode is needed when writing gzipped files "autocmd BufRead *.gz set bin|%!gunzip "autocmd BufRead *.gz set nobin "autocmd BufWritePre *.gz %!gzip "autocmd BufWritePre *.gz set bin "autocmd BufWritePost *.gz undo|set nobin "autocmd FileReadPost *.gz set bin|'[,']!gunzip "autocmd FileReadPost set nobin " Enable editing of bzipped files " read: set binary mode before reading the file " uncompress text in buffer after reading " write: compress file after writing " append: uncompress file, append, compress file autocmd BufReadPre,FileReadPre *.bz2 set bin autocmd BufReadPre,FileReadPre *.bz2 let ch_save = &ch|set ch=2 autocmd BufReadPost,FileReadPost *.bz2 |'[,']!bunzip2 autocmd BufReadPost,FileReadPost *.bz2 let &ch = ch_save|unlet ch_save autocmd BufReadPost,FileReadPost *.bz2 execute ":doautocmd BufReadPost " . expand("%:r") autocmd BufWritePost,FileWritePost *.bz2 !mv :r autocmd BufWritePost,FileWritePost *.bz2 !bzip2 :r autocmd FileAppendPre *.bz2 !bunzip2 autocmd FileAppendPre *.bz2 !mv :r autocmd FileAppendPost *.bz2 !mv :r autocmd FileAppendPost *.bz2 !bzip2 -9 --repetitive-best :r " " \<> = change to <> notation by substituting ^M and ^[ " cab \<> s///gc:s///gc " " Jump to the last space before the 80th column. " map ,\| 80\|F " " extracting variable names from mutt's init.c " :%s/^.*"\([a-z0-9_]*\)".*$/\1/ " " Automatically placing the cursor onto the first line withon the mail body: " autocmd BufRead .followup,.article,.letter 1G}j;set fo=tcq tw=78 " " Changing the From_ line in pseudo mail folders to an appropriate value - " so you can read them with a mailer. " %s/^From /From guckes Thu Apr 6 12:07:00 1967/ " syntax on " COLOR!!! Let's try this! " if exists("has_syntax") " Help files for Vim au BufNewFile,BufReadPost,TermChanged snd*,mutt*,.letter,nn.*,.followup source ~/.public_html/vim/mailnews.vim source $VIMRUNTIME/syntax/syntax.vim source $VIMRUNTIME/syntax/latex.vim source $VIMRUNTIME/syntax/c.vim source $VIMRUNTIME/syntax/perl.vim autocmd BufRead *.c,*.h set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,:// syntax sync maxlines=10 endif autocmd BufRead *.jl,.sawfishrc,custom source $VIMRUNTIME/syntax/lisp.vim autocmd BufRead *.tpl source $VIMRUNTIME/syntax/html.vim "autocmd BufRead *.pxt source $VIMRUNTIME/syntax/xml.vim autocmd BufRead *.schemas source $VIMRUNTIME/syntax/xml.vim autocmd BufRead *.pxt source $VIMRUNTIME/syntax/html.vim "set ts=4 filetype on filetype indent on "set sw=4 set smarttab source ~/.vim/extensions/php.vim "END