在SpacEmacs 中设置 helm-gtags 快捷键

尝试在spaceemacs 中使用helm-gtags 并设置快捷键如下:

(defvar tagging-packages
  '(
    helm-gtags
    ;; package taggings go here
    )
  "List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")

(defvar tagging-excluded-packages '()
  "List of packages to exclude.")

;; For each package, define a function tagging/init-<package-tagging>
;;
(defun tagging/init-helm-gtags ()
  "Initialize my package"
  (use-package helm-gtags
    :defer t
    :config
    (progn
      (evil-leader/set-key-for-mode 'helm-gtags-mode
        "t]" 'helm-gtags-find-tag-from-here
        "t[" 'helm-gtags-find-rtag
        )
      )
    )
  )

可以编译, 也可以使用helm-gtags-find-tag-from-here 等命令, 但尝试Spc-t-]的快捷键却提示undefined.

如何解决?

阅读 9.4k
1 个回答

.spacemacs 中的 dotspacemacs/config内:

(defun dotspacemacs/config ()
  (evil-leader/set-key
    "ri" 'indent-region
    "dt" 'dired-move-to-first-file
    "dy" 'put-file-name-on-clipboard
    "tt" 'helm-gtags-dwim
    "tk" 'helm-gtags-pop-stack
    )
  "Configuration function.
 This function is called at the very end of Spacemacs initialization after
layers configuration."
)

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏