{"id":16137523,"url":"https://github.com/ntbbloodbath/cheovim","last_synced_at":"2025-04-06T16:11:51.138Z","repository":{"id":43459007,"uuid":"369551518","full_name":"NTBBloodbath/cheovim","owner":"NTBBloodbath","description":"Neovim configuration switcher written in Lua. Inspired by chemacs.","archived":false,"fork":false,"pushed_at":"2023-08-01T09:55:23.000Z","size":12013,"stargazers_count":333,"open_issues_count":8,"forks_count":13,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-10T23:27:37.945Z","etag":null,"topics":["config-management","lua","neovim","neovim-lua","switching-configs"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NTBBloodbath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-21T13:53:56.000Z","updated_at":"2024-10-07T22:37:26.000Z","dependencies_parsed_at":"2024-10-26T04:53:06.733Z","dependency_job_id":"361e1719-1290-4400-85f3-1d95d2b46fe9","html_url":"https://github.com/NTBBloodbath/cheovim","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTBBloodbath%2Fcheovim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTBBloodbath%2Fcheovim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTBBloodbath%2Fcheovim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NTBBloodbath%2Fcheovim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NTBBloodbath","download_url":"https://codeload.github.com/NTBBloodbath/cheovim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509223,"owners_count":20950232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["config-management","lua","neovim","neovim-lua","switching-configs"],"created_at":"2024-10-09T23:27:46.424Z","updated_at":"2025-04-06T16:11:51.115Z","avatar_url":"https://github.com/NTBBloodbath.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n      ___           ___           ___           ___                                    ___     \n     /  /\\         /__/\\         /  /\\         /  /\\          ___        ___          /__/\\    \n    /  /:/         \\  \\:\\       /  /:/_       /  /::\\        /__/\\      /  /\\        |  |::\\   \n   /  /:/           \\__\\:\\     /  /:/ /\\     /  /:/\\:\\       \\  \\:\\    /  /:/        |  |:|:\\  \n  /  /:/  ___   ___ /  /::\\   /  /:/ /:/_   /  /:/  \\:\\       \\  \\:\\  /__/::\\      __|__|:|\\:\\ \n /__/:/  /  /\\ /__/\\  /:/\\:\\ /__/:/ /:/ /\\ /__/:/ \\__\\:\\  ___  \\__\\:\\ \\__\\/\\:\\__  /__/::::| \\:\\\n \\  \\:\\ /  /:/ \\  \\:\\/:/__\\/ \\  \\:\\/:/ /:/ \\  \\:\\ /  /:/ /__/\\ |  |:|    \\  \\:\\/\\ \\  \\:\\~~\\__\\/\n  \\  \\:\\  /:/   \\  \\::/       \\  \\::/ /:/   \\  \\:\\  /:/  \\  \\:\\|  |:|     \\__\\::/  \\  \\:\\      \n   \\  \\:\\/:/     \\  \\:\\        \\  \\:\\/:/     \\  \\:\\/:/    \\  \\:\\__|:|     /__/:/    \\  \\:\\     \n    \\  \\::/       \\  \\:\\        \\  \\::/       \\  \\::/      \\__\\::::/      \\__\\/      \\  \\:\\    \n     \\__\\/         \\__\\/         \\__\\/         \\__\\/           ~~~~                   \\__\\/    \n```\n\n\u003cdiv align=\"center\"\u003e\n\n![License](https://img.shields.io/github/license/NTBBloodbath/cheovim?style=flat-square)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n![Neovim version](https://img.shields.io/badge/Neovim-0.7-57A143?style=flat-square\u0026logo=neovim)\n\n![Cheovim Showcase GIF](https://raw.githubusercontent.com/NTBBloodbath/cheovim/assets/res/cheovim.gif)\n\nNeovim configuration switcher written in Lua. Inspired by chemacs.\n\n[Introduction](#star2-introduction) • [Installation](#clock4-installation) • [Configuration](#wrench-configuration)\n\n\u003c/div\u003e\n\n---\n\n# :star2: Introduction\nCheovim is a plugin designed to make your life easier by being able to manage several Neovim\nconfigurations simultaneously and allow you to fully seamlessly transition between them.\n\nBy default your configuration is stored under a static `~/.config/nvim` directory. This means if you want to try out\nanother chad's configuration you must first move away your configuration into a backup folder, install the other person's config,\nput it in the correct spot, clear your `site/pack` directory so that the plugin manager can work without conflicts,\ninstall the plugin manager, install the plugins and *then* start using the config. That's absolutely atrocious!\nAfterwards switching back is the exact same awful process. \n\nBut what if we told you all of that could be fully automated?\n\n# :clock4: Installation\n\u003e :exclamation: Cheovim requires at least Neovim 0.7+ to operate, and may not work on Windows machines! \n\nCheovim only works with configurations that use the new `init.lua` configuration style. If we get enough requests we will\nimplement `init.vim` support too, but for now keep up with the times!\n\nTo install cheovim, make sure to first move your configuration (located under `~/.config/nvim/`) out of the way (into e.g. `~/.config/nvim.bak/`).\nAfterwards be sure to clear everything from `~/.local/share/nvim/site/pack/`, this is the directory where all of your current plugins are installed.\nCheovim uses symlinks as part of its magic and needs this directory to be clean. Optionally, to make your life easier, remove any files inside your config\nthat may autorun on startup and attempt to load plugins (like `plugin/packer_compiled.lua`) - this isn't necessary but you'll see that it makes the initial\ninstall a bunch easier in some cases.\n\nThen we can start the installation!\n\n```sh\ngit clone --depth=1 https://github.com/NTBBloodbath/cheovim ~/.config/nvim\n```\n\nWill clone cheovim into the config directory. You're almost ready to go! Now we just have to tell cheovim which configs to use:\nNavigate to `~/.config/nvim/` and open the `profiles.lua` file - this is where all the configuration resides.\n\nThis is the default file:\n```lua\n--[[\n      ___           ___           ___           ___                                    ___     \n     /  /\\         /__/\\         /  /\\         /  /\\          ___        ___          /__/\\    \n    /  /:/         \\  \\:\\       /  /:/_       /  /::\\        /__/\\      /  /\\        |  |::\\   \n   /  /:/           \\__\\:\\     /  /:/ /\\     /  /:/\\:\\       \\  \\:\\    /  /:/        |  |:|:\\  \n  /  /:/  ___   ___ /  /::\\   /  /:/ /:/_   /  /:/  \\:\\       \\  \\:\\  /__/::\\      __|__|:|\\:\\ \n /__/:/  /  /\\ /__/\\  /:/\\:\\ /__/:/ /:/ /\\ /__/:/ \\__\\:\\  ___  \\__\\:\\ \\__\\/\\:\\__  /__/::::| \\:\\\n \\  \\:\\ /  /:/ \\  \\:\\/:/__\\/ \\  \\:\\/:/ /:/ \\  \\:\\ /  /:/ /__/\\ |  |:|    \\  \\:\\/\\ \\  \\:\\~~\\__\\/\n  \\  \\:\\  /:/   \\  \\::/       \\  \\::/ /:/   \\  \\:\\  /:/  \\  \\:\\|  |:|     \\__\\::/  \\  \\:\\      \n   \\  \\:\\/:/     \\  \\:\\        \\  \\:\\/:/     \\  \\:\\/:/    \\  \\:\\__|:|     /__/:/    \\  \\:\\     \n    \\  \\::/       \\  \\:\\        \\  \\::/       \\  \\::/      \\__\\::::/      \\__\\/      \\  \\:\\    \n     \\__\\/         \\__\\/         \\__\\/         \\__\\/           ~~~~                   \\__\\/    \n\n\tA config switcher written in Lua by NTBBloodbath and Vhyrro.\n--]]\n\n-- Defines the profiles you want to use\nlocal profiles = {\n    --[[\n    Here's an example:\n\n\t\u003cname_of_config\u003e = { \u003cpath_or_url_to_config\u003e, {\n            -- Where to install plugins under site/pack\n\t        plugins = \"packer\",\n            -- Whether or not to preconfigure a plugin manager for you\n            preconfigure = \"packer:opt\",\n\t\t}\n\t}\n\n    More in-depth information can be found in cheovim's README on GitHub.\n    --]]\n    my_config = { \"\u003cpath_or_url\u003e\", {\n    \t\tplugins = \"packer\",\n    \t\tpreconfigure = \"packer\",\n\t    }\n    },\n}\n\n-- return \u003cname_of_config\u003e, \u003clist_of_profiles\u003e\nreturn \"my_config\", profiles\n```\n\nYou can tweak this file as you see fit, although we recommend reading the next section to actually know what you're doing.\n\n# :wrench: Configuration\nCheovim has a fair amount of configuration that may not become apparent right off the bat. Here's the things that you can change:\n```lua\nlocal profiles = {\n\tmy_config = { \"/my/path\", {\n\t\t\tsetup = function()\n\t\t\t\tos.remove(\"some_important_file\")\n\t\t\tend,\n\t\t\tconfig = \"PackerSync\",\n\t\t\tplugins = \"\u003cplugin_location\u003e\",\n\t\t\tpreconfigure = \"{packer|paq-nvim}:{start|opt}:\u003cbranch\u003e\",\n\t\t}\n\t}\n}\n\nreturn \"my_config\", profiles\n```\n\n### Options\n- `setup` - can be either a function or a string, if it is a string it will get wrapped in a vim.cmd, so be warned.\nGets invoked before the new configuration gets loaded.\n- `config` - can also be either a function or a string. Gets invoked after the configuration has been fully loaded. Designed\nto also work with asynchronous configurations.\n- `plugins = \"\u003cplugin_location\u003e\"` - where under `~/.local/share/nvim/site/pack/` to install plugins. Defaults to `\"packer\"`, meaning plugins\nwill be installed under `~/.local/share/nvim/site/pack/packer`.\nBy default different plugin managers will install themselves into different directories. Packer installs itself into `packer`,\npaq-nvim installs itself into `paq-nvim`, etc. There may be times where different configs install their plugin managers into\ndifferent directories altogether, so you can change this value accordingly.\n- `preconfigure = \"\u003cconfig\u003e\"` - preconfigure a plugin manager before switching configs. Useful for seamless config transitions.\nOptions are divided with `:`, but you needn't supply all of them. For example, a value of `packer:opt:fix/premature-display-opening`\nmeans \"preconfigure packer, install it as an opt plugin, and use the `fix/premature-display-opening` branch\". Not supplying parts of these parameters\nwill use the default values instead, so `packer::fix/premature-display-opening` will be the equivalent of `packer:start:fix/premature-display-opening`,\n`packer:opt` will be the equivalent of `packer:opt:master` and finally `packer` is the equivalent of `packer:start:master`.\nThe same principles apply to `paq-nvim`. This value can be set to `nil` too to perform no preconfiguration.\n- `return \"my_config\", profiles` - selects a configuration from a list of profiles. Make sure the first returned value has the same name\nas the key inside the `profiles` table (i.e. if I define a config called `my_config = {}` make sure to return `\"my_config\"`). Changing this will automatically\nswitch configs the next time you launch Neovim.\n\nUpon launching a new config that hasn't been preconfigured yet you will be greeted with a random message, can you find em' all?\n\n### The Cheovim Command\nOhoho, it doesn't stop there. Cheovim also supplies a `:Cheovim` command that you can use to clean up your configs, remove plugins,\nforce reload the configuration on next boot, etc. These are the subcommands available:\n\n- `:Cheovim reload` - reloads the current configuration on next boot\n- `:Cheovim version` - prints the current version of cheovim\n- `:Cheovim deep-clean` - cleans all the configuration's plugins, deletes the current remote config\n  if present and force reloads on next boot\n- `:Cheovim force-reload` - reloads the current configuration on next boot and also\n  deletes the current remote config if present (remote configs are those that are pulled down by providing an url as the config path)\n  for a completely clean start\n- `:Cheovim clean-plugins` - goes ahead and removes all the plugins from your current configuration\n- `:Cheovim clean-remote-configs` - removes all of the remote configurations that aren't defined in\n  your `profiles.lua` file, therefore removing unused leftover junk configs\n\n\n# TODO\n- [x] Add support for supplying URLs rather than regular paths to be able to check out different configurations without even needing to clone them yourself\n- [x] Add the ability to execute a lua function or some vimscript code after switching configs via the config variable (inspired by packer)\n- [x] Documentation for the above features\n- [ ] Hot reloading of configs whenever a change to the profiles.lua file is detected\n\n###### Made with love by [NTBBloodbath](https://github.com/NTBBloodbath) and [Vhyrro](https://github.com/vhyrro/) :heart:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntbbloodbath%2Fcheovim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fntbbloodbath%2Fcheovim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntbbloodbath%2Fcheovim/lists"}