rawnly / gist.nvim

Neovim plugin that allows you to create a Github Gist from the current file
MIT License
187 stars 5 forks source link

Setup and refactor (resolves #10) #12

Closed lnc3l0t closed 1 year ago

lnc3l0t commented 1 year ago

Quite a big PR actually.

FIRST COMMIT. I refactored the functions to an API module so that structure is cleaner and easily maintainable: if more workflows are added they can go here (CreateGistFromMultipleFiles may go in create.lua, or ListGistsFromUser in list.lua or something else). Now the init.lua file holds the plugin option and the setup function which the user need to call if they want to change the default options. The advantage of having the API folder is that in the future wrappers can be added around the functions so that someone can reference them via :lua require("gist.api.create").from_buffer(bufnr) instead of the normal flow via CreateGist etc.

SECOND COMMIT. I added the MIT license file

THIRD COMMIT. I added to the options of the plugin setup the possibility to customize the mapping that I set up in ListGists when multiple files are present in a gist and one wishes to cycle between them.

lnc3l0t commented 1 year ago

Resolves #10