Jed是以Slang所寫成的程式,適合用來編輯程式原始代碼。
文法
jed [-2n][-batch][-f<函數>][-g<行數>][-i<檔案>][-I<檔案>][-s<字串>][檔案]
參數:
- -2 顯示上下兩個編輯區。
- -batch 以批處理模式來執行。
- -f<函數> 執行Slang函數。
- -g<行數> 移到緩衝區中指定的行數。
- -i<檔案> 將指定的檔案載入緩衝區。
- -i<檔案> 載入Slang原始代碼檔案。
- -n 不要載入jed.rc設定檔。
- -s<字串> 尋找並移到指定的字串。
執行個體
jed主要用於編輯程式的源碼,編輯源碼時將以彩色高亮的方式顯示程式的文法。例如使用jed編輯一個C語言的原始碼檔案,可使用如下命令:
jed main.c #用jed編輯器開啟main.c 檔案
輸出結果如下:
F10 key ==> File Edit Mode Search Buffers Windows System Help #編輯器菜單
/*-*- linux-c-*-*/ #編輯區
#include <linux/mm.h>
#include <linux/sysctl.h>
#include <linux/nsproxy.h>
static struct list_head *
net_ctl_header_lookup(struct ctl_table_root *root, struct nsproxy *namespaces)
{ return &namespaces->net_ns->sysctl_table_headers; }
static struct ctl_table_root net_sysctl_root ={
.lookup = net_ctl_header_lookup, };
static int sysctl_net_init(struct net *net)
{ INIT_LIST_HEAD(&net->sysctl_table_headers);
return 0; }
-----+(Jed 0.99.18U) Emacs: main.c (C) All 6:06pm-----------------------------
#從左至右分別為jed版本編號、當前是類比emacs編輯器、開啟的檔案名稱、現在的時間
loading /usr/share/jed/lib/modeinfo.slc