Git Product home page Git Product logo

openingh.nvim's Introduction

openingh.nvim

Opens the current file or project page in GitHub.

Lua GitHub release (latest by date) lint with luacheck GitHub Workflow Status

  • Features

    • Supports macOS, Linux, Windows and WSL
    • Works with detached HEAD and supports checked out branches or forks
    • Automatically selects the correct line number on the file page
    • Supports GitHub, GitHub Enterprise, GitLab, and Bitbucket
  • Demo

Requirements

  • Neovim 0.7.2+

Installation

Example with Packer

wbthomason/packer.nvim

-- init.lua
require("packer").startup(function()
  use "almo7aya/openingh.nvim"
end)

Commands

  • :OpenInGHRepo

    • Opens the project's git repository page in GitHub.
  • :OpenInGHFile

    • Opens the current file page in GitHub. This command supports ranges.
  • :OpenInGHFileLines

    • Opens the current file page in GitHub. This command supports ranges.

Usage

You can call the commands directly or define mappings them:

-- for repository page
vim.api.nvim_set_keymap("n", "<Leader>gr", ":OpenInGHRepo <CR>", { silent = true, noremap = true })

-- for current file page
vim.api.nvim_set_keymap("n", "<Leader>gf", ":OpenInGHFile <CR>", { silent = true, noremap = true })
vim.api.nvim_set_keymap("v", "<Leader>gf", ":OpenInGHFileLines <CR>", { silent = true, noremap = true })

TODO

  • Support the current file cursor position
  • Support visual mode to open a file in range selection
  • Support other version control websites

Contribution

Feel free to open an issue or a pull request if you have any suggestions or improvements

License

MIT

openingh.nvim's People

Contributors

almo7aya avatar lvauthrin avatar msr1k avatar bsathvik avatar plaiytiziano avatar enochchau avatar elias-gill avatar fazibear avatar fearphage 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.