SAMRC(5)
π NAME π
samrc β configure samterm π
okay bestie, welcome to SAMRC(5) β the File Formats Manual page for the samrc file, aka the little config cutie that sets up samterm. This is literally the file that configures the downloaded portion of the sam(1) editor (that is, samterm). π«Ά
πΈ SYNOPSIS πΈ
~/.samrc
β¨ DESCRIPTION β¨
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. No cap. π
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β Bind a key sequence to a command or a raw character. The forms are:
bind M K command C A
bind M K command C
bind M K raw C
Where M is a string describing a set of modifier keys (see βModifier Keysβ below), K is the name of a keyboard symbol suitable for passing to XStringToKeysym(3), C is either a command name (for command bindings; see βCommand Namesβ below) or a literal or hexadecimal specification of a character, and A is an arbitrary string to use as an argument to a bound command.
Note that keyboard symbol names are implementation-defined and often case-sensitive, and that not all commands will make use of arguments. iykyk π
unbindβ Remove all bindings associated with a key sequence. The form is:
unbind M K
where M is a string describing a set of modifier keys and K is the name of a keyboard symbol, as for βbindβ above. The key sequence may be subsequently rebound.
chordβ Bind a mouse chord to a command. The form is:
chord S1 S2 C T
where S1 is a string describing the initial state of the mouse buttons (see βMouse Button Statesβ below), S2 is a string describing the following state of the mouse buttons, C is a command name, and T is a target (see βTargetsβ below).
unchordβ Remove all bindings for a given mouse chord. The form is:
unchord S1 S2
where S1 and S2 are strings describing the initial and following mouse button states. The chord may be subsequently rebound.
foregroundβ Names the color used to draw text. It is of the form:
foreground C
where C is a color name suitable for passing to XAllocNamedColor(3).
backgroundβ Names the color used to draw the background of files being edited. It is of the form:
background C
where C is a colon-separated list of color names as for the foreground directive. If more than one color is specified, files will cycle through these background colors. π
borderβ Names the color used to draw file borders. It is of the form:
border C
where C is a color specification as for foreground.
fontβ Specifies the font used to draw text. It is of the form:
font F
where F is an fc-match(1) compatible font pattern.
tabsβ Specifies the width of tab characters in multiples of the width of the'0'character. It is of the form:
tabs N
where N is an integer between 1 and 12.
expandtabsβ Determines if tabs should be automatically expanded into spaces. It is of the form:
expandtabs B
where B is the string βtrueβ or βfalseβ. If βtrueβ, then tabs will be automatically expanded.
autoindentβ Determines whether a line following a non-empty indented line is automatically indented. It is of the form:
autoindent B
where B is the string βtrueβ or βfalseβ. If βtrueβ, then a new line after a non-empty indented line is automatically indented.
snarfselectionβ Indicates which X selection should be exchanged withsamrcupon execution of the exchange command (either via the menu item or key binding). The forms are:
snarfselection primary
snarfselection secondary
snarfselection clipboard
followfocusβ Determines window focus mode. It is of the form:
followfocus B
where B is the string βtrueβ or βfalseβ. If βtrueβ, then the window focus mode is set to follow the mouse pointer. In this mode typing is directed to the window currently underneath the mouse pointer.
π Defaults π
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.
π§ Modifier Keys π§
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
π Command Names π
The following names can be used for commands:
escapeβ Highlight recent text; default binding:Escapescrolldownβ Scroll down by page; default binding:PgDn,Down/Rightscrollupβ Scroll up by page; default binding:PgUp,Up/Leftscrolldownlineβ Scroll down by line; default binding:Nonescrolluplineβ Scroll up by line; default binding:Nonejumpβ Jump to/from command window; default binding:Control-Kcharrightβ Move dot one to the right; default binding:Control-Dcharleftβ Move dot one to the left; default binding:Control-Slineupβ Move dot up; default binding:Control-Elinedownβ Move dot down; default binding:Control-Xdelbolβ Delete to BOL; default binding:Control-Udelwordβ Delete prev. word; default binding:Control-Wdelbsβ Delete prev. character; default binding:BackSpacedelβ Delete next character; default binding:Deletecutβ Cut selection; default binding:Control-Ysnarfβ Snarf selection; default binding:Control-Cpasteβ Paste snarf buffer; default binding:Control-Vexchangeβ Exchange snarf buffer; default binding:Control-Qeolβ Move to end of line; default binding:Nonebolβ Move to beginning of line; default binding:Nonetabβ Insert a tab; default binding:Tabsendβ Append to command window; default binding:Nonewriteβ Write the current file to disk; default binding:Nonelookβ Find next literal string; default binding:Nonesearchβ Find next regex; default binding: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
Note that the βsendβ command is analogous to the βsendβ menu item: the argument text is simply appended to the text in the command window. Thus, one should exercise caution if partially-completed commands exist in the command window. π
π±οΈ Mouse Button States π±οΈ
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
means βbuttons 1 and 2 are pressedβ. The special string βnβ means βno buttons are pressedβ. Thus to bind the cut command to the chord βhold button one, then click button twoβ the following configuration directive can be used:
chord 1 12 cut current
π Targets π
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.
π₯ Ordering considerations π₯
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. π
π EXAMPLES π
An example samrc file is provided in the sam source distribution as doc/samrc.
π¦ SEE ALSO π¦
Thatβs the whole page, bestie π β source/version/date vibes: Debian, $Mdocdate$, and this is SAMRC(5). periodt. π«Ά
π¦ where this page comes from
- nixos 26.05: deadpixi-sam-unstable 2020-07-14
- nixpkgs unstable: deadpixi-sam-unstable 2020-07-14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms