# HG changeset patch # User zegervdv # Date 1701806459 -3600 # Node ID 6499aba0eaf3a7aa42bca9862b93157c026e7c03 # Parent 72744c944497d092d117a12d8a8d23f400983792 feat: setup helix and languageservers diff -r 72744c944497 -r 6499aba0eaf3 .chezmoiexternal.toml --- 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}} diff -r 72744c944497 -r 6499aba0eaf3 .chezmoiscripts/run_onchange_after_15-install-ubuntu-packages.sh.tmpl --- 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" diff -r 72744c944497 -r 6499aba0eaf3 .chezmoiscripts/run_onchange_after_40-setup-helix.sh.tmpl --- /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 }} diff -r 72744c944497 -r 6499aba0eaf3 .chezmoiscripts/run_onchange_after_41-install-language-servers.sh.tmpl --- /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 }} diff -r 72744c944497 -r 6499aba0eaf3 dot_config/helix/config.toml --- 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" diff -r 72744c944497 -r 6499aba0eaf3 dot_config/helix/languages.toml --- 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 = []