【问题标题】:Tab completion for unicode (Python 3/Julia) using emacs?使用emacs的unicode(Python 3 / Julia)的制表符完成?
【发布时间】:2016-11-16 17:55:10
【问题描述】:

有没有办法配置 emacs,以便我们可以使用制表符完成来键入用于 Python 3 和 Julia 的 Unicode 变量?例如

\gamma -> tab -> γ

【问题讨论】:

    标签: python unicode emacs julia tab-completion


    【解决方案1】:

    另一种方法是使用C-x RET C-\ 调用set-input-method,选择TeX,然后键入\gamma,它将自动替换为γ。然后您应该能够使用C-\ 切换输入法。或者,如果您愿意,您可以将(setq default-input-method "TeX") 添加到您的初始化文件中,然后使用C-\ 更快地进入TeX 输入并执行相同操作。

    【讨论】:

      【解决方案2】:

      不久前,我为 julia latexsubs 写了一个完成点。它只是以下(julia-latexsubs 是julia-mode 中定义的乳胶符号的哈希)

      (defun julia-completion-at-point ()
        (let ((bnds (bounds-of-thing-at-point 'symbol)))
          (when bnds
            (cond
             ;; complete latex symbol when current symbol is prefixed
             ;; by '\'
             ((eq (char-before (car bnds)) ?\\)
              (list (1- (car bnds)) (cdr bnds) julia-latexsubs
                    :annotation-function
                    #'(lambda (arg)
                        (gethash arg julia-latexsubs ""))))))))
      

      然后在你的 julia-mode 钩子中,或者ess-julia-mode-hook

        (add-hook 'completion-at-point-functions 'julia-completion-at-point nil t)
      

      【讨论】:

        【解决方案3】:

        您可以使用company-math。我的配置是here

        【讨论】:

          猜你喜欢
          • 2010-12-28
          • 2011-08-11
          • 1970-01-01
          • 1970-01-01
          • 2011-10-12
          • 1970-01-01
          • 2017-11-19
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多