如何制作前向词,后向词,将下划线视为单词的一部分? [英] How to make forward-word, backward-word, treat underscore as part of a word?
问题描述
在我的 C# 模式中,M-b 和 M-f 绑定到 {backward,forward}-word.
In my C# mode, M-b and M-f are bound to {backward,forward}-word.
但这些东西在下划线处停止,我有时将其用作成员变量的前缀.
But these things stop at underscores, which I use sometimes as a prefix on member variables.
如何让 emacs 将下划线视为单词字符?
How do I get emacs to treat the underscore as a word character?
推荐答案
正如怀远所说,你需要修改你的语法表.也就是说,他发布的内容修改了当前表...
As huaiyuan mentioned, you ned to modify your syntax table. That said, what he posted modifies the current table...
每种语言都有一个语法表,例如对于 C++,你可以这样做
Each language has a syntax table, e.g. For c++, you could do
(modify-syntax-entry ?_ "w" c++-mode-syntax-table)
我不知道你的 c# 模式"使用什么,但是快速的 Mx apropos
查找 syntax-table
应该可以帮助你找出...
I don't know what "your c# mode" uses, but a quick M-x apropos
with a look up of syntax-table
should help you find out...
这篇关于如何制作前向词,后向词,将下划线视为单词的一部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!