Coder Social home page Coder Social logo

emacsmirror / global-tags Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 129 KB

Elisp API and editor integration for GNU global

Home Page: https://launchpad.net/global-tags.el

License: GNU Lesser General Public License v3.0

Makefile 1.48% Emacs Lisp 73.97% Lua 15.50% Shell 9.05%

global-tags's Introduction

global.el

Purpose

  • Provide a (unit-) testeable Emacs Lisp API that wraps global binary calls (exposed to developer).

  • Optional integration to Emacs using aformentioned API with project.el and xref.el (exposed to final user).

Secondary purposes

  • Integrate to main Emacs branch

  • Do not expose global to the final user with commands: user should use project.el and xref.el functions

  • Improve response times of queries in remote or big codebase by pre-fetching results in the background.

  • Prevent Emacs from freezing when calling global. While global is meant to respond real quickly, calling it using Tramp can freeze Emacs for a few seconds.

Features

  • Navigate files using project.el

  • Navigate tags for current files with Imenu

  • Search for tags using xref

  • Do-what-I-mean: search either a symbol under cursor or header file under cursor (inside a #include)

  • Pre-fetch results (list files, list tags, database location) for a snappier experience.

Usage

You can setup using GNU global as backend with any of the following two lines:

;; to use GNU Global automagically, regardless of Emacs default configuration
(add-hook 'ruby-mode-hook #'global-tags-exclusive-backend-mode)
;; to use GNU Global automagically, respecting other backends
(add-hook 'ruby-mode-hook #'global-tags-shared-backend-mode)
;; configure Imenu
(add-hook 'ruby-mode-hook #'global-tags-imenu-mode)

Alternatively, you can manually configure project.el and xref.el, add their "recognize this global handled project" to the proper places like so:

;; xref (finding definitions, references)
(add-to-list 'xref-backend-functions 'global-tags-xref-backend)
;; project.el (finding files)
(add-to-list 'project-find-functions 'global-tags-try-project-root)
;; to update database after save
(add-hook 'c++-mode-hook (lambda ()
                           (add-hook 'after-save-hook
                                     #'global-tags-update-database-with-buffer
                                     nil
                                     t)))

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

global-tags's People

Contributors

felipelema avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.