// STARTUP.VDM - Startup macro for VEDIT PLUS 5.10 and VEDIT 5.10. // // NOTE: A copy of this file is supplied as STARTUP.ORG so that you // can easily refer to the original file. // // This startup macro (as supplied) performs these functions: // // * Set up syntax highlighting and template editing. // * Optionally enable file-type configuration; e.g. syntax highlighting. // * Set up the {USER} menu with your own custom editing functions. // * Set up the {TOOL} menu with the {Tutorial} menu. // * Optionally add keystroke macros to the keyboard layout. // * Set up hot-key to open the file "mynotes.txt" for editing. // * Optionally enable the "hot-key" for ctags lookup support. // * Optionally force any desired configuration settings. // * Set up the filetype specific configuration which auto-configures // VEDIT according to the filename extension of each file opened. // * Any desired startup commands can be added to this file. // // Many functions performed by STARTUP.VDM are optional - you must edit // this file to enable the function. Typically, you only need to delete // some "// " to enable the function. // // Windows: See the on-line help topics "STARTUP.VDM File", "Color // Syntax Highlighting", "Template Editing", "{USER} Menu" // and "Configuration" for more information about this file. // // DOS: See the on-line help topics "STARTUP", "SYNHI", "USER" and // "CONFIGURATION" for more information about STARTUP.VDM. // // //------- Setup Color Syntax Highlighting and Template Editing --------------- // // Language specific syntax highlighting and template editing is setup // here. The following commands support C or HTML editing. // // Load the desired syntax highlighting file. The default C.SYN supports C. // Currently, only one .SYN file can be loaded at a time. // // >>> To enable syntax highlighting for HTML, instead of C, follow these steps: // 1. Disable the following `Syntax_Load("c.syn")` command by preceding it // with "//". // 2. Enable the following `Syntax_Load("html.syn")` command by removing the // preceding "//". // 3. Search for "Config(PG_E_SYNTAX,1,LOCAL)" below in the file-type // specific configuration section corresponding to .C files. // Disable the command by preceding it with "//". // 3. Search for "Config(PG_E_SYNTAX,1,LOCAL)" below for .HTML files. // Enable the command by removing the preceding "//". // //Syntax_Load("c.syn") // Setup syntax highlighting for C // Syntax_Load("html.syn") // -OR- Setup syntax highlighting for HTML Syntax_Load("tex.syn") // Setup syntax highlighting for TEX // // Load the desired template editing file. The default VEDIT.VTM supports // both C and HTML template editing. // Reg_Load(115,"vedit.vtm",EXTRA) // // If desired, un-comment the following command to enable file-type // auto-configuration, overriding any setting in the VEDIT.CFG file. // Config(PG_F_AUTO_CFG,1+2+4) //Enable file-type configuration; values are: // // 1 - Enable filename specific configuration // // +2 - Enable template editing // // +4 - Enable color syntax highlighting // // The following two commands ensure that template editing and syntax // highlighting are OFF by default. They should only be enabled by the // file-type specific configuration. // Config(PG_TEMPLAT,0) // Default is template editing disabled Config(PG_E_SYNTAX,0) // Default is syntax highlighting disabled //------- Load the {USER} menu ----------------------------------------------- // // The following command adds the {USER} menu to the main menu. // By default, USER.MNU contains some of the macros listed in Appendix E // (Application Notes). You can place your own custom editing functions // in the {USER} menu by modifying the USER.MNU file or by loading a // different file. See the on-line help topic "{USER} and {TOOL} menus". // Reg_Load(124,"user.mnu",EXTRA+NOERR) Config_String(USER_MENU,"&User") //------- Load the {Tutorial} or a custom {TOOL} menu ------------------------ // // The following command sets up the {TOOL} menu as the {Tutorial} menu. // Alternatively, you could load your own custom {TOOL} menu, similar // to the {USER} menu. If you don't want a {Tutorial} menu, disable the // following three commands by preceding each one with "//". // Reg_Load(123,"tutor.mnu",EXTRA+NOERR) if (OS_Type==1) { Config_String(TOOL_MENU,"&Tutorial") } else { Config_String(TOOL_MENU,"&Tutor") } //-------- Setup any desired keystroke macros. (Override VEDIT.KEY) ---------- // // Key_Add() commands can set up any desired keystroke macros. Note that // these commands will override the layout auto-loaded from VEDIT.KEY. // // To enable any function, delete the "// " preceding the Key_Add command. // // The following example commands perform these functions: // is assigned to toggle {CONFIG, Programming, Lower/Upper case // key conversion}. Useful for assembly language programming. // // Key_Add("Numpad/","[VISUAL EXIT] if(CF(PG_CASE_CONV)==0){CF(PG_CASE_CONV,2)}else{CF(PG_CASE_CONV,0)}",OK) // is assigned as an alternative to [VISUAL EXIT]. Useful // with WILDFILE macro. Highly recommended! // // Key_Add("Numpad.Enter","[VISUAL EXIT]",OK) // is assigned to run our V-SPELL spelling corrector. // // Key_Add("Ctrl-F11",'[VISUAL EXIT] Reg_Set(102,PATHNAME) File_Close() Sys("vs |@(102)",DOS+MAX) File_Open(@102)',OK) // is assigned to configure VEDIT to a xBase ".DBF" file. // // Key_Add("Alt-F12",'[MENU]MMB',OK) // is assigned to a "ctags" lookup of the current symbol. // (See on-line help topic "CTAGS" for more information) // // Key_Add("F12",'[MENU]MMU',OK) // Alt-0 runs a macro which opens MYNOTES.TXT for editing personal notes. // This useful hot-key is enabled by default. // Key_Add("Alt-0",'[MENU]MMY',OK) // //Kontextsensitive Hilfe fr Macro-Befehle: Key_Add("Ctrl-F1", '[VISUAL EXIT] SPOS() if (S("|S",REVERSE+ADVANCE+NOERR)==0) {BOL} #101=CP if (S("|S",NOERR)==0) {EoL} RCB(101,#101,CP) RPos() H(@101) RE(101)', INSERT+NOCONFIRM) // //------- Force any desired configuration. (Override VEDIT.CFG) -------------- // // You can use Config() commands to force any desired configuration // settings. Note that these commands will override the configuration // auto-loaded from VEDIT.CFG. // //------- Configure Safety Features: // // Config(F_AUTO_SAVE,15) // Set file auto-save interval to 15 minutes // Config(F_BACKUP_MODE,2) // Save backup files in a directory // Config_String(BACKUP,"C:\BACKUP") // Set backup directory // //------- Configure your Keyboard: // // Config(E_INS_MODE,0) // Startup in Overstrike mode; default is Insert mode // // Note: This setting is not saved in VEDIT.CFG; // // force the desired setting here. // Config(E_SHIFT_MODE,15) // Enable all Alt/Ctrl/Shift key shortcuts, // // including as [ERASE LINE] // // The keyboard "NumLock" can be turned off when VEDIT starts up. // Currently only works for 16-bit Windows and DOS. // if (! Is_Win32) { Sys_Poke(0x417,Sys_Peek(0x417)&0xDF) } //Turn off NumLock // //------- Configure your Printer: // // Config(P_PAPER_L,66) // Set DOS printer paper length to 66 lines // // Note: Windows version is automatic // Config(P_LEFT_MARG,5) // Set printer left margin to 5 // Config(P_RIGHT_MARG,78) // Set printer right margin to 78 // //------- Configure Word Processing: // Config_String(PARA_SEP,".!%") // Lines starting with ".", "!", "\" separate // // paragraphs, in addition to blank lines // // Default is ".@!\" // Config(W_FORMAT_O,4) // Set format-paragraph options // // Note: Enabling the following Config() commands may interfere with any // File-type specific configuration. // // Config(W_WORD_WRAP,1) // Enable word wrap // Config(W_RT_MARG,78) // Set wordprocessing right margin to 78 // Config(W_LF_MARG,0) // Set wordprocessing left margin to 0 // //------- DOS Version Specific Configuration: // // Config(H_POLL_MODE,1) // Disable DOS version keyboard polling; default set during installation // // Note: This setting is not saved in VEDIT.CFG; // // force the desired setting here. // Config(S_STAT_OPT,1) // Put status line on top // Config(H_VGA_TYPE,7) // Enable {MISC, VGA toggle} to also toggle // // into 30, 34 and 60 lines modes // Config(U_E_DIALOG,0) // Use "Terse" instead of "Full" dialog boxes // //------- Set how VEDIT configures itself: // // Config(U_AUTO_CFG,0) // Disable {CONFIG, Auto-save config} // Config(U_CFG_ALL,0) // Disable {CONFIG, All Buffers} // //------- Misc. Config() commands: // // Config(WIN_AUTO_CRE,1) // Create full-sized windows // Config(S_H_CR_LINE,1) // Highlight entire cursor line // //------- File-type specific configuration ----------------------------------- // // The "File-Open" event macro in T-Reg 110 is used to set configuration // parameters according to the filename extension. // It must be enabled with {CONFIG, Programming, File open/close auto- // configuration} or with the Config(PG_F_AUTO_CFG) command above. // Reg_Set(110,`//File-Open event macro #109=Buf_Num Out_Reg(109) Name_Write(NOMSG+NOCR) Out_Reg(0) Buf_Switch(36) Buf_Empty(OK) Reg_Ins(109) // // Test if this is a ".C", ".CPP" or ".H" file... // BOF() if ( Search(".c|>",NOERR)==1 || Search(".cpp|>",NOERR)==1 || Search(".h|>",NOERR)==1 ) { Buf_Switch(#109) Config(PG_AUTO_IND,1,LOCAL) Config(PG_IND_INC,4,LOCAL) Config(PG_CASE_CONV,0,LOCAL) Config(W_LF_MARG,0,LOCAL) Config(W_WORD_WRAP,0,LOCAL) Config_Tab(8;LOCAL) //Set tabs stops to every 8 Config(CM_USER_P,1,LOCAL) //Set template editing ID for C if (Config(PG_F_AUTO_CFG)&2) { Config(PG_TEMPLAT,1,LOCAL) //Enable template editing for C } if (Config(PG_F_AUTO_CFG)&4) { // Config(PG_E_SYNTAX,1,LOCAL) //Enable syntax highlighting for C } Goto ENDMACRO } // // Test if this is an ".HTML", ".HTM" or ".HTL" file... // BOF() if ( Search(".html|>",NOERR)==1 || Search(".htm|>",NOERR)==1 || Search(".htl|>",NOERR)==1 ) { Buf_Switch(#109) Config(PG_AUTO_IND,0,LOCAL) Config(PG_IND_INC,4,LOCAL) Config(PG_CASE_CONV,0,LOCAL) Config(W_LF_MARG,0,LOCAL) Config(W_WORD_WRAP,0,LOCAL) Config_Tab(8;LOCAL) //Set tabs stops to every 8 Config(CM_USER_P,2,LOCAL) //Set template editing ID for HTML if (Config(PG_F_AUTO_CFG)&2) { Config(PG_TEMPLAT,1,LOCAL) //Enable template editing for HTML } if (Config(PG_F_AUTO_CFG)&4) { // Config(PG_E_SYNTAX,1,LOCAL) //Enable syntax highlighting for HTML } Goto ENDMACRO } // // Test if this is an ".ASM" or ".EXT" file... // BOF() if ( Search(".asm|>",NOERR)==1 || Search(".ext|>",NOERR)==1 ) { Buf_Switch(#109) Config(PG_AUTO_IND,0,LOCAL) Config(PG_IND_INC,8,LOCAL) Config(PG_CASE_CONV,2,LOCAL) Config(PG_CONV_C,59,LOCAL) Config(W_LF_MARG,0,LOCAL) Config(W_WORD_WRAP,0,LOCAL) Config_Tab(8;LOCAL) //Set tabs stops to every 8 Goto ENDMACRO } // // Test if this is a ".TXT" word processing file... // BOF() if ( Search(".txt|>",NOERR)==1 || Search(".hlp|>",NOERR)==1 ) { Buf_Switch(#109) Config(PG_AUTO_IND,1,LOCAL) Config(PG_IND_INC,4,LOCAL) Config(W_WORD_WRAP,1,LOCAL) //Enable word wrap //Config(W_RT_MARG,70,LOCAL) //Set right margin to 70 Config(W_LF_MARG,0,LOCAL) Config_Tab(8;LOCAL) //Set tabs stops to every 8 Goto ENDMACRO } // // Test if this is a ".TEX" word processing file... // BOF() if ( Search(".tex|>",NOERR)==1 ) { Buf_Switch(#109) Config(PG_AUTO_IND,1,LOCAL) Config(PG_IND_INC,4,LOCAL) Config(W_WORD_WRAP,1,LOCAL) //Enable word wrap Config(W_RT_MARG,70,LOCAL) //Set right margin to 70 Config(W_LF_MARG,0,LOCAL) Config_Tab(8;LOCAL) //Set tabs stops to every 8 Config(PG_E_SYNTAX,1,LOCAL) //Enable syntax highlighting for TEX Key_add("F11","[Visual exit] callf(100,/texcmds.vdm/)") Key_add("F12","[Visual exit] callf(121,/texenv.vdm/)") Goto ENDMACRO } // Additional tests for other filename extensions can be added here... // //... //... // // // Finish up the File-Open event macro. // :ENDMACRO: Buf_Switch(36) Buf_Quit(OK) Buf_Switch(#109) `) //The end of the "Reg_Set(110..." command above // //------- Any additional startup commands can be place here ------------------ // // // // DON'T PUT ANY COMMANDS AFTER Reg_Empty() BECAUSE THEY WON'T BE EXECUTED !! // Reg_Empty(100,EXTRA) // Empty this macro (Must be last command!)