home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vile-src.zip / vile-8.1 / modetbl < prev    next >
Text File  |  1998-09-22  |  15KB  |  322 lines

  1. # This file contains all of the editor's buffer and window modes
  2. #
  3. # It should be processed by the "mktbls" program, which produces the
  4. #  headers #included by main.c
  5. #
  6. # All that is necessary to add a new mode to the editor is to add
  7. #  an entry to this file, write the supporting code, and rebuild.
  8. #
  9. # If you want to know which modes are already taken, look
  10. #  at nemode.h, after you build it.
  11. #
  12. # The modes are table entries in the BUFFER and WINDOW structures.
  13. #
  14. # $Header: /usr/build/vile/vile/RCS/modetbl,v 1.100 1998/09/22 22:42:44 tom Exp $
  15. #
  16. #
  17. # Mode-table entries.  Capitalized letters are used for abbreviations.
  18. # The second column is the root of the index-definition.
  19. # The third column is flags used to control updates after a mode is changed.
  20. # The fourth column (if present) controls conditional compilation of the mode.
  21. .globals
  22. bool                            # GMD prefix
  23.     "AutoBuffer"    ABUFF         chgd_autobuf    # auto-buffer (lru)
  24.     "dirc"        DIRC        0        COMPLETE_DIRS # directory-completion (slow!)
  25.     "Alt-TabPos"    ALTTABPOS    0        # emacs-style cursor positioning
  26.     "expand-path"    EXPAND_PATH    0        # true iff %/# don't substitute shortened-path
  27.     "ErrorBells"    ERRORBELLS    0        # audible/visible-bells
  28.     "flash"        FLASH        0        OPT_FLASH # visible-bell (flash)
  29.     "force-console"    FORCE_CONSOLE    0        SYS_WINNT&&defined(DISP_NTWIN)
  30.     "glob"        GLOB        0        !OPT_GLOB_PIPE # enable/disable filename globbing
  31.     "HIstory"    HISTORY        0        OPT_HISTORY # command-history
  32.     "ImplyBuffer"    IMPLYBUFF     0        # imply-buffer (vi-like)
  33.     "multibeep"    MULTIBEEP    0        # multiple successive identical failed motions all beep
  34.     "maplonger"    MAPLONGER    0        # favor longer maps
  35.     "Popup-Choices"    POPUP_CHOICES    0        OPT_POPUPCHOICE&&!OPT_ENUM_MODES # popup buffer showing file-completion choices
  36.     "Popup-Msgs"    POPUP_MSGS    0        OPT_POPUP_MSGS    # popup buffer when multiple messages emitted
  37.     "ReadOnly-on-ReadOnly" RONLYRONLY    0    # set readonly mode for readonly files
  38.     "remap"        REMAP        0        # should mappings be reapplied
  39.     "remapfirst"    REMAPFIRST    0        # should 1st char of a map be remapped?
  40.     "resolve-links"    RESOLVE_LINKS    0        HAVE_SYMLINK # cache/resolve directory names (can be slow if NFS times-out)
  41.     "ShowRam"    RAMSIZE        0        OPT_RAMSIZE    # show ram-usage
  42.     "SameBangs"    SAMEBANGS    0        # use same "!!" data for ^X-!
  43.     "working"    WORKING        chgd_working    OPT_WORKING # "working" message
  44.     "usefilelock"    USEFILELOCK    0        OPT_LCKFILES # okay use filelocks
  45.     "VIEW-on-ReadOnly" RONLYVIEW    0        # set view mode for readonly files
  46.     "w32pipes"    W32PIPES    0        OPT_W32PIPES
  47.     "warn-unread"    WARNUNREAD    0        # warn if quitting with unread buffers
  48.     "warn-reread"    WARNREREAD    0        # warn before rereading a buffer
  49.     "warn-rename"    WARNRENAME    0        # warn before renaming a buffer
  50.     "xterm-mouse"    XTERM_MOUSE    chgd_xterm    # mode to control whether we allow mouse-clicking
  51.     "SmoothScroll"    SMOOTH_SCROLL    0        # should we update even if there is typeahead?
  52.     "Spaces-After-Sentence" SPACESENT    0    # add two spaces after a
  53. enum
  54.     "fcolor"    FCOLOR        chgd_color    OPT_COLOR    # foreground color
  55.     "bcolor"    BCOLOR        chgd_color    OPT_COLOR    # background color
  56.     "Mini-Hilite"   MINI_HILITE    0        # highlight minibuffer when using vi-commands
  57.     "Popup-Choices"    POPUP_CHOICES    0        OPT_POPUPCHOICE&&OPT_ENUM_MODES # popup buffer showing file-completion choices
  58. int                            # VAL_ prefix
  59.     "maplength"    MAPLENGTH    0        # maximum length of :map string
  60.     "printing-low"    PRINT_LOW    chgd_charset    # low end of high-bit-set printable range
  61.     "printing-high"    PRINT_HIGH    chgd_charset    # high end of high-bit-set printable range
  62.     "report"    REPORT        0        # threshold for reporting changes
  63.     "timeoutlen"    TIMEOUTVAL    0        # how long to catnap for more input
  64.     "timeoutlen-user" TIMEOUTUSERVAL 0        # how long to catnap for more input
  65.     "scroll-pause"    SCROLLPAUSE    0        SYS_WINNT    # how long to catnap after scrolling
  66. regex                            # VAL_ prefix
  67.     "C-SUFfixes"    CSUFFIXES    0        !OPT_MAJORMODE # match against filenames to turn on c-mode
  68. string                            # VAL_ prefix
  69.     "backup-style"  BACKUPSTYLE    0        OPT_FILEBACK # file backup style
  70.     "expand-chars"    EXPAND_CHARS    0        # list of chars we can expand (%,#,:)
  71.     "glob"        GLOB        0        OPT_GLOB_PIPE # select filename globbing style
  72.  
  73. .buffers
  74. bool                            # MD prefix
  75.     "animated"    UPBUFF        0        OPT_UPBUFF # update scratch-buffers
  76.     "AutoIndent"    AIND        0        # auto-indent
  77.     "AutoSave"    ASAVE        0        # auto-save mode
  78.     "AutoWrite"    AUTOWRITE    0        # auto-write when shelling out
  79.     "BackspaceLimit" BACKLIMIT    0        # backspace limited in insert mode
  80.     "check-modtime" CHK_MODTIME    0        !SMALLER # check buffer-modtime
  81.     "cmode"        CMOD        chgd_major_w    !OPT_MAJORMODE # C indentation and fence match
  82.     "crypt"        CRYPT        chgd_major    OPT_ENCRYPT    # encrytion mode active
  83.     "dos"        DOS        chgd_major_w    # "dos" mode -- lines end in crlf
  84.     "IgnoreCase"    IGNCASE        chgd_hilite    # Exact matching for searches
  85.     "locked"    LOCKED        chgd_disabled    OPT_LCKFILES # mode locked
  86.     "magic"        MAGIC        chgd_hilite    # regular expressions in search
  87.     "Meta-Insert-Bindings" METAINSBIND 0        # honor meta bindings in insert mode
  88.     "NewLine"    NEWLINE        chgd_buffer    # trailing newline (vi-style)
  89.     "ReadOnly"    READONLY    chgd_major    # allow writing the buffer
  90.     "ShowMatch"    SHOWMAT        0        # show matching braces during insert
  91.     "ShowMoDe"    SHOWMODE    chgd_major    # show insert/replace/command mode
  92.     "TabInsert"    TABINSERT    0        # okay to insert tab chars
  93.     "TagignoreCase"    TAGIGNORECASE    0        !SMALLER # ignore upper/lower case in tags
  94.     "TagRelative"    TAGSRELTIV    0        # tags are relative to tagsfile path
  95.     "TagWord"    TAGWORD        0        # apply tag to whole word, not only string at cursor
  96.     "terse"        TERSE        0        # be terse -- suppress messages
  97.     "view"        VIEW        chgd_major    # read-only buffer
  98.     "WrapScan"    SWRAP         0        # wrap-around search mode
  99.     "WrapWords"    WRAP        0        # word wrap
  100. enum
  101.     "visual-matches"  HILITEMATCH    chgd_hilite    OPT_HILITEMATCH # highlight all search matches
  102. int                            # VAL_ prefix
  103.     "AutoSaveCNT"    ASAVECNT    0        # how often auto-saves occur
  104.     "C-ShiftWidth"    C_SWIDTH    0        !OPT_MAJORMODE # shift-width for C buffers
  105.     "C-TabStop"    C_TAB        chgd_major_w    !OPT_MAJORMODE # tab spacing for C buffers
  106.     "FillCol"    FILL        0        # column for paragraph reformat, and line break
  107.     "ShiftWidth"    SWIDTH        0        # shiftwidth for ^T/^D/<</>>
  108.     "TabStop"    TAB        chgd_major_w    # tab spacing for most buffers
  109.     "TagLength"    TAGLEN        0        # required significant length for tag lookups
  110.     "UndoLimit"    UNDOLIM        0        # how much undo stack is saved
  111.     "WrapMargin"    WRAPMARGIN    0        # width of right margin for autowrap
  112. string                            # VAL_ prefix
  113.     "fence-pairs"    FENCES        chgd_fences    # pairs of fences {,}; (,); etc.
  114.     "locker"    LOCKER        chgd_disabled    OPT_LCKFILES  # Name of locker
  115.     "tags"        TAGS        0        # list of tags files
  116. regex                            # VAL_ prefix
  117.     "comments"    COMMENTS    0        # matches leading comment for comment reformatting
  118.     "comment-prefix" CMT_PREFIX    0        # prefix to ignore/preserve when formatting comment
  119.     "fence-begin"    FENCE_BEGIN    0        # begin a simple (character, non-nestable) fence
  120.     "fence-end"    FENCE_END    0        # end a simple fence
  121.     "fence-if"    FENCE_IF    0        # begin a complex (line, nestable) fence
  122.     "fence-elif"    FENCE_ELIF    0        # next complex fence
  123.     "fence-else"    FENCE_ELSE    0        # final complex fence
  124.     "fence-fi"    FENCE_FI    0        # end a complex fence
  125.     "paragraphs"    PARAGRAPHS    0        # delimits a paragraph
  126.     "sections"    SECTIONS    0        # delimits a section
  127.     "sentences"    SENTENCES    0        # delimits a sentence
  128.  
  129. .windows
  130. bool                            # WMD prefix
  131.     "LIst"        LIST        chgd_window    # "list" mode -- show tabs and EOL
  132.     "NUmber"    NUMBER        chgd_window    # line-numbers shown
  133.     "HorizScroll"    HORSCROLL    0        # scroll whole screen
  134.     "LineWrap"    LINEWRAP    chgd_window    OPT_LINEWRAP # wrap lines wider than screen
  135.     "ruler"        RULER        chgd_status    !SMALLER # display line+col in modeline
  136.     "Unprintable-as-Octal" NONPRINTOCTAL  chgd_window # print non-printing chars in octal
  137.     "Terse-SELections" TERSELECT    0        OPT_SELECTIONS # don't display extent of selections on message line
  138. int                            # VAL_ prefix
  139.     "SIDEways"    SIDEWAYS    chgd_window    # sideways offset for display
  140.  
  141. # Put the majormode definitions after buffers to simplify logic in mktbls.
  142. # The arguments of .majormode are the predefined majormodes and submodes.
  143.  
  144. .majormode c    tabstop
  145. .majormode c    shiftwidth
  146. regex                            # MVAL_ prefix
  147.     "PREamble"    PREAMBLE    0        # match against file header to turn on mode
  148.     "SUFfixes"    SUFFIXES    0        # match against filenames to turn on mode
  149.  
  150. #
  151. # The "environment" variables are similar to modes, but are not so neatly
  152. # organized into groups of universal/buffer/window.
  153. .environment
  154. "abufname"    ABUFNAME        # alternate buffer name (i.e. '#')
  155. "bchars"    BCHARS            # chars in current buffer
  156. "blines"    BLINES            # lines in current buffer
  157. "cbufname"    CBUFNAME        # current buffer name
  158. "buffer-hook"    BUFHOOK        OPT_PROCEDURES    # procedure to run when entering buf
  159. "cd-hook"    CDHOOK        OPT_PROCEDURES    # procedure to run when cd'ing
  160. "cfilname"    CFNAME            # current file name
  161. "char"        CURCHAR            # current character under the cursor
  162. "cryptkey"    CRYPTKEY    OPT_ENCRYPT # write-only encryption-key
  163. "curcol"    CURCOL            # current column pos of cursor
  164. "curline"    CURLINE            # current line in file
  165. "cwd"        CWD        OPT_SHELL # current directory
  166. "cwline"    CWLINE            # current screen line in window
  167. "debug"        DEBUG            # macro debugging
  168. "directory"    DIRECTORY    OPT_SHELL # controls location of temp-files
  169. "discmd"    DISCMD            # display commands on command line
  170. "disinp"    DISINP            # display command line input characters
  171. "end-of-cmd"    EOC            # true if they ended the cmd with <CR>
  172. "exit-hook"    EXITHOOK    OPT_PROCEDURES    # procedure to run when quitting
  173. "flicker"    FLICKER            # flicker suppression
  174. "font"        FONT        DISP_X11||DISP_NTWIN    # current font
  175. "forward-search" FWD_SEARCH        # search-direction (true if forward)
  176. "helpfile"    HELPFILE        # helpfile (vile.hlp)
  177. "iconname"    ICONNAM        DISP_X11    # current font
  178. "identifier"    IDENTIF            # current identifier
  179. "kill"        KILL            # kill buffer (read only)
  180. "lastkey"    LASTKEY            # last keyboard char struck
  181. "line"        LINE            # text of current line
  182. "llength"    LLENGTH            # length of current line
  183. "majormode"    MAJORMODE    OPT_MAJORMODE # current majormode, if any
  184. "match"        MATCH            # last matched magic pattern
  185. "mode"        MODE            # are we inserting/overwriting/command
  186. "modeline-format" MLFORMAT    OPT_MLFORMAT # modeline format string
  187. "modified"    MODIFIED        # is current buffer modified?
  188. "ncolors"    NCOLORS            # number of colors displayed
  189. "ntildes"    NTILDES            # number of tildes displayed at eob
  190. "ocwd"        OCWD        OPT_SHELL # previous directory
  191. "os"        OS            # what os are we on?
  192. "pagelen"    PAGELEN            # number of lines used by editor
  193. "pagewid"    CURWIDTH        # current screen width
  194. "palette"    PALETTE            # current palette string
  195. "patchlevel"    PATCHLEVEL        # current patch-level of vile (empty for release)
  196. "pathname"    PATHNAME        # current path-like word
  197. "pending"    PENDING            # type ahead pending flag
  198. "pid"        PROCESSID        # vile's process-id
  199. "progname"    PROGNAME        # returns current prog name - "vile"
  200. "qidentifier"    QIDENTIF        # current qualified identifier
  201. "ram"        RAM        OPT_RAMSIZE    # ram in use by malloc
  202. "read-hook"    RDHOOK        OPT_PROCEDURES    # procedure to run when reading
  203. "replace"    REPLACE            # replacement pattern
  204. "search"    SEARCH            # search pattern
  205. "seed"        SEED            # current random number seed
  206. "shell"        SHELL        OPT_SHELL    # shell-environment variable
  207. "sres"        SRES            # current screen resolution
  208. "startup-file"    STARTUP_FILE        # the name of the startup-file (e.g., .vilerc)
  209. "startup-path"    STARTUP_PATH        # where to find the startup-file (e.g., .)
  210. "status"    STATUS            # returns the status of the last command
  211. "tpause"    TPAUSE            # length to pause for paren matching
  212. "title"        TITLE        DISP_X11    # window title
  213. "version"    VERSION            # current version number
  214. "wlines"    WLINES            # # of lines in current window
  215. "word"        WORD            # current word
  216. "write-hook"    WRHOOK        OPT_PROCEDURES    # procedure to run when writing
  217. "xdisplay"    XDISPLAY    DISP_X11    # X Windows display, etc.
  218. "xshell"    XSHELL        DISP_X11    # xterm emulator, etc.
  219.  
  220. .functions
  221. "abs"    ABS        MONAMIC        # absolute value of a number
  222. "add"    ADD        DYNAMIC        # add two numbers together
  223. "and"    AND        DYNAMIC        # logical and
  224. "asc"    ASCII        MONAMIC        # char to integer conversion
  225. "bin"    BIND        MONAMIC        # lookup what function name is bound to a key
  226. "cat"    CAT        DYNAMIC        # concatenate string
  227. "chr"    CHR        MONAMIC        # integer to char conversion
  228. "div"    DIV        DYNAMIC        # division
  229. "env"    ENV        MONAMIC        # retrieve a system environment var
  230. "equ"    EQUAL        DYNAMIC        # logical equality check
  231. "glo"    GLOBMODE    MONAMIC        # retrieve global setting
  232. "gre"    GREATER        DYNAMIC        # logical greater than
  233. "gtk"    GTKEY        NILNAMIC    # get 1 character
  234. "gts"    GTSEQ        NILNAMIC    # get keyboard-sequence (characters)
  235. "ind"    IND        MONAMIC        # evaluate indirect value
  236. "lef"    LEFT        DYNAMIC        # left string(string, len)
  237. "len"    LENGTH        MONAMIC        # string length
  238. "les"    LESS        DYNAMIC        # logical less than
  239. "loc"    LOCMODE        MONAMIC        # retrieve local setting
  240. "low"    LOWER        MONAMIC        # lower case string
  241. "mid"    MID        TRINAMIC    # mid string(string, pos, len)
  242. "mod"    MOD        DYNAMIC        # modulo
  243. "neg"    NEG        MONAMIC        # negate
  244. "not"    NOT        MONAMIC        # logical not
  245. "or"    OR        DYNAMIC        # logical or
  246. "rd"    READABLE    MONAMIC        # is a file readable?
  247. "rig"    RIGHT        DYNAMIC        # right string(string, pos)
  248. "rnd"    RND        MONAMIC        # get a random number
  249. "seq"    SEQUAL        DYNAMIC        # string logical equality check
  250. "sgr"    SGREAT        DYNAMIC        # string logical greater than
  251. "sin"    SINDEX        DYNAMIC        # find the index of one string in another
  252. "sle"    SLESS        DYNAMIC        # string logical less than
  253. "sub"    SUB        DYNAMIC        # subtraction
  254. "tim"    TIMES        DYNAMIC        # multiplication
  255. "tri"    TRIM        MONAMIC        # trims leading/trailing/repeated whitespace
  256. "tru"    TRUTH        MONAMIC        # Truth of the universe logical test
  257. "upp"    UPPER        MONAMIC        # uppercase string
  258. "wr"    WRITABLE    MONAMIC        # is a file writeable?
  259.  
  260. .table color
  261. "default"    ENUM_UNKNOWN    DISP_TERMCAP||DISP_IBMPC # FIXME: implement this for all drivers
  262. "black"        0
  263. "red"        1
  264. "green"        2
  265. "yellow"    3        !OPT_16_COLOR
  266. "brown"        3        OPT_16_COLOR
  267. "blue"        4
  268. "magenta"    5
  269. "cyan"        6
  270. "white"        7        !OPT_16_COLOR
  271. "lightgray"    7        OPT_16_COLOR
  272. "gray"        8        OPT_16_COLOR
  273. "brightred"    9        OPT_16_COLOR
  274. "brightgreen"    10        OPT_16_COLOR
  275. "yellow"    11        OPT_16_COLOR
  276. "brightblue"    12        OPT_16_COLOR
  277. "brightmagenta"    13        OPT_16_COLOR
  278. "brightcyan"    14        OPT_16_COLOR
  279. "white"        15        OPT_16_COLOR
  280.  
  281. .table bool
  282. "false"        FALSE
  283. "true"        TRUE
  284.  
  285. .table popup
  286. "delayed"    POPUP_CHOICES_DELAYED
  287. "immediate"    POPUP_CHOICES_IMMED
  288. "off"        POPUP_CHOICES_OFF
  289.  
  290. .table backup
  291. "off"        0
  292. ".bak"        1
  293. "tilde"        2        SYS_UNIX
  294. # "tilde_N_existing", */
  295. # "tilde_N", */
  296.  
  297. .table hilite
  298. "bold"        VABOLD
  299. "color"        VACOLOR
  300. "italic"    VAITAL
  301. "none"        0
  302. "reverse"    VAREV
  303. "underline"    VAUL
  304. "black"        VACOL_0        OPT_COLOR
  305. "red"        VACOL_1        OPT_COLOR
  306. "green"        VACOL_2        OPT_COLOR
  307. "yellow"    VACOL_3        OPT_COLOR&&!OPT_16_COLOR
  308. "brown"        VACOL_3        OPT_COLOR&&OPT_16_COLOR
  309. "blue"        VACOL_4        OPT_COLOR
  310. "magenta"    VACOL_5        OPT_COLOR
  311. "cyan"        VACOL_6        OPT_COLOR
  312. "white"        VACOL_7        OPT_COLOR&&!OPT_16_COLOR
  313. "lightgray"    VACOL_7        OPT_COLOR&&OPT_16_COLOR
  314. "gray"        VACOL_8        OPT_COLOR&&OPT_16_COLOR
  315. "brightred"    VACOL_9        OPT_COLOR&&OPT_16_COLOR
  316. "brightgreen"    VACOL_A        OPT_COLOR&&OPT_16_COLOR
  317. "yellow"    VACOL_B        OPT_COLOR&&OPT_16_COLOR
  318. "brightblue"    VACOL_C        OPT_COLOR&&OPT_16_COLOR
  319. "brightmagenta"    VACOL_D        OPT_COLOR&&OPT_16_COLOR
  320. "brightcyan"    VACOL_E        OPT_COLOR&&OPT_16_COLOR
  321. "white"        VACOL_F        OPT_COLOR&&OPT_16_COLOR
  322.