diff --git a/README.md b/README.md index d756933..54c3501 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The plugin uses the [`gh` command-line tool](https://cli.github.com/) to create 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 `ListGists` command to list and edit all your gists, I suggest the `nvim-unception` plugin. +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. @@ -16,10 +16,10 @@ Once you have Neovim and gh installed, you can install `gist.nvim` using your fa return { { "Rawnly/gist.nvim", - cmd = { "CreateGist", "CreateGistFromFile", "ListGists" }, + cmd = { "GistCreate", "GistCreateFromFile", "GistsList" }, config = true }, - -- `ListGists` opens the selected gif in a terminal buffer, + -- `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 { @@ -34,7 +34,7 @@ return { use { "rawnly/gist.nvim", config = function() require("gist").setup() end, - -- `ListGists` opens the selected gif in a terminal buffer, + -- `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 } } @@ -42,15 +42,15 @@ use { ## Usage -To create a Gist from the current file, use the `:CreateGist` command in Neovim. +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. ```vim - :CreateGist [description] [public=true] + :GistCreate [description] [public=true] ``` -- `:CreateGist` will create the gist from the current selection -- `:CreateGistFromFile` will create the gist from the current file +- `: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]` @@ -61,9 +61,9 @@ After you enter the description and privacy settings, the plugin ask for confirm You can also list your gists and edit their files on the fly. ```vim - :ListGists + :GistsList ``` -- `:ListGists` will list all your gists and after you select one it will open a buffer to edit it +- `:GistsList` will list all your gists and after you select one it will open a buffer to edit it ## Configuration diff --git a/doc/gist.config.txt b/doc/gist.config.txt index 8ebdd31..e5ac43e 100644 --- a/doc/gist.config.txt +++ b/doc/gist.config.txt @@ -1,9 +1,9 @@ -*gist.config.txt* CreateGist configuration +*gist.config.txt* GistCreate configuration DESCRIPTION - The `:CreateGist` command can be configured to avoid prompting the user for the privacy settings of the Gist and target clipboard. + The `:GistCreate` command can be configured to avoid prompting the user for the privacy settings of the Gist and target clipboard. This is done via the `setup()` function with the `config.clipboard` and `config.private`. - The `:ListGists` command has mappings that allow you to cycle between files if a gist has multiple of them, + The `:GistsList` command has mappings that allow you to cycle between files if a gist has multiple of them, you can also type to fuzzy find them. The mappings can be customized with the `config.list.mappings.{next_file, prev_file}` via the `setup()` function. diff --git a/doc/gist.txt b/doc/gist.txt index 0d2fdd5..1085b1f 100644 --- a/doc/gist.txt +++ b/doc/gist.txt @@ -1,17 +1,17 @@ -*gist.txt* CreateGist plugin +*gist.txt* GistCreate plugin NAME gist - Create a GitHub Gist from the current file SYNOPSIS - :CreateGist - :CreateGistFromFile - :ListGists + :GistCreate + :GistCreateFromFile + :GistsList DESCRIPTION - The `:CreateGist` command creates a GitHub Gist from the buffer selection using the `gh` command-line tool. - The `:CreateGistFile` command creates a GitHub Gist from the current file using the `gh` command-line tool. - The `:ListGists` command lists all the GitHub Gists from your account and allows you to edit them directly inside neovim. + The `:GistCreate` command creates a GitHub Gist from the buffer selection using the `gh` command-line tool. + The `:GistCreateFile` command creates a GitHub Gist from the current file using the `gh` command-line tool. + The `:GistsList` command lists all the GitHub Gists from your account and allows you to edit them directly inside neovim. The plugin prompts you for a description and privacy settings for the Gist creation, and then copies the URL of the created Gist to the system clipboard. @@ -22,14 +22,14 @@ OPTIONS EXAMPLES To create a Gist from the current file, run the following command in Neovim: - :CreateGistFile [description] [public=true] + :GistCreateFile [description] [public=true] The plugin will prompt you for a description and privacy settings for the Gist. After you enter the description and privacy settings, the plugin will ask for confirmation and create the Gist using the `gh` command-line tool and copy the URL of the created Gist to the system clipboard. To Create a Gist from current selection, run the following command in Neovim: - :CreateGist [description] [public=true] + :GistCreate [description] [public=true] SEE ALSO :help gist.config diff --git a/lua/gist/api/list.lua b/lua/gist/api/list.lua index 384ce3b..be66b7f 100644 --- a/lua/gist/api/list.lua +++ b/lua/gist/api/list.lua @@ -36,7 +36,7 @@ function M.gists() local list = core.list_gists() if #list == 0 then - print("No gists. You can create one from current buffer with `CreateGist`") + print("No gists. You can create one from current buffer with `GistCreate`") return end diff --git a/plugin/gist.lua b/plugin/gist.lua index 3624409..f189dda 100644 --- a/plugin/gist.lua +++ b/plugin/gist.lua @@ -1,17 +1,17 @@ local gist = require("gist.api") -vim.api.nvim_create_user_command("CreateGistFromFile", gist.create_from_buffer, { +vim.api.nvim_create_user_command("GistCreate", gist.create_from_buffer, { nargs = "?", desc = "Create a Gist from the current file.", range = false, }) -vim.api.nvim_create_user_command("CreateGist", gist.create_from_file, { +vim.api.nvim_create_user_command("GistCreateFromFile", gist.create_from_file, { nargs = "?", desc = "Create a Gist from the current selection.", range = true, }) -vim.api.nvim_create_user_command("ListGists", gist.list_gists, { +vim.api.nvim_create_user_command("GistsList", gist.list_gists, { desc = "List user Gists.", })