summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorGuillaume Girol <symphorien@users.noreply.github.com>2021-07-19 19:07:37 +0000
committerGitHub <noreply@github.com>2021-07-19 19:07:37 +0000
commit23462c694156c5f9f28b44545d1445263c5b7241 (patch)
tree9b8d8b8309c9227e04cb1fe91ad00a87c9616c52 /doc
parent470168e4274ba705e27c6b1c4f3215ef3f21fc47 (diff)
parentf620722174e7b55ed5aa4ba6bcc000dba5e78d9e (diff)
downloadnixpkgs-23462c694156c5f9f28b44545d1445263c5b7241.tar
nixpkgs-23462c694156c5f9f28b44545d1445263c5b7241.tar.gz
nixpkgs-23462c694156c5f9f28b44545d1445263c5b7241.tar.bz2
nixpkgs-23462c694156c5f9f28b44545d1445263c5b7241.tar.lz
nixpkgs-23462c694156c5f9f28b44545d1445263c5b7241.tar.xz
nixpkgs-23462c694156c5f9f28b44545d1445263c5b7241.tar.zst
nixpkgs-23462c694156c5f9f28b44545d1445263c5b7241.zip
Merge pull request #130206 from symphorien/treesitter-doc
vimPlugins.nvim-treesitter: document plugins
Diffstat (limited to 'doc')
-rw-r--r--doc/languages-frameworks/vim.section.md29
1 files changed, 28 insertions, 1 deletions
diff --git a/doc/languages-frameworks/vim.section.md b/doc/languages-frameworks/vim.section.md
index e170591605c..26a01a89aa5 100644
--- a/doc/languages-frameworks/vim.section.md
+++ b/doc/languages-frameworks/vim.section.md
@@ -120,7 +120,7 @@ After that you can install your special grafted `myVim` or `myNeovim` packages.
 
 If one of your favourite plugins isn't packaged, you can package it yourself:
 
-```
+```nix
 { config, pkgs, ... }:
 
 let
@@ -154,6 +154,33 @@ in
 }
 ```
 
+### Specificities for some plugins
+#### Tree sitter
+
+By default `nvim-treesitter` encourages you to download, compile and install
+the required tree-sitter grammars at run time with `:TSInstall`. This works
+poorly on NixOS.  Instead, to install the `nvim-treesitter` plugins with a set
+of precompiled grammars, you can use `nvim-treesitter.withPlugins` function:
+
+```nix
+(pkgs.neovim.override {
+  configure = {
+    packages.myPlugins = with pkgs.vimPlugins; {
+      start = [
+        (nvim-treesitter.withPlugins (
+          plugins: with plugins; [
+            tree-sitter-nix
+            tree-sitter-python
+          ]
+        ))
+      ];
+    };
+  };
+})
+```
+
+To enable all grammars packaged in nixpkgs, use `(pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: pkgs.tree-sitter.allGrammars))`.
+
 ## Managing plugins with vim-plug {#managing-plugins-with-vim-plug}
 
 To use [vim-plug](https://github.com/junegunn/vim-plug) to manage your Vim