man mined (Commandes) - a text editor
NAME
mined - a text editor
SYNTAX
mined [ -/+options ] [ +line ] [ +/search ] [ files ... ]
xmined ...
umined ...
lmined ...
wmined ...
DESCRIPTION
Mined is a text editor with
- Good interactive features
- •
- Intuitive user interface
- •
- Logical and consistent concept of text entities and navigating or modifying text (without ancient line-end handling limitations or insert/append confusion)
- •
-
Supports various control styles:
Editing with command control, function key control, or menu control
Navigation by cursor keys, control keys, mouse or scrollbar - •
- Comprehensive menus (driven by keyboard or mouse)
- •
- "HOP" key paradigm doubles the number of navigation functions that can be most easily reached and remembered by intuitively amplifying the associated function
- •
- Immediate adjustment if the window size is changed, in any state of interaction
- Versatile character encoding support
- •
-
Extensive Unicode support, including double-width and combining characters,
script highlighting,
various methods of character input support
(mnemonic, numeric, mapped keyboard),
Support of bidirectional terminals, Arabic ligature joining - •
-
East Asian character set support: handling of major CJK
encodings (including GB18030 and full EUC-JP) in
either Unicode terminal or CJK terminal,
Support of CJK input methods by enhanced keyboard mapping including multiple choice mappings (handled by a pick list menu); characters in the pick list being sorted by relevance of Unicode ranges - •
- Auto-detection of text character encoding, edits files with mixed character encoding sections (e.g. mailboxes)
- •
- Auto-detection of UTF-8 / CJK terminal mode and detailed features (like different Unicode width and combining data versions)
- •
- Encoding support tested with: xterm, mlterm, hanterm, cxterm, rxvt, linux console
- Many useful text editing capabilities
- •
- Many text editing features, e.g. paragraph wrapping, smart quotes (with quotation marks style selection and auto-detection), multi-line support in search and replacement patterns
- •
- Cross-session paste buffer (copy/paste between multiple, even subsequent or remote, invocations of mined)
- •
- Multiple paste buffers (emacs-style)
- •
- Program editing features, HTML support and syntax highlighting, identifier and function definition search, also across files
- •
- Search and replacement patterns can contain embedded newlines
- •
- Systematic text and file handling safety, avoiding loss of data
- •
- Visible indications of special text contents (TAB characters, different line-end types, character codes that cannot be displayed in the current mode)
- •
- Full binary transparent editing with visible indications (illegal UTF-8, mixed line end types, NUL characters, ...)
- •
- Optional emacs command mode
- Small-footprint operation and portability
- •
- Plain text mode (terminal) operation
- •
- Instant start-up
- •
- Runs on many platforms: Unix (Linux/Sun/HP/BSD/Mac and more), DOS (djgpp), Windows (cygwin)
This manual contains the main topics
- •
- Command line options
- •
- Editing text with mined, an overview
- •
- Key layout
- •
- The HOP function
- •
- Mouse control and Menus
- •
- Paste buffers
- •
- Text position marker stack
- •
- Paragraph justification
- •
- Auto indentation and Structure input support
- •
- Search and replace multiple lines
- •
- Overview: input support features
- •
- Handling files with mined
- •
- Tags file support
- •
- Data security
- •
- Line end modes and binary-transparent editing
- •
- Memory of file position and editing style parameters
- •
- Version control integration
- •
- Printing
- •
- Working with mined
- •
- Mode indication flags
- •
- HTML support
- •
- Visible indication of line contents
- •
- Character input support
- •
- Accented and mnemonic input support
- •
- Keyboard Mapping and Input Methods
- •
- Unicode support
- •
- Smart quotes
- •
- Bidirectional terminal support
- •
- Combining characters
- •
- Joining characters
- •
- CJK support
- •
- CJK input method support
- •
- Han character information display
- •
- Character encoding support
- •
- CJK and mapped 8 bit encoding support
- •
- Combining characters
- •
- Terminal encoding support
- •
- Mined Command reference (command and key function assignments)
- •
- Cursor and screen motion
- •
- Entering text
- •
- Input support commands
- •
- Modifying text
- •
- Text block and buffer operations
- •
- Search
- •
- File operations
- •
- Menu
- •
- Miscellaneous
- •
- MSDOS only
- •
- emacs mode
- •
- WordStar mode
- •
- Environment interworking and configuration hints
- •
- Mined runtime support library
- •
- Terminal environment
- •
- Locale configuration
- •
- Terminal setup
- •
- Terminal interworking problems
- •
- Keyboard Mapping / Input Method pre-selection
- •
- Smart Quotes style configuration
- •
- Han info configuration
- •
- Common paste buffer configuration
- •
- Keypad configuration
- •
- Printing configuration
- •
- Compile-time configuration
- •
- MSDOS-only notes
- •
- Environment variables
- •
- Author and Acknowledgements
Online help is also available.
Command line options
Mined can be invoked
- •
- with or without list of file names
- •
- reading from a pipe (reading text from standard input)
- •
- writing into a pipe (writing edited text to standard output)
- •
- using a script that starts it in a new window
Examples
- mined x
- edits the file x
- mined x y z
- edits files x, y, and z
- cmd | mined
- edits the output of program cmd; a file name for saving can be given later
- mined x > y
- takes the contents of file x and edits it for writing into y
- mined | mail nn
- edits a text to be mailed
- cmd1 | mined | cmd2
- modifies text within a pipe between program cmd1 (output) and cmd2 (as input)
- xmined ...
- starts a new xterm and invokes mined in it
- umined ...
- starts a new xterm in UTF-8 mode and invokes mined in it
- lmined ...
- starts a new xterm in 8 bit mode and invokes mined in it
- wmined ...
- (especially on Windows) starts a new rxvt terminal, using Windows look-and-feel, and invokes mined in it; the terminal is configured to run in UTF-8 mode which may work with a future version of rxvt (currently ignored)
Startup options
- +number
- Mined positions to the given line number.
- +/expr
- Mined initially searches for the given search expression.
- -v
- Mined starts in view only mode. The text cannot be modified.
- --
- Restricted mode (tool mode): no other files can be edited or otherwise affected.
- ++
- End of options; subsequent file name can start with "-" or "+".
- +x
- Makes a new file executable (Unix).
Line end handling (transparent and transforming)
- -r
- Ignore CR characters (so strip them at line ends). I.e., read MSDOS text on Unix machines.
- -R
- Convert single CR (Mac newline) into LF (Unix newline), i.e., read MacIntosh text on MSDOS or Unix machines, transforming the line ends.
- +R
- Accept CR (Mac) newlines; don't transform them, use specific indication for their display.
- +u-u
- Interpret Unicode line separator and paragraph separator as normal characters, not line ends (handling them as line ends was previously enabled with -uu and is now on by default).
Character set and character handling
- -u (character set)
- Interprets edited text as UTF-8,
disables UTF and CJK auto detection.
Identical with -EU, ignored if the terminal is configured or detected to be in CJK mode. - -l (character set)
- Interprets edited text as Latin-1,
disables UTF and CJK auto detection.
(Used to be +u which is still valid for compatibility.)
Identical with -EL, ignored if the terminal is configured or detected to be in CJK mode. - +u-u (character handling)
- Interpret text as UTF-8, but interpret Unicode line separator and paragraph separator as normal characters, not line ends (handling them as line ends was previously enabled with -uu and is now on by default).
- -b (character handling)
- Toggle "poor man's bidi" mode: input support for right-to-left scripts, based on Unicode script ranges. (Enabled by default unless the terminal is detected to be in bidi mode; so e.g. in mlterm, poor man's bidi is disabled by default.)
- -c (character handling)
- Selects separated display mode for combined characters (separating base character and combining characters). This mode can also be toggled from the eXtra menu or by clicking on the Combining flag (next to the character encoding flag) in the flags area.
- -C (character set and terminal mode)
- Enables use of CJK encoding (Chinese/Japanese/Korean) for Han character set. If UTF-8 terminal mode is selected at the same time (by auto-detection, environment or option), this will enable handling of CJK character encoding in a UTF-8 terminal. Otherwise, mined will assume that it operates in a CJK terminal (e.g. hanterm or cxterm). For details, see CJK encoding support.
- -EX (character set)
- Where X is one of B/G/C/J/S/K/H: Selects one of the supported CJK character encodings for CJK mode and disables auto-detection of CJK encodings. Unless -C is also selected, Latin/UTF-8 auto detection is still active and may override the encoding selected here. "X" is a one-letter tag of the encoding; for supported encodings, see the Mode indication flags listing. For details, see CJK encoding support.
- -EX (character set)
- Where X is one of g/c/j: Selects one of the CJK character encodings like G/C/J and if running in a CJK terminal this tells mined to assume that the terminal cannot display GB18030 4-byte encodings, CNS 4-byte encodings, EUC-JP 3-byte encodings, respectively.
- -EX (character set)
- Where X is one of U/L or W/Y/M/V/N/T: Selects one of the character encodings Unicode/UTF-8, Latin-1, or one of the mapped 8 bit encodings Windows-ANSI, Cyrillic/KOI8-RU, Mac Roman, VISCII, TCVN, TIS-620. This is ignored if the terminal is configured or detected to be in CJK mode.
- -KX (input method handling)
- Configure the space key to perform a certain function in keyboard mapping selection menus ("CJK input method pick lists"), where X is one of:
- +K (input method handling)
- Enable keyboard mappings (input methods) even in 8-bit terminal or when editing a Latin-1 file; the characters thus entered will mostly only be displayed by substitute indications, as most characters anyway when editing UTF-8, CJK encoded, or mapped encoding (VISCII) files in an 8-bit terminal.
Terminal mode
- -U (terminal mode)
- Toggles UTF-8 screen handling assumption, i.e. selects UTF-8 screen handling unless UTF-8 keyboard input is already selected (by another -U option or environment setting). In the latter case, -U deselects UTF-8 terminal operation. This option should normally not be used as the mode should be configured in the environment (see Locale configuration).
- +U (terminal mode)
- Selects UTF-8 screen handling.
Note that none of the options -U or +U needs to be
used if the environment is correctly configured to
indicate UTF-8 as it should (see
Unicode handling / Terminal environment).
Also, mined performs auto-detection of UTF-8 terminal encoding and UTF-8 terminal features (different width data versions, handling of double-width, combining and joining characters), so even if the environment is not correctly configured, mined should work now without this explicit terminal mode parameter. - +UU (terminal mode)
- Selects bidirectional terminal support. This mode implies UTF-8 and also assumes that Arabic ligature joining (of LAM/ALEF combinations) is applied; it will be handled by mined accordingly.
- -cc (terminal mode)
- Assumes that the terminal does not support combining characters. By default - unless otherwise detected - mined assumes that combining characters work on UTF-8 terminals and do not work in CJK terminals.
- +c (terminal mode)
- Assumes that the terminal supports combining characters. This is enabled by default for UTF-8 terminals, and disabled by default for CJK terminals, unless otherwise detected.
- -C (character set and terminal mode)
- Unless UTF-8 terminal mode is selected at the same time
(by auto-detection, environment or option), mined will
assume that it operates in a CJK terminal (e.g.
hanterm or cxterm) and CJK encoding is assumed.
For details, see CJK encoding support.
Mined performs auto-detection of certain CJK terminal features (handling of non-EUC code points, GB18030, 3-byte and 4-byte encodings). - -CC (terminal mode)
- Like -C, and override UTF-8 terminal auto-detection. This enforces the assumption of a CJK terminal unless UTF-8 terminal mode is also configured by environment variable setting.
- +C (character set and terminal mode)
- Like -C, but characters encoded in a CJK encoding format are displayed transparently even if they do not map to a valid Unicode character.
- +CC (terminal mode)
- Implies +C, but even character codes that do not match the encoding scheme (e.g. wrt. to specified byte ranges) are written transparently to the terminal.
- +CCC (terminal mode)
- Implies +CC and overrides auto-detection of the terminal capability to display CJK 3-byte / 4-byte codes which would by default suppress their display if the terminal does not support them.
- -G (terminal mode)
- Toggles display of a subset of the control characters as block graphics (disabled by default).
- +G (terminal mode)
- Enforces use of block graphics for display of menu borders. May be used if the "alternative character set" capability is not configured in your system but your terminal does have the capability. (Similar but not identical to -Qv.)
Editing behaviour
- -w
- Recognise fewer places as word boundaries for word skip and delete commands.
- -a
- Append mode: Append to text buffer or external file for copy/delete commands instead of replacing it.
- +j
- Set justification level 1 (or increment level previously set by environment variable to 1 or 2): Level 1 initially enables automatic word wrap at line end when typing over right margin. Can be changed by clicking on the j/J flag.
- +jj
- Set justification level 2: Level 2 initially enables automatic word wrap at line end when typing within paragraph; buggy. Can be changed by clicking on the j/J flag.
- -j
- Set justification level 1 or 2 (other than previously set). Can be changed by clicking on the j/J flag.
- -T
- When moving vertically over a TAB character from a line position which would have been inside the TAB column range, the default behaviour is to position on the left end of the TAB. This option changes that to position right of the TAB.
Appearance
- -QX
- Select menu border style, where X is one of
- •
- s: simple border,
- •
- r: rounded corners,
- •
- f: fat border,
- •
- d: double border,
- •
- a: ASCII border (can be combined with another option -Qs or -Qr),
- •
- v: VT100 alternate character set graphics border,
- •
- @: reverse blank border,
- •
- Q: stylish selection bar for navigating menu items, see image (can be combined with another option -Qs or -Qr or -Qf). Mined sets an appropriate default based on its assumptions of the terminal capabilities.
Further mode selection, interface and display behaviour
- -4
- Set TAB size to 4 rather than 8. The effective TAB size can also be toggled while editing with the ESC T command.
- -8
- Set TAB size to 8. (May be used on command line to override TAB size being set to 4 be MINED environment variable.) The effective TAB size can also be toggled while editing with the ESC T command.
- -LN
- (N is a number) Define mouse wheel movement to scroll by N lines. Control-mouse-wheel always scrolls by 1 line. Shift-mouse-wheel scrolls by 1 page.
- -e
- Select emacs mode. This assigns functions to control keys, M-X commands (ESC commands, using the "meta" key as emacs calls the Alt prefix) and C-X commands as defined by the emacs editor. Also the emacs paste buffer ring and cut/paste behaviour is enabled.
- +V
- Enable emacs-style paste buffer functions for "delete word" and "delete to end of line" commands (^T, ^K), and place the cursor behind the pasted regions after buffer insertion. (May become the default in a future version, disabled by -V.)
- -W
- Select WordStar mode. This configures WordStar command key layout and enables many functions of the ^K, ^O, and ^Q menus.
- -B
- Backspace deletes right, Delete deletes left. But see also "Automatic backspace mode adaptation" below.
- -k
- Assign the more usual functions "goto line beginning", "goto line end" and "delete character" to the Home, End and Delete keys of the right keypad. The (assumedly more useful) mined default is to assign the frequently used paste buffer functions (mark, copy, cut) to these keys. In any case, shifted keys (Shift-Home etc) will invoke the according paste buffer functions and Control-Home etc. the more widespread functions to these keys, provided your terminal supports it (see Keypad configuration for further hints).
- -*
- Disable mouse support.
- -m (default)
- ESC ESC proceeds to the next file (after asking to save if appropriate) and exits after the last file.
- +m
- ESC ESC exits mined (after asking to save if appropriate).
- -M
- Disables mouse control and pull-down and pop-up menus.
- -oN
- Select scrollbar display mode. N=0 disables the scrollbar (may speed up editing on slow remote lines), N=1 enables cell-grained scrollbar display, N=2 (default) enables finer-grained scrollbar display on a UTF-8 terminal. For backwards compatibility, -o without a subsequent digit toggles scrollbar.
- -p
- Enables distinguished display of line ends and paragraph ends with different symbols.
- -t< tab >
- Sets the character to be used for visible TAB character indication.
- -X
- Disables display of the filename in the window title bar.
- -s
- Stay with cursor in top line after page down or bottom line after page up instead of center line.
- -S
- Use scrolling for page up/down.
- -dN
- Apply delay between lines of page output to achieve
visually effective display build-up which may help to quickly
focus on the new cursor position (the screen output is
displayed starting from the cursor position, proceeding
to the screen edges).
If N lies between '0' and '9', the respective number of milliseconds is applied between display of two lines. If N='0', still an output flush is performed. If N='-', no delay at all is applied though still the order of display output is from cursor position to edges.
Default: '-'; configuration is currently disabled in the Unix version as 'usleep' doesn't seem to be very portable. - -P
- Enables provisions for proportional display fonts. (Not really tested as there doesn't seem to exist a terminal emulator that handles proportional fonts and cursor positioning correctly.)
All options are also looked for in the environment variable MINED.
Editing text with mined
Mined is always in insert mode. Commands are single control characters, double key commands starting with ESCAPE, and a collection of function keys (for various types of keyboards and terminals). As a specialty, note the prefixing 'HOP KEY' which amplifies the effect of certain commands "just as you would expect"; this provides for more command flexibility without having to remember too many keys. It is described in a separate section below.
Key layout
Control key layout for basic movement functions is topographic on the left-hand side of the keyboard (an idea originating from early editors, when keyboards didn't have cursor keypads). (Although using a cursor block is more comfortable, a simple set of control key assignments is useful as a fallback on terminals or remote connections with reduced functionality.)
The right-hand cursor block of typical keyboards is assigned the most important movement and paste buffer functions.
- Keypad assignment features:
- •
- central placement of HOP key (see below)
- •
-
integration of frequently used copy/paste functions
+------+------+------+
| (7) | (8) | (9) |
| Mark | ^ | PgUp |
+------+------+------+
| (4) | (5) | (6) |
| <- | HOP | -> |
+------+------+------+
| (1) | (2) | (3) |
| Copy | v | PgDn |
+------+------+------+
| (0) | (.) |
| Paste | Cut |
+------+------+------+
Note that the mined keypad function assignment as shown here
deviates from the more usual assignment of Home/End to
"move to beginning/end of line" and Del to "delete character".
This is deliberately designed to provide more useful functions
to easily available keys, while e.g. line movement can also
easily be achieved with HOP cursor-left or HOP cursor-right,
respectively, and character deletion can still be done with
the Del key on the smaller keypad.
This is considered much more useful than the
"standard assignment" although now and then a user is
irritated by it.
There is an option -k to switch to the "standard assignment".
Also the respective keys pressed together with the control key
invoke the "standard functions". In -k mode, the paste buffer
functions can be invoked by pressing these keys together with
the shift key. This behaviour depends on proper keyboard
configuration, see Keypad configuration
for details.
The HOP function
This function, triggered by any of the HOP keys, amplifies (or modifies) functions as listed below. To achieve the combined function, first press any key that is assigned the HOP function, then any key assigned the second function:
- HOP - char left
- move cursor to beginning of current line
- HOP - char right
- move cursor to end of current line
- HOP - line up
- move cursor to top of screen
- HOP - line down
- move cursor to bottom of screen
- HOP - scroll up
- scroll half a screen up
- HOP - scroll down
- scroll half a screen down
- HOP - page up
- move to beginning of file
- HOP - page down
- move to end of file
- HOP - word left
- move cursor to previous ";" or "."
- HOP - word right
- move cursor to next ";" or "."
- HOP - delete tail of line/line end
- delete whole line
- HOP - delete whole line
- delete tail of line
- HOP - delete previous character
- delete beginning of line
- HOP - set mark
- go to mark
- HOP - search
- search for current identifier
- HOP - search next
- repeat previous (last but one) search
- HOP - copy/cut
- copy or cut, but append to buffer
- HOP - save buffer
- save buffer, but append to file
- HOP - paste buffer
- paste "inter-window buffer", which is the last saved buffer by any invocation of mined on the same machine by the same user.
- HOP - edit next file
- edit last file
- HOP - edit previous file
- edit first file
- HOP - exit current file
- exit mined
- HOP - suspend
- suspend without writing file
- HOP - show status line
- toggle permanent status line
- HOP - enter HTML tag (alternate opening/closing)
- embed copy area in HTML tags
While a pull-down or pop-up menu is opened, any HOP key or the blank key or the middle mouse button toggles the HOP amplifier for a function subsequently invoked in the menu; the menu redisplays with function names changed where applicable.
Character-oriented navigation and editing
From the traditional restriction of Unix tools to the line as a
unit of operation, other editors have derived a line-oriented
movement and insertion paradigm which is a nuisance for
anyone who wants an editor with decently intuitive operation.
Mined handles the end-of-line character like any ordinary
character during movement and editing operations.
Also search and replace strings can contain line ends.
Mouse control and menus
All versions of mined (Unix, DOS/Windows) support mouse operation.
Mouse control operates on pull-down and pop-up menus, flags,
the text area, the bottom line, and the scroll bar,
in order to provide the most useful functions and menu-driven
command selection at hand.
Summary of mouse functions:
- In text area:
- •
- left click moves the text cursor to the mouse position
- •
- left click-drag-release selects a text area and copies it to the paste buffer
- •
- middle click display the text status line
- •
- right click pops up the quick menu
- On scroll-bar column:
- •
- left click moves one page down
- •
- middle click moves to text position corresponding to cursor
- •
- right click move one page up
- On bottom line (status line):
- •
- left click moves one page down
- •
- middle click displays the text status line
- •
- right click move one page up
- On menu header (in menu area of upper line):
- •
- any click pulls down menu
- On flag indication (in flag area of upper line):
- •
- any click toggles flag
Configuration hint: To enable mouse operation in a Windows DOS box, deactivate "QuickEdit mode" in the properties menu.
Menus
Mined provides three kinds of menus, all can be opened with
either mouse clicks or commands.
The menus offer the most important editing functions (apart
from simple movement).
Some menus have their items grouped into sections, some of which
have subtitles.
The HOP flag can be toggled while a menu is open with any
of the HOP key, ^G, Blank, or the middle mouse button.
When a pull-down menu is opened with the middle mouse button,
the HOP variation is initially triggered, offering the HOP
versions of the menu's items.
The three menu groups are used as follows:
- •
- The pull-down menus can be opened with the mouse or from the keyboard (Alt-f or ESC f for the file menu etc., using the capital letter from the menu title as a small letter).
- •
- The flag menus are opened by clicking the right mouse button on one of the flags in the flags area (right part of top screen line). They offer a choice of the available settings and thus allow to select among them in a more intuitive way than by just toggling the flag. Also the flag menus have optional markers in front of each item showing which items are currently active (since mined 2000.10). (The Info menu, Input Method (Keyboard Mapping) menu, Smart Quotes menu, Encoding menu can also be opened with Alt-F10, ESC K or Alt-K, ESC Q or Alt-Q, ESC E or Alt-E, respectively.)
- •
- The pop-up menu is placed above the text area and can be opened with a right-click or Alt-Space (ESC Space). When a menu is open, the cursor-left or cursor-right keys cycle through the pull-down and flag menus.
There are three methods to navigate menus:
- •
- With the keyboard: open menu as described above, navigate with cursor keys or (since mined 2000.10) by typing the first letter of the desired menu item (which cycles through all items starting with that letter), activate with Return key.
- •
- With mouse clicks: open menu with click (and release) mouse button, switch to other menu with another click, click on item to activate it. The mouse wheel may be used to navigate menu items.
- •
- With mouse dragging: open menu with mouse button (left or right), browse menus and items with button held down, activate selected item with releasing mouse button. Methods may be mixed, e.g. open a menu with either mouse click or keyboard, navigate with mouse wheel, then select with Return.
Note: Your mouse driver may be configured to generate multiple (e.g. 3) mouse wheel events on one mouse wheel movement (e.g. with Windows).
Configuration hint: On Unix, in order to make Alt work as a modifier, set the xterm resource metaSendsEscape to true as suggested in the example file Xdefaults.mined. (With older versions of xterm, setting eightBitInput to false may be required instead; this xterm option doesn't actually disable 8 bit input as its name might suggest.)
Inter-window paste buffer
Mined can perform copy/paste operations within different editing sessions (parallel or subsequent invocations of mined): The command HOP Insert (e.g. ^G ^P) will insert the most recent paste buffer copied or cut in any of the user's mined sessions. This can also work remotely in a network; to configure this features, see Common paste buffer configuration.
Multiple paste buffers
Since mined 2000.8, emacs-style multiple paste buffers are
provided that are organised as a buffer ring. Every buffer
cut or copy operation (that places the text between the marked
and the current position to the buffer) creates a new buffer
and stacks it to the list of buffers.
The commands delete-end-of-line (^K), delete-word (^T) and
delete-end-of-sentence (currently emacs mode only) append to
the top buffer in emacs mode or if mined was started with
the +V option.
To paste a non-top-most buffer, paste the most recent buffer
first as usual, then use the buffer-ring command
(Alt-Insert-key or Control-F4, or M-y in emacs mode) to
exchange the pasted text with the previous buffer. This
can be repeated, going down the stack of buffers, and at
its bottom, starting over from the top again.
Text position markers
A default marker for quick use and additional 10 numbered
text markers are available.
Marker 0 has a special function: 1. it is set when opening a
file at the memorized position, 2. whenever a new current
marker is set, the previous one is pushed to marker 0.
Text position marker stack
In addition to the explicit text markers, mined implicitly maintains a marker stack to support navigation and orientation when browsing files. Whenever a command moves the position by a far distance (Go to marker, Go to line, Go to file beginning/end, Go to next/previous file, Search functions including Search identifier definition across files, Replace with confirm), the current position is first pushed to this stack. Later, in order to return to the previous position, use the command ESC Return (Alt-Return) to move along the positions in the marker stack. The command HOP ESC Return (HOP Alt-Return) moves again forward along the stack.
Paragraph justification / word wrap
Manual paragraph line/word wrap is invoked with the
justify command (ESC j or ESC J); it justifies the current
paragraph (wraps its lines/words) according to the effective
margins and paragraph termination mode.
Clever justification: With ESC j, mined automatically
determines left margins depending on the current paragraph and
line contents. Heuristic detection of numbered items will trigger
automatic indentation.
Normal justification: With ESC J, mined justifies
strictly according to the margin values currently configured.
See commands listing below "ESC j"
for margin setting commands.
Paragraph termination modes: Two different definitions of paragraph end are available.
- •
-
The primary mode is to add a space at the end of each line
when the paragraph continues and to end the line without
space where the paragraph ends. This seems an intuitive
way and as a big advantage over other approaches, it is
transparent with respect to visual formatting, i.e. no
text property is required that would affect visual layout
of the text.
Note: Additional visual support of paragraph end detection is available with the mined option -p that distinguishes paragraph/line end display. - •
- The other word-wrap mode is to add an empty (blank-only) line after each paragraph. Obviously this imposes more additional requirements on text formatting discipline and reduces freedom of text layout. The mode in effect is indicated in the mode indication display; see description there.
Auto indentation
By default, mined acts in auto-indent mode: When you enter a newline, the following line will be filled with the same prefix of white space characters (blank or tab) as the current one. This option can be toggled from the eXtra menu. A new line without auto indentation can be entered with the ^O command.
Auto indentation is automatically suppressed if text is entered very fast (by heuristic detection of input speed) in order to allow unmodified copy and paste using terminal mouse functions.
- Structure input commands
- A pair of parentheses with matched indentation can be entered
by prefixing a parenthesis character with HOP.
For example, HOP "{" would enter a pair of "{" "}", both
auto-indented on their respective new line. Other pairs are
"(" ")", "[" "]", "<" ">".
HOP "/" enters an indented Javadoc comment frame. - Back Tab (Undent function / reverse indent)
- A Backspace from a position that is only preceded by white space on the line and on the line above will revert the input position to the previous matching indentation level. To avoid auto-undentation, use Control-Backspace to delete only character left. (This only works if Control-Backspace is enabled in your X configuration, see the example configuration file Xdefaults.mined in the Mined runtime support library.)
Search and replace multiple lines
Mined has overcome the typical Unix tool limitation of line orientation in search operations. Search and replacement patterns can contain embedded newlines. Enter a linefeed character in the search string with ^V^J or \n. (In some cases there are still display problems; then update the screen with the ESC "." command.)
Header line underlining
The command HOP "-" (e.g. Control-G -) underlines the header line before the cursor position with as many "-" characters as needed; it applies to the current line unless the cursor is at a line beginning in which case it applies to the previous line.
Automatic backspace mode adaptation
The Backarrow and Delete keyboard keys are handled very differently by operating environments. In addition to the -B option to exchange their normal function, mined will detect the Unix terminal line setting for the "erase" function (stty erase ..) and attach the "Delete character left" function to the key configured there. For command details, see below.
Overview: input support features
Character input
Mined provides several methods to support input of special characters that may not be easily available on the keyboard.
- •
- Accented and mnemonic input support defines Accent prefix function keys to compose accent combinations for the most frequently used accented characters such as ä ã å á à â.
- •
- It also provides Character input mnemonics for easily memorisable input of a wide range of characters, including most composed Unicode characters.
- •
- Input support commands include a quick shortcut for two-character mnemonics.
- •
- Input support commands also provide for character input by hexadecimal / octal / decimal character code or Unicode value, including support for subsequent entry of multiple numeric characters according to ISO 14755.
- •
- Keyboard mapping switching the keyboard to support another script. This mechanism also provides CJK input methods.
Structured input
- •
- HTML tag input (starting/closing or embedding marked text).
- •
- Auto indentation and back TAB.
- •
- Structure input commands: Input of indented matching parentheses and Javadoc frames.
- •
- Paragraph justification (line/word wrap).
- •
- Header line underlining
Special features
- •
- Smart quotes (UTF-8 text mode): automatic transformation of entered straight quote marks into typographic quotation marks, as well as smart dashes. (style can be selected in flags area).
- •
- Right-to-left script input support.
Handling files with mined
Tags file support
The ESC t command moves to the definition of an identifier
(on which the cursor should be placed) using the tags file
(generated by the ctags command).
HOP ESC t prompts for an identifier. (Also available from
search or popup menu.)
If a new file is opened for this purpose, the current
file is saved automatically.
Like with some commands, ESC t places the current position
on the position marker stack before going to the location of
the identifier definition. The command ESC Return (Alt-Ret)
moves back to that position, also saving the current file if
needed first.
Data security
- Edited text
- Every care has been taken to prevent loss of the edited text in case of save errors or accidental quit commands etc. If mined really needs to terminate in the case of an unrecoverable error (which has not occurred to me in a recent released version) or due to an external signal, it will try to write the edited text into a panic file in the /usr/tmp or /tmp directory. So only if the temporary area happens to be full, you would be out of luck.
- Files
- Also, if any command is issued to write to a file not previously read in (after change of file name or directory, through copy command) mined prompts for confirmation.
Pipe output
In the "write to standard output" mode (i.e. when invoked within a pipe), only one "file save" operation can be performed writing to standard output. If more than one such operations are issued (e.g. using the ESC w / F2 , F3, or suspend command) only the first one will write the text buffer to standard output; any subsequent one is treated as usual (with empty file name).
Line end modes and binary-transparent editing
Mined is binary transparent. It can handle all types of
line ends (Unix, DOS, optionally Mac and Unicode separators)
simultaneously in the same editing session. They are indicated
by different visible line end indications. Files without
trailing line end can be edited and created (using the delete
character right function on the last line end). NUL characters
are handled as virtual line ends. Lines too long for internal
handling are split transparently (with a "none" virtual
line end).
Unicode mode: Illegal UTF-8 sequences are maintained
transparently. Files with mixed UTF-8 / 8 bit sections can
be edited comfortably.
Input: To enter a NUL character, use ^V # 0 or
^V < NUL or Control-Space > (if the keyboard supports
the latter).
Memory of file position and editing style parameters
If the current directory contains a file named @mined.mar ,
file position memory is enabled.
The current cursor position is stored with every file save
command (even if no write is performed because the text has not
been edited).
When editing that file again, mined will automatically move to
that position (and set text marker 0 to it).
(The association of the position is not with the file itself
but with its relative name from the current directory.)
If the marker file does not yet exist, its creation can be
enforced by prefixing any file writing command with the HOP
function, or with the "Save Position" command from the File menu.
In addition to the current position, mined also stores the paragraph justification margins (only if automatic paragraph justification is active) and the selected Smart Quotes style.
Page length
The command ESC P sets the number of lines that mined assumes to be on a page. So the status line can contain the page number to make finding the current position in a print-out easy. Also the Goto Line/% command (^G etc.) accepts a final page. This information will be associated and stored with the file name if file position storing is active (i.e. if the file @mined.mar exists in the current directory).
File names
When entering file names, the leading ~/ notation to refer to one's home directory is accepted.
Restricted mode (tool mode)
Restricted mode is activated with
<code>mined -- [ filenames ... ]
In restricted mode, only the file opened when mined was started can
be edited, no commands changing file name reference, involving other
files (copy/paste), or escaping to a shell command will be allowed.
(When mined is invoked without filename argument, a file name
will be prompted for despite restricted mode, however.)
Version control integration
From the File menu, checkout and checkin commands are available that invoke "co" or "ci" scripts, respectively (which must reside in the user's command search path). This offers a gateway to ClearCase or other version control systems; mined applies automatic save or screen update as appropriate.
Printing
From the File menu, a print command is available that prints the text currently being edited. If the script uprint is installed and configured properly, printing works in any selected character encoding. See Printing configuration for further details.
Working with mined
Mode indication flags
The right side of the top menu bar displays a number of one-letter or two-letter indications for certain modes; the associated flag menus can be opened from here with a mouse right-click, or the modes can be toggled quickly with a left-click. (Keyboard shortcuts for handling flags and menus are also available.)
- •
- Information display mode
- •
- "?": this flag menu offers options for permanent File info, Char info, or Han character information display. For the latter, further options can be selected to configure the information shown.
- •
- (In UTF-8 text and terminal mode or in CJK text mode) Input Method (Keyboard Mapping)
- •
- "--": no keyboard mapping is active.
- •
- "...": a two-letter input method tag indicates that an according keyboard mapping is active, mapping keyboard input to characters of the selected Unicode script range, or using a more complex CJK input method involving "pick list" selection menus. See Keyboard Mapping below.
- •
- Right mouse button on this indication opens a menu for selection of the desired keyboard mapping.
- •
- Left mouse button on this indication cycles through the available mappings.
- •
- (In UTF-8 text mode only) Smart Quotes
- •
- Two quote marks are displayed that act as automatic "smart quotes": When you type a «"» or «'» character (straight double or single quote), it is replaced by an opening or closing typographic quote mark as indicated here, depending on the text context.
- •
- Right mouse button on these indications opens a menu for selection of the desired quotation marks style.
- •
- Left mouse button on these indications cycles through the available options (in either direction).
- •
- Character encoding (used for text interpretation)
- •
-
"U8":
Unicode/ISO 10646 character set / UTF-8 encoding
UTF-8 encoding is auto-detected unless overridden with -l or -C - •
-
"L1":
Western "Latin-1" character set / ISO 8859-1
(other 8 bit character sets handled transparently
if terminal font matches)
8 bit encoding is auto-detected unless overridden with -u or -C - •
-
"WA":
Western "ANSI" character set / Windows "codepage" 1252
(superset of Latin-1)
Windows encoding is not auto-detected - •
-
"CY":
Cyrillic character set / KOI8-RU encoding
(Russian, Ukrainian, Bjelorussian)
KOI8 encoding is not auto-detected - •
-
"MR":
Mac-Roman character code
Mac encoding is not auto-detected - •
-
"B5":
Traditional Chinese character set /
Big5 encoding with HKSCS extensions
CJK encodings are auto-detected unless overridden with -u/-l/-E - •
-
"GB":
Simplified Chinese character set /
GB18030 encoding, includes GBK encoding,
includes GB 2312 / EUC-CN encoding
CJK encodings are auto-detected unless overridden with -u/-l/-E - •
-
"CN":
Traditional Chinese character set /
CNS / EUC-TW encoding (including 4-byte code points)
CNS encoding is not auto-detected - •
-
"JP":
Japanese character set / JIS X 0208 / 0212 / 0213 /
EUC-JP encoding (including 3-byte code points)
CJK encodings are auto-detected unless overridden with -u/-l/-E - •
-
"sJ":
Japanese character set / Shift-JIS encoding
(including single-byte mappings to Halfwidth Forms)
CJK encodings are auto-detected unless overridden with -u/-l/-E - •
-
"KR":
Korean Unified Hangul character set / UHC encoding,
includes KS C 5601 / KS X 1001 / EUC-KR encoding
CJK encodings are auto-detected unless overridden with -u/-l/-E - •
-
"Jh":
Korean Johab character set and encoding
Johab encoding is not auto-detected - •
-
"VI":
Vietnamese character set / VISCII encoding
VISCII encoding is auto-detected unless overridden with -u/-l/-C - •
-
"TC":
Vietnamese character set / TCVN encoding
TCVN encoding is not auto-detected - •
-
"TI":
Thai character set / TIS-620 encoding
TIS-620 encoding is not auto-detected - •
- Combining display (available only if the current text encoding contains combining characters)
- •
- "ç": combined display mode
- •
- "`": separated display mode: combining characters are separated from their base character and displayed with coloured background
- •
- HOP key active
- •
- "H": HOP applies to next command
- •
- "h": HOP not active
- •
- Edit mode vs. View only mode
- •
- "E": text is being edited
- •
- "V": text is being viewed (modification inhibited)
- •
- Note: this is not related to a file being read-only; if you "edit" and modify the text of a read-only file, you will have to save to a different file name (or discard)
- •
- Append mode
- •
- "=": cut/copy replaces (overwrites) paste buffer
- •
- "+": cut/copy appends to paste buffer
- •
- Auto-indent mode
- •
- "»": auto-indentation enabled: entering a newline indents the following line like the current one
- •
- "¦": auto-indentation disabled
- •
- Automatic paragraph justification levels
- •
- "j": justification only on request (ESC j command)
- •
- "j": justification is performed whenever text is entered beyond the right margin
- •
- "J": justification is performed whenever text is inserted and the line exceeds the right margin (slightly buggy)
- •
- Paragraph termination definition effective for justification
- •
- " ": non-blank line end terminates paragraph (blank at line end continues paragraph)
- •
- "«": empty line terminates paragraph
Scrollbar
By default, mined displays a scrollbar at the right side. It
may be used for position indication within the text and for
relative or absolute positioning with the three mouse buttons.
In a UTF-8 terminal, mined uses Unicode character cell
vertical eighths characters U+2581..U+2587 for a fine-grained
scrollbar display. If your Unicode font doesn't include those
block characters, you may switch to the cell-grained scrollbar
with the -o1 option.
Text position marker stack
On commands that jump away from the current position (HOP Mark, File Begin/End, Search, Search identifier definition, Search current character, Goto Line/%, Goto Next/Previous File), the current position is remembered in a position stack. The command ESC Return goes backward, HOP ESC Return forward in this "stack", even if this means switching the file being edited.
HTML support: syntax highlighting and tag entry/matching
HTML tag entry: With the ESC H commands,
opening and closing HTML tags can be entered or (with HOP) a
marked area can be enclosed into HTML tags.
Syntax highlighting: HTML tags are displayed in
light blue colour to set them back from the actual text
contents.
Other highlighting modes apply to HTML comments and JSP code.
This option is activated if the file name suffix is
one of .html, .htm, .xml, .jsp, .sgml;
it can be toggled from the eXtra menu.
HTML tag matching: With the ESC ( or ESC ) command,
mined searches for the opening / closing HTML tag
corresponding to the current one.
Note: While you edit within a line and change its HTML
ending status (by entering or deleting '<' or '>'), the
display status of subsequent lines is not changed. (You may
refresh the display with ESC ".")
Configuration hint: The colour used for displaying HTML
tags can be configured with the environment variable MINEDHTML
using an ANSI sequence, e.g. MINEDHTML=34 (the default).
Script highlighting
It may be desirable to distinguish characters in different
script by displaying their glyphs in different colours.
(This especially allows to distinguish easier between
similar glyphs as they occur in Latin/Greek/Cyrillic scripts.)
Script highlighting is currently pre-configured for
Greek and Cyrillic. It uses the terminal's 256-colour mode
if available.
The scripts to highlight and the colour values to use
can be configured at compile-time.
See configuration hints below.
Visible indication of line contents and display
Various options are available to indicate line control characters
(TAB and line-feed) as well as shifted line display (of lines
longer than the screen width).
(So you can see how many dummy blanks there are before the
line ends or how many superfluous blanks precede a TAB character.)
Environment variables can be used to modify these indications.
Some indications may be configured specifically for UTF-8
display mode, given as UTF-8 character in the variable
containing "UTF" in its name (see listing).
Default indications and according configuration variables:
- «
- LF (Unix-type line end)
change with MINEDRET or MINEDUTFRET, may contain up to 3 characters to configure different appearance - µ
- CRLF (MSDOS-type two-character line end)
- @
- CR (Mac-type line end)
transparently handled and displayed with +R command line option - º
- NUL character (pseudo line end)
- ¬
- "none" line end (virtual line end as used to split input lines too long for internal handling; will be joined into a single line when saving the file)
- ·
- non-breaking space (character code hex A0)
- «
- Unicode line separator
- ¶
- Unicode paragraph separator
- ¶
- end of paragraph (if enabled by -p)
change with MINEDPARA or MINEDUTFPARA - »
- line extending the end of the screen line
(move cursor right to shift line display)
change with MINEDSHIFT - ·
- position spanned by TAB character
change with MINEDTAB or MINEDUTFTAB, may contain up to 3 characters to configure different appearance within the TAB span
Configuration: Display colour of the indications which are by default red can be changed with the environment variable MINEDDIM, display colour for Unicode line end indications with MINEDUNIMARK. Their values should be the numeric part of an ANSI terminal control sequence, e.g. 31 for red, "33;44" for yellow text on blue background. For more details and recommended settings see the example script file profile.mined in the Mined runtime support library. Default values are compiled in and can be overridden by setting the variables to empty values.
Long line splitting
Mined has an internal line length limit (> ca. 1024 characters). When opening a file, longer lines are split. This is handled transparently as virtual "none" line ends are used and indicated. When saving the file, lines will be joined again.
Menu display
Menu borders are displayed using block graphics characters if they are detected to be available. (Configuration hint: This depends on the "alternative character set" being defined in your system's termcap/terminfo database for the terminal you use. If it's not configured on your system but you know the terminal has the capability, use of block graphics for menu border can be enforced with the +G command line option.)
Character input support
Some character input support features support international scripts (especially with Keyboard Mapping and Input Methods), others mainly address composite characters. For the latter, it is useful to explain a few notions:
- Combining character:
- A character (usually in Unicode) that is defined to combine with the previous character into a combined character, to be displayed as a single glyph (visual unit).
- Combined character:
- The glyph combination of a Unicode character (base character) with one or more Unicode combining characters.
- Composed character (or composite character):
- A character that has one or more accents - hmm - composed into it, or is otherwise composed of components, like the ae ligature, to be displayed as a single glyph. It can be a single Unicode character or a Unicode combined character consisting of a Unicode base character and one or two Unicode combining characters.
- Accented character (or diacritic character):
- A special case of a composite character where a letter is composed with one or more accents.
- Compose key:
- A number of system and keyboard vendors have equipped their keyboards with a "Compose" or "Combine" key. This key - when configured and interpreted properly by the operating environment - produces a composed character which is then provided as input to the application.
Accented and mnemonic input support
Function keys or character mnemonics can be used to
enter accented or other composite characters.
(This is also known as digraph function with some editors.)
These character composition functions also work on the prompt line.
(Any composite character configured on your keyboard can of
course also be entered directly or using the Compose/Combine
key of your keyboard.)
- Accent prefix function keys
For the most common Western European accents, the following function keys are defined as accent prefix keys:
- F5
- diaeresis: composes next input character with diaeresis, e.g. a » ä
- Shift-F5
- tilde: composes next input character with tilde, e.g. a » ã
- Control-F5
- ring: composes next input character with ring or with cedilla, e.g. a » å , c » ç
- F6
- acute: composes next input character with acute accent (accent d'aigu), e.g. a » á
- Shift-F6
- grave: composes next input character with grave accent, e.g. a » à
- Control-F6
- circumflex: composes next input character with circumflex accent, e.g. a » â
For the Sun keyboard, the function keys R4/- , R5/÷ , R6/× , R3 , R1 , R2 are attached to the same prefix functions, in this order.
For Vietnamese input support, the following additional accent prefix keys may be configured (see Xdefaults.mined in the Mined runtime support library):
- Control-1
- acute: composes following character with acute
- Control-2
- grave:
- Control-3
- hook above
- Control-4
- tilde
- Control-5
- dot below
- Control-6
- circumflex
- Control-7
- breve
- Control-8
- horn
- Control-9
- stroke
- Alt-1
- circumflex and acute
- Alt-2
- circumflex and grave
- Alt-3
- circumflex and hook above
- Alt-4
- circumflex and tilde
- Alt-5
- circumflex and dot below
- Control-Alt-1
- breve/horn and acute: composes following A/a with breve and acute, or following O/o or U/u with horn and acute
- Control-Alt-2
- breve/horn and grave:
- Control-Alt-3
- breve/horn and hook above
- Control-Alt-4
- breve/horn and tilde
- Control-Alt-5
- breve/horn and dot below
- Character input mnemonics
- The enter-control-code prefix (^V, or ^Q in emacs mode, or ^P
in WordStar mode) can be used for mnemonic character composition.
This covers accented characters and other mnemonics.
The available mnemonics include RFC1345 mnemonics (extended
to provide generic accent mnemonics for Unicode characters),
mnemonics known from HTML and TeX and useful additional
mnemonics. See Character Mnemos reference
on the mined web site for a listing.
With mined 2000.10, additional character mnemonics have been revised and made consistent with generic RFC1345 mnemonics, redundant mnemonics have been removed, and coverage of all Latin characters (esp. with multiple accents) has been completed.
For accent compositions, mnemonic patterns (generic accent mnemonics) are listed in the following table; the respective letter to place the accent(s) on is indicated with an "x" below.
- generic mnemonic
- accent placed on the base character ("x")
- x: or "x
- diaeresis (umlaut)
- x' or ´x
- acute (accent d'aigu)
- x! or `x
- grave
- x> or ^x
- circumflex
- x? or ~x
- tilde
- x0 or °x
- ring above
- x,
- cedilla
- x-
- macron
- x(
- breve
- x.
- dot above / middle dot
- x_ or _x
- line below
- x/
- stroke
- x"
- double acute
- x;
- ogonek
- x<
- caron
- x2
- hook above
- x9
- horn
- x-> or >x
- circumflex below
- x-. or .x
- dot below
- x--. or .x-
- dot below and macron
- x.-. or .x.
- dot below and dot above
- x7 or x.-
- dot above and macron
- x~- or x?-
- tilde and macron
- x;-
- ogonek and macron
- x:-
- diaeresis and macron
- x-:
- macron and diaeresis
- x-'
- macron and acute
- x-!
- macron and grave
- -x
- bar / topbar
- ,x
- comma below / left hook
- x#
- double grave
- x&
- hook
- %x
- retroflex hook
- x)
- inverted breve
- x-? or ?x
- tilde below
- x--: or :x
- diaeresis below
- x-0 or ox
- ring below
- x-( or (x
- breve below
- x(-. or .x(
- breve and dot below
- x>-. or .x>
- circumflex and dot below
- x9-. or .x9
- horn and dot below
- x'.
- acute and dot above
- x('
- breve and acute
- x(!
- breve and grave
- x(2
- breve and hook above
- x(?
- breve and tilde
- x<.
- caron and dot above
- x,'
- cedilla and acute
- x,(
- cedilla and breve
- x>'
- circumflex and acute
- x>!
- circumflex and grave
- x>2
- circumflex and hook above
- x>?
- circumflex and tilde
- x:'
- diaeresis and acute
- x:<
- diaeresis and caron
- x:!
- diaeresis and grave
- x9'
- horn and acute
- x9!
- horn and grave
- x92
- horn and hook above
- x9?
- horn and tilde
- x0'
- ring above and acute
- x/'
- stroke and acute
- x?'
- tilde and acute
- x?:
- tilde and diaeresis
See also the description of the
^V function below for more
input options.
Two-letter mnemonics can also be entered in reverse order if
this is unambiguous. This and the generic accent mnemonics
" ^ ` ~ ¨ ¯ ´ ¸ ° (which are available for convenience in
addition to the less intuitive > ! etc) only works with
two-letter short entry "^Vxy", not with full mnemonic
entry "^V xy... ").
Mnemonic character substitution commands (ESC _ and national variants) replace the two characters at the cursor position with a suitable composite character (e.g. accented character) if possible.
Vietnamese input support
Vietnamese input support is integrated in the two input mechanisms previously described.
- •
- Additional accent prefix function keys that cover Vietnamese accents are assigned to the control/shift digit keys provided they are configured for this purpose (see the example configuration file Xdefaults.mined in the Mined runtime support library).
- •
- Generic accent composition mnemonics also apply to Vietnamese characters.
- For this purpose, both mechanisms also work with
- Vietnamese composite base characters, i.e. characters that already have an accent and can be further composed to have a second accent. These are:
- U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
- U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX
- U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX
- U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX
- U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
- U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX
- U+0102 LATIN CAPITAL LETTER A WITH BREVE
- U+0103 LATIN SMALL LETTER A WITH BREVE
- U+01A0 LATIN CAPITAL LETTER O WITH HORN
- U+01A1 LATIN SMALL LETTER O WITH HORN
- U+01AF LATIN CAPITAL LETTER U WITH HORN
- U+01B0 LATIN SMALL LETTER U WITH HORN
- Examples: Suppose your keyboard is mapped to have
- Vietnamese characters like A with circumflex available. Then:
- ^V Â ' (Control-V A-circumflex apostrophe)
- enters the composite character U+1EA4 (A with circumflex and acute)
- ^V ~ Ô (Control-V O-circumflex tilde)
- enters the composite character U+1ED6 (O with circumflex and tilde)
- Control-6 A
- enters U+00C2 (A with circumflex)
- Alt-4 A
- enters U+1EAA (A with circumflex and tilde)
- Control-Alt-3 A
- enters U+1EB2 (A with breve and hook above)
- Control-Alt-3 O
- enters U+1EDE (O with horn and hook above)
- Note: In mined 2000.10, the usage of composite
- base characters in mined character mnemonics or accent prefix combinations as just described only works if UTF-8 text encoding is selected (so not in VISCII or TCVN encoding).
Keyboard Mapping and Input Methods
Mined supports optional keyboard mapping which is especially
useful for Unicode or CJK editing.
When a keyboard mapping is selected, input characters or
sequences are transformed to other characters or sequences,
typically of a certain Unicode script range.
Keyboard mappings for Greek, Cyrillic, Hebrew, Arabic, and
major CJK input methods are preconfigured (they have been
ordered in the Input method menu according to the order of
their respective basic ranges in the Unicode character set, or
to the order of the letters of the usual abbreviation CJKV for
East Asian text processing - Chinese, Japanese, Korean,
Vietnamese). The Radical/Stroke input
method provides additional functionality as a special case.
Mined provides compile-time configuration of additional input
methods; for this aim, further mappings can be generated using the
mkkbmap script
(from tables in various formats as used by other editors) and
then compiled into mined.
See configuration hints below for details.
Keyboard mapping works as follows: You enter a key sequence
that is mapped to a character sequence in the selected
keyboard mapping table. The transformed character sequence is
used as input.
As some typical keyboard mappings contain ambigous key
sequences where one may be a prefix of another, a short delay
is applied in these cases to allow recognition of any such
sequence to be mapped. After a timeout, the shorter sequence
already matching will be used; the timeout can be cut short by
typing a blank, the blank itself will then be discarded. (The
timeout value is 900 ms by default and can be configured with
the environment variable MAPDELAY.)
- Pick lists
- Some keyboard mappings, especially for CJK input methods,
contain multiple choice mappings. In these cases, a selection
menu is displayed that offers a "pick list" to select a
character from. A character can be picked with a mouse click,
or by navigation to the desired choice with the cursor keys
(down/up, right/left, page down/up) or the '<'/'>' keys , or
by just selecting the menu row first (cursor-up/down), then
typing a digit 1-9 or 0 to select the numbered character.
The space key can be configured to either navigate to the next choice, the next row, or to select the current choice; see option -K.
If the pick list is too large to fit on the screen, the menu will be scrollable or pageable (using cursor keys).
While navigating through the pick list, the line and the selected item in the line are highlighted accordingly; if the current item is a CJK character, also its character information (description and optionally pronunciations as configured with the Han info option of the '?' information flag menu) is displayed on the status line. If the item is a word comprising multiple CJK characters, the information for only the first of them is shown. The available information is derived from the Unihan database.
Keyboard mapping data are based on Unicode. So in CJK text mode, the selection menu (the pick list) may contain symbols that are not mapped to the active CJK text encoding. In a UTF-8 terminal, these will still be displayed but cannot be inserted. In a CJK terminal, these are not displayed; an empty entry is shown instead.
- Input method selection
- An active and a standby keyboard mapping are maintained. They
can be toggled quickly for text input, also on the prompt line.
The current mapping is indicated by its two-letter script tag in the flags area, showing "--" if no mapping is active.
The active mapping can be selected in the following ways:
- ESC k (or Alt-k)
- toggles between active and standby keyboard mapping
(also on prompt line) - HOP ESC k (or HOP Alt-k)
- resets keyboard mapping to none (unmapped input)
- ESC K (or Alt-K, or right click on mapping indication in flags area)
- opens the Keyboard Mapping selection menu
(Alt-K also on prompt line) - HOP ESC K (or HOP Alt-K, or left click on mapping indication in flags area)
- cycles through available keyboard mappings
- environment configuration
- see environment variable MINEDKEYMAP below
Note: Keyboard mapping is implicitly suppressed temporarily where it is not useful: during mnemonic character input, HTML marker input, command letter entry, help selection, yes/no prompting.
Unicode support
Introduction, handled character encodings
Mined interprets UTF-8 which is a multi-byte character encoding of the ISO-10646 character set, part of which is also known as Unicode. When reading a file, it detects UTF-8 encoding automatically (unless overridden with -u or -l). It also detects UTF-16 with BOM (byte order mark U+FEFF) which can represent the complete 21 bit Unicode subset of ISO-10646. Since mined 2000.10, UTF-16 is maintained transparently, i.e. a UTF-16 encoded file is written back in UTF-16 again (with BOM). No explicit menu/command line options are currently available for UTF-16 as internal handling is done in UTF-8.
UTF-8 internal representation, transparent handling of other text
Mined handles UTF-8 representation internally and also edits and keeps illegal UTF-8 sequences. This way, if you accidentally open a Latin-1 file in UTF-8 mode, like actually any file interpreting it in a different encoding, or switch encoding while editing, or edit a file with mixed encoding, the text contents can still be editied and you will not loose any character information.
Character encoding indication
The upper-right flags area has a character encoding indication which shows "U8" if UTF-8 text interpretation is selected. For Latin-1 text interpretation "L1" is shown, for others see Mode indication flags. You may click on the indication flag to toggle between the current and the previous selected encoding.
Encoding-related commands
The command ESC u displays character encoding information in the bottom status line (conforming to ISO 14755); in UTF-8 mode it includes both the UTF-8 encoding sequence and the ISO-10646 (Unicode) value of the current character, as well as Unicode script range and character category (based on Unicode 4.0.1 since mined 2000.10), width, and combining information. The character value is displayed with 4 hexadecimal digits if the character is in the Unicode BMP (Basic Multilingual Plane, 16 bit), with 6 digits if it is a Unicode character outside of the BMP, and 8 digits if it is an ISO-10646 character outside of the Unicode range.
With HOP ESC u, permanent display can be toggled. Other commands insert the code of the current character or insert a character taking its encoding from the text. For details, see the command summary.
Character input support
With ^V, mined's special character input support is invoked (both while editing text and entering text on the prompt line, e.g. as a search expression). With this feature, (in addition to plain control characters) a composite character can be entered by its accent combination or other mnemonic character description; a more-than-two letter character mnemonics would be embedded in space characters after the ^V. In addition, numeric character codes or values can be entered with leading ^V#, octal/decimal with ^V##/^V#=, Unicode with optional u/U/+. (For examples, see description of the ^V function below.) With numeric character input, mined supports successive multiple character entry according to ISO 14755; if the numeric code is terminated by a Space key, another numeric character can be entered subsequently; a Return or Enter key terminates numeric character input.
See also the generic section Character input support above for input support for accented characters and Keyboard Mapping.
Conversion support
Two functions support interactive character encoding conversion
(Latin-1 / UTF-8) to partially fix files with mixed encoding.
In either UTF-8 or Latin-1 text mode, search for characters
encoded in the other encoding with the command
HOP ESC ( or Alt-F11 .
Then, convert the character with ESC _ or ESC ö etc.
For repeated interactive conversion, both functions can be
combined into Alt-Shift-F11 (convert current character, then
search next).
Case toggle
The case toggle function (ESC C, HOP ESC C, F11, HOP F11) handles the full Unicode range, including some special cases (e.g. Greek final sigma and optionally Turkish "i"). Also Japanese characters are toggled between Hiragana and Katakana. The case mapping is based on Unicode 4.0.1 (since mined 2000.10).
Smart quotes
Straight (double or single) quote characters «"» or «'»
can be replaced automatically with an opening or closing
typographic quotation mark, depending on the text context.
To select the mode (quotation marks style) and choose the
quotation marks to be applied, click the quote marks displayed in
the flags area in the top screen line to cycle through the
international options in both directions, or right-click there
or enter ESC Q or Alt-Q to open the Smart Quotes selection
menu.
When a file is loaded, mined tries to determine the applicable
quotation marks style in two ways: If mined edited the file
before and noted the last cursor position (in the file @mined.mar,
which can be created using the HOP F2 command, or the File menu
"save position" command), this information also includes the last
selected smart quotes mode for the file.
If that information is not available, mined auto-detects
existing quotation marks in the file and adjusts its smart
quotes mode accordingly.
The smart quotes left/right selection algorithm considers the
text context to automatically support smart quotes also in CJK text.
In smart quotes mode, straight quotes can be inserted with
compose pairs (^V ^ " or ^V ^ ').
An apostrophe can be inserted with HOP ' (^G ').
Smart quotes style can also be preselected with the environment
variable MINEDQUOTES which should
then contain the opening/closing quote pair or just the
opening quote mark (UTF-8 encoded, double or single quotes);
this overrides both auto-detection and the preference saved
with the cursor position.
Smart dashes: If smart quotes are active, also an input
sequence of "--" is replaced with an en dash (if preceded by a
blank) or an em dash. A single "-" is replaced with a
Hebrew hyphen mark Maqaf (U+05BE) if an adjacent character is
in the Hebrew script range.
Bidirectional terminal support
A bidirectional terminal (such as mlterm) will probably
also apply Arabic LAM/ALEF ligature joining. Mined auto-detects
this feature and enables bidi terminal handling automatically.
Otherwise, bidi terminal handling can be configured with the
option +UU.
In this mode, when displaying a menu, underlying text
lines that contain right-to-left characters are cleared first
in order to prevent display confusion between the terminal's
bidi algorithm and the menu position.
Also, with bidi terminal handling enabled, mined assumes
that the terminal applies Arabic LAM/ALEF ligature joining
and properly accounts for this feature in display position
handling.
In separated display mode, the joining part of the ligature
is indicated similarly to the handling of combining characters.
Input support for right-to-left scripts (" poor man's bidi" mode)
This support feature for input of right-to-left text pieces
is enabled by default unless the terminal is detected to be
in bidi mode itself (e.g. mlterm).
"Poor man's bidi" mode is intended for quick entry of
right-to-left text without having a right-to-left terminal;
it is similar to the "revins" (reverse insert) option of vim
and works as follows:
After entering a right-to-left Unicode character, the cursor
position is moved left of it, so subsequent characters will be
appended left and the text shifted right. Characters are
stored in visual order while input support is implicit, based
on the characters being typed. Entering a left-to-right
character will automatically skip behind the previously
entered right-to-left text on the line (changed in mined 2000.10)
and switch to left-to-right direction; this behaviour
optimises inserting small pieces of right-to-left text into
basically left-to-right text; this priority is justified by
the assumption that this mode (with visual storing order) is
only useful for inserting small right-to-left quotations into
left-to-right text and not for editing right-to-left documents
(which should be stored in logical order).
Newline, Space, TAB, and combining characters attempt to
behave well according to what was entered before; however,
intermediate cursor movement is not considered.
Unicode line ends
Mined detects and handles Unicode line separators and
paragraph separators; they are displayed as shown
above (unless disabled with +u-u).
HOP Return (HOP Enter) will insert a Unicode paragraph
separator, Return (Enter) in a line that already has a Unicode
line end will insert a Unicode line separator.
Also the keys Shift-Return (Shift-Enter) or Control-Return
(Control-Enter) insert a paragraph separator or line separator
respectively.
Configuration: In order to enable shift and control
with the Return or Enter keys, xterm must be configured as
shown in the example configuration file Xdefaults.mined in
the Mined runtime support library.
Unicode display
In UTF-8 terminal mode, mined displays all Unicode characters if they are contained in the font used by the terminal. Fonts usually have a substitute glyph to indicate characters not contained in the font. Wide characters (double-width glyphs) are displayed in a double-width character cell of the terminal. Combining characters are displayed either combined or separated (see Combining characters below).
Illegal UTF-8 sequences are displayed with highlighted background, using the following indications. Furthermore, control characters encoded as a UTF-8 sequence and control characters in the "C1" range (values 0x80..0x9F) will be displayed similar to normal control characters but with coloured highlighting.
- 8
- for an unexpected UTF-8 continuation byte (range 80-BF)
- 4
- for a 0xFE (254) byte
- 5
- for a 0xFF (255) byte
- «
- for a too short UTF-8 sequence if followed by a single-byte character (00..7F)
- »
- for a too short UTF-8 sequence if followed by a multi-byte character (C0..FF)
Legal Unicode characters that cannot be displayed are indicated with the following replacements:
- e
- the character code U+FFFE
- f
- the character code U+FFFF
- ¤ or
- ¤ (if wide) a Unicode character that cannot be displayed in the (non-UTF-8) terminal (non-combining)
- a Unicode combining character that cannot be displayed in the (non-UTF-8) terminal
- E
- the Euro character U+20AC (in a non-UTF-8 terminal)
- 0 ..9 ,
- A ..Z etc a corresponding fullwidth ASCII character (in a non-UTF-8 terminal)
Configuration: Display colour of special or illegal
UTF-8 indications can be changed with the environment variable
MINEDUNI, the value should be the numeric part of an ANSI
terminal control sequence; optionally, the value can be
preceded by a character to be used for Unicode character
indication in non-UTF-8 (Latin-1) terminal mode.
(The default configuration value is "¤ 46").
Combining characters
When editing text in Unicode or any encoding that contains combining characters, mined supports display and editing of combining and combined characters.
(Note: Terminal support for combining charcters is
auto-detected; additional command line options are available
in case this fails.)
If mined operates on a terminal that handles combining
characters, it offers two editing modes: combined or separated.
They can be toggled by clicking the Combining display flag
in the Mode indication flags area
(right part of the top screen line),
or by the menu entry "eXtra - combined display";
separated display mode can also be selected by the
command line option -c.
- Combined display and editing mode (Combining display flag ç)
- Combined characters are displayed as intended (i.e., combined).
- •
- Micro movement into combined characters:
- •
- The cursor can be moved into a combined character with Control-left-arrow and Control-right-arrow, or ^V left-arrow and ^V right-arrow.
- •
- You can determine the exact position of the cursor if permanent character info is switched on (by HOP ESC u or with HOP "toggle char info" in the eXtra menu).
- •
- Partially editing combined characters:
- •
- If the cursor is on a combined character, delete next character will delete the whole combined character, with all combining accents.
- •
- If the cursor is within a combined character, delete next character will delete the current combining accent only.
- •
- Control-Backspace behind or within a combined character will only delete the combining character preceding the cursor position (while Backspace would delete the whole combined character).
- •
- (Since mined 2000.10) If the cursor is right behind a combined character, Control-Backspace will delete only the rightmost combining accent, if it is within a combined character, Control-Backspace will only delete the combining character preceding the cursor position (while Backspace would delete the whole combined character).
- •
- You can also position the cursor as described above and use copy-and-paste operations. Note: Control-left-arrow, Control-right-arrow, and Control-Backspace only work if these keys are configured to emit distinguished escape sequences with Control key held down. To enable this in your X configuration, see the example configuration file Xdefaults.mined in the Mined runtime support library.
- Separated display and editing mode (Combining display flag `)
- Combined characters are separated into base character and combining character(s) for display and editing. Combining characters are indicated with coloured background.
- •
- In separated display mode, all cursor and text modification operations work on the combining parts as displayed.
- Joining characters
- If mined assumes that the terminal applies LAM/ALEF ligature
joining (either configured with the +UU right-to-left display
option or auto-detected), the joined character width will
be handled correctly in cooperation with the terminal.
Mined supports ligature joining in both combining character display modes: - •
- In combined display mode, the screen position is accounted properly.
- •
- In separated display mode, the joining part of the ligature is indicated using the appropriate isolated form on Unicode special indication background colour (similar to the handling of combining characters).
Search expression limitations
Unicode search ranges can not be very large as all included characters are listed in an internal buffer which is limited to ca. 1 KB.
UTF-8 preservation and byte-transparent editing
When splitting lines that are too long for internal handling, consistency of UTF-8 sequences is preserved (they are not split); combining characters may get split off their base characters, however, they will join seemlessly as lines are joined again (e.g. when saving the file). Note that combining characters at the beginning of a line are not displayed in combined display mode.
Terminal environment
UTF-8 terminal operation can be configured in either of these ways:
- •
- Auto-detection: If the terminal emits cursor position reports, mined can uniquely recognise UTF-8 terminal encoding and further UTF-8 features (see Terminal encoding support below).
- •
- Parameter: +U selects UTF-8 terminal mode.
- •
- Environment: One of the locale-related environment variables LC_ALL, LC_CTYPE, LANG, whichever is found to exist first in that order, selects UTF-8 terminal mode if its value has a suffix of ".UTF-8" or ".utf8". The recommended way of configuring the terminal environment is to set LC_CTYPE implicitly when a UTF-8 terminal session is started, see the script "uterm" in the Mined runtime support library. For more details, see Locale configuration.
- See also Terminal interworking
- problems for special hints about certain terminals.
CJK support (Chinese/Japanese/Korean Han characters)
Mined provides CJK support features uniformly in Unicode and in major CJK encodings. For information relating to CJK character encoding see Character encoding support below.
CJK input method support
Input methods for CJK characters are supported with the Keyboard mapping mechanism. A selected number of input methods considered useful for each CJK script are pre-configured, others can be added easily at compile-time with the mkkbmap script.
- Radical/Stroke input method
- Mined 2000.10 implements a Radical/Stroke input method for CJK characters with specific functionality in addition to keyboard mapping; it works at two-levels, selecting a radical first, then a character from a list sorted by stroke count. If this input method is active, a selection menu for the 214 CJK radicals is displayed (without prior keyboard input). The menu displays all variations of each radical. After selecting a radical from this menu, a second-level menu is displayed, showing all CJK characters based on the selected radical, sorted by the number of strokes. Many of these menus will not fit on the screen and can be scrolled. Pressing Escape here would return to the radical menu; pressing Escape there would disable the input method. To enter a non-mapped character (e.g. a line end), you need to disable Radical/Stroke input method temporarily; just toggle it back on with Alt-k (or Esc k) and the radical menu will be displayed again for continued input.
CJK character display
Combining characters (in both JIS encodings and GB18030) are handled and the combined characters are displayed properly in either combined or separated display mode in a UTF-8 terminal (like for UTF-8 encoded text). The following special CJK character indications apply:
- ¤
- CJK character that cannot be displayed in (8-bit) terminal
- ? or
- ?
CJK character code that has no known mapping to Unicode
(to enforce display on CJK terminal use option +C) - # or
- #
invalid CJK character code that is outside of the
code range assigned to the encoding scheme
(to enforce display on CJK terminal use option +CC) - #
- CJK character in extended code range
(esp. 3 and 4 byte codes, or codes with 0x80...0x9F
byte range) that cannot be displayed on CJK terminal
due to terminal capability limitations
(to enforce display on CJK terminal use option +CCC) - <
- incomplete or otherwise illegal CJK code
The environment variables MINEDRET, MINEDTAB, MINEDSHIFT are ignored in CJK terminal mode.
Han character information display
With mined 2000.10, there is a new flag menu, the Info menu
(indicated with "?") that collects all options for information
display, mainly character-related.
If "Han info" is enabled in this menu, when the cursor is
over a Han character and either descriptive or pronunciation
information about this character is available in the Unihan
database (from unicode.org), this information is displayed.
The information can optionally be shown on the status line
(where it may be truncated if too long) or in a pop-up menu next
to the character. Pronunciation information to be displayed
can be selected in the Info menu.
To open the Info Menu, type Alt-F10 or right-click the
"?" flag.
The same information is always shown while you are browsing an input method pick list (then on the status line).
The information includes the character code (in CJK encoding, both CJK code and corresponding Unicode value are shown). The amount of descriptive information (from the Unihan database) to be shown can also be preconfigured with the environment variable MINEDHANINFO; see Han info configuration below.
Character encoding support
CJK and mapped 8 bit encoding support
Mined supports major CJK encodings.
With mined 2000.10, it also support a selected range of mapped
8 bit encodings (like Windows-ANSI, Cyrillic, and some South Asian
8 bit encodings).
Handling of character encodings is selected in one of the
following ways:
- •
- One of the command line options -EX where X is one of the character encoding tags (see the encoding options above).
- •
- From the Encoding Menu (one of the flag menus), the encoding interpretation can be changed while editing; to open it, click with the right mouse button on the encoding indication in the flags area of the top line, or type Alt-E. See also Mode indication flags for an overview.
- •
- Auto-detection (by heuristic counting of valid character codes). Note: The encodings to be taken into account for auto-detection can be configured with the MINEDDETECT environment variable. Set it to the list of encoding indications (capital letters as listed for the -E parameter) to disable auto-detection of other encodings. UTF-8 auto-detection cannot be disabled this way.
- •
- Locale indication in one of the environment variables LANG, LC_ALL or LC_CTYPE (see Locale configuration).
- •
- The command line option -C lets mined assume to handle CJK encoded text and to operate in a CJK terminal (unless auto-detection determines a UTF-8 terminal).
Combining characters
In all character encodings handled by mined that contain combining characters, mined handles them and provides partial editing and an optional separated display mode as described above under Unicode support, section Combining characters. (CJK encodings EUC-JP, Shift-JIS and GB18030, Vietnamese TCVN and Thai TIS-620).
Character code related commands
The command ESC u displays character encoding information in the bottom status line (conforming to ISO 14755); this includes the character code, the mapped Unicode character value, script and character category, and combining information.
With HOP ESC u, permanent display can be toggled. Other commands insert the code of the current character or insert a character taking its encoding from the text. For details, see the command summary.
Terminal environment for CJK encoding support
Mined supports CJK encodings in two terminal environments; it performs auto-detection of terminal features (see Terminal encoding support below).
- CJK terminals:
- For terminals that support native CJK encodings
(e.g. hanterm or cxterm), the terminal encoding assumed by
mined can be specified with the -E option (together with the
-C option in case CJK terminal auto-detection fails) or by a
locale indication in one of the environment variables LC_ALL,
LC_CTYPE or LANG.
For available encodings and usage of the -E option,
see Mode indication flags.
For usage of the locale environment variables, see
Locale configuration.
However, in CJK terminals, mined handling of CJK encoding is basically transparent: The font used by the terminal must match the encoding of the edited files; the user is responsible for setting up the terminal with the suitable fonts; display of invalid characters (that are not included in the font being used) may produce weird screen behaviour (e.g. in cxterm). Since release 2000.8, mined tries however to detect if certain CJK codes can be displayed and if it assumes they cannot (e.g. double-byte codes with bytes in the 0x80-0x9F range, or 3-byte and 4-byte code sequences) it will display replacement indications instead. Also, since release 2000.10, CJK encodings that do not map to Unicode are suppressed for display in order to avoid screen garbage caused by invalid encoded characters; this can be overridden by the new option +C. These and other invalid CJK character codes are displayed with special indications (see CJK character display below). The options +C, +CC, +CCC control the level of display transparency for unknown character codes on CJK terminals (see Command line options above for details). Apart from the necessity to set up fonts matching the encoding, mined uses the encoding information for the following purposes: determination of invalid/unknown CJK character codes, selection of appropriate CJK characters for display of line markers (line end and TAB indications), keyboard mapped input (CJK input methods, the data of which are configured in Unicode for all modes). Since release 2000.10, CJK-encoded combining characters (in both JIS encodings and GB18030) are handled on CJK terminals. - UTF-8 terminal:
- Since release 2000.7, CJK encoding is also supported in a UTF-8 terminal; mined uses character set mapping tables for display and input interpretation. The apparently major encodings for CJK (Chinese/Japanese/Korean) text are supported. See Mode indication flags for a listing. For Japanese, the JIS encodings that map to two Unicode characters are supported. Since release 2000.10, CJK-encoded combining characters (in both JIS encodings and GB18030) are handled on UTF-8 terminals.
- 8 bit terminal:
- CJK characters are displayed with substitute indications, so minimal file editing capability is provided; fullwidth ASCII characters are visible.
- See also Terminal interworking
- problems for special hints about certain terminals.
Terminal encoding support
Terminal feature detection
Since release 2000.8, mined performs auto-detection of terminal features for UTF-8 terminals (UTF-8 encoding, different width data versions up to Unicode 4.0.1 (since mined 2000.10), handling of double-width, combining and joining characters) and CJK terminals (handling of non-EUC code points, GB18030, 3-byte and 4-byte encodings). CJK terminals cannot always be distinguished from 8-bit terminals however, so that CJK terminal encoding should still be configured with either an option (-C) or by proper setting of the locale environment (LC_ALL, LC_CTYPE or LANG variable). For usage of the locale environment variables, see Locale configuration.
Mined Command reference (command and key function assignments)
Cursor and screen motion
- ^E or cursor-up
- Move cursor 1 line up.
with HOP: Go to top of page. - ^X or cursor-down
- Move cursor 1 line down.
with HOP: Go to bottom of page. - ^S or cursor-left
- Move cursor 1 character left.
with HOP or Control-Home or (with -k option) Home: Go to beginning of line. - ^D or cursor-right
- Move cursor 1 character right.
with HOP or Control-End or (with -k option) End: Go to end of line. - ^A or Shift-cursor-left
- Move backward to beginning of previous word.
with HOP: Go to beginning of sentence. - ^F or Shift-cursor-right
- Move forward to beginning of next word.
with HOP: Go to end of sentence. - Control-cursor-up
- Move backward to previous beginning of paragraph.
- Control-cursor-down
- Move forward to next beginning of paragraph.
- ^R or PgUp or PrevScreen (vt100)
- Scroll backward 1 page (Top line becomes bottom line).
with HOP: Go to beginning of text. - ^C or PgDn or NextScreen (vt100)
- Scroll forward 1 page (Bottom line becomes top line).
with HOP: Go to end of text. - Home/Pos1 (on small keypad)
- Move to beginning of line. Only if keypad is configured to emit different control sequences for the two keypads, see Keypad configuration hints below. (with -k option): Mark position.
- End (on small keypad)
- Move to end of line. Only if keypad is configured
to emit different control sequences for the two keypads,
see Keypad configuration hints below.
(with -k option): Copy text between marked and current position.
- Navigation support for combined Unicode characters
- Enabling partial editing of base character and combining characters (accents) in combined display mode.
- Control-cursor-right or ^V cursor-right
- Micro movement: Move partial character right into Unicode combined character.
- Control-cursor-left or ^V cursor-left
- Micro movement: Move partial character left over Unicode combining character.
- ^W or Control-PgUp (PC) or PF3 (vt100)
- Scroll screen backward 1 line.
with HOP: Scroll backward half a screen. - ^Z or Control-PgDn (PC) or PF4 (vt100)
- Scroll screen forward 1 line.
with HOP: Scroll forward half a screen. - ^G nn or ESC g nn
- Move to a line (prompts for line number). (Terminate command with Return or Space.)
- ^G nn % or ESC g nn %
- Move to position in text determined by percentage.
- ^G nn p or ESC g nn p
- Move to page in text (set page length with ESC P).
- ^G < command > or ESC g < command >
- If not immediately followed by a digit, the positioning command works as an alternative HOP key.
- ^G N '
- (N=0..9) Go to marker N. ("'", "g", "." may be used.)
- ESC ' N
- (N=0..9) Go to marker N.
- HOP Pos1 or ^G ^] or ESC ] or HOP ESC ^
- Move to the position previously marked by Pos1/ESC ^/^] .
- ESC Return or Alt-Return
- Return backward to the previous position marked in the position stack.
- HOP ESC Return or HOP Alt-Return
- Return forward to the next position marked in the position stack.
- ^Q or ^G or "5" (on keypad) or Scroll Lock or Pause or F10 (PC) or ESC (especially PC)
- HOP key (unless ^G followed by a digit). In order to enable the "5" key, or (for convenience on notebooks) to assign the HOP function to the Scroll Lock or Pause key, your X resource configuration may have to be adapted, see Keypad configuration below.
- left mouse button
- move cursor to position
Entering text
- < printable char >
- Insert the character at cursor position.
- < Return > or < Enter > or < LF char >
- Insert a newline at cursor position, clone line end type. Apply auto-indentation if enabled.
- < Shift-Return > or < Shift-Enter >
- Make a new line by inserting a Unicode paragraph separator at cursor position (unless disabled with +u-u). (See also Unicode line ends for key configuration.)
- < Control-Return > or < Control-Enter >
- Make a new line by inserting a Unicode line separator at cursor position (unless disabled with +u-u). (See also Unicode line ends for key configuration.)
- < TAB char >
- Insert a tab character at cursor position.
- HOP {, HOP (, HOP [, HOP <
- Enter indented pair of matching parentheses.
- HOP /
- Enter an indented Javadoc comment frame.
- HOP '
- Enter an apostrophe.
- HOP -
- Underline the line that starts before the cursor position.
- ^O
- Make new line at current position.
If the current line has a "NUL" or "NONE" special
line end type, it will be reproduced for the new line.
(Entering a new-line key always produces a real line end.)
If the current line is terminated by a Unicode
paragraph separator, a line separator is inserted.
Auto-indentation is not applied. - HOP ^O
- Split a line in two binary-transparently, i.e.
enter a "NONE" virtual line end.
- Accented character input support by accent prefix keys
- function key prefixes for accent compositions
- These functions also work on the prompt line (e.g. to enter search expressions).
- F5 < character >
- Compose character with diaeresis (umlaut accent), e.g. a » ä
- Shift-F5 < character >
- Compose character with tilde, e.g. a » ã
- Control-F5 < character >
- Compose character with ring or with cedilla, e.g. a » å , c » ç
- F6 < character >
- Compose character with acute accent (accent d'aigu), e.g. a » á
- Shift-F6 < character >
- Compose character with grave accent, e.g. a » à
- Control-F6 < character >
- Compose character with circumflex accent, e.g. a » â
- Control-1 ... Control-9
- Compose character with accent, esp. for Vietnamese (double) accented characters, see Vietnamese input support above.
- (Control-)Alt-1 ... (Control-)Alt-5
- Compose character with two accents, esp. for Vietnamese
double accented characters, see
Vietnamese input support above.
- Input support commands
- Control-V special input support
- These functions also work on the prompt line (e.g. to enter search expressions).
- ^V < control character >
- Enter control character.
- ^V [ or ^V \ or ^V ]
- Enter one of the control characters ^[, ^\, ^].
- ^V ^ ^ or ^V _ _
- Enter one of the control characters ^^, ^_.
- ^V ^ ' or ^V ^ "
- Enter one of the plain quote marks ' or " (needed in smart quotes mode)
- ^V < accent > < character >
- Compose accented character.
- ^V # xxxx < Space or Return >
- Enter character defined by a hexadecimal number being input (depending on applicable encoding, byte value, Unicode value, or valid CJK code is required).
- ^V # # xxxxxx < Space or Return >
- Like ^V # but using an octal number.
- ^V # = xxxxx < Space or Return >
- Like ^V # but using a decimal number.
- ^V # u or U or +
- followed by a numeric input as described above (with optional # or = for octal or decimal input) interprets the input as a numeric Unicode value which is converted into the current text encoding.
- ^V # ... Space ...
- With numeric character input, mined supports successive multiple character entry according to ISO 14755 if the numeric code is terminated by a Space key.
- ^V < function key >
- This is not an input support function but rather the
function key is invoked as if pressed together with the
control key.
- Mnemonic character input support
- Mnemonics recognized include the following:
- •
- RFC 1345 mnemos (except mappings to Unicode private use areas); in ambiguous cases, the RFC 1345 mnemos must be entered in long mnemonic input mode, e.g. with "^V pi " rather than "^Vpi".
- •
- HTML mnemos; in ambiguous cases, the HTML mnemos must be prepended with a "&".
- •
- TeX mnemos (macros) and substitutes, leaving out any "\".
- •
- Some additional mnemos as listed on the mined character mnemos page. Unless there is an ambiguous mapping, all two-letter mnemonics can also be entered in reverse order.
- ^V < Space > < name > < Space or Return >
- Lookup character mnemonic and enter character. RFC 1345 mnemonics take precedence in ambiguous cases.
- ^V < character > < character >
- Compose two characters. Non-RFC 1345 mnemonics take
precedence in ambiguous cases.
- Examples:
- ^V^A
- Enter Control-A.
- ^V^[ or ^V[
- Enter the escape character.
- ^V__
- Enter Control-_.
- ^V'e
- Enter é (e with accent d'aigu).
- ^Vae
- Enter æ (the ae ligature).
- ^V-,
- Enter ¬ (the negation symbol).
- ^V neg (terminated by Space or Return)
- Enter ¬ (the negation symbol).
- ^Va* or ^V a* (terminated by Space or Return)
- Enter the Greek small letter alpha.
- ^V ae' (terminated by Space or Return)
- Enter the Latin ligature ae with acute accent.
- ^V euro (terminated by Space or Return)
- Enter the Euro character.
- ^V#20ac (terminated by Space or Return)
- Enter the character with hexadecimal value 20AC (which is the Euro character in UTF-8 encoding).
- ^V#U20ac (terminated by Space or Return)
- Enter the Euro character (which has the hexadecimal Unicode value 20AC) encoded in the currently selected text encoding.
- ^V#+20ac < Space > +20ac < Return >
- Enter two Euro characters in
successive multiple character entry mode (ISO 14755).
- Input Method (Keyboard Mapping) selection
- ESC k
- toggles between active and standby keyboard mapping (ESC k/Alt-k also works on prompt line)
- HOP ESC k
- resets keyboard mapping to none (unmapped input)
- ESC K or right click on mapping indication in flags area
- opens the Input Method selection menu (ESC K/Alt-K also works on prompt line)
- HOP ESC K or left click on mapping indication in flags area
- cycles through available keyboard mappings / input methods
Modifying text
- Character deletion with DEL and Backspace (^H) characters
- In order to accommodate various usages of these keys, the function depends on environment settings and the mined option -B.
- Note that the "Delete character left" function actually applies
- the Back-Tab function if there is only white space before the
current position in the current line and the line above.
- If the terminal is set up such that Backspace (^H) deletes a character left on the command line (stty erase ^H):
- ^H
- Delete character left. Apply auto-undent function where appropriate (delete multiple spaces back to previous level of indentation).
- DEL (default)
- Delete character right.
- DEL (with -B)
- Delete character left / auto-undent.
- Control-Del
- Delete character right.
- If the terminal is set up such that DEL deletes a character left on the command line (stty erase ^?):
- DEL
- Delete character left.
- ^H (default)
- Delete character left. Apply auto-undent function where appropriate (delete multiple spaces back to previous level of indentation).
- ^H (with -B option)
- Move left.
- Control-Del
- Delete character right.
- Control-Backspace
- Delete only right-most combining accent of combined character left of cursor position. If not next to a combined character: delete character left, avoiding auto-undent function.
- HOP < delete previous character command >
- Delete the line beginning.
- ^B
- Delete character right (next character).
- ^T
- Delete next word.
- ^^
- Delete previous word.
- ^K
- Delete tail of line;
if at end of line, delete line end (joining lines).
with HOP: Delete whole line. - ESC X
- Insert hexadecimal representation of current character code.
(In UTF-8 mode, this is the UTF-8 byte sequence
of the character in hexadecimal notation.)
with HOP: Insert character with hexadecimal code scanned from text at current position. - ESC U
- Insert (hexadecimal) Unicode value of current character
(with either 4/6/8 hexadecimal digits, depending on the
value); in CJK or mapped 8 bit encoding mode, the
value is transformed from the current text encoding
into Unicode.
with HOP or Control-Shift-F11: Insert character with hexadecimal Unicode value scanned from text at current position; in CJK or mapped 8 bit encoding mode, the value is transformed from Unicode into the current text encoding. - ESC A
- Like ESC U but inserting an octal Unicode value.
with HOP: Like HOP ESC U but scanning an octal Unicode value. - ESC D
- Like ESC U but inserting a decimal Unicode value.
with HOP: Like HOP ESC U but scanning a decimal Unicode value. - ESC C or F11
- Exchange case (low/capital) of character under cursor.
Applies to Unicode characters. Special behaviour for
some characters: Greek final s, Turkish "i" if the
environment variable LANG or LC_ALL or LC_CTYPE begins
with "tr" or "az".
Also Japanese characters are toggled between
Hiragana and Katakana.
with HOP or Shift-F11: Apply to word from cursor. - ESC _ or Control-F11
- Mnemonic character substitution replaces the two characters
at the cursor position with a suitable composite
character (e.g. accented character) if possible.
With Control-F11, transformations are the same as with
the ^V two-letter character input mnemonics.
With ESC _, language-dependent preferences may take
precedence (see variations below)
according to the current locale environment.
As an additional function, the command also transforms between Latin-1 and UTF-8 encoded characters if an accordingly encoded character is found at the current position; the current character encoding mode is used to determine the target character set.
Example: ae->æ, oe->œ (oe ligature U+0153, in Unicode mode)
Example: æ (Latin-1 encoded)->æ (UTF-8 encoded) or vice versa
With Escape commands with composed letters that occur on respective national keyboards, the according preference transformations take precedence: - ESC ä or ESC ö or ESC ü or ESC ß
- Similar to ESC _, but with German transformation preferences.
example: ae->ä, oe->ö - ESC é or ESC è or ESC à or ESC ù or ESC ç
- Similar to ESC _, but with French transformation preferences.
example: oe->œ (oe ligature U+0153, in Unicode mode) - ESC æ or ESC å or ESC ø
- Similar to ESC _, but with Danish transformation preferences.
example: ae->æ, oe->ø - HOP ESC ( or Alt-F11
- Search for a character encoded in the "wrong encoding", i.e. a UTF-8 character in Latin-1 mode, or a Latin-1 character in UTF-8 mode.
- ESC _ or ESC ö etc.
- If invoked on a non-ASCII character, Latin-1 / UTF-8 character conversion is applied; if the character is encoded in the encoding other than the current text encoding it is converted into the current text encoding.
- Alt-Shift-F11
- Convert Latin-1 / UTF-8, then search for the next "wrong encoded" character.
- ESC j
- ("Clever Justify") Format paragraph by word-wrapping
according to the currently set right margin value;
left margins are derived from the contents of the
paragraph and line. Heuristic detection of numbered
items automatically triggers appropriate indentation.
End-of-paragraph is a line without trailing blank.
with HOP: Same, but end-of-paragraph is a blank line. - ESC J
- ("Normal Justify") Format paragraph by word-wrapping
according to the currently set left and right margin values.
End-of-paragraph is a line without trailing blank.
with HOP: Same, but end-of-paragraph is a blank line. - ESC <
- Set left margin for justification.
- ESC ;
- Set left margin of first line of paragraph only.
- ESC :
- Set left margin of next lines of paragraph only.
- ESC >
- Set right margin for justification.
- ESC H (every first time)
- Enter HTML tag (and remember for subsequent ESC H). (Note that Alt-Shift-H will do the same thing if your terminal is configured appropriately - see the example configuration file Xdefaults.mined in the Mined runtime support library.) The tag can be entered with attributes and values; these will not be repeated in the closing tag (see next entry on ESC H).
- ESC H (every second time)
- Enter closing HTML tag. Any tag attributes and values entered with the tag (see previous entry on ESC H) will be left out.
- HOP ESC H
- Put text between mark and current position in HTML tags. The "A" tag gets special treatment.
Text block and buffer operations
- ^] or Control-@ (Control-Space) or ESC @ or ESC ^ or Stop (sun) or Home/Pos1 (on right keypad) or Select (vt100) or Shift-Home
- Set mark (to remember the current location).
with HOP: Goto mark. - ^G N m or ESC g N ,
- (N=0..9) Set marker N. (^G N , also works.)
- ESC m N
- (N=0..9) Set marker N.
- ^G N ' or ESC g N '
- (N=0..9) Go to marker N. (^G N g or ^G N . also works.)
- ESC ' N
- (N=0..9) Go to marker N.
- ^Y or End (on right keypad) or Copy (sun) or Do (vt100) or Shift-End or Control-Ins
- Copy text between mark and current position to buffer.
with HOP: Append to buffer. - ^U or Del (on right keypad) or Cut (sun) or Control-End (PC) or Remove (vt100) or Shift-Del
- Cut text between mark and current position; save in buffer.
with HOP: Append to buffer. - ^P or Ins or Paste (sun) or InsertHere (vt100)
- Paste contents of buffer to current position.
With ^P, the cursor is always placed before the pasted region.
In emacs mode or with the option +V the cursor is placed behind
the pasted region.
with HOP: (e.g. HOP Ins or ^G^P) Paste from inter-window buffer. Thus you can quickly copy text from one invocation of mined to another. - Alt-Insert or Control-F4
- Replace text just pasted with preceding paste buffer. This command uses a ring of paste buffers as established with the emacs editor ("yank ring").
- ESC b or Shift-F4
- Copy contents of paste buffer into a file.
with HOP: Append to file. - ESC i or F4
- Insert file at current position.
- (from File menu)
- Print text being edited (to default printer).
- ESC c
- Invoke operating system command (prompted for) with paste buffer as input.
Search
- ESC / or Find or F7 or F8
- Search forward (prompt for regular expression).
with HOP: Search for current identifier. - ESC \
- Search backward (prompt for regular expression).
- HOP F8 or Shift-F9
- Search for current identifier.
- Alt-Shift-F9
- Search for current identifier backward.
- HOP Shift-F8 or ESC t
- Search for definition of current identifier (using tags file). See ESC t below for further description.
- HOP Control-Shift-F8
- Search for identifier definition (prompts for identifier).
- HOP Control-F8
- Search for current character.
- ^N or F9
- Search for next occurence (using previous
search expression and direction).
with HOP: Repeat last but one search; two alternating search expressions can be used with this command. - Alt-F9
- Search again (for last expression) but in the opposite direction.
- ESC , or Shift-F8
- (Global) Substitute (prompt for search and replacement strings).
- ESC r or Control-F8
- (Global) Replace with confirmation prompting (first prompt for strings).
- ESC R or Control-Shift-F8
- (Line Replace) Substitute on current line (prompt for strings).
- ESC ( or ESC ) or ESC { or ESC }
- Search for corresponding bracket matching the bracket at current position in one of the pairs (), [], {}, <>, «». (Nested matching bracket pairs are skipped.) Also works for matching HTML tags. In case you are editing a mailbox file, these commands also work for MIME separators or mail headers; in this case, the search direction depends on the command character, e.g. ESC ( searches backward, ESC ) searches forward.
- ESC t or HOP Shift-F8
- Search for and move to the location of the definition of
identifier at the current cursor position. This command
uses the tags file that can be generated with the
ctags command (Unix).
It opens another file if necessary and automatically saves
the current file then.
Like with some commands, ESC t places the current position on the position marker stack before going to the location of the identifier definition. The command ESC Return (Alt-Ret) can move back to that position, even if edited files were changed with the command. - HOP ESC t
- Similar, but prompts for identifier.
- HOP ESC ( or Alt-F11
- Search for a character encoded in the "wrong encoding", i.e. a UTF-8 character in Latin-1 mode, or a Latin-1 character in UTF-8 mode.
- Special functions in a search string
- matches any character.
- ^
- (at begin of pattern) restricts match to the begin of a line.
- $
- (at end of pattern) restricts match to the end of a line.
- [< character set >]
- matches any one of a set of characters; the set may be given by listing elements, denoting a range < c1 >...< c2 >, or negating the whole set [^< character set >].
- \< character >
- matches the character literally.
- < pattern >*
- (a star appended to any one of the defined patterns) matches a (zero or more times) repetition of this pattern. In a final position within the search expression, however, it matches one or more times this pattern.
- ^V^J or \n
- (a linefeed character or its representation)
searches for newline embedded in the search pattern
- Special functions in a replacement string
- &
- is replaced by the matched pattern to be replaced.
- ^V^J or \n
- (a linefeed character) embeds a newline in the replacement string
File operations
- ESC w or F2
- Save (write back) current text to file (only if modified).
with HOP: saves current file position in marker file @mined.mar, so that subsequent editing sessions will start at the current position and remember formatting parameters. - ESC W or Shift-F2
- Save (write back) current text to file (unconditionally).
- Control-F2
- Save As; save current text to file with different name
- F12
- enable memory for file positions in current directory; saves current file position in marker file @mined.mar, so that subsequent editing sessions will start at the current position and remember formatting parameters.
- F3
- Edit another file (prompt for save if current text changed).
- ESC v
- View another file (prompt for save if current text changed).
- ESC V
- Toggle between edit mode and view only mode.
- ESC q
- Quit the editor (prompt for save if current text changed).
- ESC ESC
- Exit editing current text (save first if changed), continue with next file if multiple files are being edited, otherwise exit mined.
- ESC +
- Edit the next file in the list of files being edited.
with HOP: Edit the last file in the list. - ESC -
- Edit the previous file in the list of files being edited.
with HOP: Edit the first file in the list. - ESC #
- Ask for index into the list of files and edit that file.
- ^G N # or ESC g N #
- Edit Nth file. (^G N f also works.)
- ESC # #
- Reload file currently being edited.
Menu
- ESC Space or Alt-Space or Shift-F10
- Open Popup menu.
- Alt-F10
- Open first flag menu (Info menu).
- ESC f or Alt-f or F10
- Open File menu.
- ESC < letter > or Alt-< letter >
- Open menu.
- ESC K or Alt-K
- opens the Input Method selection menu (ESC K/Alt-K also works on prompt line)
- ESC Q or Alt-Q
- opens the Smart Quotes selection menu
- ESC E or Alt-E
- opens the Encoding selection menu
Miscellaneous
- ESC = < count >
- Repeat a command < count > times (prompts for count). Example: ESC=7< cursor down > moves the cursor 7 lines down. Note: If the function to be repeated is a character to be inserted and the input is keyboard mapped to a multi-character sequence, only the first character of the sequence is inserted repeatedly.
- ESC < count >
- Repeat a command < count > times (prompts for rest of count); this short form is only accepted, however, if the repeat count consists of at least two digits (this is to avoid confusion with function key escape sequences of certain terminals). Example: ESC77. enters a line of 77 dots, ESC07x enters "xxxxxxx".
- ^V < function key >
- Invoke function as if pressed together with the control key. E.g. ^V < cursor-left > moves left into the parts of a combined character just like Control-cursor-left would do (the latter may depend on proper terminal setup).
- ^\
- Abort current command, e.g. while on prompt line.
- ESC ?
- Show the current status of the file (name, whether modified,
current line, number of lines, characters, and bytes).
with HOP: Toggle permanent display of text status line. - ESC u
- Display the character code of the current character
in the bottom status line.
(In UTF-8 mode, both the UTF-8 byte sequence and the
Unicode value are displayed; in CJK mode,
Han character values and corresponding Unicode values
are displayed when applicable.)
In UTF-8 mode, additional Unicode information is included,
indicating the script, character category, width,
combining, and surrogate properties of the character.
with HOP: Toggle permanent character code display. - ESC T
- Toggle TAB width. Alternates the width interpretation of TAB characters between 4 and 8.
- ESC P
- Set page length (number of lines that mined assumes to be on a page). (Useful for status display.)
- ESC a
- Toggle append mode (append to text buffer/file instead of overwriting).
- ESC d
- Show current directory / change to another one (also change drive in MSDOS version).
- ESC n or New Name from File menu
- Change file name associated with edited text (does not affect the text currently being edited, just detaches it from the file previously read in). Assumed text editing properties (encoding, smart quotes style to be applied, margins, ...) are preserved (if the file was UTF-16 encoded, this is also preserved with the new file); this is in contrast to editing another file (using File/Open or multiple command line file names) and pasting contents in which case such information is lost.
- ESC .
- Redraw the screen.
- ESC z
- Suspend editor process; first write back file if modified (no write if HOPped or given empty file name on prompting).
- ESC !
- Fork off a shell and wait for it to finish.
- ESC h or F1 or Help
- Online help function. Selection of help topics is offered.
The environment variable MINEDHELPFILE can be set to the file name of the online help file "mined.hlp", but mined also looks for the file in a couple of typical installation locations.
with HOP: View online help with mined itself instead of invoking the "less" viewer. (This is the default even without HOP in the DOS versions.) The text being edited will automatically be saved (if it was modified) and any prompting required will be involved. The suspended editing session will automatically be restored after help viewing is finished. - ESC
- While a command is active and prompting, ESC aborts the current command.
- ESC ' '
- (Escape Space) Do nothing, so Space aborts the ESC command.
- F1 / Shift-F1 / Control-F1 / Alt-F1 (PC)
- Display quick help line explaining assignment of function keys.
MSDOS only
- Screen size change functions
- MSDOS screen size changes depend on a
mode table contained in the source file keydefs.c.
In the presence of a TSR driver which can change fonts and screen modes while running a program (e.g. the excellent VGAMAX), the actual change effective may occasionally be unexpected. Mined does however recognize those changes and adjusts its conception of screen size appropriately, although only after the next character being input. - ESC %
- Change video mode to the mode with the next smaller total resolution (lines * columns).
- ESC &
- Change video mode to the mode with the next higher total resolution.
- ESC l
- Change video lines mode to the mode with the next smaller number of lines but same number of columns. (The number of lines is first tried to be decreased within the current video mode. If it is already the lowest, the next video mode is chosen.)
- ESC L
- Change video lines mode to the mode with the next higher number of lines but same number of columns.
- Alt-F9 / Control-F9
- Switch between highest and lowest line number modes / circle through all line number modes within the current basic screen mode.
- HOP ESC %/&/l/L
- Several other video mode settings are prompted for (experimental).
emacs mode (-e)
This mode is in beta state. In emacs mode, emacs command key assignments to control keys, ESC (Meta commands) and ^X (C-X commands) are configured. In addition, the following emacs-compatible changes apply:
- •
- The mined ESC commands can be reached via M-x. (Function keys remain unaffected.)
- •
- The Delete key (on the small keypad) is configured to delete the previous character.
- •
- The control key insertion prefix is ^Q.
- •
- The quit character (e.g. for the prompt line) is ^G.
- •
- The emacs multiple buffer ring is fully enabled.
- •
- Paragraph justification mode is set to consider an empty line as paragraph separation by default.
- •
- mined ESC commands can be reached via M-x (Alt-X).
- •
- ^^ (Control-^) is configured as an additional HOP key.
- •
- keyboard mapping (input method) can be toggled with ^\
Command overview:
- ^A, ^B, ^E, ^F, ^N, ^P, ^V, M-v, M-b, M-f, M-a, M-e, M-< , M->, ^X[, ^X]
- cursor and screen movement
- ^D
- delete character
- ^O
- insert new line
- ^Q
- insert literal character
- ^@
- mark position
- ^W / M-w
- cut / copy to buffer
- ^K
- delete to end of line / delete line end, and append to buffer
- M-d / M-k
- delete word / delete end of sentence, and append to buffer
- ^Y
- paste buffer
- M-y
- paste previous buffer, replacing text just pasted
- M-u
- transform word upper-case
- M-l
- transform word lower-case
- M-c
- transform word capitalised (initial upper-case)
- ^S, ^R
- search forward / reverse
- M-%
- replace with confirmation
- M-.
- search for identifier definition (using tags file)
- ^X^S, ^Xs
- save file
- ^X^W
- save file as (using different name)
- ^X^F
- edit other file (prompts for name)
- ^X^B
- edit previous file (among those listed on command line)
- ^X^C
- exit editor, saving edited text
- ^Xk
- quit editor, discard edited text (but confirms)
- ^Xi
- insert file
- ^X=
- display file statistics
- ^L
- refresh display
- ^U, ^X^[
- repeat (not as generic numeric command parameter)
- ^H
- help
- ^Z, M-z, ^X^Z
- suspend editor
- ^\ (mined add-on)
- toggle keyboard mapping (input method)
- ^^ (mined add-on)
- HOP (generic function amplifier / modifier)
- M-x (mined add-on)
- invoke mined ESC command
WordStar mode (-W)
The usual Escape commands and function key assignments of mined
also apply in WordStar mode.
In prefixed two-key commands, the control state and case of the second
key does not matter, e.g. ^K^B, ^KB and ^Kb are identical.
- ^S, ^D, ^E, ^X, ^A, ^F, ^R, ^C, ^W, ^Z, ^H
- cursor and screen movement
- ^G
- delete character
- ^T
- delete word
- ^Y
- delete line
- ^Q^Y
- delete to end of line
- ^N
- insert new line
- ^P
- insert control character
- ^Q^W, ^Q^Z
- scroll multiple screen lines
- ^Q^F
- find
- ^Q^A
- find and replace (with HOP: with confirm)
- ^L
- repeat last search
- ^Q
- HOP key
- ^Q, ^K, ^O
- two-key command prefixes
- ^Q^Q
- repeat following command
- ^B
- paragraph justification (word wrap)
- ^OL
- set left margins
- ^OG
- set left margin for first line of paragraph
- ^OR
- set right margin
- ^KB
- set marker
- ^QB
- goto marker
- ^Kn
- (n=0..9) set marker n
- ^Qn
- (n=0..9) goto marker n
- ^KK
- copy between here and marker (not exactly WS function)
- ^KC
- copy (paste) saved text here (not exactly WS function)
- ^KY
- delete between here and marker (not exactly WS function)
- ^KV
- copy (paste) saved text here (not exactly WS function)
- ^KW
- write paste buffer to file
- ^KR
- read (insert) file here
- ^KS
- write (save) edited text to file
- ^KD
- write (save) edited text to file, edit next file
- ^KX
- exit (and save)
- ^KQ
- quit (don't save)
- ^KL
- change current directory
Environment interworking and configuration hints
A number of configuration options have already been addressed throughout the manual page. A few more configuration features are mentioned here. For more details, examples, and other display settings see the example script profile.mined in the Mined runtime support library.
Mined runtime support library
The mined distribution provides a collection of runtime support files (in subdirectory usrshare); if mined is installed into standard locations, they are copied to one of the directories /usr/share/mined, /usr/share/lib/mined, /usr/local/share/mined, /opt/mined/share, $HOME/opt/mined/share (depending on operating system and installation options).
Mined runtime support includes the following files:
- README
- mined overview and introduction
- CHANGES
- change log
- profile.mined
- shell commands to set environment variables for mined, template for inclusion in $HOME/.profile
- Xdefaults.mined
- xterm configuration entries suitable for mined, template for inclusion in $HOME/.Xdefaults or $HOME/.Xresources
- xinitrc.mined
- shell commands to activate Xdefaults.mined, template for inclusion in $HOME/.profile
- mined.hlp
- online help file
- minedmar
- script to clean up the @mined.mar file position file
- minedmar.bat
- DOS/Windows version of minedmar
- uterm
- script to invoke xterm in UTF-8 mode
- mterm
- script to invoke mlterm with suitable options (for bidi support)
- umined
- script to start mined in a separate xterm window, using UTF-8 mode
- lmined
- script to start mined in a separate xterm window, using Latin-1 mode
- xmined
- script to start mined in a separate xterm window, using same encoding mode as currently set
- wmined
- script to start mined in a separate rxvt window, using Windows look-and-feel, especially on Windows where rxvt is run in stand-alone mode
- wmined.bat
- DOS/Windows version of wmined
- mined.desktop
- KDE desktop entry to start mined in an xterm from a menu entry, using the uterm script
- configure-xterm
- sample configuration script to build xterm with recommended configuration options
- makeprint
- script to search for or retrieve and build the uniprint program from the yudit package
- uprint
- script for printing a Unicode file, using the uniprint program from the yudit package
- bdf18to20
- script to transform an 18x18 pixel double-width screen font into a corresponding 20x20 pixel font matching the 10x20 single-width font (which is much nicer than the 9x18)
- bdf18to20.sed
- sed script for the above
Terminal environment
The Unix terminal type is determined from the environment variable TERM.
Recognition of some special terminal features or restrictions is associated with the setting of TERM (xterm, linux, vt100, sun*, cygwin, rxvt, *ansi*, hpterm, 97801).
For detection of function keys and cursor keys, the escape sequences being used by terminals are often not known to an operating system environment because they are poorly and incompletely configured. Because this does usually not work as expected (see this bug report just for an example), mined does not rely on the termcap/terminfo configuration of function key codes; rather it always accepts a wide variety of typical codes. A few ambiguous codes are resolved according to the TERM variable.
In an xterm, window headline and icon text are set to the current filename and "(*)" is added if the text has been modified.
Special DOS terminal handling (remote login to Unix):
If the environment variable TERM begins with "pcansi", "nansi",
"ansi.", or contains "-emx",
mined assumes the terminal to run the PC character set
(codepage 437) so this supports remote login from a DOS system
or Windows telnet (in a DOS box) to Unix. If the effective
encoding used via the remote connection is rather Windows-ANSI
(codepage 1252), TERM should be "cygwin" instead.
Note: The character set or codepage being used depends
on the telnet program; cygwin telnet always emulates Windows
codepage 1252 and sets TERM=cygwin, so mined detects it
correctly; the older Microsoft telnet GUI client uses Windows
codepage 1252 and sets TERM=ansi; the newer Microsoft telnet
console mode client always uses DOS codepage 437 ("pcansi")
(even if started from a cygwin shell with codepage 1252 emulation)
and sets TERM=ansi; so mined cannot detect the encoding based
on TERM=ansi. If you use the newer Microsoft telnet console
mode client, please set TERM=ansi.sys or TERM=pcansi on
the Unix machine to adjust this.
Native DOS terminal handling: Cygwin emulates the Latin-1 character encoding in a DOS box window (unless reconfigured with the CYGWIN variable) instead of the IBM PC character set that a DOS box runs by default. This may produce unexpected appearance of non-ASCII characters when editing DOS files; even editing the same file in the same DOS box alternatingly with cygwin mined or djgpp mined will exhibit this change of character display. Mined detects, however, the environment setting "CYGWIN=codepage:oem" and behaves accordingly.
Running mined in a dosemu session (DOS emulator on Linux) works fine, even in an xterm-embedded session although not perfect in that case: ^S and ^Q are interpreted for flow control (thus ^S will hold all output until ^Q is entered), and the mined option -Qa should be used to tune menu borders right.
- Locale configuration
- For configuration of the character encoding to be used,
environment variables may be defined.
Mined accepts both explicit encoding suffixes (starting with ".")
or, if none are specified, also some region suffixes
(starting with "_").
The following table lists detected encodings in dependence
of recognized suffixes:
- Unicode: UTF-8
- suffixes: .UTF-8 / .utf8
- Traditional Chinese (Hongkong): Big5 with HKSCS
- suffixes: .BIG5* / .Big5* / _HK / _TW (_TW ambiguous, .euctw may follow)
- Simplified Chinese: GB18030 (includes GBK and GB2312)
- suffixes: .GB* / .gb* / .EUC-CN / .euccn / _CN
- Traditional Chinese (Taiwan): CNS (EUC-TW)
- suffixes: .EUC-TW / .euctw
- Japanese: JIS / EUC-JP
- suffixes: .EUC-JP / .eucjp / .euc (.euc ambiguous, kr/tw/cn may follow)
- Japanese: Shift-JIS
- suffixes: .Shift_JIS / .sjis
- Korean Unified Hangul: UHC (includes EUC-KR)
- suffixes: .UHC / .EUC-KR / .euckr
- Korean: Johab
- suffixes: .JOHAB
One of the problems with locale conventions is that there is
no explicit distinction between text encoding and terminal
encoding although this is obviously a very different thing and
mixed combinations of both may occur and are actually supported
by mined. For this reason, mined follows a pragmatic approach:
For text encoding, mined checks the variables
LANG, LC_ALL, LC_CTYPE in this order.
For terminal encoding, mined checks the variables
LC_ALL, LC_CTYPE, LANG in this order.
Thus it is possible to specify for example that
mined runs in a UTF-8 terminal and should assume GB text encoding
by default:
LC_CTYPE=whatever.UTF-8
LANG=zh_CN.gbk
An encoding specification with the -E parameter takes precedence over environment configuration.
If mined performs auto-detection of CJK encoding, it can be configured which encodings are to be taken into account for detection. For this purpose, set the MINEDDETECT environment variable to the list of encoding indications (capital letters as listed for the -E parameter) to disable auto-detection of other encodings. UTF-8 auto-detection cannot be disabled this way.
- Terminal setup
- The Mined runtime support library includes a configuration file Xdefaults.mined which lists settings that should be applied to the terminal for proper operation of several features as described throughout this manual. Depending on the terminal you use, the resource class "XTerm" may have to be adapted (copying entries) to apply to your terminal as well.
In some terminals, the cursor may not be well visible or not visible at all if the cursor is on a character with reverse background (control character, occurs e.g. in xterm) or highlighted background (invalid character code, occurs e.g. in xterm and rxvt). See the X resource parameters for "cursorColor" in the example configuration file Xdefaults.mined for remedy.
If your terminal scrolls down one line when you click the left mouse button in the text area, the terminal type is not properly set up. This occurs, e.g., when you run inside a cygwin or rxvt terminal but the environment variable TERM is incorrectly set to xterm. Set it to the correct value for remedy.
If mouse wheel movement moves more than expected, especially if it cannot move by single items in a menu, this is probably a configuration issue with your mouse driver. You are probably running a Windows-based X server which is (often by default) configured to generate multiple mouse wheel events on each actual mouse wheel movement. Often not even in the Control Panel mouse section, but only in a configuration menu of mouse-specific setup software (e.g. "Browser Mouse Settings"), configure the scroll unit to 1.
- Terminal interworking problems
- With some terminals, problems are known due to missing terminal features or terminal bugs:
any terminal: menu border display
- •
-
If the borders of mined menus appear as letters rather
than graphic borders, the terminal can unexpectedly not handle
VT100 block graphics. Use the option -Qa to switch to ASCII
borders.
In a UTF-8 terminal, mined uses Unicode graphic characters by default. If they don't display they are missing in the font used by the terminal. Use the option -Qv to switch to VT100 block graphics or -Qa to switch to ASCII graphics. If borders are visible but without corners, use -Qs to switch to rectangular borders.
any terminal: slow terminal feature auto-detection
- •
-
Occasionally, when starting mined, you may receive a message
"Late screen mode response - set ESCDELAY=2000 or higher for proper detection".
This happens if there is a large delay (> 700 ms) in the interaction mined uses to detect terminal properties. There are two possible reasons for this: - •
- A slow remote terminal connection. In this case, set up your environment variable ESCDELAY to a value (in milliseconds) large enough to cover the anticipated delay, e.g.: export ESCDELAY; ESCDELAY=3000
- •
- Font loading. Especially with rxvt and mlterm, X fonts seem to be loaded partially on demand. While this speeds up initial terminal operation, it also results in unexpected delays of terminal responses. In this case, exiting mined and starting again will normally resolve the issue for one session of the terminal. For a more permanent remedy, also use the environment variable ESCDELAY when using those terminals, e.g.: export ESCDELAY; ESCDELAY=1200 Automatic handling of the situation is planned for the next release of mined.
mlterm
- •
- Bidirectional display handling of mlterm is based on the final display, not regarding any context (such as positioning control, that's why mined implements a work-around for menu display on mlterm). This also affects mouse cursor position reports which do not match over right-to-left text, so the cursor will be placed somewhere else in the line.
hanterm
- •
- CJK display is buggy at the line beginning or after a TAB, often only the second byte of the character code is displayed as an ASCII character instead of displaying the complete CJK character.
- •
- Character attributes in hanterm are all mapped to reverse, so there is a work-around to enable a visible position in the scrollbar which is displayed as blank space. The criteria for this work-around to apply are: CJK terminal (detected or configured), TERM=xterm, Korean encoding (UHC or Johab) configured with parameter or locale.
rxvt
- •
-
The recent rxvt-unicode release provides a CJK terminal
emulation. CJK display is buggy for characters that rxvt
thinks cannot be displayed, especially for GB18030
(LC_CTYPE=zh_CN.gb18030 rxvt); single bytes are then
interpreted instead which amounts to an unpredictable screen
width and cannot be correctly handled.
(This applies to character codes that are not mapped to
Unicode but also to many that are mapped.)
Moreover, CJK width handling is inconsistent for many characters in rxvt CJK mode (rxvt claims to adhere to the locale mechanism in this respect but that's not the case here - character widths are inconsistent with the locale, too).
Remedy: Don't use rxvt in CJK-encoded mode; mined CJK terminal support is tailored to native CJK terminals (such as cxterm or hanterm) where it works fine - if you use a UTF-8-capable terminal, use it in UTF-8 mode! Mined can edit CJK-encoded files well in a UTF-8-encoded terminal. - •
- Due to the scrollbar display work-around for hanterm (see above), the scrollbar position may be shown as blank space instead of coloured (only in rxvt CJK mode with Korean encoding and if you explicitly set TERM=xterm which you shouldn't anyway in rxvt). In this case, coloured scrollbar foreground can be enabled with the environment variable MINEDSCROLLFG="44;36" or MINEDSCROLLFG="38;5;45".
- •
- As a work-around for an xterm bug on cygwin, mined applies terminal size re-adjustment. This may confuse rxvt (being resized to an unexpectedly large window) if it pretends to be xterm. Remedy: in rxvt, make sure that the environment variable TERM=rxvt; the according X resource (Rxvt.termName: rxvt) is also listed in the file Xdefaults.mined from the Mined runtime support library.
cxterm
- •
- EUC-JP half-width characters (8EA1-8EDF) are not properly displayed by cxterm in EUC-JP mode (cxterm -JIS, not available in "classic" cxterm).
- •
- Due to the scrollbar display work-around for hanterm (see above), the scrollbar position may be shown as blank space instead of coloured (only in Korean encoding mode which is probably rarely used with cxterm anyway). In this case, coloured scrollbar foreground can be enabled with the environment variable MINEDSCROLLFG="44;36" or MINEDSCROLLFG="38;5;45".
DOS console
- •
- With the djgpp-compiled version apparently there is a Control-C problem on older Windows versions. Every first Control-C will display ^C on the screen at the current position without mined noticing it, while every second Control-C will be passed to mined. This problem does not occur on Windows XP. It does occur on Windows ME in a DOS box. It does not occur with the cygwin-compiled version.
- Work-around support to enable 8-bit character set on weird terminals
- There exist some exceptionally weird 7 bit terminals that have an alternative character set containing composed character which can be displayed simultaneously with the default character set. For those there is optional output translation which embeds non-ASCII characters into the respective code switching sequences. To enable output character transformation, set the environment variable MINEDOUT to contain the upper half (with respect to an 8 bit character set) of the translation table into the terminal's alternate character set. (Character set switching will be done as specified in the termcap (as/ae) or terminfo (smacs/rmacs) entry.) An example setting of MINEDOUT is included in the environment sample file profile.mined in the Mined runtime support library for Siemens 9780x terminals.
- Concerning some especially stupid terminal drivers
- There used to be terminal drivers which make use of the soft handshake mechanism by exchange of ^S and ^Q characters but yet pass them through to application programs which is quite stupid. If it is necessary to ignore such hazardous ^S and ^Q keys, the environment variable NoCtrlSQ or NoControlSQ must be set. Mined will then not disable the tty channel soft handshake setting either.
Keyboard Mapping / Input Method pre-selection
With the environment variable MINEDKEYMAP the active or
standby mapping or both can be preselected. The value is a
two-letter script tag to set the active mapping, or it is
prepended with "-" to set the standby mapping, or a combination.
Example:
export MINEDKEYMAP=-gr
will set Greek keyboard mapping standby.
export MINEDKEYMAP=py-rs
will set Pinyin input method active and Radical/Stroke
input method standby.
The respective tags attached to the keyboard mappings can be
looked up in the Input Method flag menu; the HOP function
toggles between display of the full input method name and its tag.
Smart Quotes style configuration
Smart quotes style can also be preselected with the environment
variable MINEDQUOTES which should then contain the
opening/closing quote pair or just the opening quote mark
(double or single quotes).
Example:
export MINEDQUOTES="»"
sets these »inward« quotes and corresponding single smart quotes.
export MINEDQUOTES="»»"
sets these »Swedish» quotes and corresponding single smart quotes.
The value of the MINEDQUOTES variable must be encoded in UTF-8.
Han info configuration
With the environment variable MINEDHANINFO, the information shown for Han characters can be preselected. If the variable is defined, Han info mode is enabled. It may contain letters to select description, pronunciation information, and display mode to be used:
- M
- show Mandarin pronunciation
- C
- show Cantonese pronunciation
- J
- show Japanese pronunciation
- S
- show Sino-Japanese pronunciation
- K
- show Korean pronunciation
- V
- show Vietnamese pronunciation
- D
- show character description
- F
- display full information (in popup-menu form); without F, the information will be shown on the status line where it is subject to truncation
Common paste buffer configuration
The paste buffers, used for cut/copy/paste operations, as well as the inter-window paste buffer, are located in a temporary directory, using system conventions by default. To maintain the inter-window paste functionality even remotely, mined uses the environement variables MINEDTMP and MINEDUSER which, in combination, point to a user-defined temporary directory and file name pattern to be used for buffer files:
- •
- Set MINEDTMP to refer to a common mounted network directory on all machines which means that the value of $MINEDTMP may have to be different to reflect different mount points across the network.
- •
- Set MINEDUSER to the same name within the network even if using different user name accounts. For details, see also the FILES section below.
Keypad configuration
In order to enable the Alt key modifier for quicker entry of "ESC" commands, or the keypad "5" key as a HOP key, or the Scroll Lock or Pause key as a HOP key (for convenience on notebooks), you may have to add some X configuration. Also you may want to distinguish "Home" and "End" keys on the two keypads of PC keyboards in order to enhance keypad value (double assignment of functions to keypads is a waste of resources). And you may want to enable control and shift modifiers for keypad and function keys. See the example file Xdefaults.mined in the Mined runtime support library for suggestions.
Printing configuration
Mined uses the script uprint from the
Mined runtime support library
to print the current contents of the text being edited
in any selected encoding (unless the environment variable
MINEDPRINT is set to direct mined to use a different print command).
If the support library is not installed in one of its
standard locations (system-dependent), it should be made
available in the usual command search path. Furthermore, the
script uses the program uniprint for actual print
preprocessing. This program is part of the yudit distribution;
if you don't have it installed on your system, there is another
script makeprint in the support library which can
be used to download and build the needed uniprint program.
The font to be used with uprint can be configured with
the environment variables FONT, FONTPATH, FONTSIZE.
Also the printer can be configured as usual with PRINTER.
In addition, uprint checks an environment variable LPR for
an alternative for the system printing command (lpr/lp) if
that is needed.
See Environment variables to configure Printing
for further details.
Display of contents indications and scrollbar
- Line ends
- The line end is usually marked by a "«" double left angle character. This can be changed with the environment variable MINEDRET, its content (one character) is used as an indicator at the end of every text line on screen (so you can see how many blanks there are). If MINEDRET contains another character it is used to fill the rest of the screen line, and a third character would terminate the indication line at the screen border. "··«" is a nice setting for people who used to work at Siemens terminals.
- Paragraph ends
- With the option "p", mined displays different indicators for line ends and paragraph ends. As with word-wrap, a paragraph is defined to continue while a line ends with a space character. The default display character is "¶". It can be changed with the environment variable MINEDPARA.
- TAB characters
- TAB characters are usually indicated by a sequence of '·' characters. This can be changed by the environment variable MINEDTAB. More than one indication is possible.
- UTF-8 indicators
- The contents of the special indicator variables are taken to be Latin-1 encoded, even if mined runs in UTF-8 modes. To use UTF-8 characters for these indications, additional variables MINEDUTFRET, MINEDUTFTAB, MINEDUTFPARA may be used. For details, see the example script profile.mined in the Mined runtime support library.
- Long lines
- Lines which are too long for the screen are usually indicated by a '»' double right angle (guillemot) character. This marker can be changed by setting the environment variable MINEDSHIFT. If MINEDSHIFT contains a second character, that one will be used to indicate lines shifted out left off the screen.
- Display mode of indicators
- It is recommended to display these indicator characters in a dim display mode to prevent distraction from the text contents. The default is a red colour which is a moderate dark red in xterm. The display mode can be used by placing the code part of an ANSI display control sequence in the environment variable MINEDDIM. E.g., MINEDDIM=31 would select the default mode, red foreground; MINEDDIM="32;40" would display indicators in green on black.
- Unicode characters
- For a description of special display indications in UTF-8 text editing mode see "Unicode display" above. The highlighting mode of UTF-8 display in a Latin-1 terminal, or of illegal UTF-8 sequences in general, can be configured with the variable MINEDUNI.
- Scrollbar colour
- The foreground and background colours of the scrollbar can be configured with MINEDSCROLLFG and MINEDSCROLLBG, respectively, using ANSI modes; if only the background is configured, the foreground is the reverse of it. In general, to support fine-grained scrollbar display in UTF-8 terminals, the foreground and background colour settings should be the reverse of each other. The default for the background is "46;34;48;5;45" if use of 256 colour mode is enabled, or "46;34" if it is disabled. The default for the forground is "", meaning that the reverse background is used, with a work-around for hanterm (see above).
Online Help access
Mined can be told where to find its online help file by the environment variables MINEDHELPFILE (for display, the program "less" is used). Mined also looks for the file in a couple of typical installation locations so online help may be available without this variable configured. It also tries to find it in the directory where it was loaded from; this is especially useful for the DOS/Windows version.
Compile-time configuration
- Script highlighting
- The the mined distribution contains a file
src/colours.cfg; it contains entries with the
script name (as listed in the Unicode data file
Scripts.txt), white space, and a colour index
into the xterm 256-colour mode. (To make good use of 256
colour mode, the terminal program should be compiled with 256
colour support enabled. Configure xterm with
configure --enable-256-color .)
Edit colours.cfg before building mined to adapt coloured script display to your preferences. - Keyboard Mapping (Input Method)
- The mined distribution contains a file src/keymaps.cfg and a script mkkbmap; go into the src directory and use the script to generate additional keyboard mappings: The parameter to the mkkbmap script can be one of
- path.../name.kmap
- a keyboard mapping file of the yudit text editor
- path.../name.vim
- a keyboard mapping file of the vim text editor
- path.../name.cit
- an input method mapping file of the cxterm terminal, binary form; only works if the cxterm binary/text conversion utility cit2tit is accessible
- path.../name.tit
- an input method mapping file of the cxterm terminal, text form; only works if the character set conversion utility iconv is accessible and works on the mapping file
- path.../name.utf
- an input method mapping file of the cxterm terminal, already converted to UTF-8 encoding; converted versions can be downloaded from the mined download web page
- Cangjie
- with this tag, a keyboard mapping for the Cangjie input method will be generated, taking information from the Unihan database (unicode.org)
- MainlandTelegraph , TaiwanTelegraph
- with one of these tags, a keyboard mapping will be generated using one of these telegraph codes as an input method, taking information from the Unihan database (unicode.org)
- Cantonese , HanyuPinlu , Mandarin , Tang
- with one of these tags, a keyboard mapping will be generated using the according Chinese pronunciation as an input method, taking information from the Unihan database (unicode.org)
- JapaneseKun , JapaneseOn
- with one of these tags, a keyboard mapping will be generated using Japanese or Sino-Japanese pronunciation as an input method, taking information from the Unihan database (unicode.org)
- Korean , Vietnamese
- with one of these tags, a keyboard mapping will be generated using Korean or Vietnamese pronunciation as an input method, taking information from the Unihan database (unicode.org)
- VIQR , VNI , Vtelex
- with one of these tags, a keyboard mapping will be generated for the respective Vietnamese input methods, taking character information from the Unicode database (unicode.org)
- script tag
- for many scripts listed in the UnicodeData.txt database,
character names listed there can build a useful
keyboard mapping;
mkkbmap will then generate an according
keyboard mapping file, e.g. for Bopomofo
Each successful generation of a mapping table adds an entry
to the configuration file keymaps.cfg; the
entry is however initially disabled as it usually needs manual
adjustment: edit the configuration file; enable the new
entry by removing the leading '#' character, check the first
element which will be the name of the mapping to appear in the
Input Method menu, check the last element of the entry
which is a two-letter shortcut and must be unique for all
mappings, then move the entry to the position where you want
it to appear in the menu. You can also group mappings by
adding "-" lines in this configuration file.
With mined 2000.10, all included keyboard mappings are based on Unicode 4.0.1 data.
For the keyboard mappings generated from Unihan data, characters are sorted according to the priorities of their Unicode ranges (assigning lower priority to "Supplement" and "Extension" and "Compatibility" ranges). So for some input mnemos, the "pick list" for the Cangjie input method is displayed more in order of relevance (since mined 2000.10).
For keyboard mappings for CJK encodings, mkkbmap will add appropriate punctuation mapping entries for Chinese, Japanese, Korean, respectively, in addition to the entries derived from the respective data source.
MSDOS-only notes
DOS binaries: Two DOS-based versions, compiled with djgpp and with cygwin, are available for download from the mined web site http://towo.net/mined/ for users who want a quick binary on DOS-based systems. The djgpp binary is a "dual-mode" executable which runs on plain DOS and also supports long file names in a Windows 98/2000/... DOS box (not NT4.0).
Highlight mode: The ANSI codes for selecting normal and exposed display can be chosen with the environment variable MINEDCOL. The two selections are separated by a space. Each selection is a semicolon-separated list of the code values. The default behaviour corresponds to the setting
- set MINEDCOL=7 27
- Example: Green on red text, red on green status:
- set MINEDCOL=34;42 32;44
For command line options, "/" can be used instead of "-".
The "ESC -" command cannot go back within a group of files named by the same wildcard expression. It goes to the previous file name (or wildcard expression) instead.
Enabling the keypad HOP key: If you have a very old and crappy BIOS, you may have to enable use of the cursor block "5" key (for use as a HOP key) with a TSR driver (ENHKBD.COM) or an enhanced keyboard driver. (Older PC keyboard drivers were often so ignorant to forbid you to use that key.)
Immediate adjustment to changed window size does not work in the DOS version if the size change is caused by a TSR (e.g. VGAMAX using a hotkey).
The cygwin terminal environment (cygwin in a DOS box window) provides an emulation of a Unix 8 bit character set so non-ASCII characters entered in this version are different from those entered in other DOS-based versions. Editing UTF-8 text, on the other hand, works transparently in all DOS-based versions. See Terminal environment for more details.
In order to enable mouse use in a DOS box, deactivate "QuickEdit mode" in the properties menu.
The following only applies if DOS ANSI driver output is used which is currently not the case in any configuration:
The default colour setting depends on an extended ANSI driver (like NNANSI) as does the scroll down function anyway. Unfortunately, there is no way to find out the current colour setting nor is there an inverse video mode in many ANSI drivers (only a fixed black on white mode) so that it is impossible to implement just inverse display for highlighting. Therefore, if mined thinks to see an ANSI driver of the simpler kind, it will change its colour setting defaults. In any case, these can be overridden with the MINEDCOL variable. Recommended ANSI drivers:
- NNANSI by Tom Almy (very capable, but needs some
- installation effort), or
- ANSI.COM by Michael J. Mefford (small, works well at
- usual screen sizes).
Mined tries to analyse the ANSI drivers capabilities by checking some control sequences. This works, however, only if the ANSI driver is at least able to send cursor position reports. For primitive ANSI drivers that cannot even do that, mined's operation can be ensured with an emergency procedure: A faked pseudo-report should be stuffed into mined as its first input (with some key-stuffing program) and mined will use no further cursor position requests. It will also assume a simple ANSI driver then. The faked report should consist of the screen size in lines and columns, embedded at the positions of the ANSI cursor report sequence but with different surrounding characters. For an invocation of mined on a 25 lines and 80 columns screen a batch file for this would look like:
- keypress xx25x80xx
- mined %1 %2 %3 %4 %5 %6 %7 %8 %9
The remaining remarks apply to the Turbo-C version only which is no longer supported (use djgpp instead):
- •
- The file size being edited is limited to 200KB to 500KB (depending on average line length and number of lines).
- •
- Typing of Control-P while display output is active (i.e., during screen paging) can hang the system. Typing of Control-C or Control-Break while display output is active can at least leave some garbage on the screen. Control-S may stop screen output until Control-Q is typed. Typing of Control-P, Control-C, or Control-Break while a search operation is active can be desastrous. (Can anyone tell me how to disable BIOS/MSDOS interpretation of these characters from Turbo-C?)
- •
- The Turbo-C version is configured to handle screen output using the "conio" module. (It used to use an ANSI driver.) The disadvantage of conio is that it doesn't handle arbitrary screen modes and sizes whereas good ANSI drivers support them all.
ENVIRONMENT VARIABLES
Environment variables for configuration of mined are listed
in the script file profile.mined
in the Mined runtime support library
together with explanations and suggested values.
Further variables used by mined in the usual meaning are:
- HOME
- USER
- SHELL
- SYS$SCRATCH (VMS)
- TEMP (MSDOS)
- TMP
- TMPDIR
- TERM
- Terminal type to be assumed.
- ESCDELAY
- Delay after an ESCAPE character that mined waits for recognition of a function key control sequence. Default is 450 ms.
- MAPDELAY (non-standard)
- Similar delay that mined applies to wait for subsequent input characters when applying keyboard mapping for an input method. Default is 900 ms.
- LINES, COLUMNS (MSDOS ANSI mode only)
- Line / column count of terminal to be assumed.
- windir
- Used to determine if it runs under MS Windows and set some defaults (screen output delay) accordingly.
- Environment variables to configure Printing
- MINEDPRINT
- Print command to use instead of uprint; the value must contain an embedded "%s" which is replaced with the file name.
- FONT
- Name of a font file, e.g. LucidaBrightRegular or bodoni.ttf for use with uprint/uniprint; the file must reside in the configured font path.
- FONTPATH
- Directory search path (separate directory names with ":") for use with uprint/uniprint which uses Truetype fonts.
- FONTSIZE
- Font size to be used with uprint/uniprint.
- LPR
- Print spooling command to be used by uprint/uniprint (or mined itself if uprint does not work) instead of the system-specific print spooling command (e.g. lpr).
- PRINTER
- Name of printer to be spooled to.
FILES
Unix
- $MINEDHELPFILE
- online help file as configured, first attempt (to find it)
- $0/mined.hlp
- online help file in mined program directory, next attempt
- /usr/share/mined/mined.hlp
- online help file, next attempt
- /usr/local/share/mined/mined.hlp
- online help file, next attempt
- /usr/share/lib/mined/mined.hlp
- online help file, next attempt
- /opt/mined/share/mined.hlp
- online help file, next attempt
- /usr/share/doc/packages/mined/mined.hlp
- online help file, next attempt
- $MINEDTMP
- directory for auxiliary files, first attempt Using this variable and $MINEDUSER (see below), you can establish copy and paste among machines that share network directories but are normally configured to use separate (usually local) temporary directories.
- $TMPDIR
- directory for auxiliary files, next attempt
- $TMP
- directory for auxiliary files, next attempt
- $TEMP
- directory for auxiliary files, next attempt
- /usr/tmp
- directory for auxiliary files, next attempt
- /tmp
- directory for auxiliary files, next attempt
- $MINEDUSER
- user name assumed instead of $USER for building auxiliary file names; using this, common copy-and-paste buffers can be used on a network file system from different machines where the user possibly has different user names
- minedbuf.< USER >.< PID >.< NN >
- temporary file for paste buffer; USER is either $MINEDUSER or $USER
- minedbuf.< USER >
- file for inter-window paste buffer; USER is either $MINEDUSER or $USER; see descriptions of $MINEDTMP and $MINEDUSER above for how to set up a common inter-window paste buffer in a heterogeneous network
- minedpanic.< USER >.< PID >
- panic file to rescue text in case of crash or external signal caught
VMS
- SYS$MINEDTMP:$MINEDBUF$user.pid.nn
- paste buffer, first attempt
- SYS$SCRATCH:$MINEDBUF$user.pid.nn
- paste buffer, next attempt
- SYS$SCRATCH:$MINEDPANIC$user.pid
- panic file, first attempt
- SYS$MINEDTMP:$MINEDBUF$user
- inter-window paste buffer, first attempt
- SYS$SCRATCH:$MINEDBUF$user
- inter-window paste buffer, next attempt
- SYS$SCRATCH:$MINEDPANIC$user.pid
- panic file, next attempt
- If SYS$SCRATCH is not available, SYS$LOGIN is used instead.
MSDOS / Windows
- %MINEDHELPFILE%
- online help file as configured, first attempt (to find it)
- mined.hlp (in mined program directory)
- online help file, next attempt
- \bin\mined.hlp
- online help file, next attempt
- %MINEDTMP%\minedbuf.nn
- paste buffer
- %MINEDTMP%\minedbuf
- inter-window paste buffer
- %MINEDTMP%\minedbuf.%MINEDUSER%
- inter-window paste buffer, as configured to use the same file as other mined versions in a heterogeneous network; note, however, that %MINEDUSER% will be shortened to 3 characters in pure DOS
- %MINEDTMP%\mined-pa.nic
- panic file
- If %MINEDTMP% is not available, %TEMP% or %TMP% or \ are used.
DIAGNOSTICS
In all cases where it is considered sensible, the appropriate message of a system error occurred is displayed (instead of printing numerical hieroglyphs or indistinguished commonplace messages as many other UNIX tools do).
BUGS
In an extremely narrow terminal window (less than 8 characters), if lines are shifted out of the display, moving the cursor around may cause positioning errors and display garbage.
(Unix:) Mined cannot edit a pipe or device file and hangs if
you try to do so. (But it can insert from, or write to, a pipe.)
This restriction does not refer to editing from standard
input in a piped command like cmd | mined
which works of course.
(MSDOS:) Piped editing from standard input does not work for unknown reason. This restriction does not apply to the cygwin version.
(MSDOS, xterm:) Non-cygwin versions (djgpp etc.) do not work in an xterm for unknown reason. The cygwin version does of course work in xterm.
AUTHOR AND ACKNOWLEDGEMENTS
Long ago, the initial version of mined was written for the Minix
educational operating system by Michiel Huisjes.
It was adapted to Unix by Achim Müller who added termcap support.
Mined was later debugged, partly rewritten and enhanced and
is now maintained by Thomas Wolff.
Please send comments, suggestions, bug reports to
mined@towo.net.
Mailing list
Mined is also hosted as a sourceforge project (sf.net/projects/mined) where a mailing list is available. To subscribe for information about updates, or discussion, error reports, and feature requests, or to send a mail, please go to the Mined mailing list page.
Acknowledgements
- •
- Thanks to Nadim Shaikli < shaikli @ yahoo.com > for discussion of right-to-left issues and interworking with mlterm.
- •
- Thanks to Mike Fabian < mfabian @ suse.de > for making the RPM package included in the SuSE distribution.
- •
- Thanks to Ziying Sherwin < sherwin @ nlm.nih.gov > and R. P. Channing Rodgers < rodgers @ nlm.nih.gov > for suggestions and information about CJK input method support and multiple choice handling (pick lists).
- •
- Thanks to Tobias Ernst < tobias_ernst @ eml.cc > for providing a Mac OS X makefile and suggestion and information to implement Emacs command mode.
- •
- Thanks to 吴咏炜 (Wu Yongwei) < yongwei @ eastday.com > for suggestions and information about Pinyin input methods, for discussion about keyboard mappings for CJK punctuation, and for further maintaining the Pinyin input method.
- •
- Thanks to Ramakrishnan Muthukrishnan < rkrishnan @ debian.org > for making the Debian package.
- •
- Thanks to Thierry Thomas < thierry @ FreeBSD.org > for making the FreeBSD package.