From 95c88c3ce12229c7e7c102fb5ddb780b6a29cafb Mon Sep 17 00:00:00 2001 From: Anton Volnuhin Date: Wed, 4 Mar 2026 18:13:21 +0300 Subject: [PATCH] add tide-reset function, fix treesitter config for stable nvim Extract tide configuration into a reusable fish function (tide-reset) and call it from the chezmoi onchange script. Also revert treesitter config to the stable API (nvim-treesitter.configs). Co-Authored-By: Claude Opus 4.6 --- private_dot_config/nvim/init.lua | 12 +++++++----- .../private_fish/functions/tide-reset.fish | 13 +++++++++++++ run_onchange_after_z_configure_tide.sh.tmpl | 8 +------- 3 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 private_dot_config/private_fish/functions/tide-reset.fish diff --git a/private_dot_config/nvim/init.lua b/private_dot_config/nvim/init.lua index 503dd0e..bb438fb 100644 --- a/private_dot_config/nvim/init.lua +++ b/private_dot_config/nvim/init.lua @@ -34,11 +34,13 @@ require("lazy").setup({ -- Treesitter for better highlighting and moving { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", config = function() - require("nvim-treesitter").setup({}) - require("nvim-treesitter").install({ - "c", "query", "vimdoc", "vim", "bash", "go", "css", - "python", "html", "javascript", "json", "jsonc", - "lua", "rust", "typescript", + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "c", "query", "vimdoc", "vim", "bash", "go", "css", + "python", "html", "javascript", "json", "jsonc", + "lua", "rust", "typescript", + }, + highlight = { enable = true }, }) end, }, diff --git a/private_dot_config/private_fish/functions/tide-reset.fish b/private_dot_config/private_fish/functions/tide-reset.fish new file mode 100644 index 0000000..5dbc70f --- /dev/null +++ b/private_dot_config/private_fish/functions/tide-reset.fish @@ -0,0 +1,13 @@ +function tide-reset + if not type -q tide + echo "Tide is not installed" + return 1 + end + + tide configure --auto --style=Classic --prompt_colors='True color' --classic_prompt_color=Dark --show_time='24-hour format' --classic_prompt_separators=Slanted --powerline_prompt_heads=Slanted --powerline_prompt_tails=Round --powerline_prompt_style='Two lines, frame' --prompt_connection=Disconnected --powerline_right_prompt_frame=No --prompt_connection_andor_frame_color=Darkest --prompt_spacing=Sparse --icons='Few icons' + set -U tide_prompt_transient_enabled false + set -U tide_right_prompt_items (string match -v -- node $tide_right_prompt_items) + set -U tide_right_prompt_items (string match -v -- gcloud $tide_right_prompt_items) + set -U tide_right_prompt_items (string match -v -- kubectl $tide_right_prompt_items) + echo "Tide configured." +end diff --git a/run_onchange_after_z_configure_tide.sh.tmpl b/run_onchange_after_z_configure_tide.sh.tmpl index 25dc061..2db1d17 100644 --- a/run_onchange_after_z_configure_tide.sh.tmpl +++ b/run_onchange_after_z_configure_tide.sh.tmpl @@ -12,10 +12,4 @@ if ! fish -c "type -q tide" &>/dev/null; then exit 0 fi -echo "Configuring tide prompt..." -fish -c "tide configure --auto --style=Classic --prompt_colors='True color' --classic_prompt_color=Dark --show_time='24-hour format' --classic_prompt_separators=Slanted --powerline_prompt_heads=Slanted --powerline_prompt_tails=Round --powerline_prompt_style='Two lines, frame' --prompt_connection=Disconnected --powerline_right_prompt_frame=No --prompt_connection_andor_frame_color=Darkest --prompt_spacing=Sparse --icons='Few icons'" >/dev/null -fish -c "set -U tide_prompt_transient_enabled false" -fish -c "set -U tide_right_prompt_items (string match -v -- node \$tide_right_prompt_items)" -fish -c "set -U tide_right_prompt_items (string match -v -- gcloud \$tide_right_prompt_items)" -fish -c "set -U tide_right_prompt_items (string match -v -- kubectl \$tide_right_prompt_items)" -echo "Tide configured." +fish -c "tide-reset"