Giter Site home page Giter Site logo

gist.nvim's Introduction

gist.nvim

Showcase

gist.nvim is a Neovim plugin that allows you to create a GitHub Gist from the current file. The plugin uses the gh command-line tool to create the Gist and provides a simple interface for specifying the Gist's description and privacy settings.

Installation

To use gist.nvim, you need to have Neovim installed on your system. You also need to have the gh command-line tool installed and configured with your GitHub account.

If you intend to use the GistsList command to list and edit all your gists, I suggest the nvim-unception plugin.

Once you have Neovim and gh installed, you can install gist.nvim using your favorite plugin manager.

Using lazy.nvim:

return {
  {
    "Rawnly/gist.nvim",
    cmd = { "GistCreate", "GistCreateFromFile", "GistsList" },
    config = true
  },
  -- `GistsList` opens the selected gif in a terminal buffer,
  -- nvim-unception uses neovim remote rpc functionality to open the gist in an actual buffer
  -- and prevents neovim buffer inception
  {
    "samjwill/nvim-unception",
    lazy = false,
    init = function() vim.g.unception_block_while_host_edits = true end
  }
}
use {
  "rawnly/gist.nvim",
  config = function() require("gist").setup() end,
  -- `GistsList` opens the selected gif in a terminal buffer,
  -- this plugin uses neovim remote rpc functionality to open the gist in an actual buffer and not have buffer inception
  requires = { "samjwill/nvim-unception", setup = function() vim.g.unception_block_while_host_edits = true end }
}

Usage

To create a Gist from the current file, use the :GistCreate command in Neovim. The plugin will prompt you for a description and whether the Gist should be private or public.

  :GistCreate [description] [public=true]
  • :GistCreate will create the gist from the current selection
  • :GistCreateFromFile will create the gist from the current file

Both the commands accept the same options which are [description=] and [public=true]

If you don't pass the description it will prompt to insert one later. If you pass [public=true] it won't prompt for privacy later.

After you enter the description and privacy settings, the plugin ask for confirmation and will create the Gist using the gh command-line tool and copy the Gist's URL to the given clipboard registry.

You can also list your gists and edit their files on the fly.

    :GistsList
  • :GistsList will list all your gists and after you select one it will open a buffer to edit it

Configuration

gist.nvim provides a few configuration options that you can with the setup function:

    require("gist").setup({
        private = false, -- All gists will be private, you won't be prompted again
        clipboard = "+", -- The registry to use for copying the Gist URL
        list = {
            -- If there are multiple files in a gist you can scroll them,
            -- with vim-like bindings n/p next previous
            mappings = {
                next_file = "<C-n>",
                prev_file = "<C-p>"
            }
        }
    })

License

gist.nvim is released under MIT License. See LICENSE for details.

Contributing

If you find a bug or would like to contribute to gist.nvim, please open an issue or a pull request. All contributions are welcome and appreciated!

gist.nvim's People

Contributors

aspeddro avatar lnc3l0t avatar rawnly avatar rezaarezvan 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.