Emacs eshell的好处

               

一直在Linux下用shell,现在来谈谈eshell.

eshell是完全用elisp编写的shell,所以和shell不一样。shell会创建子进程比如bash. 因此eshell的语法和bash/sh并不完全一样。当然大多数都差不多。


eshell有几个优点

1. 在windows操作系统下,有了eshell,可以方便的运行Linux风格的命令,不需要再安装别的东西. 当然各个平台行为一致也是优点。

2. 支持重定向到其他buffer,用 >#<buffer ...> 格式

~ $ echo hello >#<buffer results>~ $ ls >#<buffer *scratch*>

这样,会将hello输出到result buffer中,会将ls的结果输出到*scratch*buffer中。

3. grep的结果会包含链接,点击直接打开文件并跳转到结果表示的那一行。这个实在是太赞了。

4. eshell里面直接运行elisp, 相当方便

~ $ (+ 2 1)3

5. 运行man命令

shell中

$ man grepWARNING: terminal is not fully functional-  (press RETURN)GREP(1)                                                                                   General Commands Manual                                                                                   GREP(1)NAME       grep, egrep, fgrep - print lines matching a patternSYNOPSIS       grep [OPTIONS] PATTERN [FILE...]       grep [OPTIONS] [-e PATTERN | -f FILE] [FILE...]DESCRIPTION       grep  searches  the  named  input  FILEs for lines containing a match to the given PATTERN.  If no files are specified, or if the file “-” is given, grep searches standard input.  By default, grep       prints the matching lines.       In addition, the variant programs egrep and fgrep are the same as grep -E and grep -F, respectively.  These variants are deprecated, but are provided for backward compatibility.OPTIONS   Generic Program Information       --help Output a usage message and exit.       -V, --version              Output the version number of grep and exit.   Matcher Selection

不能显示全,


而在eshell中,直接打开一个buffer显示,效果和M-x man一样,但是更加快捷。


注意

eshell仍然是一个编辑器,eshell里的所有内容都可以作为文本复制,但是必须用C-n 和 C-p来上下移动光标,上下键无效。

实际上在eshell中,控制光标应该这样,以我的Dell XPS 13为例

Fn/Home 移动到行首

C-a 移动到$后的第一个字符

Fn/End 或者 C-e移动到行尾

C-b 后移一个字符

C-f 前移一个字符

C-n 下移一行

C-p 上移一行

M-< buffer开头

M-> buffer结尾

M-g g 跳转到某一行,输入数字指定行号

M-g Tab 跳转到当前行某一列,输入数字制定列号


eshell的文档

http://www.gnu.org/software/emacs/manual/html_mono/eshell.html


推荐使用eshell,放弃shell吧。因为这更emacs.



           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值