Simple editor for X: Users' Guide - chapter 3
Advanced features
SeX allows you to mark logical places in the file. The
mark will move with text as the file is edited. There are
ten independent marks, though only five are accessible via the
Edit menu; the other marks need to be used via the keyboard
(see Command summary
, chapter 4). The marks are not remembered
the next time you edit the same file.
You set a mark, and then you can go to it. There is no visible
feedback of where the marks are. To find out where a mark is,
go to it.
Marks are useful when you often need to go to certain places,
or when you need to check some other part of the file, and then
return back to where you where.
This chapter will explain the special features of pasting
into menu buttons.
Some of the names of the menus on the menu bar at the top of the window
are special: you can paste some text into them, and SeX will do something
useful with the text. The special buttons are:
- File
- Load file named in the pasted text. The whole text is taken as the
name of the file.
- Goto
- Goto line given in pasted text. The line number is extracted from the
text, so it's not necessary to paste only the number. The line number
should be the first number in the text, however.
- Search
- Search for the pasted text.
- Window
- Make a clone of the window.
All of these actions can be done traditionally via the menus,
but the shortcuts make some common operations faster.
The Pipe entry in the Edit menu allows you to filter
the selected text through a Unix command. It pops up a dialog
box, where you can enter any valid command line for the
/bin/sh shell. The selected text will be the
standard input of the command. The text will be replaced with the
standard output of the command.
This could be used to sort lines, to convert tabs to spaces,
or to remove lines that match some pattern. The possibilities are
endless.
Key bindings are configured via X resources, using the usual
syntax. You need to be careful with the order, when binding to
sequences of keys.
The following list describes all actions that can be bound
to events (keys, usually) via X resources. At the moment, the list
is rather incomplete.
change(arbitrary-text)
- Change the selection to
arbitrary-text
and select the
empty text after the modification. This works just as if the user
had typed arbitrary-text
, except that key bindings are not
obeyed.
SeX reads the configuration file ~/.sexrc
when it starts up.
This file can define various variables. The general syntax is
variablename = value
Comments and empty lines are allowed. Comments begin with
`#
' and continue to the end of the line. Each variable
has one of the following types:
- Boolean
- A truth value, i.e., `
yes
' or `no
'.
- String
- Any text, which can be enclosed in double quote (`
"
').
Inside double quotes, you can use standard C syntax for unusual
characters, e.g., `\n
' to mark a newline character.
- Integer
- An integer expression. The four basic arithmetic operations
are allowed.
If the configuration file tries to assign the wrong kind of
value to a variable, SeX will not start. The variables that
can be defined are (the type is indicated inside parentheses):
- save_backup
- (Boolean) When saving a file, should the old file be renamed to
have a `
~
' suffix? Default is `no
'.
- fmt_program
- (String) Program that formats text nicely by folding long lines,
and joining short lines. Default is `
fmt
'.
- font
- (String) Font to use for displaying the text. Should be the name
of an available X font. Default is `
fixed
'.
- max_killring
- (Integer) Maximum amount of memory to use for the kill ring, in
bytes. Default is 64 kilobytes.
- indent_width
- (Integer) How many columns the
edit(indent)
command should
move text. Default is 8.
It is not necessary to assign all variables, but SeX will not start
if you have invalid variables.
Simple editor for X: Users' Guide
- Copyright © 1996, 1997 Lars Wirzenius.
Contents; abstract; next; back.
Version 0.12
Lars Wirzenius liw@iki.fi