company-mode org-mode yasnippet 补全问题

org-mode里开启了 yasnippet,company 模式, 以company-yasnippet 为后端,但是company的候选列表不能显示以 <, #, _ 等符号开头的 snippet,无法补全 , 大家是怎么解决的?

查了些 但是没找到解决办法

company-yasnippet--candidates just looks for snippets with name that starts with the symbol-at-point, which can’t include snippets with names starting with punctuation.

 (modify-syntax-entry ?< "w" org-mode-syntax-table)
 (modify-syntax-entry ?@ "w" org-mode-syntax-table)
 (modify-syntax-entry ?- "w" org-mode-syntax-table) 

使用此方式解决 不知道这样做 有没有什么副作用?

会改变forward-word等的行为,在org这种非programming mode里面应该影响不大。另一个办法是换用ivy/helm来补全。

1 个赞

ivy/helm 不是侧重于minibuffer里补全命令路径之类的?也能补全这些程序语言的东西吗?不是太懂 这种补全我还是感觉overlay这种方式比较习惯一点

是啊,更好的办法是改/advise company的代码,让它不只补全word这种syntax元素,不过我没试过。我倒是挺想让它改成补全symbol的。