首页 > 在SpacEmacs 中设置 helm-gtags 快捷键

在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.

如何解决?


.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."
)

【热门文章】
【热门文章】