Hello_World is a word in Python, it is different in an other mode. How I change it?

lou*_*xiu 6 python emacs

在python模式下,当我forward-word.光标从(Hello_World)跳转Hd.但在另一种模式(shell-modec-mode)中,光标从跳转H_.

我想要在Python模式下获得的结果,即使在其他模式下也是如此.我该怎么办?

PS:之前我看到过类似的问题,我已经搜索过了,但我找不到了.

djf*_*djf 6

我想你正在寻找这个:

(modify-syntax-entry ?_ "w")
Run Code Online (Sandbox Code Playgroud)

下划线将被视为单词的一部分.此命令将更改您当前所处模式的语法表 .AFAIK无法全局更改语法.但是,您可以尝试修改标准语法表.大多数主要模式都继承标准语法表.

(modify-syntax-entry  ?_ "w" standard-syntax-table)
Run Code Online (Sandbox Code Playgroud)

如果这不起作用,我想你必须为你正在使用的所有模式添加模式挂钩并单独修改它们的语法表.