home *** CD-ROM | disk | FTP | other *** search
/ ftp.freefriends.org / ftp.freefriends.org.tar / ftp.freefriends.org / arnold / Source / mush.rstevens.tar.gz / mush.tar / Gnurc < prev    next >
Text File  |  1990-05-03  |  3KB  |  100 lines

  1. # .mushrc to simulate Gnu emacs (NOT Rmail!) for curses mode
  2. # -- Bart Schaefer (schaefer@cse.ogc.edu)
  3. #---------------------------------------------------------------------------
  4. # Shortcomings:
  5. #  In compose mode, can't use C-h, C-r, C-w, DEL, etc.
  6. #  Ought to delete most of the default bindings.  If you want remove the
  7. #   default bindings, you can:
  8. #    Run "mush -noinit" and do a "saveopts";
  9. #    Edit the saved file and change every "bind" to an "unbind";
  10. #    Remove all other extranous commands;
  11. #    Include the resulting list at the TOP of this file.
  12. #---------------------------------------------------------------------------
  13. #
  14. set no_reverse
  15. #
  16. # TTY setup -- you may want to customize this, because the old interrupt
  17. #  character and so on might not be reset correctly when mush exits.
  18. #
  19. cmd ntty 'stty intr ^G dsusp undef stop undef start undef lnext undef'
  20. cmd rtty 'stty intr ^C dsusp ^Y stop ^S start ^Q lnext ^V'
  21. cmd exit 'rtty; \exit'
  22. cmd xit exit
  23. cmd x exit
  24. cmd quit 'update; exit'
  25. cmd q quit
  26. cmd curses 'ntty; \curses; rtty'
  27. #
  28. # Curses mode bindings
  29. #
  30. # Exiting -- try to make sure tty gets reset
  31. bind-macro '\CX\CC' '[line-mode]exit\n'
  32. bind-macro x [no-op]
  33. bind-macro X [no-op]
  34. bind-macro q [no-op]
  35. bind-macro Q [no-op]
  36. # Files (folders)
  37. bind '\CX\CF' folder
  38. bind '\CX\CS' update
  39. bind-macro '\CXi' '[line-mode]merge '
  40. bind '\CX\CV' folder
  41. bind-macro '\CX\CW' '[save-list]*\n'
  42. # Help
  43. bind '\CX\CH' help    # Can't use just C-h, it's a prefix of the others
  44. bind-macro '\CHa' '[bind]_\n\n\CH'    # List all curses commands
  45. bind-macro '\CHc' '[line-mode]bind '    # Show one binding
  46. bind-macro '\CHf' '[line-mode]? '    # Explain line-mode function
  47. # Error Recovery -- very primitive, sorry
  48. bind '\CXu' undelete-list
  49. bind '\C_' undelete-list
  50. # Searching -- sorry, can't be incremental
  51. #  also can't repeat with same key
  52. bind '\CS' search-next
  53. bind '\CR' search-back
  54. # Motion (the important part)
  55. bind '\CB' back-msg
  56. bind '\Eb' back-msg
  57. bind '\CP' back-msg
  58. bind '\CF' next-msg
  59. bind '\Ef' next-msg
  60. bind '\CN' next-msg
  61. bind '\Ea' back-msg
  62. bind '\Ee' next-msg
  63. bind '\E[' top-page
  64. bind '\E]' bottom-page
  65. bind '\CX[' screen-back
  66. bind '\CX]' screen-next
  67. bind '\E<' first-msg
  68. bind '\E>' last-msg
  69. bind '\CV' screen-next
  70. bind '\Ev' screen-back
  71. # Killing/deleting ("forward", i.e. at cursor, only)
  72. bind '\CD' delete
  73. bind '\Ed' delete
  74. bind '\CK' delete
  75. bind '\Ek' delete
  76. bind-macro '\CW' '[line-mode]delete [getstr] | set kill\n[no-op]'
  77. bind-macro '\CY' '[undelete-list]$kill\n'
  78. # Marking -- somewhat limited because can't use C-SPC (C-@)
  79. bind-macro '\CX\CX' '[line-mode].|set mark\n[no-op]'
  80. bind-macro '\Eh' '[line-mode]h|set mark\n[no-op]'
  81. bind-macro '\CXCP' '[line-mode]h|set mark\n[no-op]'
  82. bind-macro '\CXh' '[line-mode]*|set mark\n[no-op]'
  83. # Buffers -- treated same as folders
  84. bind '\CXb' folder
  85. bind-macro '\CX\CB' '[folder]?\n\CH'    # List folders and back out
  86. bind-macro '\CXk' '[delete-list]*\n'
  87. # Shells
  88. bind-macro '\E!'\
  89.     '[line-mode]rtty\n[shell-escape][getline][line-mode]ntty\n'
  90. bind-macro '\Ex!' '[line-mode]rtty;sh\n[line-mode]ntty\n'
  91. # Macros
  92. #  Sorry, no appending to macros, and end with <RETURN> not `C-x )'
  93. bind '\CX(' bind-macro
  94. #
  95. # Lastly, actually reset the tty
  96. #
  97. if iscurses
  98.     ntty
  99. endif
  100.