Home

Awesome

thanks.nvim

Never forget to star a repo

Automatically star all the Neovim plugins you use.

[!NOTE]
Only works with lazy.nvim, packer and mini.deps.
Please open an issue or PR if you want to use it with another plugin manager.

See :h thanks if you are in Neovim.

🚀 Usage

After installing thanks.nvim, you must first log in to GitHub using the :ThanksGithubAuth command. This step is necessary only once.

Once you're authenticated, you can star all the installed plugins using the :ThanksAll command.
If you have unstar_on_uninstall set to true, it will also unstar the plugins that are not installed anymore.

The initial run may take a minute if you have a lot of plugins, but next runs will be faster due to the utilization of a local cache.
The local cache can be deleted using the :ThanksClearCache command. It will be recreated the next time you execute :ThanksAll.

With the default configuration, every time a new plugin is installed, :ThanksAll will be automatically executed (set star_on_startup to true if you want to check on each Neovim startup, see caveat).

🔧 Requirements and dependencies

📋 Installation

-- add this to your lua/plugins.lua, lua/plugins/init.lua, or the file you keep your other plugins:
{
    'jsongerber/thanks.nvim',
    config = true,
}
use({
    'jsongerber/thanks.nvim',
    config = function()
        require("thanks").setup()
    end,
})
add({
	source = "/Users/jasongerber/Documents/neovim-plugins/thanks.nvim",
	checkout = 'dev'
})

require('thanks').setup({
	star_on_install = false, -- not supported by mini.deps, see caveat section of the README or the help
})

⚙ Configuration

-- Those are the default values and can be ommited
require("thanks").setup({
	star_on_install = true,
	star_on_startup = false,
	ignore_repos = {},
	ignore_authors = {},
	unstar_on_uninstall = false,
	ask_before_unstarring = false,
})
OptionTypeDescriptionDefault value
star_on_installBooleanAutomatically run on install, so you can forget about it and it will automatically star your new plugins (mini.deps does not support this option, see caveat)true
star_on_startupBooleanSame that star_on_install, but run on startup so it check if you have any new plugins everytime you open Neovim. <br>Set to true if beeing always up to date is important to you (see caveat). <br>Default is false so you startup time maniacs won't be disapointed, but if you don't care a file read on startup it is recommended to have it to truefalse
ignore_reposTableRepos you wish to ignore when starring/unstarring eg: { "author/repo" }{}
ignore_authorsTableAuthors you wish to ignore when starring/unstarring (e.g. if you don't want to star you own repos: { "author" }){}
unstar_on_uninstallBooleanUnstar plugins when they are uninstalledfalse
ask_before_unstarringBooleanAsk before unstarring a plugin (unstar the plugin if the prompt is dismissed without n)false

🧰 Commands

CommandDescription
:ThanksAllStar all the plugins you have installed (and unstar if unstar_on_uninstall is set to true)
:ThanksGithubAuthAuthenticate with your GitHub account
:ThanksGithubLogoutLogout of your GitHub account (this command only delete the locally saved access token, you still need to revoke app permission manually)
:ThanksClearCacheDelete local cache of starred plugins

🚧 Caveats

🗑️ Uninstall

Uninstall the plugin as you normally would, if you want to clean everything, you can delete the cache file and the saved access token:

rm path/to/jsongerber-thanks.json

To find the path of this file, you can run the following command in neovim:

:lua vim.print(vim.fn.stdpath("data") .. "/jsongerber-thanks.json")

⌨ Contributing

PRs and issues are always welcome. Make sure to provide as much context as possible when opening one.

📝 TODO

Will do if there is demand (open issue or PR)

📜 License

MIT © jsongerber

Shameless plug

See my other plugins: