{"id":13895607,"url":"https://github.com/anuvyklack/nvim-api-wrappers","last_synced_at":"2025-04-04T05:24:10.583Z","repository":{"id":107001413,"uuid":"553698576","full_name":"anuvyklack/nvim-api-wrappers","owner":"anuvyklack","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-22T13:09:01.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-09T16:42:57.193Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anuvyklack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-10-18T16:12:56.000Z","updated_at":"2023-03-03T05:28:53.000Z","dependencies_parsed_at":"2024-04-16T02:49:24.954Z","dependency_job_id":null,"html_url":"https://github.com/anuvyklack/nvim-api-wrappers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuvyklack%2Fnvim-api-wrappers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuvyklack%2Fnvim-api-wrappers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuvyklack%2Fnvim-api-wrappers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuvyklack%2Fnvim-api-wrappers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anuvyklack","download_url":"https://codeload.github.com/anuvyklack/nvim-api-wrappers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247124997,"owners_count":20887608,"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":[],"created_at":"2024-08-06T18:02:20.405Z","updated_at":"2025-04-04T05:24:10.561Z","avatar_url":"https://github.com/anuvyklack.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# nvim-api-wrappers\n\nThe library with OOP wrappers around Neovim api.\nThis library itself depend on [middlecalss](https://github.com/anuvyklack/middleclass)\nlibrary. You are welcome to open pull-requests to extend the library if\nsomething you need is missing.\n\n\u003e I know arguments about dependency hell, and know that many people are afraid\n\u003e of plugins with dependencies. But with moving to Lua, the pool of\n\u003e opportunities is increased, and it is harder for plugins to be self-contained\n\u003e avoiding libraries. As a consequence, libraries, such\n\u003e [plenary](https://github.com/nvim-lua/plenary.nvim),\n\u003e [nui](https://github.com/MunifTanjim/nui.nvim)\n\u003e and others are become to appear.\n\u003e And I personaly tied to write this classes every time.\n\n## Modules\n\n- `window` (`require('api-wrappers.window)`)\n- `buffer` (`require('api-wrappers.buffer)`)\n- `highlight` (`require('api-wrappers.highlight)`)\n\n## \n\nBoth `Window` and `Buffer` classes have meta-accessors to interact with options\nof the particular window or buffer, respectively.\n\nHere is the example for `Buffer` class:\n\n```lua\nlocal Buffer = require('api-wrappers.buffer')\n\nlocal bufnr = vim.api.nvim_get_current_buf()\nlocal buffer = Buffer(bufnr) ---@type nvim.api.Buffer\n\n-- Access buffer option through meta-accessor.\nm = buffer.bo.modifiable\n-- the same using method\nm = buffer:get_option('modifiable')\n\n-- Set buffer option through meta-accessor\nbuffer.bo.modifiable = false\n-- the same with method\nbuffer:set_option('modifiable', false)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanuvyklack%2Fnvim-api-wrappers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanuvyklack%2Fnvim-api-wrappers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanuvyklack%2Fnvim-api-wrappers/lists"}