• Stars
    star
    204
  • Rank 192,063 (Top 4 %)
  • Language
    Emacs Lisp
  • Created over 12 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

GNU GLOBAL helm interface

melpa badge melpa stable badge

helm-gtags.el

CI travis badge

Introduction

helm-gtags.el is GNU GLOBAL helm interface.

Screenshot

helm-gtags

Requirements

  • Emacs 24 or higher.
  • helm 1.7.7 or higher
  • GNU Global 6.2.3 or higher

helm-gtags.el does not require gtags.el.

Installation

helm-gtags is available on MELPA and MELPA stable

You can install helm-gtags with the following command.

M-x package-install [RET] helm-gtags [RET]

Use Ctags with helm-gtags

You can use helm-gtags for languages which are supported by ctags(Both exuberant ctags and universal ctags) with ctags backend feature of GNU global. You can generate ctags backend tags by following command.

# exuberant ctags
% gtags --gtagslabel=ctags

# universal ctags
% gtags --gtagslabel=new-ctags

Basic Usage

helm-gtags-mode

Enable helm-gtags-mode.

helm-gtags-find-tag

Input tag name and move to the definition.

helm-gtags-find-tag-from-here

Find tag from here and move to its definition.

helm-gtags-find-rtag

Input tag name and move to the referenced point.

helm-gtags-find-symbol

Input symbol and move to the locations.

helm-gtags-find-files

Input file name and open it.

You can use those searching commands with prefix key.

Prefix Key Description
C-u Searches from specified directory
C-u C-u Searches under current directory
C-- Jump to symbol with other window

helm-gtags-select

Tag jump using gtags and helm

helm-gtags-dwim

Find name by context.

  • Jump to header file if cursor is on include statement
  • Jump to tag definition if cursor is on tag reference
  • Jump to tag reference if cursor is on tag definition

helm-gtags-tags-in-this-function

Show tagnames which are referenced in this function and jump to them.

helm-gtags-update-tags

Update TAG file. Default is update only current file, You can update all files with C-u prefix.

helm-gtags-create-tags

Create TAG file. Please choose default as GTAGSLABEL if you don't enable --with-ctags and plugin parser options. If you use homebrew on MacOSX, you can enable those features by following command.

# You should uninstall global at first if you already install global
% brew install global --with-ctags --with-pygments

helm-gtags-parse-file

Show symbols in current file like gtags-parse-file. You can choose any files with C-u prefix.

helm-gtags-pop-stack

Move to previous point on the stack. helm-gtags pushes current point to stack before executing each jump functions.

helm-gtags-push-stack

Push current location to the stack.

helm-gtags-next-history

Move to next history on context stack.

helm-gtags-previous-history

Move to previous history on context stack.

helm-gtags-show-stack

Show context stack with helm interface. You can jump to the context.

helm-gtags-clear-stack

Clear current context stack.

helm-gtags-clear-all-stacks

Clear all context stacks.

helm-gtags-clear-cache

Clear current project cache for helm-gtags-select and helm-gtags-select-path

helm-gtags-clear-all-cache

Clear all result cache for helm-gtags-select and helm-gtags-select-path

helm-gtags-resume

Resurrect previously invoked helm-gtags command. This is similar to helm-resume however this command resurrects helm gtags buffer if other helm commands are called.

Using Suggested Key Mapping

helm-gtags.el provides suggested key maps like gtags.el by setting helm-gtags-suggested-key-mapping to non-nil. Its prefix key is C-c as default. You can change prefix by setting helm-gtags-prefix-key.

You have to set them before loading helm-gtags.el. I recommend you to use custom-set-variables for setting this value.

(custom-set-variables
 '(helm-gtags-prefix-key "\C-t")
 '(helm-gtags-suggested-key-mapping t))

If you use invalid modifier string(like C-,) as prefix key, please don't escape Control prefix.(OK: C-,, NG: \C-,).

Default Key Mapping

Key Command
Prefix h helm-gtags-display-browser
Prefix C-] helm-gtags-find-tag-from-here
Prefix C-t helm-gtags-pop-stack
Prefix P helm-gtags-find-files
Prefix f helm-gtags-parse-file
Prefix g helm-gtags-find-pattern
Prefix s helm-gtags-find-symbol
Prefix r helm-gtags-find-rtag
Prefix t helm-gtags-find-tag
Prefix d helm-gtags-find-tag
M-* helm-gtags-pop-stack
M-. helm-gtags-find-tag
C-x 4 . helm-gtags-find-tag-other-window

Customize Variables

helm-gtags-path-style(Default 'root)

File path style, 'root or 'relative or 'absolute. You can only use 'absolute if you use Windows and set GTAGSLIBPATH environment variable. helm-gtags.el forces to use absolute style in such case.

helm-gtags-ignore-case(Default nil)

Ignore case for searching flag

helm-gtags-read-only(Default nil)

Open file as readonly, if this value is non-nil

helm-gtags-use-input-at-cursor(Default nil)

Use word at cursor as input if this value is non-nil

helm-gtags-highlight-candidate(Default t)

Highlighting candidates if this value is non-nil

helm-gtags-display-style(Default nil)

Show detail information if this value is 'detail, show reference point of function etc.

helm-gtags-auto-update(Default nil)

If this variable is non-nil, TAG file is updated after saving buffer

helm-gtags-update-interval-second(Default 60)

Tags are updated in `after-save-hook' if this seconds is passed from last update Always update if value of this variable is nil.

helm-gtags-cache-select-result(Default nil)

If this variable is non-nil, use cache for helm-gtags-select and helm-gtags-select-path

helm-gtags-cache-max-result-size(Default 10MB)

Max size(bytes) to cache for each select result

helm-gtags-pulse-at-cursor(Default nil)

If this variable is non-nil, pulse at point after jumping

helm-gtags-fuzzy-match(Default nil)

Enable fuzzy match. You should set this value before loading helm-gtags.el.

helm-gtags-direct-helm-completing(Default nil)

Use helm completion instead of normal Emacs completion if this value is non-nil.

helm-gtags-maximum-candidates

Maximum number of helm candidates in helm-gtags.el. Please set small number if you feel slow for large source tree such as Linux kernel.

Default value is

  • 9999(Disable fuzzy match)
  • 100(Enable fuzzy match)

helm-gtags-preselect

If this variable is non-nil, preselect current file and line.

helm-gtags-cygwin-use-global-w32-port

This variable is only for Cygwin users. If you use both Cygwin version Emacs and GNU global, please set nil to this variable.

Faces

helm-gtags-file

Face of file name of candidates

helm-gtags-lineno

Face of line number of candidates

anything-gtags.el

helm-gtags.el is not compatible anything-gtags.el. But helm-gtags.el is designed for faster search than anything-gtags.el.

anything-gtags.el is slow in large source tree such as Linux kernel, FreeBSD, Android etc. Because anything-gtags.el creates candidates by processing output of gtags.el. helm-gtags.el creates candidates by itself, so helm-gtags.el is faster than anything-gtags.el.

Sample Configuration

;;; Enable helm-gtags-mode
(add-hook 'c-mode-hook 'helm-gtags-mode)
(add-hook 'c++-mode-hook 'helm-gtags-mode)
(add-hook 'asm-mode-hook 'helm-gtags-mode)

;; customize
(custom-set-variables
 '(helm-gtags-path-style 'relative)
 '(helm-gtags-ignore-case t)
 '(helm-gtags-auto-update t))

;; key bindings
(with-eval-after-load 'helm-gtags
  (define-key helm-gtags-mode-map (kbd "M-t") 'helm-gtags-find-tag)
  (define-key helm-gtags-mode-map (kbd "M-r") 'helm-gtags-find-rtag)
  (define-key helm-gtags-mode-map (kbd "M-s") 'helm-gtags-find-symbol)
  (define-key helm-gtags-mode-map (kbd "M-g M-p") 'helm-gtags-parse-file)
  (define-key helm-gtags-mode-map (kbd "C-c <") 'helm-gtags-previous-history)
  (define-key helm-gtags-mode-map (kbd "C-c >") 'helm-gtags-next-history)
  (define-key helm-gtags-mode-map (kbd "M-,") 'helm-gtags-pop-stack))

More Repositories

1

god-mode

Minor mode for God-like command entering
Emacs Lisp
849
star
2

git-gutter

Emacs port of GitGutter which is Sublime Text Plugin
Emacs Lisp
830
star
3

helm-swoop

Efficiently hopping squeezed lines powered by Emacs helm interface
Emacs Lisp
688
star
4

org-page

[INACTIVE] A static site generator based on Emacs and org mode.
Emacs Lisp
673
star
5

popwin

Popup Window Manager for Emacs
Emacs Lisp
496
star
6

helm-ag

The silver searcher with helm interface
Emacs Lisp
492
star
7

quickrun

Run command quickly. This packages is inspired quickrun.vim
Emacs Lisp
474
star
8

anzu

Emacs Port of anzu.vim
Emacs Lisp
414
star
9

emamux

tmux manipulation from Emacs
Emacs Lisp
265
star
10

ov

Overlay library for Emacs Lisp.
Emacs Lisp
211
star
11

direx

Directory Explorer for GNU Emacs
Emacs Lisp
204
star
12

terraform-mode

Major mode of Terraform configuration file
Emacs Lisp
194
star
13

git-gutter-fringe

Fringe version of git-gutter.el
Emacs Lisp
160
star
14

req-package

dependency management system on top of use-package
Emacs Lisp
153
star
15

git-messenger

Emacs Port of git-messenger.vim
Emacs Lisp
146
star
16

go-eldoc

eldoc for go language
Emacs Lisp
128
star
17

libegit2

Emacs bindings for libgit2
C
115
star
18

key-chord

Map pairs of simultaneously pressed keys to commands
Emacs Lisp
108
star
19

yascroll

Yet Another Scroll Bar Mode
Emacs Lisp
104
star
20

zoom-window

Zoom and Unzoom window
Emacs Lisp
102
star
21

company-jedi

Company backend for Python jedi
Emacs Lisp
100
star
22

swoop

Peculiar buffer navigation for Emacs
Emacs Lisp
90
star
23

org-redmine

Redmine tools using Emacs OrgMode
Emacs Lisp
83
star
24

dired-k

Highlighting dired buffer like k
Emacs Lisp
82
star
25

magit-gerrit

Magit plugin for Gerrit Code Review
Emacs Lisp
61
star
26

go-add-tags

Add field tags for struct fields
Emacs Lisp
59
star
27

pkg-info

Provide information about Emacs packages
Emacs Lisp
57
star
28

helm-css-scss

This emacs program makes your CSS/SCSS/LESS coding faster and easier than ever.
Emacs Lisp
54
star
29

smeargle

Highlighting Regions by Last Updated Time
Emacs Lisp
49
star
30

evil-anzu

anzu for Evil
Emacs Lisp
49
star
31

mongo

MongoDB driver for Emacs Lisp
Emacs Lisp
47
star
32

manage-minor-mode

Manage your minor-mode on the dedicated interface buffer. Emacs.
Emacs Lisp
47
star
33

gh-md

Render markdown using the github api
Emacs Lisp
46
star
34

farmhouse-themes

Hand-picked light and dark color theme for Emacs 24+
Emacs Lisp
43
star
35

go-direx

Tree style source code viewer for Go language
Emacs Lisp
40
star
36

undohist

Persistent Undo History for GNU Emacs
Emacs Lisp
40
star
37

helm-themes

Emacs theme selection with helm interface
Emacs Lisp
38
star
38

fontawesome

fontawesome utility
Emacs Lisp
33
star
39

go-impl

impl for Emacs
Emacs Lisp
32
star
40

ansible-doc

Ansible documentation for GNU Emacs
Emacs Lisp
32
star
41

sr-speedbar

Same frame speedbar
Emacs Lisp
31
star
42

fancy-battery

Display battery in Emacs Mode line
Emacs Lisp
31
star
43

cpp-auto-include

Insert and delete C++ header files automatically.
Emacs Lisp
31
star
44

helm-open-github

Utilities for opening github page
Emacs Lisp
29
star
45

ac-etags

etags/ctags completion source for auto-complete
Emacs Lisp
28
star
46

transpose-frame

Transpose windows arrangement in a frame
Emacs Lisp
26
star
47

osx-trash

Make Emacs' delete-by-moving-to-trash do what you expect it to do on OS X.
Emacs Lisp
26
star
48

ac-emoji

auto-complete source of Emoji
Emacs Lisp
25
star
49

ac-ispell

ispell/aspell completion source for auto-complete
Emacs Lisp
25
star
50

applescript-mode

Emacs mode for editing AppleScript
Emacs Lisp
24
star
51

codic

Codic for Emacs
Emacs Lisp
23
star
52

magit-svn

Git-Svn extension for Magit
Emacs Lisp
22
star
53

helm-pydoc

pydoc with helm interface
Emacs Lisp
20
star
54

evil-textobj-line

Evil Line text object
Emacs Lisp
18
star
55

ac-alchemist

auto-complete source of alchemist
Emacs Lisp
18
star
56

sourcemap

Sourmap parser in Emacs Lisp
Emacs Lisp
18
star
57

dart-mode

An Emacs mode for the Dart language
Dart
16
star
58

helm-ack

App::ack with helm interface
Emacs Lisp
13
star
59

helm-perldoc

perlpod with helm interface
Emacs Lisp
12
star
60

reverse-theme

Emacs color theme of reverse(like 'emacs --reverse-video')
Emacs Lisp
12
star
61

helm-github-issues

github issues with helm interface
Emacs Lisp
12
star
62

ac-capf

auto-complete source of completion-at-point
Emacs Lisp
12
star
63

sound-wav

Play wav file
Emacs Lisp
12
star
64

ac-racer

auto-complete source of racer
Emacs Lisp
10
star
65

qt-pro-mode

GNU Emacs major-mode for Qt build-system files
Emacs Lisp
9
star
66

popup-complete

Completion with popup-el
Emacs Lisp
9
star
67

splitjoin

Emacs port of splitjoin.vim
Emacs Lisp
8
star
68

miniedit

Enhanced editing for minibuffer fields
Emacs Lisp
8
star
69

helm-ispell

ispell completion with helm interface
Emacs Lisp
8
star
70

thingopt

Additional features of thingatpt.el
Emacs Lisp
8
star
71

helm-package

Listing ELPA packages with helm interface
Emacs Lisp
7
star
72

magit-p4

Magit plugin integrating git-p4 add-on.
Emacs Lisp
6
star
73

docean

Interact with DigitalOcean from Emacs
Emacs Lisp
6
star
74

pyimpsort

Sort python imports
Python
5
star
75

emamux-ruby-test

Ruby test with emamux
Emacs Lisp
5
star
76

octicons

Emacs octicons utility
Emacs Lisp
5
star
77

oberon

Major mode for editing Oberon/Oberon-2 program texts
Emacs Lisp
5
star
78

dedicated

A very simple minor mode for dedicated buffers
Emacs Lisp
4
star
79

haxe-mode

Major mode for editing Haxe files.
Emacs Lisp
4
star
80

helm-robe

Helm completing function for robe
Emacs Lisp
4
star
81

ert-expectations

The simplest unit test framework in the world
Emacs Lisp
4
star
82

keydef

A simpler way to define keys, with kbd syntax
Emacs Lisp
3
star
83

help-find-org-mode

Advise help functions to find org babel source blocks instead of tangled source
Emacs Lisp
3
star
84

test-more

Emacs Test framework like Perl's Test::More
Emacs Lisp
3
star
85

tree-mode

A mode to manage tree widgets
Emacs Lisp
3
star
86

showtip

Show tip at cursor
Emacs Lisp
3
star
87

import-popwin

Pop up buffer near by import statements with popwin
Emacs Lisp
3
star
88

literate-coffee-mode

Major mode for Literate CoffeeScript
Emacs Lisp
3
star
89

perl-utils

Emacs Perl utilities
Emacs Lisp
2
star
90

ltsv

LTSV for Emacs
Emacs Lisp
2
star
91

later-do

Execute lisp code ... later
Emacs Lisp
2
star
92

findr

Breadth-first file-finding facility for (X)Emacs
Emacs Lisp
2
star
93

org-json

Conversion between org and json
Emacs Lisp
2
star
94

dirtree

Directory tree views
Emacs Lisp
2
star
95

pylint

Minor mode for running `pylint'
Emacs Lisp
2
star
96

jedi-eldoc

Eldoc with emacs-jedi
Emacs Lisp
2
star
97

w32-browser

Run Windows application associated with a file
Emacs Lisp
2
star
98

setnu

Emacs Lisp
1
star
99

oddmuse

Edit pages on an Oddmuse wiki
Emacs Lisp
1
star
100

.github

Talk and learn about the Emacsorphanage
Makefile
1
star