#
# editor config file
#

#
# color names
#

assign %(Rdhook) = rdme.vi
assign %(Wrhook) = wrme.vi
assign %(Modhook) = rcs.vi
assign %(Menuhook) = menu.vi
assign %(MCselhook) = mcsel.vi
assign %(MLselhook) = mlsel.vi
load rdme.vi
load wrme.vi
load rcs.vi
load menu.vi

#
# aliases defined here
#
#alias wq x
alias untile tile 1 1
#abbrev wh while(
#abbrev fo for(

set menus

#
# menus
#
menu windowgadget
    menuitem &Maximize maximize
    menuitem M&inimize minimize
    menuitem ""
    menuitem "&Open another view" open
    menuitem ""
    menuitem "&Save" write
    menuitem "&Save & close" keyadd ZZ
    menuitem "Close &no save" quit!
    menuitem &Close quit
endmenu
menu &File
    menuitem "&Open new file ..." edit
    menuitem "&Next file" next
    menuitem "&Read file ..." read
    menuitem "&File list ..." file
    menuitem ""
    menuitem "&Save current file" write
    menuitem "Save &current file & close" wq
    menuitem ""
    menuitem "En&ter command ..." keyadd \<CTRL_K>
    menuitem "S&ystem" shell
    menuitem ""
    menuitem "E&xit" exitall
endmenu
menu &Edit
    menuitem "&Delete region" keyadd \<SHIFT_DEL>
    menuitem "&Copy (yank) region" keyadd yr
    menuitem "&Paste (put)" put
    menuitem ""
    menuitem "&Insert Text" keyadd i
    menuitem "&Overstrike Text" keyadd R
    menuitem ""
    menuitem "&Undo" undo
    menuitem "&Redo" undo!
endmenu
menu &Position
    menuitem "&Start of file" 1
    menuitem "&End of file" $
    menuitem "Line &number ..." so lnum._vi
    menuitem ""
    menuitem "S&tart of line" keyadd 0
    menuitem "En&d of line" keyadd $
    menuitem ""
    menuitem "Search &forwards ..." keyadd \<CTRL_S>
    menuitem "Search &backwards ..." keyadd ?
    menuitem "&Last search" keyadd n
    menuitem "&Reverse last search" keyadd N
endmenu
menu &Window
    menuitem "&Tile windows" tile
    menuitem "&Cascade windows" cascade
    menuitem "&Reset windows" tile 1 1
    menufilelist
endmenu
menu &Options
    menuitem "&Settings ..." set
endmenu
menu &Help
    menuitem "&Command Line" help com
    menuitem "&Key Strokes" help keys
    menuitem "&Regular Expressions" help reg
    menuitem "&Scripts" help scr
    menuitem "S&ettings" help set
    menuitem "Starting &Up" help start
endmenu


#
# parameters
#
if %(OS) == qnx
    assign %(HOME) = /HOME/$
    assign %(HIS) = "%(HOME)/.vihistory"
    set historyfile = %(HIS)
    set tmpdir = /tmp
else
    set historyfile = c:\vi.his
endif

#set autosaveinterval = 30
set clock,menus,repeatinfo,statusinfo
set statusstring="L:$6L$nC:$6C"

set gadgetstring = 诳蕾衬疵佰
#set gadgetstring ="圹圹圹圹佰"

#set word = __09AZaz
#set wordalt = \\..__09AZaz

set maxswapk = 8192
#set maxemsk = 1024
#set maxxmsk = 1024
if %(OS386) == 1
    set stackk=40
else
    set stackk=12
endif
set maxlinelen = 512

set maxclhistory = 20, maxfindhistory = 10
if %(OS) != nt
    set insertcursortype= 50 100
    set commandcursortype= 7 100
else
    set insertcursortype= 70 100
    set commandcursortype= 0 100
endif

if %(OS) == dos
    set zapcolorsatexit
endif

set realtabs

set magic
set magicstring =()

set shiftwidth=4, tabamount=8, hardtab=8

set currentstatuscolumn = %(SW)-16
set windowgadgets

#
# flags
#
set readentirefile
set escapemessage
set verbose, beepflag, autoindent, extendedmemory
set caseignore, searchwrap, currentstatus
set linebased
set ppkeywordonly 
set notoolbar, nocolorbar, nofontbar

#
# no longer necessary - filetypesource (below) sets on a per-file-basis
#
set nocmode

# this drives Brian batty
set nojumpyscroll

#
# stuff to ignore when using command completion
#
#set fignore = com, fignore= obj, fignore= exe

#
# some mouse/windows stuff
#
#set doubleclickticks = 7
#set mousespeed = 4

set maxwindowtilex = 3, maxwindowtiley = 2
set inactivewindowcolor %(white)

#
# extra things to match with '%'
#
match /\/\*/\*\//
match /# *if/# *endif/

#
# key mappings
#
map CTRL_Q \x:\hso qh._vi \<CTRL_W>\n
map ALT_Q \x:\hso qh2._vi\n
map F5 yyPj:.,. s/./*/g\n: .,. s/^..(.*)..$/\\/*\\1*\\//\n
map SHIFT_F1 \x\e:\hso proc._vi\n
map F7 \x:\hf\n
map V \x:\hf\n
map F8 \x:\hsource error.vi 1\n
map SHIFT_F8 \x:\hsource error.vi 0\n
map CTRL_T \x:\hda\n
map CTRL_W \x:fgrep \<CTRL_W>\n
map K      \x:\hnext\n

map! F1 \e\<F1>g
map! F2 \e\<F2>g
map! F7 \e\x:\hso fin._vi\n
map! SHIFT_F1 \x\e:so proc._vi\n
map! CTRL_W \edwi
map! CTRL_X \ecw

#
# line numbering setup
#
#set linenumbers
#set linenumsonright
#set linenumwinwidth = 6
#linenumberwindow
#    border 1 %(Brw) %(red)
#    text %(blue) %(red)
#endwindow

#
# window definitions follow
#
set clockx = %(SW)-6, clocky = 0
set nospin

#
# COLOR CONFIGURATION
#
if config == 100

    assign %(black) = 0
    assign %(blue) = 1
    assign %(green) = 2
    assign %(cyan) = 3
    assign %(red) = 4
    assign %(purple) = 5		# real men don't say magenta
    assign %(brown) = 6
    assign %(white) = 7
    assign %(darkgrey) = 8
    assign %(lightblue) = 9
    assign %(lightgreen) = 10
    assign %(lightcyan) = 11
    assign %(lightred) = 12
    assign %(lightpurple) = 13
    assign %(yellow) = 14
    assign %(highwhite) = 15

    defaultwindow
        border 1 %(white) %(blue)
	text %(white) %(blue)
        hilight %(highwhite) %(cyan)
    endwindow

    editwindow
       dimension 0 1 %(SW)-1 %(SH)-2
       border 1 %(black) %(white)
       text %(black) %(white) 0

	hilight %(yellow) %(black) 0
	whitespace %(black) %(white) 0
	selection %(highwhite) %(black) 0
	eoftext %(black) %(white) 0
	keyword %(blue) %(white) 0
	octal %(lightred) %(white) 0
	hex %(lightgreen) %(white) 0
	integer %(brown) %(white) 0
	char %(brown) %(white) 0
	preprocessor %(yellow) %(white) 0
	symbol %(blue) %(white) 0
	invalidtext %(yellow) %(red) 0
	identifier %(black) %(white) 0
	jumplabel %(yellow) %(white) 0
	comment %(red) %(white) 0
	float %(yellow) %(white) 0
	string %(brown) %(white) 0
    endwindow
	
    filecwindow
       dimension 4 7 %(SW)-5 %(SH)-9
    endwindow
    
    countwindow
       dimension 28 %(SH)-5 43 %(SH)-3
    endwindow
    
    commandwindow
       dimension 2 %(SH)-7 %(SW)-3 %(SH)-5
    endwindow
    
    dirwindow
       dimension 15 2 %(SW)-14 %(SH)-7
    endwindow
    
    setwindow
       dimension 12 2 43 %(SH)-4
    endwindow
    
    setvalwindow
       dimension 46 6 73 9
    endwindow

    filewindow
       dimension 26 2 %(SW)-2 %(SH)-7
    endwindow
    
    statuswindow
       border -1
       dimension 0 %(SH)-1 9 %(SH)-1
       text %(white) %(blue)
       hilight %(yellow) %(blue)
    endwindow
    
    messagewindow
       border -1
       dimension 10 %(SH)-1 %(SW)-1 %(SH)-1
       text %(white) %(blue)
       hilight %(yellow) %(blue)
    endwindow
    
    menuwindow
       border 1 %(yellow) %(blue)
       text %(highwhite) %(blue)
       hilight %(yellow) %(blue)
    endwindow
    
    menubarwindow
       border -1
       text %(highwhite) %(blue)
       hilight %(yellow) %(blue)
    endwindow

    activemenuwindow
	text %(white) %(black)
	hilight %(yellow) %(black)
    endwindow

    greyedmenuwindow
	text %(brown) %(blue)
	hilight %(yellow) %(blue)
    endwindow

    activegreyedmenuwindow
	text %(red) %(black)
	hilight %(yellow) %(black)
    endwindow
    
#
# MONOCOLOR CONFIGURATION  
#
elseif config == 1

#
# BLACK AND WHITE CONFGURATION
# 
else

endif

source user.vi

#
# File Specific Source (*.* traps unspecified file types)
#
filetypesource *.c *.h
    set language=1
    set cmode
endfiletypesource

filetypesource *.cpp *.hpp
    set language=2
    set cmode
endfiletypesource

filetypesource *.for *.f *.inc
    set language=3
    set nocmode
endfiletypesource

filetypesource *.*
    set language=0
    set nocmode
endfiletypesource
