···120121If one of your favourite plugins isn't packaged, you can package it yourself:
122123-```
124{ config, pkgs, ... }:
125126let
···153 ];
154}
155```
000000000000000000000000000156157## Managing plugins with vim-plug {#managing-plugins-with-vim-plug}
158
···120121If one of your favourite plugins isn't packaged, you can package it yourself:
122123+```nix
124{ config, pkgs, ... }:
125126let
···153 ];
154}
155```
156+157+### Specificities for some plugins
158+#### Tree sitter
159+160+By default `nvim-treesitter` encourages you to download, compile and install
161+the required tree-sitter grammars at run time with `:TSInstall`. This works
162+poorly on NixOS. Instead, to install the `nvim-treesitter` plugins with a set
163+of precompiled grammars, you can use `nvim-treesitter.withPlugins` function:
164+165+```nix
166+(pkgs.neovim.override {
167+ configure = {
168+ packages.myPlugins = with pkgs.vimPlugins; {
169+ start = [
170+ (nvim-treesitter.withPlugins (
171+ plugins: with plugins; [
172+ tree-sitter-nix
173+ tree-sitter-python
174+ ]
175+ ))
176+ ];
177+ };
178+ };
179+})
180+```
181+182+To enable all grammars packaged in nixpkgs, use `(pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: pkgs.tree-sitter.allGrammars))`.
183184## Managing plugins with vim-plug {#managing-plugins-with-vim-plug}
185