How to make forward-word, backward-word, treat underscore as part of a word?

后端 未结 3 1852
自闭症患者
自闭症患者 2020-12-03 11:19

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.

3条回答
  •  执笔经年
    2020-12-03 11:44

    As huaiyuan mentioned, you ned to modify your syntax table. That said, what he posted modifies the current table...

    Each language has a syntax table, e.g. For c++, you could do

    (modify-syntax-entry ?_ "w" c++-mode-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...

提交回复
热议问题