You are here: http://dunne.freeshell.org//exrc.html
" Paul Dunne's decades-old .exrc file
" last updated Sunday 30th July 2017
"
" Generic options
"
set autoindent
set exrc
set flash
set nomesg
" this is off by default in nvi
set noautowrite
set noerrorbells
set noshowmatch
set nowrapscan
set report=1
set ruler
" superfluous if SHELL is set, and it always is
"set shell=/bin/ksh
set shiftwidth=4
set showmode
" I only use tab as a field seperator in data files
" NB: use -t n with fmt to match the setting here
" NB: use -x 1 with less, ditto
" NB: use stty -xtabs, ditto
" is this more trouble than it is worth?
" yes!
"set tabstop=1
"set tabstop=4
set tabstop=8
set tildeop
" try it out
set verbose
set nowarn
" I like to write with four-space margins to right and left
set wrapmargin=4
"
" Version-specific options
"
"" vim
"
"set compatible
"set directory=>/tmp/
"set visualbell
"
"" nvi
"
set cedit=
" why not just use default (TAB)?
" because it messes up command that use literal tab in regexps on command line
"set filec=
" vim doesn't like this:
set leftright
" this appears to fuck stuff up (!)
"set extended
" not present in vi on openbsd
" tc source /home/paul/.nvi_tcl
" I got used to this that I forgot it was an nvi extension
" set wraplen=79
"
" Key mappings
"
"" SINGLE KEYSTROKES
"
" comment out a line, C-style
"map C I/* A */
"
" adjust/fill a paragraph
map f {!} fmt -t 8 -p -w 79
}
"
" adjust/fill current line (default: Search count times backward through the current line for character.)
map F :.!fmt -t 8 -p -w 79
"
" goto beginning of file
map g 1G
"
" attach personal .sig
"map s Go
I-- :r ~/.sig2
0
"
" sign end of document
map s Go
I--
Paul Dunne,
!!jdate
kJ
"
" adjust/fill a paragraph for posting to mailing lists
map q {!} fmt -t 8 -p -w 70
}
"
" spell-check file
map V :w
:!ispell -x -S %
:e!
"
" comment out a line (shell)
map z# I#
"
"" DOUBLE KEYSTROKES
"
" center current line
map zc :.!centre
"
" double spacing
map zd !!dbl
"
" format from mark to point
map zf :'a,.!fmt -t 8 -p -w 79
"
" format MH message
map zm 1G/---
j:.,$!fmt -t 8 -p -w 70
}
"
" sort a paragraph
map zs {jma}k:'a,.!sort
"
" attach business .sig
"map zs Go
I-- :r ~/.sig
0
"
" timestamp
map zt !!date '+\%d/\%m/\%y'
"
" unquote blank lines in an e-mail repy
"map zu :%s/^> $//
map zu :'a,.!unfill
"
" word count
map zw :!wc -w %
"
" quote the current paragraph with >
map z> mc{jma}kmb:'a,'bs/^/> /
'c
"
"" CONTROL/KEY COMBINATIONS
"
" next file
map :n
"
" previous file
map :prev
"
" write file
map :w
"
" centre current line
" map c :.!centre
map c :.!fmt -t 8 -c -w 79
"
" format from mark to point
map f :'a,.!fmt -t 8 -p -w 79
"
" replace multiple blank lines with just one blank line
map j :v/./.,/./-1join
"
" make first letter on line lower-case
map l :.s/^[A-Z]/\l&/
"
" quote the current paragraph with >
map q mc{jma}kmb:'a,'bs/^/> /
'c
"
" reverse order of lines
map r :g/.*/m0
"
" strip leading whitespace
" NB: the tab in the char class must be escaped!
map s :'a,.:s/^[\ ]*//g
"
" Junk (!)
"
" footnotes
" This makes a end notes. It will insert a [#] at the current location
" and put a [#] at the bottom of the document and let you type there.
" Hitting `a will take you back to the original location once you are
" done with your end note. [#] will be the number of the end note, not
" the literal # character. (Pretty crazy, huh?)
"map K ma1GO[0]G$?[[0-9]*]
This page was brought to you by ksh, vi, m4, sed & make,
courtesy of openbsd.
Last changed: Sun Mar 3 11:54:02 CET 2019