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 "zyiwn:set buftype=nofile:r!
\perldoc -tf 'z' 2>/dev/null perldoc 'z'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 "zyiwn:set buftype=nofile:r! man 3 'z'gg
autocmd BufNewFile,BufRead *.html source ~/.vim/html.vim
map!
map!
map!
map!
map!
map!
map!
map!
map!
map!
map
map
map
map
map
map
map
map
map
map
"
"
"
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 :%! perltidy
map ,ptv :'<,'>! perltidy
"
" Editing and HTML mappings
"
" Wrap word under cursor in single quotes
nmap \' ciw'pa'
"
" Wrap visually-selected word in single quotes
vmap \' c'pa'
"
" Wrap word under cursor in double quotes
nmap \" ciw"pa"
"
" Wrap visually-selected word in double quotes
vmap \" c"pa"
"
" Wrap word under cursor in *s
nmap \* ciw*pa*
"
" Wrap visually-selected word in *s
vmap \* c*pa*
"" Wrap word under cursor in _s
nmap \_ ciw_pa_
"
" Wrap visually-selected word in _s
vmap \_ c_pa_
"
" Wrap visually-selected word/current line in
vmap \2 "zdiz
nmap \2 :s#.*#&
#
"
" Wrap visually-selected word/current line in
vmap \3 "zdiz
nmap \3 :s#.*#&
#
"
"" Wrap visually-selected word/current line in
vmap \4 "zdiz
nmap \4 :s#.*#&
#
"
" Mark the visually-selected area/entire file with HTML paragraphs
vmap \a :!perl -0 -wne's/^(\s*)//s;$start=$1;s/(\s*)$//s;$end=$1;s/(?:\s*\n){2,}/\n<\/p>\n\n\n/gsm;print "$start
\n$_\n
$end"'
nmap \a :%s#\(\s*\n\)\{2,\}#\r
&\r#g:%s#\n*\%$#\r
\r#g:0/<\/p>dd:0
"
" Wrap visually-selected word/current line in
vmap \b "zdiz
nmap \b :s#.*#&#
"
" Wrap visually-selected word in
vmap \c cpa
"
" For email - pull the first name out of the first line and write 'Hi, name -'
map \g $F,wywIHi, pa-
" Make that 'Hello, name -'
map \G $F,wywIHello, pa-
"
" Convert thumbnail filename to an HTML link to a larger eponymous image plus
" name tag
map \h :s#\(.*\)th_\(.*\)\(\.jpg\)#
\2#
"
" Wrap visually-selected word/current line in
vmap \i cpa
nmap \i :s#.*#&#
"
" Jump-FROM and jump-TO links for '[1]'-type syntax
map \j :s:\[\([0-9]\+\)\]:[\1]:
map \J :s:\[\([0-9]\+\)\]:[\1]:
"
" Convert visually-selected URL/current line to HTML link
vmap \l "zdi"zpa
nmap \l :s#.*#&#
"
" Convert visually-selected URL/current line to HTML link (no URL)
vmap \L "zdi"zpaF"
nmap \L :s#.*#&#t>
"
" Convert visually-selected URL/current line to "mailto:" link
vmap \m "zdi"zpa
nmap \m :s#.*#&#
"
" Wrap current paragraph in
vmap \p "zdiz
" Wrap current line in
nmap \p :s#.*#&
#
"
" Wrap current paragraph in
vmap \P "zdiz
" Wrap current line in
nmap \P :s#.*#&
#
"
" 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 :set filetype=perl:set kp=perldoc\ -f:0:-r!which perlI#!$a -wo# Created by Ben Okopnik on:r!date-J^i
" Prepend Bash shebang, etc.
map :set filetype=sh:set kp=man:0:-r!which bashI#!o# Created by Ben Okopnik on:r!date-J^i
" Dictionary lookup for word under cursor
map :!dict \|less
" Execute the current file, allowing argument/option entry
map :w:![ -x "%:p" ]\|\|chmod +x "%:p":!"%:p"
" Compile current file and execute resulting 'a.out'
map :w:!cc % && ./a.out
" Toggle spell-checking
map :if exists("syntax_on")syntax offset spellelsesyntax enableset nospellendif
"
" Toggle a comment hash at the beginning of the line
map :.!perl -wlne'/^(\s*)((?:\# ?)?)(.*)/;print $2?"$1$3":"$1\# $3"'
vmap :!perl -wlne'/^(\s*)((?:\# ?)?)(.*)/;print $2?"$1$3":"$1\# $3"'
"
" Reformat/reflow the current line/specified text area
map q vipgq
map! q vipgq
"
" Insert date
map :-r!date
"
" Rebuild LG issue
map r :w:!lg-build-issue
"
"
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; }T<
abb _uperl die "Usage: ", $0 =~ /([^\/]+)$/, " <>\n" unless @ARGV;T<
abb _html :set indentexpr=:set noautoindent:0:-r!perl -MCGI=:standard -we'print start_html,end_html'kki
abb _main #include #include int main( char *argv, int argc ){return( 0 );}kkkki
"
" 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 :-r $LG_ROOT/doc/new_author.txt