mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
treesitter: ensure_installed to none if using nix
This is a temporary workaround for an upstream bug which causes nvim-treesitter to complain about a read-only installation directory
This commit is contained in:
parent
88fb867da5
commit
bd6f978d51
1 changed files with 58 additions and 52 deletions
|
@ -38,12 +38,14 @@ in
|
|||
description = "Custom capture group highlighting";
|
||||
};
|
||||
|
||||
incrementalSelection = let
|
||||
incrementalSelection =
|
||||
let
|
||||
keymap = default: mkOption {
|
||||
type = types.str;
|
||||
inherit default;
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
enable = mkEnableOption "Incremental selection based on the named nodes from the grammar";
|
||||
keymaps = {
|
||||
initSelection = keymap "gnn";
|
||||
|
@ -59,7 +61,8 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
config =
|
||||
let
|
||||
tsOptions = {
|
||||
highlight = {
|
||||
enable = cfg.enable;
|
||||
|
@ -68,7 +71,8 @@ in
|
|||
custom_captures = if (cfg.customCaptures != { }) then cfg.customCaptures else null;
|
||||
};
|
||||
|
||||
incremental_selection = if cfg.incrementalSelection.enable then {
|
||||
incremental_selection =
|
||||
if cfg.incrementalSelection.enable then {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
init_selection = cfg.incrementalSelection.keymaps.initSelection;
|
||||
|
@ -78,14 +82,16 @@ in
|
|||
};
|
||||
} else null;
|
||||
|
||||
indent = if cfg.indent then {
|
||||
indent =
|
||||
if cfg.indent then {
|
||||
enable = true;
|
||||
} else null;
|
||||
|
||||
ensure_installed = cfg.ensureInstalled;
|
||||
ensure_installed = if cfg.nixGrammars then [ ] else cfg.ensureInstalled;
|
||||
ignore_install = cfg.ignoreInstall;
|
||||
};
|
||||
in mkIf cfg.enable {
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
programs.nixvim = {
|
||||
extraConfigLua = ''
|
||||
require('nvim-treesitter.configs').setup(${helpers.toLuaObject tsOptions})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue