thenbe / csgithub.nvim

Neovim plugin to search for code on Github.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A simple plugin to simplify searching for code on Github Code Search.

In normal mode, searches for the word under the cursor.

In visual mode, searches for the selected text.

Demo

2023-03-20.18-09-00.mp4

Install

-- Install with Lazy
{
  "thenbe/csgithub.nvim",
  keys = {
    {
      "<leader>feg",
      function()
        local csgithub = require("csgithub")

        local url = csgithub.search({
          includeFilename = false,
          includeExtension = true,
          betaSearch = true, -- set to false if you haven't opted in to GitHub Code Search (beta)
        })

        csgithub.open(url)
      end,
      mode = { "n", "v" },
      desc = "Search Github",
    },
  },
}

About

Neovim plugin to search for code on Github.


Languages

Language:Lua 100.0%