set nocompatible " TODO " :help 'list' " :help folding " safeguard for re-sourcing autocmd! " HACK: I don't want a .gvimrc but some stuff gets reset during GUI init, " therefore re-source .vimrc at GUI start if has("gui") autocmd GUIEnter * source endif set ruler set number set showcmd set linebreak set scrolloff=4 set noerrorbells visualbell t_vb= " no beeps of any kind set winminheight=0 set splitbelow set confirm set history=2000 " 100x the default set incsearch set autoindent set smartindent set textwidth=0 set tabstop=4 set shiftwidth=4 set softtabstop=4 set isfname+=/,. set backspace=2 " indent,eol,start set nojoinspaces map j map k map if exists("&encoding") set fileencodings=utf-8,iso-8859-1 if has("gui_running") set encoding=utf-8 else set encoding=iso-8859-1 endif endif if has("digraphs") digraphs .. 8230 " … digraphs -- 8212 " — endif set mouse=a set nomousehide if has("menu") amenu Book&marks.&Plasmasturm.home :e scp://rice/plasmasturm.atom amenu Book&marks.&Plasmasturm.links :e scp://rice/www/links/index.shtml amenu Book&marks.&Plasmasturm.template :e scp://rice/www/template.shtml amenu Book&marks.&Plasmasturm.css :e scp://rice/www/global.css amenu Book&marks.MP&3 :e ~/mp3/LIST amenu Book&marks.Lists :E ~/public_html/lists/ endif " current directory follows the file being edited, so long as it's not a remote file if exists(":lcd") autocmd BufEnter * if bufname("") !~ '^[[:alnum:]]*://' | silent! lcd %:p:h | endif else autocmd BufEnter * if bufname("") !~ '^[[:alnum:]]*://' | cd %:p:h | endif endif if has("gui_running") set columns=130 lines=50 if has("gui_gtk2") set guioptions-=tT set guifont=Bitstream\ Vera\ Sans\ Mono\ 10 colorscheme desert elseif has("gui_win32") set guioptions-=tT set guifont=Bitstream_Vera_Sans_Mono:h10:cANSI colorscheme murphy endif else " enable Xterm mouse wheel scrolling map [62~ map! [62~ map [63~ map! [63~ map [64~ map! [64~ map [65~ map! [65~ set background=dark if exists(":colorscheme") colorscheme elflord endif endif syntax on if exists(":filetype") filetype plugin indent on runtime ftplugin/man.vim " to have :Man available endif " some servers refuse to respond to user agents they assume to be spiders let g:netrw_http_cmd = "wget -U 'Vim (netrw 6.2)' -O" " for :TOhtml let g:html_use_css = 1 let g:html_use_xhtml = 1 let g:html_number_lines = 1 " FIXME: the following need a better solution autocmd BufNewFile *.html execute "normal I<\!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\\\title\\\\\\\{" autocmd BufNewFile *.pm,*.pl execute "normal I#!/usr/bin/perl\\use strict\;\use warnings\;\\\jo\"