# tedrc is case-sensitive
# the key def can be any combination of a,c,s
#    a  -> Alt     c -> Control    s -> Shift
# The string definition is C-string-like:
# \t : tab   \n : enter  \e : escape
# \x??  two hexadecimal digits
#
# the [c-a][X] is used for X server like HP's, which doesn't accept the
# combination of Alt and [A..Z 0..9]
#
# if you want to define shift key+(Ctl or Alt) + [0..9], you should use
# '!@# ..)' instead.
###### cursor movement ######
f [up]		up()
f [down]	down()
f [left]	left()
f [right]	right()
f [pgup]        pgup()
f [pgdn]	pgdn()
f [c-up]	spgup()
f [c-down]	spgdn()
f [home]        home()
f [end]		end()
f [c-left]	CurLeftWord()
f [c-right]	CurRightWord()
####### page op #######
f [c-pgup]	pgtop()
f [c-pgdn]	pgbottom()
f [c-home]	beginfile()
f [c-end]	endfile()
###### Search, Replace string #####
f [a-s]		FindStr()
f [c-a][s]	FindStr()
f [c-k][f]	FindStr()
f [a-r]		RepStr()
f [c-a][r]	RepStr()
f [a-n]		RepFind()
f [c-a][n]	RepFind()
f [c-l]		RepFind()
###### Mark lines, block ######
f [a-l]		MarkLn()
f [c-a][l]	MarkLn()
f [a-b]		MarkBlk()
f [c-a][b]	MarkBlk()
f [a-u]		Unmark()
f [c-a][u]	Unmark()
f [s-up]	ExtMarkUp()
f [s-down]	ExtMarkDown()
f [s-left]	ExtMarkLeft()
f [s-right]	ExtMarkRight()
###### Block operations, Copy Del, Move ######
f [a-m]		MvArea()
f [c-a][m]	MvArea()
f [a-z]		CpArea()
f [s-ins]	CpArea()
f [a-c]		CpArea(); Unmark()
f [a-d]		DelArea()
f [c-a][d]	DelArea()
# Overwrite copy, rectangle block only
f [a-o]		OwCp()
f [c-a][o]	OwCp()
f [a-ins]	OwCp()
f [c-q][u]	UpLowBlk(1)
f [c-q][l]	UpLowBlk(0)
f [a-up]	BShiftUpDn(0)
f [a-down]      BShiftUpDn(1)
f [a-left]	BShiftLR(0)
f [a-right]	BShiftLR(1)
f [ca-up]	BShiftUpDn(0)
f [ca-down]     BShiftUpDn(1)
f [ca-left]     BShiftLR(0)
f [ca-right]    BShiftLR(1)
###### Misc Edit commands ######
f [f4]		quit()
f [c-x][c-c]	quit()
f [del]		del()
f [c-bs]	DelLn()
f [c-y]		DelLn()
f [c-del]	DelEol()
f [a-del]	DelWord()
f [s-del]	DelBol()
f [bs]		bs()
f [enter]	enter()
f [a-j]		JoinLine()
###### text Window ######
f [f7]		SwWin()
f [c-w]		SplitWin()
####### Files command #####
f [a-f8]	PrevFile()
f [f8]		NextFile()
f [f2]		SaveFile()
f [a-w]		WrFile()
f [c-a][w]	WrFile()
f [a-e]		EdFile()
f [c-a][e]	EdFile()
f [a-i]		ChDir()
f [c-k][r]	IncFile()
f [a-f6]	SetHotFile()
f [f6]		TgHotFile()
####### Misc commands, undo, redo, goto line, set tag, readpipe,
f [ins]		TogIns()
f [c-t][i]	TogIndent()
f [c-q][w]	SetWordWrap()
f [c-u]		Undo()
f [c-z]		Undo()
f [c-r]		Redo()
f [a-g]		GotoRow()
f [f9]          SaveIfModified(); Compile("make")
#f [f9]          SaveIfModified(); Compile("make -f Makefile.b5")
#f [f9]         SaveIfModified(); system("make -f Makefile.dbg &")
# IDE compile win
f [f5]		TogCpEdit()
f [a-f5]	CloseCpWin()
f [a-f9]	system("ctags -t -s *.[ch] &")
#  up to 10 tags can be defined
f [c-1]		SetTag(1)
f [c-2]		SetTag(2)
f [c-3]		SetTag(3)
f [a-1]		GotoTag(1)
f [c-a][1]	GotoTag(1)
f [a-2]		GotoTag(2)
f [c-a][2]	GotoTag(2)
f [a-3]		GotoTag(3)
f [a-t]		LookupTag()
###
f [f12]		system("./ted &")
# will append current file name to the command
f [c-k][p]      SaveIfModified(); SystemFname("lpr -Plp1")
f [c-k][s]      SaveIfModified(); SystemFname("ispell"); Reload()
f [a-f10]       ReadPipe("ls -al | grep -v '\.o'")
#f [a-f10]       ReadPipe("ls -l *.[ch]"); SetHotFile()
f [f11]		MarkWord(" {}()[]<>+-*/=%\\|&!,.:;\t\""); ExecMarkWord("grep -n -w","*.[ch]"); Unmark()
f [s-f10]       MarkWord("\t <>\""); EditMarkWord()
f [s-f20]       MarkWord("\t <>\""); EditMarkWord()
f [c-f12]	EditFName("tedrc")
f [s-f12]	LoadTedrc("tedrc")
f [a-f12]	MergeTedrc("localtedrc")
## This one is for making a '.o' file currently edited individually
f [s-f9]	ExeCmdFnameExt("make",".o")
##		If the file is already open, switch to this file; otherwise
##		load the file
f [f1]		RaiseOrLoad("/usr/local/lib/Ted/ted.help")
f [c-a][f1]	RaiseOrLoad("/usr/local/lib/Ted/tedrc")
## execute command and place the output in the current file
#f [c-q][s]	InsPipe("ls")
# Excute command and and place output in a new file with name same as the command
f [c-q][e]      ExecCmd()
##### create your template
f [c-m][d]	PutStr("do {\n\t\n} while ();\n"); up();up();right()
f [c-m][i]	PutStr("if () {\n\t\n}\n"); up(); up();right()
f [c-m][t]	PutStr("typedef struct {\n\t\n} ;\n") up();up();right()
f [c-m][v]	PutStr("void ()\n{\n\n}\n"); up();up();up();up();right();right();right();right();right()
f [c-m][f]	PutStr("for(;;) {\n\n}\n"); up();up();up();right();right();right();right()
f [c-m][m]	PutStr("main()\n{\n\n}\n"); up();up();
###########################################
########## keys-string binding  ###########
d [a-`] "This \tis a \e[35mtest\e[m\n"
d [as-!] "\e[31m"
d [as-@] "\e[32m"
d [a-0] "\e[m"
d [c-a][0] "\e[m"
d [a-7] "\e[7m"
d [c-a][7] "\e[7m"
d [space] " "
d [!] "!"
d ["] "\""
d [#] "#"
d [$] "$"
d [%] "%"
d [&] "&"
d ['] "'"
d [(] "("
d [)] ")"
d [*] "*"
d [+] "+"
d [minus] "-"
d [.] "."
d [,] ","
d [/] "/"
d [0] "0"
d [1] "1"
d [2] "2"
d [3] "3"
d [4] "4"
d [5] "5"
d [6] "6"
d [7] "7"
d [8] "8"
d [9] "9"
d [:] ":"
d [;] ";"
d [<] "<"
d [=] "="
d [>] ">"
d [?] "?"
d [@] "@"
d [A] "A"
d [B] "B"
d [C] "C"
d [D] "D"
d [E] "E"
d [F] "F"
d [G] "G"
d [H] "H"
d [I] "I"
d [J] "J"
d [K] "K"
d [L] "L"
d [M] "M"
d [N] "N"
d [O] "O"
d [P] "P"
d [Q] "Q"
d [R] "R"
d [S] "S"
d [T] "T"
d [U] "U"
d [V] "V"
d [W] "W"
d [X] "X"
d [Y] "Y"
d [Z] "Z"
d [brl] "["
d [\] "\\"
d [brr] "]"
d [^] "^"
d [_] "_"
d [`] "`"
d [a] "a"
d [b] "b"
d [c] "c"
d [d] "d"
d [e] "e"
d [f] "f"
d [g] "g"
d [h] "h"
d [i] "i"
d [j] "j"
d [k] "k"
d [l] "l"
d [m] "m"
d [n] "n"
d [o] "o"
d [p] "p"
d [q] "q"
d [r] "r"
d [s] "s"
d [t] "t"
d [u] "u"
d [v] "v"
d [w] "w"
d [x] "x"
d [y] "y"
d [z] "z"
d [{] "{"
d [|] "|"
d [}] "}"
d [~] "~"
d [tab]	"\t"
d [kp0] "0"
d [kp1] "1"
d [kp2] "2"
d [kp3] "3"
d [kp4] "4"
d [kp5] "5"
d [kp6] "6"
d [kp8] "8"
d [kp9] "9"
d [kpplus] "+"
d [kpminus] "-"
d [kpmult] "*"
d [kpdivide] "/"
d [kpdot] "."
d [kpenter] "\n"

########### Language keyword setting ############
## Default constraint
#	- Max lang 4
#	- Max keyword type 6
#	- Max keywords in a type 40
#    Modify edit.h if you want to change that
#  Remove the language you will never use to save memory
##                                 -string color -C comment-
#                                  vvvvvvvvvvv   vvvvvvvvvv
lang ".c .h .cc" , bisque black #, pink black,  grey black, red black "exit break return continue goto free malloc realloc strdup", cyan black "for while if else do switch case default", green black "char short int long unsigned float double void typedef struct u_char u_short u_long u_int FILE static extern", white black "printf fopen fclose fileno fread fwrite fseek fgets fputs fprintf open popen read getchar close opendir fstat stat chmod fchmod unlink signal ioctl fcntl fork pipe wait strcpy strcat strcmp memcpy memset strstr strchr"
lang ".sh .profile .bashrc" , bisque black #, pink black, yellow black, red black "exit goto", cyan black "for in if then else elif fi do while until case done default cd alias export umask" green black "echo read cat find ls rm cp mv mkdir rmdir tar dd cpio stty kill"
## Thanks to Richard James, raj@ast.man.ac.uk for his fortran setting
## Remove the first '#' character to enable it.
#lang ".f90 .f .f77 .for" , bisque black !, pink black, green black, green black"real integer complex logical character type pointer allocatable save intent optional", red black "module interface exit return continue goto use", cyan black "call subroutine if else end elseif endif do enddo case"

## Thanks to jong@mrc-lmb.cam.ac.uk for his Perl setting
## Remove the first '#' character to enable it.
# lang ".pl .pm" , wheat black #, pink black,  grey black, red black "next croak die warn last redo reset", orange black "tr rand reverse lengthwrite select format split substr grep splice print printf sprintf sortjoin system open opendir readdir close push shift unshift for foreachint ref undef then until unless while if else elsif do chr chop chompaccept atan bind binmode caller chdir chmod chown chroot close closedircmp command connect cos crypt dbmclose dbmopen defined delete dump eacheof eval exec exp fcntl fileno flock fork ge getc getgrgid gethostbyaddrhex index ioctl join keys values oct ord pack pipe pop qx read readlinkrecv rename rindex rmdir scalar seek seekdir semctl semget semop sendstat substr study srand socket sleep sin shutdown symlink syscall syswrite tell time times write wantarray wait utime unlink truncatekill", green black "my local package require use ARGV ENV INC sub__FILE__ __END__ __LINE__ SIG HOME LOGDIR PATH PERLLIB PERLDB", white black "le gt ge lt perl eq ne"


########### set color ##########
s TextFg	grey80
s TextBg	black
s CursorFg	yellow
s CursorBg	red
s SepLineFg	yellow
s SepLineBg	steelblue
s MarkFg	yellow
s MarkBg	blue
s EnterStrFg	yellow
s EnterStrBg	steelblue
s EnterBorderFg	yellow
s EnterBorderBg	steelblue
s EnterRectBg	blue
s EnterFirstFg  black
s EnterFirstBg	yellow
s StatusWarnFg	red
s StatusWarnBg	black
s StatusFSavedFg pink
s StatusFSavedBg black
s BracketFg red
s BracketBg black
s MouseFg black
s MouseBg red
s OvwCursorFg	blue
s OvwCursorBg	green

############# set the initial mode of ted ************
# if set to 0, no autosave(auto backup), the unit is second
set autosave 300
# if set to 0, no word wrap
# set WrapWidth 78
set TabWidth 8
# LeadSpaceTab is for replacing leading space in all lines with tab
# Set it to 0 if you don't want
set LeadSpaceTab 1
# set initial edit mode of Indent off/on
set Indent 1
# set initial edit mode of Overwrite/Insert
set Insert 1
# rename the original one before saving
set Backup 1
# Delete the trailing blank of each line
set TrimBlankTail 1
# Move cursor to prev/next line if it is at the beginning/end of a line
set CurAutoUpDownAtEdge 0
## include is a new command
include localtedrc
