Information Technology

Configuring Jed

I thought  posted this once before, but it doesn’t show up in the search utility so here we go again. The file .jedrc can either be in your home directory or it can be in $HOME/.jed depending on your distro.

% .jedrc
require ("keydefs");
require ("cua");
require ("wmark.sl");
% if you need to findout what code a key generates in your terminal
% invoke jed as follows
%
% jed -l keycode -f keycode
%
% Some terminals send \e0H for both Home and Ctrl-Home
% Some terminals send \e0F for both End and Ctrl-End
% Sometimes you need to unset \eo %unsetkey ("\e0");

setkey ("beg_of_buffer", "\e[1;5H" );
setkey ("end_of_buffer", "\e[1;5F" );
c_set_style("linux");

LINENUMBERS = 2; % show line and column numbers in status line
WRAP_INDENTS = 0; % turn off auto-indent so pasting into buffer doesn't get wonky
USE_TABS = 0;
TAB_DEFAULT = 4;
WRAP = 0;
BLINK = 1; % blink matching parenthesis
C_INDENT = 4;
C_BRA_NEWLINE = 1;
C_BRACE = 0;
C_Colon_Offset = 0;

enable_top_status_line (0); % hide tome menu

if (BATCH == 0)
{
() = evalfile ("cua"); % CUA-like key bindings
%() = evalfile ("ide"); % Borland IDE
}


define my_trim_buffer()
{
push_spot();
while (up_1()) { eol_trim(); bol(); }
pop_spot();
push_spot();
while (down_1()) { eol_trim(); bol(); }
pop_spot();
}

% Trim buffer but keep multiple blank lines:
public define trim_buffer_lines()
{
% remove whitespace at end of lines
push_spot_bob();
do {
eol_trim();
}
while (down_1());
% remove empty lines at end of buffer
eob();
do {
go_left_1();
if (bolp() and eolp())
del();
}
while (bolp());

pop_spot();
!if (BATCH) message ("done.");
}

add_to_hook("_jed_save_buffer_before_hooks",&trim_buffer_lines);

define text_mode_hook() {
set_mode("Text", 0); % do not wrap
}
define readonly ()
{
  set_readonly (1);
}

If you need to configure or learn more about this editor the manual is here.jed manual

If you need to find out what values certain key combinations actually send in your terminal start jed as follows:

jed -l keycode -f keycode