├── .gitignore ├── Announce-2.2_1 ├── BUGS ├── COPYING ├── INSTALL ├── Makefile.in ├── README.html ├── README.md ├── alias.c ├── autocmd.c ├── autocmd.h ├── buffer.c ├── buffer.h ├── buffer2.h ├── calc.c ├── calc.h ├── color.c ├── color.h ├── configure ├── ctags.c ├── ctypetbl.h ├── cut.c ├── cut.h ├── data ├── elvgdb.ini ├── elvis.ali ├── elvis.arf ├── elvis.awf ├── elvis.brf ├── elvis.bro ├── elvis.bwf ├── elvis.clr ├── elvis.ini ├── elvis.lat ├── elvis.msg ├── elvis.pc8 ├── elvis.ps ├── elvis.rc ├── elvis.spe ├── elvis.syn ├── elvis.x11 ├── icons │ ├── elvis.xpm │ ├── elvis1.xpm │ ├── elvis2.xpm │ ├── elvis3.xpm │ ├── kde.xpm │ ├── mini.xpm │ ├── normal.xpm │ ├── presley.xpm │ ├── small.xpm │ └── vi.xpm ├── scripts │ ├── align.ex │ ├── cb.ex │ ├── cursor.ex │ ├── decode.ex │ ├── define.ex │ ├── dict.ex │ ├── ellipse.ex │ ├── find.ex │ ├── fontsize.ex │ ├── gdb.ex │ ├── gzip.ex │ ├── herefile.ex │ ├── html.ex │ ├── info.ex │ ├── info2.ex │ ├── inregion.ex │ ├── isearch.ex │ ├── life.ex │ ├── likevim.ex │ ├── mail.ex │ ├── mailto.ex │ ├── makehtml.ex │ ├── match.ex │ ├── note.ex │ ├── pig.ex │ ├── reverse.ex │ ├── rot13.ex │ ├── sfb.ex │ ├── shade.ex │ ├── show.ex │ ├── shuffle.ex │ ├── since.ex │ ├── tags.ex │ ├── wc.ex │ ├── whois.ex │ └── xbuf.ex ├── stubs │ ├── ansistub.c │ ├── gdkstub.c │ ├── glibstub.c │ ├── gtkstub.c │ ├── pthread.c │ ├── unixstub.c │ ├── xftstub.c │ ├── xlibstub.c │ └── xpmstub.c └── themes │ ├── sand.ex │ └── sand.xpm ├── debian ├── NEWS ├── changelog ├── compat ├── control ├── copyright ├── elvis-common.README.Debian ├── elvis-common.dirs ├── elvis-common.doc-base ├── elvis-common.docs ├── elvis-common.examples ├── elvis-common.install ├── elvis-common.links ├── elvis-common.menu ├── elvis-console.dirs ├── elvis-console.install ├── elvis-console.links ├── elvis-console.postinst ├── elvis-console.prerm ├── elvis-tools.dirs ├── elvis-tools.install ├── elvis-tools.links ├── elvis-tools.postinst ├── elvis-tools.prerm ├── elvis.dirs ├── elvis.install ├── elvis.links ├── elvis.postinst ├── elvis.preinst ├── elvis.prerm ├── elvis_32x32.xpm ├── elvisnox ├── lintian │ ├── elvis │ ├── elvis-console │ └── elvis-tools ├── patches │ ├── APPLY │ ├── disable-instman │ ├── doc-man-location │ ├── ft2-nameclash-fix │ ├── getline │ ├── make-rm-elvfmtman │ ├── printdoc-debian │ └── series ├── rules └── watch ├── descr.c ├── descr.h ├── digraph.c ├── digraph.h ├── display.c ├── display.h ├── display2.h ├── dmhex.c ├── dmmarkup.c ├── dmnormal.c ├── dmsyntax.c ├── doc ├── bugs.txt ├── ctags.man ├── doexec.txt ├── elvgdb.man ├── elvis.html ├── elvis.man ├── elviscut.html ├── elvisdm.html ├── elvisex.html ├── elvisexp.html ├── elvisgui.html ├── elvisinp.html ├── elvismsg.html ├── elvisnet.html ├── elvisopt.html ├── elvisos.html ├── elvisqr.html ├── elvisre.html ├── elvisses.html ├── elvistag.html ├── elvistip.html ├── elvistrs.msg ├── elvisvi.html ├── elvtags.man ├── fmt.man ├── howto.html ├── license.html ├── printdoc.bat └── ref.man ├── draw.c ├── draw.h ├── draw2.h ├── e2 ├── elvctype.h ├── elvdump.c ├── elvgdb.c ├── elvis.h ├── elvis.lsm ├── elvis.spec.in ├── elvisio.h ├── event.c ├── event.h ├── ex.c ├── ex.h ├── exaction.c ├── exconfig.c ├── exedit.c ├── exmake.c ├── exsubst.c ├── fmt.c ├── fold.c ├── fold.h ├── ftp.c ├── gui.c ├── gui.h ├── gui2.h ├── guicurs.c ├── guiopen.c ├── guitcap.c ├── guiwin32 ├── WinElvis.rc ├── WinTags.rc ├── arrow.cur ├── cursor1.cur ├── elvis.ico ├── elvisres.h ├── foo ├── guiwin.c ├── gwcmd.c ├── gwdlgs.c ├── gwimage.c ├── gwmsg.c ├── gwopts.c ├── gwprint.c ├── gwstatb.c ├── gwtoolb.c ├── gwutil.c ├── toolbar.bmp ├── winelvis.c ├── winelvis.h ├── winelvis.manifest ├── wintags.c ├── wintags.h ├── wintools.c └── wintools.h ├── guix11 ├── Elvis.kdelnk ├── elvis.xbm ├── elvispin.xbm ├── foo.xbm ├── gray.xbm ├── guix11.c ├── guix11.h ├── tags ├── xclip.c ├── xclip.h ├── xdialog.c ├── xdialog.h ├── xevent.c ├── xevent.h ├── xmisc.c ├── xmisc.h ├── xscroll.c ├── xscroll.h ├── xstatus.c ├── xstatus.h ├── xtext.c ├── xtext.h ├── xtool.c └── xtool.h ├── http.c ├── input.c ├── input.h ├── instman.sh ├── io.c ├── lowbuf.c ├── lowbuf.h ├── lp.c ├── lp.h ├── lpescape.c ├── lpovrtyp.c ├── lpps.c ├── main.c ├── makmsdos.bat ├── makos2.cmd ├── makwin32.bat ├── map.c ├── map.h ├── mark.c ├── mark.h ├── message.c ├── message.h ├── message2.h ├── misc.c ├── misc.h ├── more.c ├── more.h ├── move.c ├── move.h ├── need.c ├── need.h ├── operator.c ├── operator.h ├── opsys.h ├── optglob.c ├── optglob.h ├── options.c ├── options.h ├── options2.h ├── osmsdos ├── ctags.mak ├── doexec.h ├── doexec.lib ├── elvis.mak ├── fmt.mak ├── mouse.c ├── mouse.h ├── osblock.c ├── osconfig.h ├── osdef.h ├── osdir.c ├── osprg.c ├── ostext.c ├── pcvideo.h ├── ref.mak ├── tcaphelp.c └── vi.mak ├── osos2 ├── Elvis1.ICO ├── Elvis2.ICO ├── Makefile.os2 ├── config-no-tcp.h ├── config-with-tcp.h ├── debug.c ├── debug.h ├── elvis.def ├── guivio.c ├── guivio.h ├── manual-scripts │ ├── ctags.man.ed │ ├── elvis.ali.ed │ ├── elvis.html.ed │ ├── elvis.ini.ed │ ├── elvis.ipf.ed │ ├── elvis.man.ed │ ├── elvis.syn.ed │ ├── elvismsg.html.ed │ ├── elvistrs.msg.ed │ ├── fixhtml.cmd │ ├── fmt.man.ed │ ├── h2i-guide.cmd │ ├── others.html.ed │ └── ref.man.ed ├── osblock.c ├── osdef.h ├── osdir.c ├── osnet.c ├── osprg.c ├── ostext.c └── tcaphelp.c ├── osunix ├── osblock.c ├── osdef.h ├── osdir.c ├── osnet.c ├── osprg.c ├── ostext.c ├── tcapbsd.h ├── tcaphelp.c ├── tcaposix.h └── tcapsysv.h ├── oswin32 ├── elvis.mak ├── elvisutl.mak ├── ls.c ├── osblock.c ├── osconfig.h ├── osdef.h ├── osdir.c ├── osnet.c ├── osprg.c ├── ostext.c ├── tcaphelp.c ├── winelvis.mak └── wintags.mak ├── ref.c ├── regexp.c ├── regexp.h ├── region.c ├── region.h ├── regsub.c ├── safe.c ├── safe.h ├── scan.c ├── scan.h ├── screen.h ├── search.c ├── session.c ├── session.h ├── spell.c ├── spell.h ├── state.c ├── state.h ├── state2.h ├── tag.c ├── tag.h ├── tagelvis.c ├── tagelvis.h ├── tagsrch.c ├── tagsrch.h ├── tinytcap.c ├── url.c ├── verify.c ├── version.h ├── vi.c ├── vi.h ├── vicmd.c ├── vicmd.h ├── window.c └── window.h /.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.o 3 | config.h 4 | config.stat 5 | ctags 6 | doc/elvfmt.man 7 | elvfmt 8 | elvis 9 | elvgdb 10 | elvtags 11 | fmt 12 | ref 13 | elvis*.rpm 14 | elvis*.tar.gz 15 | -------------------------------------------------------------------------------- /BUGS: -------------------------------------------------------------------------------- 1 | The bugs list has been moved to doc/bugs.txt 2 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Elvis 2.2 Copyright 2003 by Steve Kirkendall 2 | 3 | Elvis 2.2 is copyrighted freeware. It is provided in the hope that it will 4 | be useful, but with no warranty. 5 | 6 | Elvis is distributed under the terms of the "Clarified Artistic License." 7 | This is the same license under which PERL is distributed. A copy of this 8 | license is available in the "doc/license.html" file. 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # elvis 2 | 3 | This is a thirdparty github repo for the elvis text editor originally written 4 | by Steve Kirkendall and published on ftp://ftp.cs.pdx.edu/pub/elvis/ 5 | 6 | Its main purpose is preserving the source code of the various historic Elvis 7 | releases and collect bugfixes to the last version (2.2_1). 8 | 9 | The elvis documentation can be found 10 | [here](http://htmlpreview.github.io/?https://github.com/mbert/elvis/blob/master/README.html). 11 | 12 | There is also an [unofficial home page](http://elvis.the-little-red-haired-girl.org). 13 | -------------------------------------------------------------------------------- /autocmd.h: -------------------------------------------------------------------------------- 1 | /* autocmd.h */ 2 | 3 | #ifdef FEATURE_AUTOCMD 4 | 5 | /* The following symbolic constants may be passed to auperform() to trigger 6 | * auto-commands. The values here correspond to indicies into the nametbl[] 7 | * array in autocmd.c -- if you change one, then you should change the other 8 | * to keep them in sync. 9 | */ 10 | typedef enum { 11 | AU_ALL_EVENTS = 0, 12 | AU_NONOPTION_EVENTS, 13 | AU_BUFCREATE, 14 | AU_BUFDELETE, 15 | AU_BUFENTER, 16 | AU_BUFFILEPOST, 17 | AU_BUFFILEPRE, 18 | AU_BUFHIDDEN, 19 | AU_BUFLEAVE, 20 | AU_BUFNEWFILE, 21 | AU_BUFREAD, /* same as AU_BUFREADPOST */ 22 | AU_BUFREADPOST, 23 | AU_BUFREADPRE, 24 | AU_BUFUNLOAD, 25 | AU_BUFWRITE, /* same as AU_BUFWRITEPRE */ 26 | AU_BUFWRITEPOST, 27 | AU_BUFWRITEPRE, 28 | AU_FILEAPPENDPOST, 29 | AU_FILEAPPENDPRE, 30 | AU_FILECHANGEDSHELL, 31 | AU_FILEREADPOST, 32 | AU_FILEREADPRE, 33 | AU_FILEWRITEPOST, 34 | AU_FILEWRITEPRE, 35 | AU_FILTERREADPOST, 36 | AU_FILTERREADPRE, 37 | AU_FILTERWRITEPOST, 38 | AU_FILTERWRITEPRE, 39 | AU_STDINREADPOST, 40 | AU_STDINREADPRE, 41 | AU_ALIASENTER, 42 | AU_ALIASLEAVE, 43 | AU_BGCHANGED, 44 | AU_CURSORHOLD, 45 | AU_DISPLAYENTER, 46 | AU_DISPLAYLEAVE, 47 | AU_DISPMAPENTER, 48 | AU_DISPMAPLEAVE, 49 | AU_EDIT, 50 | AU_FILEENCODING, 51 | AU_FILETYPE, 52 | AU_FOCUSGAINED, 53 | AU_FOCUSLOST, 54 | AU_GUIENTER, 55 | AU_OPTCHANGED, 56 | AU_OPTSET, 57 | AU_SCRIPTENTER, 58 | AU_SCRIPTLEAVE, 59 | AU_SYNTAX, 60 | AU_TERMCHANGED, 61 | AU_USER, 62 | AU_VIMENTER, 63 | AU_VIMLEAVE, 64 | AU_VIMLEAVEPRE, 65 | AU_WINENTER, 66 | AU_WINLEAVE, 67 | AU_USER01, 68 | AU_USER02, 69 | AU_USER03, 70 | AU_USER04, 71 | AU_USER05, 72 | AU_USER06, 73 | AU_USER07, 74 | AU_USER08, 75 | AU_USER09, 76 | AU_USER10, 77 | AU_USER11, 78 | AU_USER12, 79 | AU_USER13, 80 | AU_USER14, 81 | AU_USER15, 82 | AU_USER16, 83 | AU_USER17, 84 | AU_USER18, 85 | AU_USER19, 86 | AU_USER20, 87 | AU_USER21, 88 | AU_USER22, 89 | AU_USER23, 90 | AU_USER24, 91 | AU_USER25, 92 | AU_USER26, 93 | AU_USER27, 94 | AU_USER28, 95 | AU_USER29, 96 | AU_USER30, 97 | AU_QTY_EVENTS, /* number of events in nametbl[] */ 98 | AU_NO_EVENT /* not a valid event code */ 99 | } auevent_t; 100 | 101 | extern MARK autop, aubottom; 102 | extern ELVBOOL aubusy; 103 | 104 | extern RESULT ex_auevent P_((EXINFO *xinf)); 105 | extern RESULT ex_augroup P_((EXINFO *xinf)); 106 | extern RESULT ex_autocmd P_((EXINFO *xinf)); 107 | extern RESULT ex_doautocmd P_((EXINFO *xinf)); 108 | extern RESULT auperform P_((WINDOW win, ELVBOOL bang, CHAR *groupname, auevent_t event, CHAR *filename)); 109 | extern void audispmap P_((void)); 110 | extern CHAR *auname P_((CHAR *name)); 111 | 112 | # ifdef FEATURE_MKEXRC 113 | extern void ausave P_((BUFFER custom)); 114 | # endif 115 | 116 | # ifdef FEATURE_COMPLETE 117 | extern CHAR *aucomplete P_((WINDOW win, MARK from, MARK to)); 118 | # endif 119 | 120 | 121 | #endif /* not FEATURE_AUTOCMD */ 122 | -------------------------------------------------------------------------------- /buffer2.h: -------------------------------------------------------------------------------- 1 | /* buffer2.h */ 2 | /* Copyright 1995 by Steve Kirkendall */ 3 | 4 | /* Ideally, these function would have been declared in buffer.h, but since 5 | * their arguments are MARKs, they had to be declared after the MARK data type 6 | * is declared in mark.h, but mark.h can only be included after buffer.h... 7 | * so these functions' declarations had to go into their own separate file. 8 | */ 9 | BEGIN_EXTERNC 10 | extern ELVBOOL bufread P_((MARK mark, char *rname)); 11 | extern ELVBOOL bufwrite P_((MARK from, MARK to, char *wname, ELVBOOL force)); 12 | extern void bufwilldo P_((MARK cursor, ELVBOOL will)); 13 | extern long bufundo P_((MARK cursor, long back)); 14 | extern void bufreplace P_((MARK from, MARK to, CHAR *newp, long newlen)); 15 | extern void bufpaste P_((MARK dst, MARK from, MARK to)); 16 | extern CHAR *bufmemory P_((MARK from, MARK to)); 17 | END_EXTERNC 18 | 19 | /* This is used to store information needed to restore MARKs for an "undo" */ 20 | struct umark_s 21 | { 22 | MARK mark; /* pointer to POSSIBLY FREED mark */ 23 | long offset; /* offset of that mark, before a change */ 24 | }; 25 | 26 | -------------------------------------------------------------------------------- /calc.h: -------------------------------------------------------------------------------- 1 | /* calc.h */ 2 | /* Copyright 1995 by Steve Kirkendall */ 3 | 4 | /* This is used for storing information about subscripts */ 5 | typedef struct 6 | { 7 | CHAR *ptr; /* start of a chunk of text */ 8 | int len; /* length of the chunk */ 9 | } CHUNK; 10 | 11 | typedef enum {CALC_DOLLAR=1, CALC_PAREN=2, CALC_MSG=3, CALC_OUTER=4, CALC_ALL=7} CALCRULE; 12 | 13 | BEGIN_EXTERNC 14 | extern ELVBOOL calcnumber P_((CHAR *value)); 15 | extern ELVBOOL calctrue P_((CHAR *value)); 16 | extern CHAR *calculate P_((CHAR *expr, CHAR **arg, CALCRULE rule)); 17 | #ifdef FEATURE_CALC 18 | # ifdef FEATURE_ARRAY 19 | extern _CHAR_ calcsubscript P_((CHAR *array, CHAR *sub, int max, CHUNK *chunks)); 20 | # endif 21 | extern ELVBOOL calcbase10 P_((CHAR *value)); 22 | extern ELVBOOL calcsel P_((MARK from, MARK to)); 23 | extern CHAR *calcelement P_((CHAR *set, CHAR *element)); 24 | extern CHAR *calcset P_((CHAR *left, _CHAR_ oper, CHAR *right)); 25 | #endif 26 | END_EXTERNC 27 | -------------------------------------------------------------------------------- /ctypetbl.h: -------------------------------------------------------------------------------- 1 | /* ctypetbl.h */ 2 | 3 | /* This file contains a definition (not just declaration!) for the variable 4 | * "elvct_class" which is used by ctags.c, fmt.c, and oswin32/ls.c to support 5 | * elvis' own ctype macros. Elvis itself uses a more complete version of 6 | * this variable which is declared in digraph.c; this file is not #included 7 | * in elvis. 8 | */ 9 | 10 | #ifdef ELVCT_DIGIT 11 | CHAR elvct_class[256] = { 12 | 0,0,0,0,0,0,0,0,0,ELVCT_SPACE,ELVCT_SPACE,0,0,ELVCT_SPACE,0,0, 13 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 14 | ELVCT_SPACE,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 15 | ELVCT_DIGIT,ELVCT_DIGIT,ELVCT_DIGIT,ELVCT_DIGIT,ELVCT_DIGIT, 16 | ELVCT_DIGIT,ELVCT_DIGIT,ELVCT_DIGIT,ELVCT_DIGIT,ELVCT_DIGIT, 17 | 0,0,0,0,0,0,0, 18 | ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER, 19 | ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER, 20 | ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER, 21 | ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER, 22 | ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER,ELVCT_UPPER, 23 | ELVCT_UPPER, 24 | 0,0,0,0,0,0, 25 | ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER, 26 | ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER, 27 | ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER, 28 | ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER, 29 | ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER,ELVCT_LOWER, 30 | ELVCT_LOWER 31 | }; 32 | #endif 33 | -------------------------------------------------------------------------------- /cut.h: -------------------------------------------------------------------------------- 1 | /* cut.h */ 2 | /* Copyright 1995 by Steve Kirkendall */ 3 | 4 | 5 | BEGIN_EXTERNC 6 | extern BUFFER cutbuffer P_((_CHAR_ cbname, ELVBOOL create)); 7 | extern void cutyank P_((_CHAR_ cbname, MARK from, MARK to, _CHAR_ type, _CHAR_ aideeffect)); 8 | extern MARK cutput P_((_CHAR_ cbname, WINDOW win, MARK at, ELVBOOL after, ELVBOOL cretend, ELVBOOL lretend)); 9 | extern CHAR *cutmemory P_((_CHAR_ cbname)); 10 | END_EXTERNC 11 | -------------------------------------------------------------------------------- /data/elvgdb.ini: -------------------------------------------------------------------------------- 1 | # General pseudo-annotations 2 | elvgdb-default: trace 3 | elvgdb-init: brown fromgdb toelvis 4 | elvgdb-term: fromgdb toelvis 5 | elvgdb-trace: magenta 6 | #elvgdb-trace: fromgdb toelvis table server 7 | #elvgdb-all: trace 8 | 9 | # Prompts 10 | pre-prompt pre-prompt-for-continue pre-query: bold blue 11 | prompt: blue 12 | prompt commands overload-choice query prompt-for-continue: flush server 13 | post-prompt post-prompt-for-continue post-query: 14 | 15 | # Errors 16 | pre-error error-begin: bold red 17 | error: 18 | 19 | # Moving the cursor to the current execution point 20 | source: fromgdb args toelvis 21 | 22 | # Adjusting breakpoints. This is tricky because GDB simply sends us a 23 | # "breakpoints-invalid" message when something changes. To find out what 24 | # changed, we need to force gdb to run an "info breakpoints" command and 25 | # then parse the table that it generates. The result of this parsing will 26 | # be a series of "breakpoints-table" messages, each describing one breakpoint. 27 | # Note that the table may also contain other things like watchpoints. 28 | breakpoints-invalid: fromgdb toelvis limit 29 | breakpoints-table: table 30 | record: record 31 | breakpoints-table-end: toelvis 32 | field0 field1 field3 field5: text bold 33 | breakpoints-headers field2 field4: 34 | field6 field7 field8 field9: red 35 | 36 | # Running state 37 | starting: fromgdb toelvis 38 | stopped: 39 | breakpoint watchpoint: fromgdb args toelvis 40 | signalled signal: fromgdb 41 | signal-name: text 42 | signal-name-end: toelvis 43 | signal-string signal-string-end: 44 | exited: fromgdb args toelvis 45 | 46 | # Listing stack frames 47 | frames-invalid: 48 | frame-begin frame-end: 49 | function-call: 50 | signal-handler-caller: 51 | frame-address frame-address-end: 52 | frame-function-name frame-args arg-end: bold red 53 | frame-source-begin: 54 | frame-source-file frame-source-file-end: 55 | frame-source-line frame-source-end: 56 | frame-where: 57 | 58 | # Displays 59 | display-begin display-number-end display-format: 60 | display-expression display-expression-end display-value: red 61 | display-end: 62 | 63 | # Printed values 64 | value-history-begin value-history-value value-history-end: 65 | value-begin: fromgdb args text 66 | value-end: toelvis 67 | arg-begin arg-name-end arg-value: red 68 | field-begin field-name-end field-value field-end: 69 | array-section-begin elt elt-rep elt-rep-end array-section-end: 70 | -------------------------------------------------------------------------------- /data/elvis.arf: -------------------------------------------------------------------------------- 1 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2 | " SAVE THE CURRENT STATE OF THE "saveregexp" OPTION 3 | local nosaveregexp 4 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 5 | " TAKE A GUESS AT THE BUFFER'S PREFERRED DISPLAY MODE 6 | if !userprotocol 7 | then { 8 | if knownsyntax(filename) 9 | then set! bufdisplay=syntax 10 | if os=="unix" && buflines >= 1 11 | then { 12 | try 1s/\V^#! *[^ ]*\/\([^ ]\+\).*/set! bufdisplay="syntax \1"/x 13 | if bufdisplay=="syntax env" 14 | then try 1s/\V^#! *[^ ]*\/[^ ]\+ \([^ ]\+\).*/set! bufdisplay="syntax \1"/x 15 | if bufdisplay<<11=="syntax perl" 16 | then set! bufdisplay="syntax perl" 17 | if bufdisplay<<12=="syntax tclsh" 18 | then set! bufdisplay="syntax tcl" 19 | } 20 | if !newfile 21 | then { 22 | if readeol=="binary" && bufdisplay=="normal" && (partiallastline || !binary) 23 | then set! bufdisplay=hex 24 | switch tolower(dirext(filename)) 25 | case .man set! bufdisplay=man 26 | case .tex set! bufdisplay=tex 27 | case .htm 28 | case .html 29 | case .shtml 30 | case .dhtml set! bufdisplay=html 31 | if buflines >= 2 && bufdisplay=="hex" 32 | then try 1,2s/\V^\s*<[HIThit!]/set! bufdisplay=html/x 33 | if (filename<<5=="http:" || filename<<4=="ftp:") && strlen(dirext(filename))<4 && bd=="hex" 34 | then set! bufdisplay=normal 35 | if bufdisplay=="normal" && buflines >= 1 36 | then try 1s/\V^From .*/set! bufdisplay="syntax email"/x 37 | if strlen(dirext(filename))==2 && isnumber(filename>>1) && buflines>=1 38 | then try 1s/\V^\./set! bufdisplay=man/x 39 | } 40 | if bufdisplay=="html" && readonly 41 | then set locked 42 | if bufdisplay=="html" 43 | then set nosmartargs 44 | if readonly && (bufdisplay=="html" || bufdisplay=="man") 45 | then try set nospell 46 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 47 | " Set the buffer's "initialsyntax" option, based on "prefersyntax" 48 | if (bufdisplay=="html" || bufdisplay=="man" || bufdisplay=="tex") 49 | then { 50 | try { 51 | switch prefersyntax 52 | case always set isyn 53 | case local let isyn = !readonly && dirdir(filename) == "." 54 | case writable let isyn = !readonly 55 | case never set noisyn 56 | } 57 | } 58 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 59 | " Some messages 60 | if tolower(basename(program))!="elvis" && !ro && (bd=="html" || bd=="man" || bd="tex") 61 | then message To toggle the display mode, hit ^Wd 62 | if partiallastline && readeol!="binary" 63 | then warning Partial last line 64 | } 65 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 66 | " Set mapmode to the bufdisplay, if appropriate 67 | switch bufdisplay 68 | case html 69 | case man 70 | case tex let! mapmode=bufdisplay 71 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 72 | " Store the file's timestamp 73 | if security != "restricted" 74 | then let timestamp = time(filename) 75 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 76 | " EXECUTE MODELINES, IF "modeline" OPTION IS SET 77 | if modeline && buflines >= 1 && buflines <= modelines * 2 78 | then try %s/\V[ev][xi]:\([^!]*\):/\1/x 79 | if modeline && buflines > modelines * 2 80 | then { 81 | eval try 1,(modelines)s/\V[ev][xi]:\\\([^!]*\\\):/\1/x 82 | eval try (buflines - modelines + 1),(buflines)s/\\V[ev][xi]:\\\([^!]*\\\):/\1/x 83 | } 84 | -------------------------------------------------------------------------------- /data/elvis.awf: -------------------------------------------------------------------------------- 1 | """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2 | " Update the timestamp 3 | if security != "restricted" 4 | then let timestamp = time(filename) 5 | -------------------------------------------------------------------------------- /data/elvis.brf: -------------------------------------------------------------------------------- 1 | """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 2 | " TAKE A GUESS AT THE BUFFER'S TYPE (unless already known) 3 | if readeol == "text" && security != "restricted" 4 | then let! readeol=fileeol(filename) 5 | -------------------------------------------------------------------------------- /data/elvis.bro: -------------------------------------------------------------------------------- 1 |
2 |.----------------.----------------.------------------------------------------. 7 | | TAG NAME | SOURCE FILE | SOURCE LINE | 8 | |----------------|----------------|------------------------------------------| 9 | 10 | | (((strlen($1)<=15 ? $1 : $1<<15);"")<<19)|((" ";$2)>>15) | (htmlsafe($3)<<41)| 11 | 12 | ^----------------^----------------^------------------------------------------^ 13 |14 | 15 | -------------------------------------------------------------------------------- /data/elvis.bwf: -------------------------------------------------------------------------------- 1 | " Check for changed timestamp (unless it was never set, or forced write) 2 | if security != "restricted" 3 | then { 4 | if !bang && edited && timestamp != "" && time(filename) != timestamp 5 | then error file's timestamp has changed 6 | } 7 | " Maybe make a backup 8 | if backup && !newfile && security == "normal" 9 | then { 10 | switch os 11 | case unix eval ! cp (filename) (filename).bak 12 | default eval ! copy (filename) (dirname(filename) / basename(filename)).bak >NUL 13 | } 14 | -------------------------------------------------------------------------------- /data/elvis.clr: -------------------------------------------------------------------------------- 1 | switch gui 2 | case windows 3 | case x11 { 4 | color normal black on gray90 5 | color argument like keyword green or dark green 6 | color bottom like normal 7 | color comment italic dark green or light green 8 | color cursor blue on navyblue 9 | color fixed gray35 or gray80 10 | color function Red4 or pink 11 | color guide white 12 | color hexheading gray70 13 | color hlsearch boxed 14 | color keyword bold 15 | color libt like keyword italic 16 | color lnum gray 17 | color link like formatted underlined blue or light blue 18 | color number Blue4 or light blue 19 | color other like keyword 20 | color prep bold Blue4 or light blue 21 | color prepquote like string 22 | color scroll like tool 23 | color scrollbar like toolbar 24 | color selection on tan 25 | color spell on pink 26 | color status like tool 27 | color statusbar like toolbar 28 | color string tan4 or tan1 29 | color tool black on gray75 30 | color toolbar white on gray40 31 | color variable Gray15 or palegoldenrod 32 | } 33 | case vio 34 | case termcap { 35 | color normal yellow or black 36 | color char like string 37 | color comment italic light green or green 38 | color fixed white or gray 39 | color function light cyan or cyan 40 | color hexheading gray 41 | color hlsearch bold 42 | color keyword bold white or black 43 | color libt like keyword 44 | color lnum gray 45 | color link underlined blue or light cyan 46 | color number light cyan or blue 47 | color other like keyword 48 | color prep bold magenta or blue 49 | color prepquote like string 50 | color regexp like string 51 | color ruler blue or light cyan 52 | color showmode green boxed 53 | color spell red or light magenta 54 | color string white or brown 55 | color variable like normal 56 | } 57 | -------------------------------------------------------------------------------- /data/elvis.lat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbert/elvis/3684829e8596b9761c36629f20ff9d3262c10481/data/elvis.lat -------------------------------------------------------------------------------- /data/elvis.msg: -------------------------------------------------------------------------------- 1 | # This is a sample "elvis.msg" file, for translating messages. Each line 2 | # contains a terse message followed by a colon, some optional whitespace, and 3 | # whatever text you want to use as the verbose form of that message. Lines 4 | # that start with '#' are ignored simply because no terse messages happen to 5 | # start with '#'. Blank lines are also allowed. The terse forms of most 6 | # messages are listed in the "elvistrs.msg" file. 7 | #------------------------------------------------------------------------------ 8 | no match above: Hit top of file without finding a match 9 | no match below: Hit bottom of file without finding a match 10 | $1 is a boolean option: Use "set $1" or "set no$1" to enable or disable $1 11 | termcap needs $1: This termcap entry lacks the :$1: capability 12 | read $1, $2 lines, $3 chars: Read $1(readonly?" [READONLY]"), $2 lines, $3 chars 13 | nothing to fold there: To create a new folded region, you must give a name 14 | 15 | # Some words that are stored as options: True False Submit Cancel Help 16 | Submit:Okay 17 | 18 | # This demonstrates how to cause specific messages to beep, regardless of the 19 | # settings of the "errorbells" and "warningbells" options. This example is 20 | # commented out; delete the initial '#' to activate it. 21 | #------------------------------------------------------------------------------ 22 | #wrapped: Wrapped 23 | 24 | # The following shows how to silence a typical error message -- just don't 25 | # have any text after the colon character. 26 | #------------------------------------------------------------------------------ 27 | not while in open mode: 28 | 29 | # The following line is used to control the output of the :file command and 30 | # visual ^G command. This is by far the most complex message used by elvis. 31 | #------------------------------------------------------------------------------ 32 | (filename)(readonly?" [READONLY]")(modified?" [MODIFIED]")(!edited?" [NOT EDITED]")(newfile?" [NEW FILE]") ($1 * 100 / $2)%:(filename)(readonly?" [READONLY]")(modified?" [MODIFIED]")(!edited?" [NOT EDITED]")(newfile?" [NEW FILE]") line $1 of $2 \(($1*100 / $2)%\) 33 | -------------------------------------------------------------------------------- /data/elvis.pc8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mbert/elvis/3684829e8596b9761c36629f20ff9d3262c10481/data/elvis.pc8 -------------------------------------------------------------------------------- /data/elvis.rc: -------------------------------------------------------------------------------- 1 | " Here are some typical settings that you might want to try. The simplest 2 | " way to use this file is to :source this file, and then run ":mkexrc" to 3 | " save the settings where they can be automatically loaded. 4 | set undolevels=12 5 | set autoindent 6 | try set spell 7 | try set smartargs 8 | set taglibrary 9 | set wrapscan 10 | set incsearch 11 | set spellautoload 12 | map gw lbygS:word
>
>36 | $a37 | se bufdisplay=html noinitialsyntax 38 | } 39 | se nomod 40 | } 41 | eval display (m) 42 | } 43 | 44 | alias info sp info:!1 45 | -------------------------------------------------------------------------------- /data/scripts/info2.ex: -------------------------------------------------------------------------------- 1 | " This file tries to implement an "info:" protocol, for viewing info pages 2 | " inside elvis. It doesn't quite succeed, but it comes close. 3 | " 4 | " This assumes your info pages are stored in /usr/share/info. If they're 5 | " stored someplace else, then you'll need to edit the "local d=..." line below. 6 | 7 | alias readINFO { 8 | local d=/usr/share/info 9 | local report=0 10 | local magic magicchar=^$.[* noignorecase 11 | local m 12 | if "!(/)2" == "/" 13 | then { 14 | r (d/"dir") 15 | try %s/&/\&/g 16 | try %s/\</g 17 | try %s/>/\>/g 18 | try %s/^\* \([^:]*\): (\([^)]*\))\(.*\)\.$/* \1<\/a>: (\2)\3/ 19 | try %s/^\* \([^:]*\): (\([^)]*\))\(.*\)/* \1<\/a>: (\2)\3/ 20 | } 21 | else { 22 | if exists(d/"!2.info") 23 | then r !!cat (d)/!2.info (d)/!2.info-* 2>/dev/null 24 | eval r !!gzip -d -c (d)/!2.info*.gz (d)/!2.info-*.gz 2>/dev/null 25 | try 1,/^File: .* Node: !(Top)3,/-1 d 26 | try %s/&/\&/g 27 | try %s/\</g 28 | try %s/>/\>/g 29 | } 30 | try %s/^$/
36 | $a37 | se bufdisplay=html noinitialsyntax nomod 38 | } 39 | 40 | alias info sp info:!1 41 | -------------------------------------------------------------------------------- /data/scripts/inregion.ex: -------------------------------------------------------------------------------- 1 | "defines a :inregion alias 2 | alias inregion { 3 | " execute a command for each line that happens to be in a given region 4 | if "!1" == "" 5 | then error usage: inregion facename excmdline... 6 | normal mz 7 | !%g/^/ { 8 | if current("region") == "!1" 9 | then !2* 10 | } 11 | normal `z 12 | } 13 | -------------------------------------------------------------------------------- /data/scripts/isearch.ex: -------------------------------------------------------------------------------- 1 | " This script defines :ilist and :isearch aliases, and some vim-compatible 2 | " maps that use them. They search for the first usage of an identifier name 3 | " in the current file. 4 | 5 | alias ilist { 6 | " list all lines containing a given word 7 | push 8 | !%g/\/ 9 | pop 10 | } 11 | 12 | alias isearch { 13 | " search for a word within a range (default whole file) 14 | local l="" 15 | push 16 | !%g/\/ { 17 | if l == "" 18 | then let l = current("line") 19 | } 20 | eval (l)p 21 | pop 22 | } 23 | 24 | map [i yiw:isearch 25 | map ]i yiw:+,$isearch 26 | map [I yiw:ilist 27 | map ]I yiw:+,$ilist 28 | -------------------------------------------------------------------------------- /data/scripts/likevim.ex: -------------------------------------------------------------------------------- 1 | " This file creates some aliases and maps that make elvis work more like vim 2 | 3 | " Some variations of the :map and :unmap commands 4 | alias nmap map command 5 | alias nm map command 6 | alias vmap map select 7 | alias vm map select 8 | alias omap map motion 9 | alias om map motion 10 | alias imap map input 11 | alias im map input 12 | alias cmap map history 13 | alias cm map history 14 | alias noremap map!? noremap 15 | alias nore map!? noremap 16 | alias nnoremap map noremap command 17 | alias nn map noremap command 18 | alias vnoremap map noremap select 19 | alias vn map noremap select 20 | alias inoremap map noremap input 21 | alias ino map noremap input 22 | alias cnoremap map noremap history 23 | alias cno map noremap history 24 | alias nunmap unmap command 25 | alias nun unmap command 26 | alias vunmap unmap select 27 | alias vu unmap select 28 | alias ounmap unmap motion 29 | alias ou unmap motion 30 | alias iunmap unmap input 31 | alias iu unmap unput 32 | alias cunmap unmap history 33 | alias cu unmap history 34 | 35 | " Some redundant commands that work on visibly selected text 36 | map noremap select r g= 37 | map noremap select x d 38 | map noremap select U noremap gU 39 | map noremap select u noremap gu 40 | map noremap select ~ noremap g~ 41 | map noremap select J :j 42 | map noremap select gJ :j! 43 | map noremap select y:ta 44 | map noremap select o g% 45 | map noremap select O g 46 | "map noremap select R S ... except that "vS" isn't implemented yet 47 | 48 | " Some 'g' commands that aren't built in to elvis 49 | map g# yiw??w 50 | map g* yiw//w 51 | map gf :eval find (current(/[^[:space:]<>"]*/)) 52 | map gm :eval normal (columns/2+1;char(124)) 53 | map go 54 | 55 | " Some '^W" commands that aren't built in to elvis 56 | map f :eval sfind (current(/[^[:space:]<>"]*/)) 57 | 58 | " A few miscellaneous vim commands 59 | alias find { 60 | " Locate a file in 'includepath', and then edit it 61 | local elvispath f 62 | if "!*" == "" 63 | then error cursor not on file name 64 | let elvispath=includepath 65 | let f=elvispath("!*") 66 | if f == "" 67 | then error "!*" not found in includepath 68 | else e!? (f) 69 | } 70 | alias fin find 71 | alias sfind { 72 | " Locate a file in 'includepath', and then split it 73 | local elvispath f 74 | if "!*" == "" 75 | then error cursor not on file name 76 | let elvispath=includepath 77 | let f=elvispath("!*") 78 | if f == "" 79 | then error "!*" not found in includepath 80 | else sp (f) 81 | } 82 | alias sf sfind 83 | alias sview split +"se ro" 84 | alias sv sview 85 | alias update { 86 | " Write a file, but only if modified 87 | if modified 88 | then !%write!? !* 89 | } 90 | alias up !%update!? 91 | -------------------------------------------------------------------------------- /data/scripts/mail.ex: -------------------------------------------------------------------------------- 1 | "This defines a :Mail alias. This is intended mostly to be used when elvis 2 | "is invoked as an external editor by a mail program such as Kmail or Sylpheed. 3 | "The idea is that you'd configure the mail editor to run "elvis -cMail" as the 4 | "external editor. To make that work, you'd need to run ":load mail" and 5 | " ":mkexrc" first though. 6 | alias Mail { 7 | set bufdisplay="syntax email" equalprg="elvfmt -M" 8 | display syntax email 9 | if color("signature") == "" 10 | then color signature italic red on gray 11 | try $;?^-- *$?,$ region signature 12 | } 13 | -------------------------------------------------------------------------------- /data/scripts/mailto.ex: -------------------------------------------------------------------------------- 1 | " This script attempts to define the mailto: protocol. This 2 | " feature of elvis is still changing rapidly, so this might not work. 3 | " Also, the mailto: alias only works on Unix-like systems. 4 | 5 | alias readMAILTO { 6 | "initialize a mailto: message 7 | se noro reol=text 8 | if exists($HOME/".signature") 9 | then { 10 | read ~/.signature 11 | 1 i -- 12 | } 13 | } 14 | alias writeMAILTO { 15 | "send a mailto: message 16 | 17 | " This is a lot more complex that one would think. The mail program forks 18 | " off a spooler, and the spooler inherits the stdout/stderr file descriptors. 19 | " This has the unfortunate side-effect of making elvis wait until the mail 20 | " queue is emptied, after this message and any other pending messages have 21 | " been uploaded to the mailserver. Yuck! To avoid that, we redirect the 22 | " mail program's stdout/stderr to /dev/null. 23 | w !!mail -s"!(no subject)subject=" !2 >/dev/null 2>&1 24 | se nomod 25 | } 26 | -------------------------------------------------------------------------------- /data/scripts/makehtml.ex: -------------------------------------------------------------------------------- 1 | " Defines makehtml alias to convert plain text to HTLM source 2 | 3 | alias makehtml { 4 | "Convert plain text to HTML source 5 | local report=0 m=text n=text b=false magic magicchar=^$.[* noignorecase 6 | " 7 | " m is current line mode -- one of "text", "pre", "ol", or "ul" 8 | " n is next line mode 9 | " b is a flag for detecting series of blank lines. 10 | " 11 | " For each line... 12 | !%g /^/ { 13 | " Protect characters which are special to HTML 14 | try s/&/\&/g 15 | try s/\</g 16 | try s/>/\>/g 17 | " 18 | " Convert uppercase lines into headings 19 | try s/^[A-Z0-9][A-Z0-9-.) ]*$/
tags, though. 60 | if m!="pre" && b=="false" 61 | then { 62 | try s/^$/
/ 63 | then set b=true 64 | } 65 | " 66 | " if mode switched, then add tags for that. 67 | if m!=n 68 | then { 69 | if m!="text" 70 | then eval i (m)> 71 | if n!="text" 72 | then eval i <(n)> 73 | let m=n 74 | set b=false 75 | } 76 | } 77 | " 78 | " if not in text mode, then terminate the mode 79 | if m != "text" 80 | then eval !> a (m)> 81 | " 82 | " If converting the whole file, then add ... 83 | if "!%" == "" 84 | then { 85 | $a