version 6.0
" set nocompatible
set showcmd
set showmatch
set incsearch
set ignorecase smartcase
set modeline
runtime ftplugin/man.vim
let cpo_save=&cpo
set cpo=B
autocmd FileType text setlocal tw=72 spell spelllang=en_us
autocmd FileType mail setlocal tw=72 nosmartindent nocindent
autocmd FileType perl so $VIM/vimcurrent/indent/perl.vim
autocmd FileType perl nmap K "zyiw<c-W>n:set buftype=nofile<CR>:r!
	\perldoc -tf '<c-R>z' 2>/dev/null <bar><bar> perldoc '<c-R>z'<cr>gg
autocmd FileType sh so $VIM/vimcurrent/indent/sh.vim
autocmd FileType sh setlocal ai
autocmd FileType c setlocal kp=man\ 3
autocmd FileType c nmap K "zyiw<C-W>n:set buftype=nofile<CR>:r! man 3 '<C-R>z'<CR>gg
autocmd BufNewFile,BufRead *.html source ~/.vim/html.vim
map! <xHome> <Home>
map! <xEnd> <End>
map! <S-xF4> <S-F4>
map! <S-xF3> <S-F3>
map! <S-xF2> <S-F2>
map! <S-xF1> <S-F1>
map! <xF4> <F4>
map! <xF3> <F3>
map! <xF2> <F2>
map! <xF1> <F1>
map <xHome> <Home>
map <xEnd> <End>
map <S-xF4> <S-F4>
map <S-xF3> <S-F3>
map <S-xF2> <S-F2>
map <S-xF1> <S-F1>
map <xF4> <F4>
map <xF3> <F3>
map <xF2> <F2>
map <xF1> <F1>
"
"
"
syntax on
"
" Set up printing
if !exists("printexpr_set")
	let printexpr_set = 1
	set printexpr=PrintFile(v:fname_in)
	set printoptions=top:5pc,bottom:10pc,header:0
	function PrintFile(fname)
		call system("gv " . a:fname)
		call delete(a:fname)
		return v:shell_error
	endfunc
endif
"
" You can have an xterm with any color background, as long as it's black.
set background=dark
"
" Allow 'Ctrl-N' identifier "copy" mechanism to recognize Perl idents
set iskeyword+=:
"
" Perltidy
map ,pt  <Esc>:%! perltidy<CR>
map ,ptv <Esc>:'<,'>! perltidy<CR>
"
" Editing and HTML mappings
"
" Wrap word under cursor in single quotes
nmap \' ciw'<ESC>pa'
"
" Wrap visually-selected word in single quotes
vmap \' c'<ESC>pa'
"
" Wrap word under cursor in double quotes
nmap \" ciw"<ESC>pa"
"
" Wrap visually-selected word in double quotes
vmap \" c"<ESC>pa"
"
" Wrap word under cursor in *s
nmap \* ciw*<ESC>pa*
"
" Wrap visually-selected word in *s
vmap \* c*<ESC>pa*
"" Wrap word under cursor in _s
nmap \_ ciw_<ESC>pa_
"
" Wrap visually-selected word in _s
vmap \_ c_<ESC>pa_
"
" Wrap visually-selected word/current line in <h2></h2>
vmap \2 "zdi<h2><C-R>z</h2><ESC>
nmap <silent> \2 :s#.*#<h2>&</h2>#<CR>
"
" Wrap visually-selected word/current line in <h3></h3>
vmap \3 "zdi<h3><C-R>z</h3><ESC>
nmap <silent> \3 :s#.*#<h3>&</h3>#<CR>
"
"" Wrap visually-selected word/current line in <h4></h4>
vmap \4 "zdi<h4><C-R>z</h4><ESC>
nmap <silent> \4 :s#.*#<h4>&</h4>#<CR>
"
" Mark the visually-selected area/entire file with HTML paragraphs
vmap <silent> \a :!perl -0 -wne's/^(\s*)//s;$start=$1;s/(\s*)$//s;$end=$1;s/(?:\s*\n){2,}/\n<\/p>\n\n<p>\n/gsm;print "$start<p>\n$_\n</p>$end"'<CR>
nmap <silent> \a :%s#\(\s*\n\)\{2,\}#\r</p>&<p>\r#g<CR>:%s#\n*\%$#\r</p>\r#g<CR>:0<CR>/<\/p><CR>dd:0<CR>
"
" Wrap visually-selected word/current line in <strong></strong>
vmap \b "zdi<strong><C-R>z</strong><ESC>
nmap <silent> \b :s#.*#<strong>&</strong>#<CR>
"
" Wrap visually-selected word in <code></code>
vmap \c c<code><ESC>pa</code>
"
" For email - pull the first name out of the first line and write 'Hi, name -'
map \g $F,wywIHi, <Esc>pa-<CR><CR>
" Make that 'Hello, name -'
map \G $F,wywIHello, <Esc>pa-<CR><CR>
"
" Convert thumbnail filename to an HTML link to a larger eponymous image plus
" name tag
map <silent> \h :s#\(.*\)th_\(.*\)\(\.jpg\)#<a href="\1\2\3"><img src="&">\2</a>#<CR>
"
" Wrap visually-selected word/current line in <em></em>
vmap \i c<em><ESC>pa</em>
nmap <silent> \i :s#.*#<em>&</em>#<CR>
"
" Jump-FROM and jump-TO links for '[1]'-type syntax
map <silent> \j :s:\[\([0-9]\+\)\]:<a id="<C-R>%_\1_back"></a><a href="#<C-R>%_\1">[\1]</a>:<CR>
map <silent> \J :s:\[\([0-9]\+\)\]:<a id="<C-R>%_\1"></a><a href="#<C-R>%_\1_back">[\1]</a>:<CR>
"
" Convert visually-selected URL/current line to HTML link
vmap \l "zdi<a href="<ESC>"zpa"><ESC>"zpa</a><ESC>
nmap <silent> \l :s#.*#<a href="&">&</a>#<CR>
"
" Convert visually-selected URL/current line to HTML link (no URL)
vmap \L "zdi<a href=""><ESC>"zpa</a><ESC>F"
nmap <silent> \L :s#.*#<a href="">&</a>#<CR>t>
"
" Convert visually-selected URL/current line to "mailto:" link
vmap \m "zdi<a href="mailto:<ESC>"zpa"><ESC>"zpa</a><ESC>
nmap <silent> \m :s#.*#<a href="mailto:&">&</a>#<CR>
"
" Wrap current paragraph in <pre></pre>
vmap \p "zdi<pre><CR><C-R>z</pre><CR><ESC>
" Wrap current line in <pre></pre>
nmap <silent> \p :s#.*#<pre>&</pre>#<CR>
"
" Wrap current paragraph in <pre class="code"></pre>
vmap \P "zdi<pre class="code"><CR><C-R>z</pre><CR><ESC>
" Wrap current line in <pre class="code"></pre>
nmap <silent> \P :s#.*#<pre class="code"><CR>&</pre><CR>#<CR>
"
" Cut current paragraph into 'n' buffer; see '\v' and '\V'
nmap \x vip"nd
" Cut visually-selected paragraph into 'n' buffer; see '\v' and '\V'
vmap \x "nd
"
"
" Prepend Perl shebang, etc.
map <silent> <F2> :set filetype=perl<CR>:set kp=perldoc\ -f<CR>:0<CR>:-r!which perl<CR>I#!<ESC>$a -w<ESC>o# Created by Ben Okopnik on<ESC>:r!date<CR>-J^<CR>i<CR>
" Prepend Bash shebang, etc.
map <silent> <F3> :set filetype=sh<CR>:set kp=man<CR>:0<CR>:-r!which bash<CR>I#!<ESC>o# Created by Ben Okopnik on<ESC>:r!date<CR>-J^<CR>i<CR>
" Dictionary lookup for word under cursor
map <F4> :!dict <C-R><C-W>\|less<CR>
" Execute the current file, allowing argument/option entry
map <F5> :w<CR>:![ -x "%:p" ]\|\|chmod +x "%:p"<CR>:!"%:p"
" Compile current file and execute resulting 'a.out'
map <F6> :w<CR>:!cc % && ./a.out<CR>
" Toggle spell-checking
map <silent> <F7> :if exists("syntax_on")<BAR>syntax off<BAR>set spell<BAR>else<BAR>syntax enable<BAR>set nospell<BAR>endif<CR>
"
" Toggle a comment hash at the beginning of the line
map <silent> <F9> :.!perl -wlne'/^(\s*)((?:\# ?)?)(.*)/;print $2?"$1$3":"$1\# $3"'<CR>
vmap <silent> <F9> :!perl -wlne'/^(\s*)((?:\# ?)?)(.*)/;print $2?"$1$3":"$1\# $3"'<CR>
"
" Reformat/reflow the current line/specified text area
map <ESC>q <ESC>vipgq
map! <ESC>q <ESC>vipgq
"
" Insert date
map <A-d> :-r!date<CR>
"
" Rebuild LG issue
map <ESC>r <ESC>:w<CR>:!lg-build-issue<CR>
"
"
let &cpo=cpo_save
unlet cpo_save
set noautoindent
set smartindent
set backupdir=~/backup,/tmp
set backspace=2
" set encoding=utf-8 fileencodings=
set formatoptions=tcql
set history=50
set lazyredraw
set ruler
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc
set syntax=mail
set textwidth=75
set viminfo='20,\"50
set tabstop=4
set shiftwidth=4
set report=1
set updatecount=50   " write swap file to disk after each 100 characters
set updatetime=6000  " write swap file to disk after 6 inactive seconds
set visualbell
"
abb nad and
abb hte the
abb teh the
abb THe The
abb THis This
abb taht that
abb htat that
abb jsut just
abb mroe more
abb wnat want
abb lauhg laugh
abb weatehr weather
abb whetehr whether
abb excercise exercise
abb waht what
abb wiht with
abb becasue because
abb otehr other
abb rahter rather
abb thouhg though
abb althouhg although
abb togetehr together
abb mena mean
abb enouhg enough
abb enoguh enough
abb anyhting anything
abb Microsoft Micr0s0ft
abb Windows Wind0ws
abb Outlook 0utlook
abb Holland the Netherlands
"
"
abb _ushell [ -z "$1" ] && { printf "Usage: ${0##*/} <>\n"; exit; }<ESC>T<
abb _uperl die "Usage: ", $0 =~ /([^\/]+)$/, " <>\n" unless @ARGV;<ESC>T<
abb _html <ESC>:set indentexpr=<CR>:set noautoindent<CR>:0<CR>:-r!perl -MCGI=:standard -we'print start_html,end_html'<CR><ESC>kki
abb _main #include <stdio.h><CR>#include <stdlib.h><CR><CR>int main( char *argv, int argc ){<CR><CR><CR>return( 0 );<CR>}<CR><ESC>kkkki<TAB>
"
" Here come my LG abbrevs!
"
abb _lg linuxgazette.net
abb _hlg http://linuxgazette.net
abb _atg "Asking Questions of The Answer Gang" at http://linuxgazette.net/tag/ask-the-gang.html
abb _auth http://linuxgazette.net/faq/author.html
abb _tag tag@lists.linuxgazette.net
abb _svn http://admin.linuxgazette.net/SVN-setup.txt
abb _join http://lists.linuxgazette.net/mailman/listinfo
abb _newauth <ESC>:-r $LG_ROOT/doc/new_author.txt<CR>
