{"id":24510021,"url":"https://github.com/wurli/contextindent.nvim","last_synced_at":"2025-05-12T21:21:23.344Z","repository":{"id":273281215,"uuid":"919197409","full_name":"wurli/contextindent.nvim","owner":"wurli","description":"A tiny Neovim plugin adding context-aware indent to files with embedded languages 🌟","archived":false,"fork":false,"pushed_at":"2025-04-16T09:18:54.000Z","size":11,"stargazers_count":54,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-16T12:23:40.627Z","etag":null,"topics":["neovim","neovim-plugin","neovim-plugin-lua","nvim","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wurli.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":"2025-01-19T23:46:02.000Z","updated_at":"2025-04-16T09:18:55.000Z","dependencies_parsed_at":"2025-01-20T00:28:00.924Z","dependency_job_id":"e3489854-b2b6-47a9-822c-67b4eccf78f2","html_url":"https://github.com/wurli/contextindent.nvim","commit_stats":null,"previous_names":["wurli/contextindent.nvim"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wurli%2Fcontextindent.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wurli%2Fcontextindent.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wurli%2Fcontextindent.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wurli%2Fcontextindent.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wurli","download_url":"https://codeload.github.com/wurli/contextindent.nvim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253823701,"owners_count":21969891,"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":["neovim","neovim-plugin","neovim-plugin-lua","nvim","nvim-plugin"],"created_at":"2025-01-22T00:24:39.194Z","updated_at":"2025-05-12T21:21:23.324Z","avatar_url":"https://github.com/wurli.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# contextindent.nvim\n\nA tiny Neovim plugin which adds context-aware indenting (i.e. using `=`/`==`).\nIn practice this means that if you're editing a file with treesitter language\ninjections - think a markdown file with a python code chunk, or a HTML file with\nembedded javascript - the python/javascript portions of the files will be\nindented according to your indent settings for those languages; not according to\nthe settings you use for markdown/HTML.\n\n![demo](https://github.com/user-attachments/assets/fcc3dd6e-8690-4f31-b858-b7481ccf0b66)\n\nThis plugin has a much more noticeable effect for files when treesitter\nindentation is *disabled*, since unlike vim syntax rules, treesitter indentation\nis already context-aware. That said, treesitter alone won't adjust the indent\nwidth based on language, so this plugin will still add some value even if you\nhave treesitter indentation enabled all the time.\n\n**Note**: this plugin relies on treesitter for language detection.\n\n## Installation\n\nUsing lazy.nvim:\n\n``` lua\n{\n    \"wurli/contextindent.nvim\",\n    -- This is the only config option; you can use it to restrict the files\n    -- which this plugin will affect (see :help autocommand-pattern).\n    opts = { pattern = \"*\" },\n    dependencies = { \"nvim-treesitter/nvim-treesitter\" },\n}\n```\n\n## Implementation\n\nThis plugin works by overriding `indentexpr` whenever a new buffer is entered.\nThe new indentexpr will in most cases fall back to the normal behaviour, but if\ntreesitter detects that the language for the region the cursor is currently in\nis *not* the same as that of the buffer, it will use the indentexpr for the\ncurrent region.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwurli%2Fcontextindent.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwurli%2Fcontextindent.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwurli%2Fcontextindent.nvim/lists"}