Ubuntu Emacs23中,去到某一行的命令。

本文介绍了在Emacs编辑器中快速跳转到指定行的方法。除了使用M-x goto-line命令外,还提供了更便捷的M-g-g命令,并分享了一个自定义快捷键C-l的设置方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ubuntu的Linux,在emacs23中打算去到某一行,使用M-g 或者 M-x goto-line 命令却起不到作用。

在如下的链接中,找到了答案。输入 M-g-g 命令, 就会 提示 Goto line:  在冒号后面输入目的行号就OK了。


http://www.stylesen.org/emacs_goto_line


原文如下

Emacs goto line

08 Jan 2010
Posted by stylesen

I was reading through this post and thought I can share my recipe for the same problem. In the past (3 years back) I had the same difficulty of instructing emacs to goto a line. Each time I want to do that I need to "M-x" and type "goto-line" (tab completion is there). But this is annoying since I may need to do this 'n' number of times while writing code. I wanted a good short cut, I chose 'C-l' for this and hence came up with the following lines in my .emacs file which am so used to that in any system as soon as I open and read code in emacs, I keep pressing 'C-l' :)

;; Goto-line short-cut key                                                                                                  
(global-set-key "\C-l" 'goto-line)


Though I learnt from Senthilkumaran's blog post comments that the default that comes along in emacs is 'M-g-g' (which works in Debian and Ubuntu boxes), but I somewhat feel it will take time for me to make my fingers learn this deafult.

Having said that, I ve put my .emacs file in the attachments of this post, which may help someone.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值