home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
fed0217s.zip
/
obj
/
fed.ini
< prev
next >
Wrap
Text File
|
2001-11-07
|
28KB
|
824 lines
//Module :FED.INI
//Abstract :Sample FED initialization file
//
//Copyright (C) Sergey I. Yevtushenko
//
//Log: Fri 27/03/1998 Created
// Mon 20/04/1998 Updated
// Tue 24/10/2000 Updated again (a lot of changes)
// Fri 01/12/2000 Updated to reflect changes in version 0.2.10
// Thu 07/12/2000 Some more comments, new file masks and others
//-------------------------------------------------------------------
// NOTE!!!
//
// Back slash (\) character is an escape character!
// Do not forget to add second back slash if you need
// back slash character to be preserved during processing.
// Escaping is done for REXX macroses and strings as well.
//-------------------------------------------------------------------
//-------------------------------------------------------------------
// NOTE:
//
// Read definition of kbInit and kbAltComma macro. They contain
// environment and/or user-specific information.
//-------------------------------------------------------------------
//For those who don't like to dig through regexp's :)
//Note: all pattern searches here are case insensitive.
//
// Patterns below will match following files:
//
// CPP : *.c, *.h, *.cpp, *.hpp, *.cxx, *.hxx, *.cc, *.rc, fed.ini
// REXX: *.cmd, *.frx, *.brk
// ASM : *.asm
// MAKE: makefile, makefile.*, *.mak, *.mak.*
// HTML: *.htm, *.html, *.phtm, *.xhtm, *.shtm, *.phtml, *.xhtml, *.shtml
// MAIL: *.bod, *.msg
// PAS : *.bod, *.pas
// PERL: *.pl, *.pm, *.ph, *.al, *.ix
//
// Each file may have additional extensions: .bak, .sav or extension from
// any number of decimal digits, for example: .1, .05, etc.
// All patterns are designed to match file name 'from tail', i.e.
// checks are done in way which prevents intermediate matching patterns
// to affect proper recognition.
//
// For example, folowing file will be recognized as CPP: one.file.in.c.sav
editor.syntax = "C++:\\.[ch](pp|xx)?(\\.(bak|sav|[0-9]+))?$;\n",
"C++:\\.[cr]c(\\.(bak|sav|[0-9]+))?$;\n",
"C++:^fed.ini(\\.(bak|sav|[0-9]+))?$\n",
"REXX:\\.(cmd|frx|brk)(\\.(bak|sav|[0-9]+))?$\n",
"ASM:\\.asm(\\.(bak|sav|[0-9]+))?$\n",
"MAKE:^makefile(\\..*)?(\\.(bak|sav|[0-9]+))?$\n",
"MAKE:\\.mak(\\..*)?(\\.(bak|sav|[0-9]+))?$\n",
"HTML:\\.[pxs]?html?(\\.(bak|sav|[0-9]+))?$\n",
"MAIL:\\.(bod|msg)(\\.(bak|sav|[0-9]+))?$\n",
"PAS:\\.(int|pas)(\\.(bak|sav|[0-9]+))?$\n",
"PERL:\\.(p[lmh]|al|ix)(\\.(bak|sav|[0-9]+))?$\n"
// Save syntax highlighting mode in EA?
// 0 - never
// 1 - only if manually set by user (see kbAltH and kbCtrlH below) (default)
// 2 - always
editor.syntax.save.mode = 1
//Default file name for newly created file
editor.untitled = ".Untitled"
//Cursor shape for two modes (in precents from full hight).
cursor.shape.insert = 20
cursor.shape.overwrite = 60
//Mouse event mask
//
//MOTION 0x01
//MOTION_WITH_BN1_DOWN 0x02
//BN1_DOWN 0x04
//MOTION_WITH_BN2_DOWN 0x08
//BN2_DOWN 0x10
//MOTION_WITH_BN3_DOWN 0x20
//BN3_DOWN 0x40
//Default 0x06 = MOTION_WITH_BN1_DOWN | BN1_DOWN
mouse.event.mask = 0x06
//Enable (1 - default) or disable (0) checking of the state of Shift
//key when processing mouse events
//mouse.sense.shift = 1
//Enable (1 - default) or disable (0) reduction of file name in status line
//editor.file.name.reduce = 1
editor.statusline = "(%p%%) L%4r:C%2c CHR(%xh,%3dd) [%h:%m:%u:%t:%30f]%w%l"
// 0 - die with message box (default if not specified)
// 1 - die without messages, all changes are lost
// 2 - die with saving all changes
// 3 - ignore Ctrl-Break
editor.ctrlbreak.action = 2;
// 0 - DOS file format (CR/LF as a line separator) (default)
// 1 - Unix file format (CR as a line separator)
//editor.default.format = 0
//Obsolete
//editor.force.pm
// 0 - Use Extended Attributes (EA) to
// store position, hiliting, codepage, etc. (default)
// 1 - Do not use Extended Attributes
//editor.no.ea = 0
// 0 - bottom of the screen (default)
// 1 - top of the screen
//editor.statuspos = 0
// Tab width (default - 4)
//editor.tabwidth = 4
//editor.tabwidth = 8
//editor.verbose.search = 0
//Default state of word wrap and merge:
//Value Word wrap Merge
//0 off off
//1 on off
//2 off on
//3 on on
//editor.default.wordwrap.state = 2
//Default right margin.
//editor.default.wordwrap.margin = 78
//--------------------------------------------------------------
// Colors
//--------------------------------------------------------------
//Defaul colors
//color.edit.default = 0x08
//color.edit.selection = 0x70
//color.edit.eof = 0x1B
//color.edit.comment = 0x06
//color.edit.ident = 0x07
//color.edit.const = 0x0E
//color.edit.preproc = 0x0A
//color.edit.number = 0x0C
//color.edit.stdword = 0x0F
//color.edit.semicol = 0x09
//color.edit.function = 0x0F
//color.edit.xnumber = 0x0D
//NE-like set
//color.edit.default = 0x18
//color.edit.selection = 0x70
//color.edit.eof = 0x0B
//color.edit.comment = 0x16
//color.edit.ident = 0x17
//color.edit.const = 0x1E
//color.edit.preproc = 0x1A
//color.edit.number = 0x1C
//color.edit.stdword = 0x1F
//color.edit.semicol = 0x19
//color.edit.function = 0x1F
//color.edit.xnumber = 0x1D
//--------------------------------------------------------------
// Help message
//--------------------------------------------------------------
editor.helptext = "",
"FED key assignments:\n",
"FILE keys\n",
" F3 - open file\n",
" Alt+- - list open files\n",
" Alt+F3 - open new .Untitled\n",
" Gray + - next open file\n",
" Gray - - previous open file\n",
" F2 - save file\n",
" Alt+F2 - save file as ...\n",
" Alt+M - flip file type (DOS/Unix)\n",
" Alt+V - list of functions in file (JL 9)\n",
" Ctrl+F2 - command line prompt\n",
" Alt+F4 - close file\n",
" Esc - Exit\n",
"\n",
"EDIT keys\n",
" Alt+Bksp - undo\n",
" Alt+D - insert current date\n",
" Alt+L - convert to lower case\n",
" Alt+U - convert to upper case\n",
" Ctrl+D - duplicate line under cursor\n",
" Alt+H - switch hilighting mode\n",
" Ctrl+H - select hilighting mode\n",
" Alt+Point - put #ifndef ... (C/C++ header files)\n",
" Alt+Comma - put standard header for C/C++ file\n",
" Ctrl+C - set codepage\n",
" Ctrl+1 - set codepage to IBM-866\n",
" Ctrl+2 - set codepage to IBM-1251\n",
" Ctrl+3 - set codepage to IBM-878\n",
"\n",
"NAVIGATE keys\n",
" Arrow keys - move cursor one character\n",
" Home - line begin\n",
" End - line end\n",
" PgUp - screen up\n",
" PgDn - screen down\n",
" Ctrl+PgDn - file end\n",
" Ctrl+PgUp - file begin\n",
" Ctrl+Left - word left\n",
" Ctrl+Right - word right\n",
" Alt+J - go to column\n",
" Ctrl+J - go to line\n",
" Alt+Ctrl+0-9 - set anchor 0-9 at cursor position\n",
" Alt+0-9 - jump to anchor position 0-9\n",
" Shift+Tab - long tab\n",
" Alt+A - toggle Autoindent\n",
" Alt+] - indent\n",
" Alt+[ - unindent\n",
"\n",
"DELETE keys\n",
" Bksp - delete character left (backspace)\n",
" Shift+BkSp - Smart Backspace\n",
" Del - delete character right\n",
" Ctrl+Bksp - delete word left\n",
" Ctrl+T - delete word right\n",
" Ctrl+Y - delete line\n",
" Ctrl+E - delete to end of line\n",
"\n",
"MARK keys\n",
" Alt+S - flip block/stream marking\n",
" Alt+T - mark word at cursor\n",
" Shift+Arrow - mark in arrow direction\n",
" Shift+End - mark to end of line\n",
" Shift+Home - mark to begin of line\n",
" Shift+PgDn - scroll page down while marking\n",
" Shift+PgUp - scroll page up while marking\n",
" Ctrl+Shft+Left- word left with block mark\n",
" Ctrl+Shft+Rght- word right with block mark\n",
" Ctrl+Shft+PgUp- go to file end with block mark\n",
" Ctrl+Shft+PgDn- go to file begin with block mark\n",
" Ctrl+Ins - copy block to clipboard\n",
" Shift+Del - cut block to clipboard\n",
" Shift+Ins - paste block from clipboard\n",
" Shift+F3 - sort lines ascending using marked block as key\n",
"\n",
"SEARCH keys\n",
" Alt+F - search dialog\n",
" Ctrl+L - search again\n",
" Ctrl+Shift+L - search again with block mark\n",
" Alt+/ - match bracket\n",
" Alt+Shift+/ - match bracket with block mark\n",
"\n",
"MACRO keys\n",
" Alt+B - bind keys\n",
" F11 - start macro recording\n",
" F12 - end macro recording\n",
"\n",
"COMPILER keys\n",
" Alt+F9 - call IBM NMAKE and VisualAge C++ (JL 0)\n",
" Shift+F9 - open JumpList 0\n",
" Alt+F8 - call Borland make and Watcom C++ (JL 1)\n",
" Shift+F8 - open JumpList 1\n",
" Alt+F7 - call Jikes Java compiler (JL 2)\n",
" Shift+F7 - open JumpList 2\n",
" Alt+F5 - find references to function under cursor (JL 3)\n",
" Shift+F5 - open JumpList 3\n",
"\n",
"HELP keys\n",
" F1 - show Help screen\n",
" Ctrl+F1 - on-line Help for function under cursor\n",
" Alt+F1 - Copyright\n",
"\n"
//--------------------------------------------------------------
// Key bindings
//--------------------------------------------------------------
kbAltShiftDiv = MatchBracketMark
kbAltA = FlipAutoindent
kbAltBksp = Undo
kbAltDiv = MatchBracket
kbAltF = Search
kbAltF1 = Copyright
kbAltF2 = SaveAs
kbAltF3 = New
kbAltF4 = Close
kbAltH = FlipHiliting
kbAltJ = JumpCol
kbAltL = Lower
kbAltM = FlipType
kbAltLbracket = Unindent
kbAltMinus = FileList
kbAltRbracket = Indent
kbAltS = FlipBlockMode
kbAltU = Upper
kbBksp = Bksp
kbCtrlBksp = DelWordLeft
kbCtrlC = SetCp
kbCtrlD = DupLine
kbCtrlE = DelToEOL
kbCtrlH = HiliteSelect
kbCtrlIns = Copy
kbCtrlJ = JumpLine
kbCtrlL = SearchAgain
kbCtrlLeft = WordLeft
kbCtrlN = { rc = fedInsChar(fedGet('N')); return '';}
kbCtrlPgDown = FileEnd
kbCtrlPgUp = FileBegin
kbCtrlRight = WordRight
kbCtrlShiftL = SearchAgain
kbCtrlShiftLeft = WordLeftMark
kbCtrlShiftPgDown = FileEndMark
kbCtrlShiftPgUp = FileBeginMark
kbCtrlShiftRight = WordRightMark
kbCtrlT = DelWordRight
kbCtrlY = DelLine
kbDel = Del
kbDown = Down
kbEnd = End
kbEsc = Exit
kbF1 = HelpScreen
kbF2 = Save
kbF3 = Load
kbGrMinus = NextFile
kbGrPlus = PrevFile
kbHome = Home
kbIns = Ins
kbLeft = Left
kbPgDown = PgDn
kbPgUp = PgUp
kbRight = Right
kbShiftF3 = Sort
kbShiftDel = Cut
kbShiftDown = DownMark
kbShiftEnd = EndMark
kbShiftHome = HomeMark
kbShiftIns = Paste
kbShiftLeft = LeftMark
kbShiftPgDown = PgDnMark
kbShiftPgUp = PgUpMark
kbShiftRight = RightMark
kbShiftUp = UpMark
kbUp = Up
kbGrEnter = "\n"
kbAltD = InsDate
kbAltI = Home "#include <" End ".h>"
kbAltCtrl0 = MarkSet0
kbAltCtrl1 = MarkSet1
kbAltCtrl2 = MarkSet2
kbAltCtrl3 = MarkSet3
kbAltCtrl4 = MarkSet4
kbAltCtrl5 = MarkSet5
kbAltCtrl6 = MarkSet6
kbAltCtrl7 = MarkSet7
kbAltCtrl8 = MarkSet8
kbAltCtrl9 = MarkSet9
kbAlt0 = MarkGo0
kbAlt1 = MarkGo1
kbAlt2 = MarkGo2
kbAlt3 = MarkGo3
kbAlt4 = MarkGo4
kbAlt5 = MarkGo5
kbAlt6 = MarkGo6
kbAlt7 = MarkGo7
kbAlt8 = MarkGo8
kbAlt9 = MarkGo9
kbAltComma = FileBegin ,
Home "\n" Up,
"/*\n",
"** Module :" InsFileNameShort "\n",
"** Abstract :\n",
"**\n",
"** Copyright (C) Sergey I. Yevtushenko\n",
"**\n",
"** Log: " InsDate "\tCreated\n",
"**\n",
"*/\n"
kbAltPoint = Home "\n" Up,
"#ifndef __" InsFileNameShort WordLeft BkSp "_" End "\n",
"#define __" InsFileNameShort WordLeft BkSp "_" End "\n",
FileEnd End "\n" End,
"#endif /*__" InsFileNameShort WordLeft BkSp "_" End "*/\n",
Up Up End
kbAltQuote = Home "\n" Up,
"//-----------------------------------------\n",
"//\n",
"//-----------------------------------------\n",
Up Up End " "
kbF11 = MacroRecStart
kbF12 = MacroRecEnd
//
// REXX Macro functions
// Copyright (C) 1998 Vit Timchishin
// Copyright (C) 1999,2000 Sergey I. Yevtushenko
//
kbAltT = { /* Mark word */
lastpos = 0
row=fedGet('r')
col=fedGet('c')
do ncol=col to 1 by -1
if fedGetChar(row,ncol,1)=' '
then leave;
end
do while fedGetChar(row,col,1)<>'00'x
if fedGetChar(row,col,1)=' '
then leave;
col=col+1
end
ncol=ncol+1
if ncol < col
then do
call fedSet 'C', ncol /* Goto to start of word */
call fedSet 'M', 0 /* unmark */
do while ncol < col
call fedRightMark
ncol=ncol+1
end
end
return ''
}
kbShiftTab = { /* Long tab */
if fedget('row')<>1 then
do
col=fedget('c');
row=fedget('row');
do while fedgetchar(row-1,col,1)=' ' &,
fedgetchar(row-1,col,1)<>'0'x
col=col+1
end
if fedgetchar(row-1,col,1)='0'x
then return '';
call fedset 'col',col
end
return ''
}
kbShiftBkSp = { /* Smart back space */
col=fedget('c')
do row=fedget('row')-1 to 1 by -1
if fedgetchar(row,col-1,1)<>' ' then
do cl=col-1 to 1 by -1
if fedgetchar(row,cl,1)=' ' then
do
call fedset 'col',cl+1
return 0
end
end
call fedset 'col',1
end
return 0;
}
kbShiftF7 = {
fedOpenJumpList(2);
return '';
}
kbAltF7 = { /* Jikes Java compiler */
/* Using JumpList 2 */
address cmd
rc = fedSaveAll()
'nmake | rxqueue'
lst.jump_len=0
i=0
do while queued() > 0
parse pull str
parse value str with fname':'l1':'c1':'l2':'c2':'msg
if strip(fname)='' | l1='' | c1='' | l2='' | c2=''
then iterate;
if msg=''
then do
parse pull msg
msg=strip(msg)
end
lst.i.jump_header='('l1':'c1'):'msg
lst.i.jump_file=fname
lst.i.jump_row=l1
lst.i.jump_col=c1
i=i+1
end
lst.jump_len=i
rc = fedFillJumpList('lst',2);
rc = fedOpenJumpList(2);
return '';
}
kbShiftF8 = {
fedOpenJumpList(1);
return '';
}
kbAltF8 = { /* Borland make and Watcom C++ compiler */
/* Using JumpList 1 */
address cmd
rc = fedSaveAll()
'bmake | rxqueue'
lst.jump_len=0
i=0
do while queued() > 0
parse pull str
parse value str with fname'): 'msg
if strip(fname)='' | strip(msg)=''
then iterate;
parse value str with fname'('arow'):'txt': col('acol')'rest
lst.i.jump_header=str
lst.i.jump_file=fname
lst.i.jump_row=arow
lst.i.jump_col=strip(acol)
i=i+1
end
lst.jump_len=i
rc = fedFillJumpList('lst',1);
rc = fedOpenJumpList(1);
return '';
}
kbShiftF9 = {
fedOpenJumpList(0);
return '';
}
kbAltF9 = { /* IBM's NMAKE and Visual Age C++ compiler */
/* Using JumpList 0 */
address cmd
rc = fedSaveAll()
'nmake | rxqueue'
lst.jump_len=0
i=0
do while queued() > 0
parse pull str
parse value str with fname' : 'msg
if strip(fname)='' | strip(msg)=''
then iterate;
parse value fname with fname'('arow':'acol')'rest
lst.i.jump_header=str
lst.i.jump_file=fname
lst.i.jump_row=arow
lst.i.jump_col=acol
i=i+1
end
lst.jump_len=i
rc = fedFillJumpList('lst',0);
rc = fedOpenJumpList(0);
return '';
}
kbAltF10 = { /* Contributed by Max Alekseyev relf@os2.ru */
/* GNU MAKE */
/* Using JumpList 2 */
address cmd
rc = fedSaveAll()
'make 2>&1 | rxqueue'
lst.jump_len=0
i=0
do while queued() > 0
parse pull str
parse value str with fname':'arow':' msg
if strip(fname)='' | strip(msg)=''
then iterate;
lst.i.jump_header=str
lst.i.jump_file=fname
lst.i.jump_row=arow
lst.i.jump_col=1
i=i+1
end
lst.jump_len=i
rc = fedFillJumpList('lst',2);
rc = fedOpenJumpList(2);
return '';
}
kbAltV = {
/* List of functions in file */
/* Using JumpList 9 */
fname=fedGet('Name');
lst.jump_len=0
i=0
do j = 1 to fedGet('Last')
str=fedGetChar(j)
chr=translate(left(str, 1))
if chr<'A' | chr > 'Z' | length(strip(str)) < 3
then iterate;
chr=translate(right(strip(str), 1))
if chr=';' | chr='=' | chr='{' | chr=']'
then iterate
lst.i.jump_header=str
lst.i.jump_file=fname
lst.i.jump_row=j
lst.i.jump_col=1
i=i+1
end
lst.jump_len=i
rc = fedFillJumpList('lst',9)
rc = fedOpenJumpList(9)
return '';
}
kbInit = { /* load additional keys if current directory
* matches specified criteria
*/
roots='C:\DEV\ C:\WORK\ '
curdir=translate(fedGet('Dir'))
do i = 1 to words(roots)
root=word(roots,i)
dir=left(curdir, length(root))
if left(curdir, length(root)) = root then
do
/* bind additional keys */
file=root'FED.INI'
rc=fedBind(file)
end
end
/* Set some defaults */
rc= fedVarSet('word.wrap', 0);
return '';
}
kbDone = { /* do nothing */
return '';
}
kbAltB = { /* Reload profile (for example key bindings) from current buffer */
call fedBind
call fedMsgBox " Profile reload complete ", 400
return ''
}
kbAltQ = { rc = fedSet('P', 'IBM-866' ); return '';}
kbAltW = { rc = fedSet('P', 'IBM-1251'); return '';}
kbAltE = { rc = fedSet('P', 'IBM-878' ); return '';}
kbCtrlF1 = {/* On-line help for function under cursor */
address cmd
col = fedget(c)
books=value('CPREF',,'OS2ENVIRONMENT')||'+'||value('PMREF',,'OS2ENVIRONMENT')
a = translate(fedgetchar(fedget(row)),,
' ',,
'~:@#$%^&*()-=+/?.><,\|"`'||"'")
do i = 1 to words(a)
pos = wordindex(a, i)
sz = wordlength(a, i)
if pos <= col & (pos+sz) >= col
then do
'@view 'books word(a,i)
leave
end
end
return '';
}
kbCtrlF2 = { /* command-line prompt */
address cmd
a = fedInput("Command")
if a <> '' then
'@'a' 2>&1 | clip '
return '';
}
kbCtrlF3 = { /* convert marked hex dump into string */
address cmd
rc = parse value str with lt'>'rt
str=lt'>'rt
end
rc = fedSetClip(str);
return '';
}
/* Some HTML tags. Note that marked text is inserted inside tags */
kbCtrlQ = {
str = fedGetClip()
rc = fedCut()
rc = fedInsChar("<b></b>")
do 4
rc = fedLeft()
end
rc = fedPaste();
rc = fedSetClip(str)
return '';
}
kbCtrlA = {
str = fedGetClip()
rc = fedCut()
rc = fedInsChar("<td></td>")
do 5
rc = fedLeft()
end
rc = fedPaste();
rc = fedSetClip(str)
return '';
}
kbCtrlZ = {
str = fedGetClip()
rc = fedCut()
rc = fedInsChar("<tr></tr>")
do 5
rc = fedLeft()
end
rc = fedPaste();
rc = fedSetClip(str)
return '';
}
kbOpen = { /* Switch word wrapping depending on the file extension */
ext_list = 'MSG TXT DOC'
file = fedGet('Name')
dot = lastpos('.', file)
if dot = 0 then
return ''
ext = translate(substr(file, dot+1))
if wordpos(ext, ext_list) > 0 then
call fedSet 'WS', 1
else
call fedSet 'WS', 0
return ''
}
kbCtrlW = { /* Switch word wrapping manually */
call fedSet 'WS', 1 - fedGet('WS')
if fedGet('WS') = 0 then
ww = 'off'
else
ww = 'on'
/* uncomment line below if you wish to switch merge
state together with wprd wrap state */
/* call fedSet 'WM', fedGet('WS') */
call fedMsgBox "Word wrap is "ww, 300
}
kbCtrlM = { /* Set right margin for word wrap */
a = fedInput("Right margin")
call fedMsgBox "a = "a||" ("verify(a,'0123456789')")", 800
if verify(a,'0123456789') = 0 then
if a > 0 & a < 256 then /* resonable bounds */
call fedSet 'WW', a
}