TrumanWong

jed

Editor mainly used for editing code

Supplementary instructions

jed command was developed by Slang. Its main purpose is to edit the source code of the program. It supports colored syntax highlighting and can simulate emacs, EDT, wordstar and Brief editors.

grammar

jed(option)(parameter)

Options

-2: Display the upper and lower editing areas;
-batch: execute in batch mode;
-f<function>: execute Slang function;
-g<number of lines>: Move to the specified number of lines in the buffer;
-i<file>: Load the specified file into the buffer;
-n: Do not load the jed.rc configuration file;
-s<string>: Find and move to the specified string.

Parameters

File: Specify the file list to be edited.

Example

Open the mysource.c original code file in the upper and lower editing areas. To switch the editing area, you can use the command introduced later to open the operation command. After opening the menu, press 3 and then 2 to switch the editing area:

jed -2 mysource.c

operate

Some Emacs key combinations conflict with jed menu key combinations. For example, Alt+f should be "forward one word" in Emacs, but it is "File Menu" in jed. If you want to use Emacs-style key combinations, edit /usr/ share/jed/lib/menus.slcfind the following paragraph:

unsetsetkey ("selectmenubar", "\em");
unsetsetkey ("@\emF", "\ef");
unsetsetkey ("@\emE", "\ee");
unsetsetkey ("@\emo", "\eo");
% Mode menu unsetsetkey ("@\emS", "\es");
unsetsetkey ("@\emB", "\eb");
unsetsetkey ("@\emi", "\ei");
unsetsetkey ("@\emH", "\eh");
unset_setkey ("@\emy", "\ey");

You can modify it according to your own needs, or simply comment it out; use the F10 key to use the menu.

Since Jed can simulate multiple editors, their respective key commands are also different. Here we take simulating Emacs as an example to illustrate the operation method in the editor.

document

/usr/share/jed/lib/*.sl This is the default file for running jed slang.
/usr/share/jed/lib/site.sl This is the default startup file.
/etc/jed.rc This is the global system configuration file.
~/.jedrc This is the user configuration file.