Linux jed命令詳解 Linux jed命令怎麼用

來源:互聯網
上載者:User

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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.