是否可以在emacs中折叠功能? [英] Is it possible to collapse a function in emacs?

查看:130
本文介绍了是否可以在emacs中折叠功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,对于我进行的家庭作业轻率来说,它具有很长的defparameter表达式,这是一个很大的数据集。我想知道的是,emacs或SLIME是否可以将大型defparameter折叠成一行,例如MATLAB吗?

So, for a lisp homework assignment I have, it has a long defparameter expression that's a large data set. What I'm wondering is, does emacs or SLIME have anything to "collapse" that large defparameter into a single line, like, say, MATLAB does?

推荐答案

像Bertfred提到的那样, hideshow 的效果很好,并且内置了最新版本的emacs。要使用它,只需将以下代码段添加到您的init文件中:

Like Bertfred mentioned, hideshow works great, and it comes build in with more recent versions of emacs. To use it simply add the following snippet to your init file:

(add-hook 'prog-mode-hook #'hs-minor-mode)
(global-set-key (kbd "C-c <right>") 'hs-show-block)
(global-set-key (kbd "C-c <left>") 'hs-hide-block)

第一行启用与以下任何主要模式相关的功能编程。到达那里后, Cc< left> Cc< right> 应该可以达到您的期望-请注意点在哪里。

The first line enables the functionality in any major mode associated with programming. Once there, C-c <left> and C-c <right> should do what you expect - just be mindful of where point is.

https://www.emacswiki.org/ emacs / HideShow

这篇关于是否可以在emacs中折叠功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆