Coder Social home page Coder Social logo

gitbeam's Introduction

Description

gitbeam is a Light Table plugin that provides seamless interaction with github. With one command browse any github url locally and with another command browse the current file on github. These commands work for any file path and git SHA as well as preserve lines selected in LT or in the browser.

Install

Install this plugin with LT's plugin manager or clone this project to your LT plugins directory. This plugin requires LT >= 0.7.0.

Usage

gitbeam does not assume any default keybindings for its commands. See below to configure them. To access its commands, open the command bar (Ctrl-Space) and type "gitbeam".

gitbeam provides the following URL->file (beam in) commands:

  • :gitbeam.in-with-clipboard - opens a project using a clipboard url
  • :gitbeam.in-with-current-word - opens a project for the url under the cursor

These commands clone a project, add it to the current workspace, checkout the specified commit and optionally open the specified file and highlight selected lines.

Examples:

  • private url e.g. [email protected]:user/my-project.git
  • public url e.g. https://github.com/cldwalker/gitbeam
  • url with path e.g. https://github.com/technomancy/leiningen/blob/master/sample.project.clj
  • url with a specific SHA/branch e.g. https://github.com/technomancy/leiningen/blob/3.x/sample.project.clj
  • url with lines selected e.g. https://github.com/technomancy/leiningen/blob/a5cf442cf3c6db0f9d0bf272942d5fb7fb90173c/sample.project.clj#L152-L157

gitbeam provides the following file->URL (beam out) commands:

  • :gitbeam.out-with-external-browser - opens current file on github with external browser
  • :gitbeam.out-with-internal-browser - opens current file on github with LT's browser
  • :gitbeam.out-with-clipboard-copy - copies github url of current file to clipboard

These commands operate on the url equivalent of a selected file and optionally handle selected lines.

Configuration

To map a key to a command, add an entry in user.keymap. For example, under :editor add "alt-g" [:gitbeam.out-with-external-browser]. For more examples of mapped gitbeam commands, see my LT files.

Note: when mapping gitbeam.out commands, editor selection cannot be detected if using lt.plugins.vim/map-keys.

Bugs/Issues

Please report them on github.

All commands should work with LT >= 0.6.4.

Contributions

See here for contributing guidelines.

There are a couple of enhancements that would be welcome:

  • Importing a project in a new window instead of the current one
  • Add support for other git-based sites e.g. bitbucket. Currently there is only github support.

TODO

  • Add tests

Credits

Links

  • open-on-github - Atom plugin which has the beam out functionality of this plugin.

gitbeam's People

Contributors

cldwalker avatar

Watchers

 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.