2015-04-22 05:08:22 +00:00
|
|
|
;;; funcs.el --- gtags functions File
|
|
|
|
;;
|
2016-01-12 02:40:54 +00:00
|
|
|
;; Copyright (c) 2012-2016 Sylvain Benner & Contributors
|
2015-04-22 05:08:22 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2015-04-27 12:56:33 +00:00
|
|
|
|
|
|
|
(defun helm-gtags-dwim-other-window ()
|
|
|
|
"helm-gtags-dwim in the other window"
|
|
|
|
(interactive)
|
|
|
|
(let ((helm-gtags--use-otherwin t)
|
|
|
|
(split-height-threshold nil)
|
|
|
|
(split-width-threshold 140))
|
|
|
|
(helm-gtags-dwim)))
|
|
|
|
|
2015-04-22 05:08:22 +00:00
|
|
|
(defun spacemacs/helm-gtags-define-keys-for-mode (mode)
|
|
|
|
"Define key bindings for the specific MODE."
|
|
|
|
(when (fboundp mode)
|
|
|
|
(let ((hook (intern (concat (symbol-name mode) "-hook"))))
|
|
|
|
(add-hook hook 'helm-gtags-mode))
|
2015-11-18 00:38:05 +00:00
|
|
|
(spacemacs/set-leader-keys-for-major-mode mode
|
|
|
|
"gc" 'helm-gtags-create-tags
|
|
|
|
"gd" 'helm-gtags-find-tag
|
2016-03-25 06:43:12 +00:00
|
|
|
"gD" 'helm-gtags-find-tag-other-window
|
2015-11-18 00:38:05 +00:00
|
|
|
"gf" 'helm-gtags-select-path
|
|
|
|
"gg" 'helm-gtags-dwim
|
|
|
|
"gG" 'helm-gtags-dwim-other-window
|
|
|
|
"gi" 'helm-gtags-tags-in-this-function
|
|
|
|
"gl" 'helm-gtags-parse-file
|
|
|
|
"gn" 'helm-gtags-next-history
|
|
|
|
"gp" 'helm-gtags-previous-history
|
|
|
|
"gr" 'helm-gtags-find-rtag
|
|
|
|
"gR" 'helm-gtags-resume
|
|
|
|
"gs" 'helm-gtags-select
|
|
|
|
"gS" 'helm-gtags-show-stack
|
|
|
|
"gu" 'helm-gtags-update-tags)))
|
2015-04-22 08:46:43 +00:00
|
|
|
|
2016-04-05 04:08:34 +00:00
|
|
|
(defun spacemacs/ggtags-mode-enable ()
|
|
|
|
"Enable ggtags and eldoc mode.
|
|
|
|
|
|
|
|
For eldoc, ggtags advises the eldoc function at the lowest priority
|
|
|
|
so that if the major mode has better support it will use it first."
|
|
|
|
(ggtags-mode 1)
|
|
|
|
(eldoc-mode 1))
|