Emacs:左侧的 TODO 指示器
我希望在源代码中的任何位置都在该行的左侧有某种指示器
#TODO: some comment
//TODO: some comments
该指示器可以是一个公正的标记,并且我已经启用了该行emacs 中显示的数字。
I want to have sort of indiacator at left side of the line wherever I have in the source code
#TODO: some comment
//TODO: some comments
The indicator could be a just mark and I already enabled line numbers displayed at emacs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该命令将执行您想要的操作。
您可以根据需要自定义位图 。
要使其适用于所有文件,您可以将其添加到
'find-file-hooks
或者,如果您只想将其用于某些模式,则可以将其添加到这些模式挂钩中。
请参阅边缘、'display' 属性,叠加层,最重要的是 before-string 属性。
注意:代码已于 2010 年 2 月 27 日更新为使用叠加层,而不是直接向当前文本添加文本属性。
This command will do something like you want.
You can customize the bitmap as desired.
To get this to apply to all files, you could add it to the
'find-file-hooks
Or, if you want it just for certain modes, you could add it to those mode hooks.
See Fringes, The 'display' Property, Overlays, and most importantly the before-string property.
Note: The code was updated 27/02/2010 to use overlays instead of directly adding text properties to the current text.
我喜欢这篇文章中描述的方法 在 emacs-fu 上,它将 TODO/FIXME/... 添加到您需要的模式的字体锁定设置中。与 Trey 的方法相反,这应该在您键入时突出显示单词,而他的方法应该仅在您打开文件时突出显示它们(或者我是否弄错了)。
无论如何,这取决于你。一个好的谷歌搜索可能会给你更多的想法:http://www.google .com/search?q=emacs+highlight+todo
更新: 您的问题已得到解答:Emacs,突出显示单词的所有出现
I like the approach described in this post on emacs-fu, which adds TODO/FIXME/... to the font-lock settings of the modes where you need it. In contrast to Trey's approach this should highlight the words as you type, whereas his approach should only highlight them when you open a file (or do I get this wrong).
Anyway its up to you. A good google search gives you probably even more ideas: http://www.google.com/search?q=emacs+highlight+todo
Update: Your question has already been answered: Emacs, highlight all occurences of a word