{"id":17955155,"url":"https://github.com/ianhomer/knobs.vim","last_synced_at":"2026-05-05T17:32:06.077Z","repository":{"id":136890606,"uuid":"413523780","full_name":"ianhomer/knobs.vim","owner":"ianhomer","description":"Vim with Knobs - feature flags that can flip extensions on and off","archived":false,"fork":false,"pushed_at":"2026-02-22T21:29:46.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-23T02:03:19.593Z","etag":null,"topics":["lua","neovim","nvim","vim"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ianhomer.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-10-04T17:38:02.000Z","updated_at":"2026-02-22T21:29:48.000Z","dependencies_parsed_at":"2024-10-29T10:42:35.310Z","dependency_job_id":null,"html_url":"https://github.com/ianhomer/knobs.vim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ianhomer/knobs.vim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianhomer%2Fknobs.vim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianhomer%2Fknobs.vim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianhomer%2Fknobs.vim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianhomer%2Fknobs.vim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianhomer","download_url":"https://codeload.github.com/ianhomer/knobs.vim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianhomer%2Fknobs.vim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32660234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["lua","neovim","nvim","vim"],"created_at":"2024-10-29T10:24:58.332Z","updated_at":"2026-05-05T17:32:06.071Z","avatar_url":"https://github.com/ianhomer.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# knobs.vim\n\nFeature flags and conditional configurations. Vim with knobs.\n\nFor development/contribution guidelines, see [DEVELOP.md](./DEVELOP.md).\n\n## Why?\n\n- Different configurations for different environments or work contexts.\n- Toggle on and off experimental plugins or configuration.\n- Spin up different configuration levels, light vs full.\n\n## neovim with packer\n\nConfigure the level at which each knob should switch on.\n\n```lua\nvim.api.nvim_set_var(\n    \"knobs_levels\",\n    {\n        fugitive = 3,\n        eunuch = 5\n    }\n)\n```\n\nWire in the an enhanced version of packer's use from the knobs plugin which\nautomatically sets up conditionals for the packer loading.\n\n```lua\nrequire(\"packer\").startup {\n    function(_use)\n        local ok, knobs = pcall(require, \"knobs\")\n        use = ok and knobs.use(_use) or _use\n\n        use \"wbthomason/packer.nvim\"\n        use \"ianhomer/knobs.vim\"\n        use {\"tpope/vim-fugitive\", cmd = {\"G\", \"Git\"}}\n        use \"tpope/vim-eunuch\"\n        use \"tpope/vim-dispatch\"\n    end\n}\n```\n\nThe above example would switch on fugitive at level 3 (the default), and would\nswitch on eunuch if knobs level set to 5, e.g. starting nvim with `VIM_KNOBS=5\nnvim`.\n\nLayers can be defined to switch collections of knobs. For example if you want a\nmode for editing your notes as markdown files, you can set up a layer called\n\"notes\" such as\n\n```lua\nvim.api.nvim_set_var(\n    \"knobs_layers_map\",\n    {\n        notes = {\n            compactcmd = 1\n        }\n    }\n)\n```\n\nDefine when the layer should be enabled\n\n```lua\nvim.api.nvim_set_var(\n    \"knobs_layers\",\n    {\n      notes = vim.env.VIM_KNOBS_NOTES == \"1\" and 1 or 0\n    }\n)\n```\n\nAnd drive conditional configuration from this flag\n\n```lua\nvim.o.cmdheight = vim.g.knob_compactcmd and 1 or 2\n```\n\nThen you can start up vim with this environment variable set to use this\nalternative configuration.\n\n```sh\nVIM_KNOBS_NOTES=1 nvim\n```\n\n## vim with plug\n\n### Installation\n\n    mkdir -p ~/.vim/pack/ianhomer/start\n    cd ~/.vim/pack/ianhomer/start\n    git clone https://github.com/ianhomer/knobs.vim\n\n### Usage\n\nSet up feature flags in your `.vimrc`\n\n```vim\n\" Levels at which features are enabled\nlet g:knobs_levels = {\n  \\   \"fugitive\":3,\n  \\   \"eunuch\":5\n}\n\ncall plug#begin('~/.vim/plugged')\n\nif knobs#(\"fugitive\")\n  Plug 'tpope/vim-fugitive'\n  Plug 'tpope/vim-rhubarb'\nendif\nIfKnob 'eunuch' Plug 'tpope/vim-eunuch'\n\ncall plug#end()\n```\n\nStart Vim at different configuration levels. For example, with the `.vimrc`\nabove,\n\n    VIM_KNOBS=5 vim\n\nwould load `vim-fugitive`, `vim-rhubarb` and `vim-eunuch` plugins. With the\ndefault knob level of 3,\n\n    vim\n\nwould only load `vim-fugitive` and `vim-rhubarb`.\n\n```vim\nif !exists(\"g:knob_fugitive\")\n   \" Do something if knob is set\nendif\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianhomer%2Fknobs.vim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianhomer%2Fknobs.vim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianhomer%2Fknobs.vim/lists"}