From c36595c15a4170a7d260efaae2ee5f5ea9e2623c Mon Sep 17 00:00:00 2001 From: Frieder Schlesier Date: Thu, 6 Feb 2025 20:15:20 +0100 Subject: [PATCH] add helix-editor and config --- .config/helix/config.toml | 30 ++++++++++++ .config/helix/languages.toml | 95 ++++++++++++++++++++++++++++++++++++ README.org | 5 ++ 3 files changed, 130 insertions(+) create mode 100644 .config/helix/config.toml create mode 100644 .config/helix/languages.toml diff --git a/.config/helix/config.toml b/.config/helix/config.toml new file mode 100644 index 0000000..0331894 --- /dev/null +++ b/.config/helix/config.toml @@ -0,0 +1,30 @@ +# [language-server.tinymist] +# command = "tinymist" + +# [[language]] +# name = "typst" +# language-servers = ["tinymist"] + +# https://github.com/helix-editor/helix/wiki/Themes#dracula +# set with :theme +theme = "monokai_pro_machine" + +[editor.cursor-shape] +insert = "bar" +normal = "block" +select = "underline" + +[editor.statusline] +left = ["mode", "spinner", "version-control", "file-name"] + + +[editor.lsp] +enable=true +auto-signature-help=true +display-messages = true + +[editor.indent-guides] +render = true +character = "┊" +skip-levels = 1 + diff --git a/.config/helix/languages.toml b/.config/helix/languages.toml new file mode 100644 index 0000000..e481298 --- /dev/null +++ b/.config/helix/languages.toml @@ -0,0 +1,95 @@ +[[language]] +name = "rust" +auto-format = true + +roots = [ + "Cargo.toml", + "Cargo.lock" +] + +[language.auto-pairs] +'(' = ')' +'{' = '}' +'[' = ']' +'"' = '"' +'`' = '`' + +[language-server.rust-analyzer] +command = "rust-analyzer" + +[language-server.rust-analyzer.config] +inlayHints.bindingModeHints.enable = false +inlayHints.closingBraceHints.minLines = 10 +inlayHints.closureReturnTypeHints.enable = "with_block" +inlayHints.discriminantHints.enable = "fieldless" +inlayHints.lifetimeElisionHints.enable = "skip_trivial" +inlayHints.typeHints.hideClosureInitialization = false + +[language-server.jinja-lsp] +command = "jinja-lsp" +config = { templates = "./templates", backend = ["./src"], lang = "rust"} +timeout = 5 + +[[language]] +name = "jinja" +language-servers = ["jinja-lsp"] + +[[language]] +name = "ai-chat" +language-servers = ["lsp-ai"] +scope = "my-lsp-ai" +file-types = [ { glob = "my-ai-chat.md" } ] + + + +############################## +## Configuration for lsp-ai ## +############################## + +[language-server.lsp-ai] +command = "lsp-ai" + +[language-server.lsp-ai.config.memory] +file_store = { } + +[language-server.lsp-ai.config.models.model1] +type = "mistral_fim" +# fim_endpoint = "https://api.mistral.ai/v1/chat/completions" +fim_endpoint = "https://codestral.mistral.ai/v1/chat/completions" +model = "codestral-latest" +auth_token_env_var_name = "CODESTRAL_API_KEY" + +[language-server.lsp-ai.config.models.model2] +type = "mistral_fim" +# fim_endpoint = "https://api.mistral.ai/v1/fim/completions" +fim_endpoint = "https://codestral.mistral.ai/v1/fim/completions" +model = "codestral-latest" +auth_token_env_var_name = "CODESTRAL_API_KEY" +# auth_token_env_var_name = "MISTRAL_API_KEY" + +[language-server.lsp-ai.config.models.model3] +type = "anthropic" +chat_endpoint = "https://api.anthropic.com/v1/messages" +model = "claude-3-5-sonnet-20240620" +auth_token_env_var_name = "ANTHROPIC_API_KEY" + +[[language-server.lsp-ai.config.chat]] +trigger = "!C" +action_display_name = "Chat" +model = "model1" + +[language-server.lsp-ai.config.chat.parameters] +max_context = 4096 +max_tokens = 1024 +system = "You are a code assistant chatbot. The user will ask you for assistance coding and you will do you best to answer succinctly and accurately" + +[language-server.lsp-ai.config.completion] +model = "model2" + +[language-server.lsp-ai.config.completion.parameters] +max_tokens = 64 +max_context = 1024 + +[[language]] +name = "rust" +language-servers = ["rust-analyzer", "lsp-ai"] diff --git a/README.org b/README.org index 181482d..51d5594 100644 --- a/README.org +++ b/README.org @@ -149,6 +149,7 @@ integrates with KeepassXC ([[https://github.com/keepassxreboot/keepassxc/blob/de glances \ gparted \ grimshot \ + helix \ htop \ isync \ keepassxc \ @@ -179,6 +180,8 @@ integrates with KeepassXC ([[https://github.com/keepassxreboot/keepassxc/blob/de ln -s /home/fschl/git/dotfiles/.config/git /home/fschl/.config/git ln -s /home/fschl/git/dotfiles/.config/sway /home/fschl/.config/sway ln -s /home/fschl/git/dotfiles/.config/waybar /home/fschl/.config/waybar + ln -s /home/fschl/git/dotfiles/.config/helix/languages.toml /home/fschl/.config/helix/languages.toml + ln -s /home/fschl/git/dotfiles/.config/helix/config.toml /home/fschl/.config/helix/config.toml git clone https://gitlab.com/fschl/emacs-config ~/git/emacs cd ~/git/emacs @@ -196,6 +199,8 @@ Install [[https://github.com/typst/typst][Typst]] modern replacement for LaTeX, #+begin_src sh cargo install --locked starship cargo install --locked typst-cli + cargo install jinja-lsp + cargo install lsp-ai #+end_src Install [[https://difftastic.wilfred.me.uk/][difftastic]] ([[https://github.com/Wilfred/difftastic][Github]]), for improved diff highlighting.