{"id":13412869,"url":"https://github.com/nvim-treesitter/nvim-treesitter-context","last_synced_at":"2025-04-30T00:51:26.542Z","repository":{"id":37037042,"uuid":"305332301","full_name":"nvim-treesitter/nvim-treesitter-context","owner":"nvim-treesitter","description":"Show code context","archived":false,"fork":false,"pushed_at":"2025-04-17T20:29:42.000Z","size":7390,"stargazers_count":2766,"open_issues_count":17,"forks_count":220,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-25T09:25:29.388Z","etag":null,"topics":["neovim","neovim-plugin","vim","vim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Janet","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/nvim-treesitter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2020-10-19T09:32:33.000Z","updated_at":"2025-04-24T22:58:13.000Z","dependencies_parsed_at":"2023-12-19T00:30:41.723Z","dependency_job_id":"b6db1736-3ef4-4e0d-b6f7-eefd2fef378a","html_url":"https://github.com/nvim-treesitter/nvim-treesitter-context","commit_stats":{"total_commits":433,"total_committers":144,"mean_commits":"3.0069444444444446","dds":0.6697459584295612,"last_synced_commit":"2bcf700b59bc92850ca83a1c02e86ba832e0fae0"},"previous_names":["romgrk/nvim-treesitter-context"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fnvim-treesitter-context","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fnvim-treesitter-context/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fnvim-treesitter-context/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvim-treesitter%2Fnvim-treesitter-context/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvim-treesitter","download_url":"https://codeload.github.com/nvim-treesitter/nvim-treesitter-context/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250930605,"owners_count":21509713,"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","vim","vim-plugin"],"created_at":"2024-07-30T20:01:30.400Z","updated_at":"2025-04-30T00:51:26.522Z","avatar_url":"https://github.com/nvim-treesitter.png","language":"Janet","readme":"# nvim-treesitter-context\n\nLightweight alternative to [context.vim](https://github.com/wellle/context.vim)\n\nNote: This plugin requires necessary language parsers in order to work. Non default\nlanguage parsers can be installed with [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter).\n\n## Requirements\n\nNeovim \u003e= v0.9.0\n\nNote: if you need support for Neovim 0.6.x please use the tag `compat/0.6`.\n\n## Screenshot\n\n![theme](./static/demo.gif)\n\n## Supported Languages\n\nNote: support for specific languages is strictly community maintained and can break from time to time as parsers are updated.\n\n\u003cdetails\u003e\n\u003csummary\u003eSupported (click to expand)\u003c/summary\n\n  - [x] `org`\n  - [x] `ada`\n  - [x] `apex`\n  - [x] `bash`\n  - [x] `c`\n  - [x] `c_sharp`\n  - [x] `capnp`\n  - [x] `clojure`\n  - [x] `cmake`\n  - [x] `cpp`\n  - [x] `css`\n  - [x] `cuda`\n  - [x] `cue`\n  - [x] `d`\n  - [x] `dart`\n  - [x] `devicetree`\n  - [x] `diff`\n  - [x] `elixir`\n  - [x] `elm`\n  - [x] `enforce`\n  - [x] `fennel`\n  - [x] `fish`\n  - [x] `fortran`\n  - [x] `gdscript`\n  - [x] `glimmer`\n  - [x] `glsl`\n  - [x] `go`\n  - [x] `graphql`\n  - [x] `groovy`\n  - [x] `haskell`\n  - [x] `html`\n  - [x] `ini`\n  - [x] `janet_simple`\n  - [x] `java`\n  - [x] `javascript`\n  - [x] `json`\n  - [x] `jsonnet`\n  - [x] `julia`\n  - [x] `kdl`\n  - [x] `latex`\n  - [x] `liquidsoap`\n  - [x] `lua`\n  - [x] `make`\n  - [x] `markdown`\n  - [x] `matlab`\n  - [x] `nim`\n  - [x] `nix`\n  - [x] `norg`\n  - [x] `nu`\n  - [x] `objdump`\n  - [x] `ocaml`\n  - [x] `ocaml_interface`\n  - [x] `odin`\n  - [x] `php`\n  - [x] `php_only`\n  - [x] `prisma`\n  - [x] `proto`\n  - [x] `python`\n  - [x] `r`\n  - [x] `ruby`\n  - [x] `rust`\n  - [x] `scala`\n  - [x] `scss`\n  - [x] `smali`\n  - [x] `solidity`\n  - [x] `starlark`\n  - [x] `svelte`\n  - [x] `swift`\n  - [x] `tact`\n  - [x] `tcl`\n  - [x] `teal`\n  - [x] `templ`\n  - [x] `terraform`\n  - [x] `toml`\n  - [x] `tsx`\n  - [x] `typescript`\n  - [x] `typoscript`\n  - [x] `typst`\n  - [x] `usd`\n  - [x] `verilog`\n  - [x] `vhdl`\n  - [x] `vim`\n  - [x] `vue`\n  - [x] `xml`\n  - [x] `yaml`\n  - [x] `yang`\n  - [x] `zig`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eUnsupported (click to expand)\u003c/summary\n\n  - [ ] `agda`\n  - [ ] `angular`\n  - [ ] `arduino`\n  - [ ] `asm`\n  - [ ] `astro`\n  - [ ] `authzed`\n  - [ ] `awk`\n  - [ ] `bass`\n  - [ ] `beancount`\n  - [ ] `bibtex`\n  - [ ] `bicep`\n  - [ ] `bitbake`\n  - [ ] `blueprint`\n  - [ ] `bp`\n  - [ ] `cairo`\n  - [ ] `chatito`\n  - [ ] `circom`\n  - [ ] `comment`\n  - [ ] `commonlisp`\n  - [ ] `cooklang`\n  - [ ] `corn`\n  - [ ] `cpon`\n  - [ ] `csv`\n  - [ ] `cylc`\n  - [ ] `desktop`\n  - [ ] `dhall`\n  - [ ] `disassembly`\n  - [ ] `djot`\n  - [ ] `dockerfile`\n  - [ ] `dot`\n  - [ ] `doxygen`\n  - [ ] `dtd`\n  - [ ] `earthfile`\n  - [ ] `ebnf`\n  - [ ] `editorconfig`\n  - [ ] `eds`\n  - [ ] `eex`\n  - [ ] `elsa`\n  - [ ] `elvish`\n  - [ ] `embedded_template`\n  - [ ] `erlang`\n  - [ ] `facility`\n  - [ ] `faust`\n  - [ ] `fidl`\n  - [ ] `firrtl`\n  - [ ] `foam`\n  - [ ] `forth`\n  - [ ] `fsh`\n  - [ ] `fsharp`\n  - [ ] `func`\n  - [ ] `fusion`\n  - [ ] `gap`\n  - [ ] `gaptst`\n  - [ ] `gdshader`\n  - [ ] `git_config`\n  - [ ] `git_rebase`\n  - [ ] `gitattributes`\n  - [ ] `gitcommit`\n  - [ ] `gitignore`\n  - [ ] `gleam`\n  - [ ] `glimmer_javascript`\n  - [ ] `glimmer_typescript`\n  - [ ] `gn`\n  - [ ] `gnuplot`\n  - [ ] `goctl`\n  - [ ] `godot_resource`\n  - [ ] `gomod`\n  - [ ] `gosum`\n  - [ ] `gotmpl`\n  - [ ] `gowork`\n  - [ ] `gpg`\n  - [ ] `gren`\n  - [ ] `gstlaunch`\n  - [ ] `hack`\n  - [ ] `hare`\n  - [ ] `haskell_persistent`\n  - [ ] `hcl`\n  - [ ] `heex`\n  - [ ] `helm`\n  - [ ] `hjson`\n  - [ ] `hlsl`\n  - [ ] `hlsplaylist`\n  - [ ] `hocon`\n  - [ ] `hoon`\n  - [ ] `htmldjango`\n  - [ ] `http`\n  - [ ] `hurl`\n  - [ ] `hyprlang`\n  - [ ] `idl`\n  - [ ] `idris`\n  - [ ] `inko`\n  - [ ] `ipkg`\n  - [ ] `ispc`\n  - [ ] `jinja`\n  - [ ] `jinja_inline`\n  - [ ] `jq`\n  - [ ] `jsdoc`\n  - [ ] `json5`\n  - [ ] `jsonc`\n  - [ ] `just`\n  - [ ] `kconfig`\n  - [ ] `kotlin`\n  - [ ] `koto`\n  - [ ] `kusto`\n  - [ ] `lalrpop`\n  - [ ] `ledger`\n  - [ ] `leo`\n  - [ ] `linkerscript`\n  - [ ] `liquid`\n  - [ ] `llvm`\n  - [ ] `luadoc`\n  - [ ] `luap`\n  - [ ] `luau`\n  - [ ] `m68k`\n  - [ ] `markdown_inline`\n  - [ ] `menhir`\n  - [ ] `mermaid`\n  - [ ] `meson`\n  - [ ] `mlir`\n  - [ ] `muttrc`\n  - [ ] `nasm`\n  - [ ] `nginx`\n  - [ ] `nickel`\n  - [ ] `nim_format_string`\n  - [ ] `ninja`\n  - [ ] `nqc`\n  - [ ] `objc`\n  - [ ] `ocamllex`\n  - [ ] `pascal`\n  - [ ] `passwd`\n  - [ ] `pem`\n  - [ ] `perl`\n  - [ ] `phpdoc`\n  - [ ] `pioasm`\n  - [ ] `po`\n  - [ ] `pod`\n  - [ ] `poe_filter`\n  - [ ] `pony`\n  - [ ] `powershell`\n  - [ ] `printf`\n  - [ ] `problog`\n  - [ ] `prolog`\n  - [ ] `promql`\n  - [ ] `properties`\n  - [ ] `prql`\n  - [ ] `psv`\n  - [ ] `pug`\n  - [ ] `puppet`\n  - [ ] `purescript`\n  - [ ] `pymanifest`\n  - [ ] `ql`\n  - [ ] `qmldir`\n  - [ ] `qmljs`\n  - [ ] `query`\n  - [ ] `racket`\n  - [ ] `ralph`\n  - [ ] `rasi`\n  - [ ] `razor`\n  - [ ] `rbs`\n  - [ ] `re2c`\n  - [ ] `readline`\n  - [ ] `regex`\n  - [ ] `rego`\n  - [ ] `requirements`\n  - [ ] `rescript`\n  - [ ] `rnoweb`\n  - [ ] `robot`\n  - [ ] `robots`\n  - [ ] `roc`\n  - [ ] `ron`\n  - [ ] `rst`\n  - [ ] `runescript`\n  - [ ] `scfg`\n  - [ ] `scheme`\n  - [ ] `sflog`\n  - [ ] `slang`\n  - [ ] `slim`\n  - [ ] `slint`\n  - [ ] `smithy`\n  - [ ] `snakemake`\n  - [ ] `soql`\n  - [ ] `sosl`\n  - [ ] `sourcepawn`\n  - [ ] `sparql`\n  - [ ] `sql`\n  - [ ] `squirrel`\n  - [ ] `ssh_config`\n  - [ ] `strace`\n  - [ ] `styled`\n  - [ ] `supercollider`\n  - [ ] `superhtml`\n  - [ ] `surface`\n  - [ ] `sway`\n  - [ ] `sxhkdrc`\n  - [ ] `systemtap`\n  - [ ] `t32`\n  - [ ] `tablegen`\n  - [ ] `textproto`\n  - [ ] `thrift`\n  - [ ] `tiger`\n  - [ ] `tlaplus`\n  - [ ] `tmux`\n  - [ ] `todotxt`\n  - [ ] `tsv`\n  - [ ] `turtle`\n  - [ ] `twig`\n  - [ ] `typespec`\n  - [ ] `udev`\n  - [ ] `ungrammar`\n  - [ ] `unison`\n  - [ ] `uxntal`\n  - [ ] `v`\n  - [ ] `vala`\n  - [ ] `vento`\n  - [ ] `vhs`\n  - [ ] `vimdoc`\n  - [ ] `vrl`\n  - [ ] `wgsl`\n  - [ ] `wgsl_bevy`\n  - [ ] `wing`\n  - [ ] `wit`\n  - [ ] `xcompose`\n  - [ ] `xresources`\n  - [ ] `yuck`\n  - [ ] `zathurarc`\n  - [ ] `ziggy`\n  - [ ] `ziggy_schema`\n\n\u003c/details\u003e\n\n## Configuration\n\n(Default values are shown below)\n\nNote: calling `setup()` is optional.\n\n```lua\nrequire'treesitter-context'.setup{\n  enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)\n  multiwindow = false, -- Enable multiwindow support.\n  max_lines = 0, -- How many lines the window should span. Values \u003c= 0 mean no limit.\n  min_window_height = 0, -- Minimum editor window height to enable context. Values \u003c= 0 mean no limit.\n  line_numbers = true,\n  multiline_threshold = 20, -- Maximum number of lines to show for a single context\n  trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'\n  mode = 'cursor',  -- Line used to calculate context. Choices: 'cursor', 'topline'\n  -- Separator between context and content. Should be a single character string, like '-'.\n  -- When separator is set, the context will only show up when there are at least 2 lines above cursorline.\n  separator = nil,\n  zindex = 20, -- The Z-index of the context window\n  on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching\n}\n```\n\n## Commands\n\n`TSContextEnable`, `TSContextDisable` and `TSContextToggle`.\n\n## Appearance\n\nUse the highlight group `TreesitterContext` to change the colors of the\ncontext. Per default it links to `NormalFloat`.\n\nUse the highlight group `TreesitterContextLineNumber` to change the colors of the\ncontext line numbers if `line_numbers` is set. Per default it links to `LineNr`.\n\nUse the highlight group `TreesitterContextSeparator` to change the colors of the\nseparator if `separator` is set. By default it links to `FloatBorder`.\n\nUse the highlight groups `TreesitterContextBottom` and/or\n`TreesitterContextLineNumberBottom` to change the highlight of the last line of\nthe context window. By default it links to `NONE`.\nHowever, you can use this to create a border by applying an underline highlight, e.g,\nfor an underline across the screen:\n\n```vim\nhi TreesitterContextBottom gui=underline guisp=Grey\nhi TreesitterContextLineNumberBottom gui=underline guisp=Grey\n```\n\nOr an underline below the line numbers only:\n\n```vim\nhi TreesitterContextLineNumberBottom gui=underline guisp=Grey\n```\n\n## Jumping to context (upwards)\n\n```lua\nvim.keymap.set(\"n\", \"[c\", function()\n  require(\"treesitter-context\").go_to_context(vim.v.count1)\nend, { silent = true })\n```\n\n## Adding support for other languages\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## Overriding the builtin for a given language\n\nRead [CONTRIBUTING.md](CONTRIBUTING.md) first.\n\nYou can provide you own language files by adding them to the\n`runtimepath` (`:help runtimepath`).\n\nFor example, creating `~/.config/nvim/queries/java/context.scm` will take\nprecedence over the `queries/java/context.scm` included in `nvim-treesitter-context`\nas long as `~/.config/nvim` appears earlier in  `runtimepath`.\n\nYou can check the value of `runtimepath` with `:set rtp`.\n","funding_links":[],"categories":["Editing Support","Janet","Lua"],"sub_categories":["Scrollbar"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-treesitter%2Fnvim-treesitter-context","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvim-treesitter%2Fnvim-treesitter-context","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvim-treesitter%2Fnvim-treesitter-context/lists"}