changeset 810:6499aba0eaf3

feat: setup helix and languageservers
author zegervdv <zegervdv@me.com>
date Tue, 05 Dec 2023 21:00:59 +0100
parents 72744c944497
children 83bf3561016d
files .chezmoiexternal.toml .chezmoiscripts/run_onchange_after_15-install-ubuntu-packages.sh.tmpl .chezmoiscripts/run_onchange_after_40-setup-helix.sh.tmpl .chezmoiscripts/run_onchange_after_41-install-language-servers.sh.tmpl dot_config/helix/config.toml dot_config/helix/languages.toml
diffstat 6 files changed, 59 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/.chezmoiexternal.toml	Tue Dec 05 20:03:16 2023 +0100
+++ b/.chezmoiexternal.toml	Tue Dec 05 21:00:59 2023 +0100
@@ -70,4 +70,12 @@
   type = "file"
   url = "https://git.zx2c4.com/password-store/plain/src/completion/pass.zsh-completion"
 
+[".config/helix/runtime/queries/tcl/highlights.scm"]
+  type = "file"
+  url = "https://github.com/lewis6991/tree-sitter-tcl/raw/ac8b94b7a89825ddbdd6f8fc0a81c67c065be851/queries/tcl/highlights.scm"
+
+[".config/helix/runtime/queries/tcl/indents.scm"]
+  type = "file"
+  url = "https://github.com/lewis6991/tree-sitter-tcl/raw/ac8b94b7a89825ddbdd6f8fc0a81c67c065be851/queries/tcl/indents.scm"
+
 {{- end}}
--- a/.chezmoiscripts/run_onchange_after_15-install-ubuntu-packages.sh.tmpl	Tue Dec 05 20:03:16 2023 +0100
+++ b/.chezmoiscripts/run_onchange_after_15-install-ubuntu-packages.sh.tmpl	Tue Dec 05 21:00:59 2023 +0100
@@ -20,7 +20,8 @@
 	"fonts-firacode"
 	"kitty"
 	"yodl"
-	"libevent-core-2.1-7" -}}
+	"libevent-core-2.1-7"
+	"pipx" -}}
 
 {{ $ppa := list
 	"ppa:maveonair/helix-editor"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.chezmoiscripts/run_onchange_after_40-setup-helix.sh.tmpl	Tue Dec 05 21:00:59 2023 +0100
@@ -0,0 +1,12 @@
+{{ if (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu")) -}}
+#!/usr/bin/env bash
+
+# helix languages config {{ include "dot_config/helix/languages.toml" | sha256sum }}
+
+set -xe
+
+hx --grammar fetch
+hx --grammar build
+
+
+{{ end }}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.chezmoiscripts/run_onchange_after_41-install-language-servers.sh.tmpl	Tue Dec 05 21:00:59 2023 +0100
@@ -0,0 +1,19 @@
+{{ if (or (eq .chezmoi.os "darwin") (and (eq .chezmoi.os "linux") (eq .chezmoi.osRelease.name "Ubuntu"))) -}}
+{{ $taplo_version := "0.8.1" -}}
+{{ $ruff_version := "0.1.7" -}}
+{{ $pyright_version := "1.1.338" -}}
+#!/usr/bin/env zsh
+
+set -xe
+
+eval "$($HOME/bin/rtx activate bash)"
+eval "$($HOME/bin/rtx hook-env)"
+
+curl -fsSL https://github.com/tamasfe/taplo/releases/download/{{ $taplo_version }}/taplo-full-linux-x86_64.gz | gzip -d - | sudo install -m 755 /dev/stdin /usr/local/bin/taplo
+
+pipx install "ruff=={{ $ruff_version }}"
+pipx install "pyright=={{ $pyright_version }}"
+
+npm install -g "@ansible/ansible-language-server"
+
+{{ end }}
--- a/dot_config/helix/config.toml	Tue Dec 05 20:03:16 2023 +0100
+++ b/dot_config/helix/config.toml	Tue Dec 05 21:00:59 2023 +0100
@@ -15,3 +15,6 @@
 
 [keys.insert]
 C-f = "move_char_right"
+
+[keys.normal."space"]
+o = "file_picker_in_current_buffer_directory"
--- a/dot_config/helix/languages.toml	Tue Dec 05 20:03:16 2023 +0100
+++ b/dot_config/helix/languages.toml	Tue Dec 05 21:00:59 2023 +0100
@@ -1,3 +1,5 @@
+use-grammars = { except = ["gemini"] }
+
 [language-server.pyright-langserver]
 command = "pyright-langserver"
 args = ["--stdio"]
@@ -11,3 +13,16 @@
 roots = ["pyproject.toml"]
 formatter = { command = "black", args = ["--quiet", "-"] }
 language-servers = ["ruff-lsp", "pyright-langserver"]
+
+[[grammar]]
+name = "tcl"
+source = { git = "https://github.com/lewis6991/tree-sitter-tcl", rev = "ac8b94b7a89825ddbdd6f8fc0a81c67c065be851" }
+
+[[language]]
+name = "tcl"
+scope = "source.tcl"
+injection-regex = "tcl"
+file-types = ["tcl"]
+comment-token = "#"
+indent = { tab-width = 2, unit = " " }
+roots = []