使用组织模式的“org-edit-special”;编辑 HTML 中嵌入的 javascript/css
在组织模式下,当该点位于 ex
或 src
块内时,我可以按 Cc ' 在另一个窗口中编辑该部分具有正确缩进和突出显示的相应主要模式。我想重用此功能以使编辑 HTML 变得更容易。
在有人提出 MMM 模式、mumamo 等之前。它们对我不起作用。如果有人知道如何在多模式设置中使缩进和字体锁定正常工作,我也很乐意研究这一点。
要求(其中大部分正是 org-edit-special 所做的:
- 当在
和
块中时,在正确的间接缓冲区中打开块相应的主要模式。
- 在原始 HTML 缓冲区中添加一个覆盖层,以显示该部分正在编辑,并
- 的原始缩进是正确的,并在编辑完成后用那么多空格填充整个块。
假设第一行 知道类似的用法org-mode 似乎迫在眉睫。
In org-mode when the point is inside an ex
or src
block, I can ppress C-c ' to edit the section in another window in the respective major-mode with correct indenting and highlighting. I would like to reuse this functionality to make editing HTML easier.
Before anyone brings up MMM-mode, mumamo, etc. They don't work for me. If anyone knows how to get indentation and font-locking working right in a multi-mode setup, I'll gladly look into that as well.
Requirements (most of this is exactly what org-edit-special does:
- when in
<script>
and<style>
block, open block in indirect buffer in the proper respective major-mode. - an overlay is added to the original HTML buffer to show that this section is being edited.
- assume the original indentation of the first line is correct, and pad the whole block with that many spaces when editing is finished.
Does anyone know of a similar usage of org-mode? It seems imminently feasible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不能说这对你有多有效(它今天才发布到邮件列表)但是 邮件列表上的此线程可能会为您提供解决方案。
它应该完全按照您所描述的方式进行,仅缺少正则表达式来正确定义代码块(以扩展它以适应您正在使用的文件类型)
I cannot say how well this would work for you (it was only just posted to the mailing-list today) but this thread on the mailing list may provide you with the solution.
It is supposed to do exactly what you describe, lacking only the regexps to properly define the code blocks perhaps (to extend it to fit the filetype you're working with)
我已经按照我在这里描述的方式实现了它:
不过,Jonathan Leech-Pepin 比我先一步宣布了我自己的项目。 :(
I've implemented it pretty much exactly as I've described here:
Jonathan Leech-Pepin beat me to the bunch announcing my own project, though. :(