SAMRC(5) | File Formats Manual | SAMRC(5) |
samrc
— configure
samterm
~/.samrc
A samrc
file in the user's home directory
can be used to configure the downloaded portion of the
sam(1) editor (that is, samterm.) This file,
if it exists, is read at startup.
Each line begins with a configuration directive and some number of arguments. Lines whose first printing character is a “#” are considered comments and are ignored. The following configuration directives are supported:
bind M K command C A bind M K command C bind M K raw C
Note that keyboard symbol names are implementation-defined and often case-sensitive, and that not all commands will make use of arguments.
unbind M K
chord S1 S2 C T
unchord S1 S2
foreground C
background C
border C
font F
tabs N
expandtabs B
autoindent B
samrc
upon execution of the
exchange
command (either via the menu item or key binding.) The forms are:
snarfselection primary snarfselection secondary snarfselection clipboard
followfocus B
The default keybindings and mouse chords are those documented in sam(1). The default foreground and border color is black, and the default background color is white. Tabs are not expanded by default, and tabstops are set at every eight characters. The default X selection is “primary”. The default window focus mode is "Click to focus". Typing is directed to the window which was last clicked.
The bind directive expects a string describing the state of modifier keys. This string consists of one or more of “*” meaning any set of modifiers, “a” meaning Alt (Mod1,) “c” meaning Control, or “s” meaning Shift.
For example, bind the "exchange" command to Control-Shift-E, the following directive could be used:
bind CS e command exchange
The following names can be used for commands:
Name | Meaning | Default Binding |
escape | Highlight recent text | Escape |
scrolldown | Scroll down by page | PgDn, Down/Right |
scrollup | Scroll up by page | PgUp, Up/Left |
scrolldownline | Scroll down by line | None |
scrollupline | Scroll up by line | None |
jump | Jump to/from command window | Control-K |
charright | Move dot one to the right | Control-D |
charleft | Move dot one to the left | Control-S |
lineup | Move dot up | Control-E |
linedown | Move dot down | Control-X |
delbol | Delete to BOL | Control-U |
delword | Delete prev. word | Control-W |
delbs | Delete prev. character | BackSpace |
del | Delete next character | Delete |
cut | Cut selection | Control-Y |
snarf | Snarf selection | Control-C |
paste | Paste snarf buffer | Control-V |
exchange | Exchange snarf buffer | Control-Q |
eol | Move to end of line | None |
bol | Move to beginning of line | None |
tab | Insert a tab | Tab |
send | Append to command window | None |
write | Write the current file to disk | None |
look | Find next literal string | None |
search | Find next regex | None |
Additionally, the command name “none” means that the given binding should perform no action (not even insert a character,) and the command name “default” means that the given binding should perform whatever action was previously defined for it.
For the send command, the text to send is specified in the argument of the binding. For example, to bind Control-Z to undo the last 10 changes, the following line binding could be used:
bind C z command send u10
Chords are described using two states: a beginning state and an end state. When the mouse buttons are in the beginning state and then switch to being in the end state, the chord is activated.
States are described using button numbers between 1 and 5, corresponding to the buttons on the mouse numbered from the left (though this is up to your windowing system and may vary.) For example, the string
12
chord 1 12 cut current
Mouse chords can send their commands to either the current file (i.e. the one receiving typed input) by specifying "current" as the target; or to the file under the mouse pointer by specifying "mouse" as the target.
Commands are executed in the order they are present in the
samrc
file. Later commands will override earlier
commands, meaning that in the case of duplicate binding or chord
definitions, the last one wins.
Note that this means that bindings defined with the “any” modifier set should be defined earlier in the file than those binding the same key with modifiers, since otherwise the “any” binding will always win.
An example samrc
file is provided in the
sam source distribution as doc/samrc.
November 18, 2024 | x86_64 |