• 要找福利?记不住网址?搜不到?如何与我们保持联系?试试 CTRL+D 把零点博客添加进您的浏览器收藏夹,一键直达永不失联!

Linux jed命令

linux系统 涛涛 104次浏览 0个评论

Linux jed命令用于编辑文本文件。

Jed是以Slang所写成的程序,适合用来编辑程序原始代码。

语法

<span class="pln">jed </span><span class="pun">[-</span><span class="lit">2n</span><span class="pun">][-</span><span class="pln">batch</span><span class="pun">][-</span><span class="pln">f</span><span class="pun"><函数>][-</span><span class="pln">g</span><span class="pun"><行数>][-</span><span class="pln">i</span><span class="pun"><文件>][-</span><span class="pln">I</span><span class="pun"><文件>][-</span><span class="pln">s</span><span class="pun"><字符串>][文件]</span>

参数

  • -2 显示上下两个编辑区。
  • -batch 以批处理模式来执行。
  • -f<函数> 执行Slang函数。
  • -g<行数> 移到缓冲区中指定的行数。
  • -i<文件> 将指定的文件载入缓冲区。
  • -n 不要载入jed.rc配置文件。
  • -s<字符串> 查找并移到指定的字符串。

实例

jed主要用于编辑程序的源码,编辑源码时将以彩色高亮的方式显示程序的语法。例如使用jed编辑一个C语言的源代码文件,可使用如下命令:

<span class="pln">jed main</span><span class="pun">.</span><span class="pln">c       </span><span class="com">#用jed编辑器打开main.c 文件 </span>

输出结果如下:

<span class="pln">F10 key </span><span class="pun">==></span> <span class="typ">File</span> <span class="typ">Edit</span> <span class="typ">Mode</span> <span class="typ">Search</span> <span class="typ">Buffers</span> <span class="typ">Windows</span> <span class="typ">System</span> <span class="typ">Help</span> <span class="com">#编辑器菜单  </span>
<span class="com">/*-*- linux-c-*-*/</span> <span class="com">#编辑区  </span>
<span class="com">#include</span> <span class="str"><linux/mm.h></span> 
<span class="com">#include</span> <span class="str"><linux/sysctl.h></span> 
<span class="com">#include</span> <span class="str"><linux/nsproxy.h></span> 
<span class="kwd">static</span> <span class="kwd">struct</span><span class="pln"> list_head </span><span class="pun">*</span><span class="pln">  
net_ctl_header_lookup</span><span class="pun">(</span><span class="kwd">struct</span><span class="pln"> ctl_table_root </span><span class="pun">*</span><span class="pln">root</span><span class="pun">,</span> <span class="kwd">struct</span><span class="pln"> nsproxy </span><span class="pun">*</span><span class="pln">namespaces</span><span class="pun">)</span>  
<span class="pun">{</span>  
<span class="kwd">return</span> <span class="pun">&</span><span class="pln">namespaces</span><span class="pun">-></span><span class="pln">net_ns</span><span class="pun">-></span><span class="pln">sysctl_table_headers</span><span class="pun">;</span>  
<span class="pun">}</span>  
<span class="kwd">static</span> <span class="kwd">struct</span><span class="pln"> ctl_table_root net_sysctl_root </span><span class="pun">=</span> <span class="pun">{</span>  
<span class="pun">.</span><span class="pln">lookup </span><span class="pun">=</span><span class="pln"> net_ctl_header_lookup</span><span class="pun">,</span>  
<span class="pun">};</span>  
<span class="kwd">static</span> <span class="kwd">int</span><span class="pln"> sysctl_net_init</span><span class="pun">(</span><span class="kwd">struct</span><span class="pln"> net </span><span class="pun">*</span><span class="pln">net</span><span class="pun">)</span>  
<span class="pun">{</span><span class="pln">  
INIT_LIST_HEAD</span><span class="pun">(&</span><span class="pln">net</span><span class="pun">-></span><span class="pln">sysctl_table_headers</span><span class="pun">);</span>  
<span class="kwd">return</span> <span class="lit">0</span><span class="pun">;</span>  
<span class="pun">}</span>  
<span class="pun">-----+(</span><span class="typ">Jed</span> <span class="lit">0.99</span><span class="pun">.</span><span class="lit">18U</span><span class="pun">)</span> <span class="typ">Emacs</span><span class="pun">:</span><span class="pln"> main</span><span class="pun">.</span><span class="pln">c </span><span class="pun">(</span><span class="pln">C</span><span class="pun">)</span> <span class="typ">All</span> <span class="lit">6</span><span class="pun">:</span><span class="lit">06pm</span><span class="pun">-----------------------------</span>  
<span class="com">#从左到右分别为jed版本编号、当前是模拟emacs编辑器、打开的文件名、现在的时间  </span><span class="pln">
loading </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">share</span><span class="pun">/</span><span class="pln">jed</span><span class="pun">/</span><span class="pln">lib</span><span class="pun">/</span><span class="pln">modeinfo</span><span class="pun">.</span><span class="pln">slc </span>

欢迎转载本文:Linux jed命令
喜欢 (0)
[ld]
分享 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址