add helix-editor and config

This commit is contained in:
Frieder Schlesier 2025-02-06 20:15:20 +01:00
parent 8b289d0215
commit c36595c15a
3 changed files with 130 additions and 0 deletions

30
.config/helix/config.toml Normal file
View File

@ -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

View File

@ -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"]

View File

@ -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.