Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 820 Bytes

README.md

File metadata and controls

36 lines (28 loc) · 820 Bytes

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",
    },
  },
}