{"id":13525182,"url":"https://github.com/SergioRibera/cmp-dotenv","last_synced_at":"2025-04-01T04:31:20.676Z","repository":{"id":214225559,"uuid":"735452075","full_name":"SergioRibera/cmp-dotenv","owner":"SergioRibera","description":"cmp import and use all environment variables from .env.* and system","archived":false,"fork":false,"pushed_at":"2024-06-05T21:42:25.000Z","size":47,"stargazers_count":72,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T18:48:35.695Z","etag":null,"topics":["lua","neovim","neovim-plugin","nix","nvim-cmp","nvim-plugin"],"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/SergioRibera.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":["SergioRibera"]}},"created_at":"2023-12-25T01:47:53.000Z","updated_at":"2025-03-08T20:49:26.000Z","dependencies_parsed_at":"2024-06-05T23:07:16.324Z","dependency_job_id":"08402c57-93df-40b6-a3bf-a4594564d8aa","html_url":"https://github.com/SergioRibera/cmp-dotenv","commit_stats":null,"previous_names":["sergioribera/cmp-dotenv"],"tags_count":0,"template":false,"template_full_name":"mrcjkb/nvim-lua-nix-plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SergioRibera%2Fcmp-dotenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SergioRibera%2Fcmp-dotenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SergioRibera%2Fcmp-dotenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SergioRibera%2Fcmp-dotenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SergioRibera","download_url":"https://codeload.github.com/SergioRibera/cmp-dotenv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246586085,"owners_count":20801024,"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":["lua","neovim","neovim-plugin","nix","nvim-cmp","nvim-plugin"],"created_at":"2024-08-01T06:01:16.636Z","updated_at":"2025-04-01T04:31:20.421Z","avatar_url":"https://github.com/SergioRibera.png","language":"Lua","readme":"# cmp-dotenv\nhttps://github.com/SergioRibera/cmp-dotenv/assets/56278796/8a23c17a-6f08-45db-b567-de47cd9a8a81\n\n|  Wihtout cmp-dotenv  | With cmp-dotenv |\n|----------------------|-----------------|\n| ![image](https://github.com/SergioRibera/cmp-dotenv/assets/56278796/28c1123a-62b5-414d-8b54-4705dffbe966) | ![image](https://github.com/SergioRibera/cmp-dotenv/assets/56278796/30aa4131-28f7-4295-82aa-9cf7df279647) |\n\n\nThe plugin you need to have an autocomplete of the environment variables of your system\nand those of your `.env*` files\n\n\u003e [!IMPORTANT]\n\u003e This repository does not require constant updates but if you have any problems or feature suggestions open an [issue](https://github.com/SergioRibera/cmp-dotenv/issues) and I will be happy to check it out.\n\n## Setup\n\n```lua\nrequire(\"cmp\").setup {\n    sources = {\n        { name = \"dotenv\" }\n    }\n}\n```\n\nOr with configuration\n\n```lua\nlocal cmp = require(\"cmp\")\n\ncmp.setup {\n    sources = {\n        {\n          name = \"dotenv\",\n          -- Defaults\n          option = {\n            path = '.',\n            load_shell = true,\n            item_kind = cmp.lsp.CompletionItemKind.Variable,\n            eval_on_confirm = false,\n            show_documentation = true,\n            show_content_on_docs = true,\n            documentation_kind = 'markdown',\n            dotenv_environment = '.*',\n            file_priority = function(a, b)\n              -- Prioritizing local files\n              return a:upper() \u003c b:upper()\n            end,\n          }\n        }\n    }\n}\n```\n\n## Options\n\n| name                 | default                                                                              | description                                                                                                                                                                              |\n|----------------------|--------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| path                 | '.'                                                                                  | The path where to look for the files                                                                                                                                                     |\n| load_shell           | true                                                                                 | Do you want to load shell variables?                                                                                                                                                     |\n| item_kind            | [Variable](https://github.com/hrsh7th/nvim-cmp/blob/main/lua/cmp/types/lsp.lua#L178) | What kind of suggestion will cmp make?                                                                                                                                                   |\n| eval_on_confirm      | false                                                                                | When you confirm the completion, do you want the variable or the value?                                                                                                                  |\n| show_documentation   | true                                                                                 | Do you want to see the documentation that has the variable?                                                                                                                              |\n| show_content_on_docs | true                                                                                 | Allows to preview the content in the documentation popup with the prefix of `Content: `.                                                                                                 |\n| documentation_kind   | 'markdown'                                                                           | What did you write the variable documentation on?                                                                                                                                        |\n| dotenv_environment   | '.*'                                                                                 | Which variable environment do you want to load? `.*` by default loads all of them, this variable accepts regex, some suggestions I can give you are `example`, `local` or `development`. |\n| file_priority        | function                                                                             | With this function you define the upload priority, by default it prioritizes the local variables, this responds to the callback of a computer for the found files.                       |\n\n## Advanced Usage\n\nIf you are a developer or just want to do more things in your lua configuration,\nyou can use the api provided here and the (recommended) functions available, are these\n\n```lua\nlocal dotenv = require('cmp-dotenv.dotenv')\n\n-- Get the variable you want by name or\n-- get the default value in case it does not exist.\ndotenv.get_env_variable(name, default)\n\n-- Get all variables that have been loaded\ndotenv.get_all_env()\n\n-- You can set a variable to the auto-completion system and\n-- find it available throughout the Neovim environment.\n-- You can pass it a documentation in the format\n-- you have configured or not pass it at all.\ndotenv.set_env_variable(name, value, docs or nil)\n\n-- This loads all the environment variables according to the\n-- configuration you have from the files or the shell,\n-- I do not recommend calling this function as it is\n-- usually called by default by cmp.\ndotenv.load(force, options)\n```\n\n## Contributing\n\nAll contributions are welcome!\nSee [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n## License\n\nThis template is [licensed according to GPL version 2](./LICENSE),\nwith the following exception:\n\nThe license applies only to the Nix CI infrastructure provided by this template\nrepository, including any modifications made to the infrastructure.\nAny software that uses or is derived from this template may be licensed under any\n[OSI approved open source license](https://opensource.org/licenses/),\nwithout being subject to the GPL version 2 license of this template.\n","funding_links":["https://github.com/sponsors/SergioRibera"],"categories":["Lua","Completion"],"sub_categories":["(requires Neovim 0.5)","Diagnostics"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSergioRibera%2Fcmp-dotenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSergioRibera%2Fcmp-dotenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSergioRibera%2Fcmp-dotenv/lists"}