From 6d90c4c3077a392c7005dfb87e642fa932f70aa1 Mon Sep 17 00:00:00 2001 From: xnm Date: Sun, 26 Jan 2025 22:15:11 +0200 Subject: [PATCH] update: fixes & changes, added configs for `aider` and `aichat` --- .gitignore | 2 + home/.aider.conf.yml | 49 +++++++++++++++++++ home/.config/aichat/config.yaml | 48 ++++++++++++++++++ home/.config/aichat/roles/spellcheck.md | 5 ++ home/.config/aichat/roles/to-emoji.md | 6 +++ .../aichat/roles/translate#english#russian.md | 5 ++ .../aichat/roles/translate#russian#english.md | 5 ++ home/.config/fish/completions/aichat.fish | 27 ++++++++++ home/.config/fish/functions/aichat_fish.fish | 8 +++ .../functions/fish_user_key_bindings.fish | 2 + home/.config/helix/config.toml | 2 +- home/.config/helix/languages.toml | 4 +- home/.config/wezterm/wezterm.lua | 5 ++ nixos/rust-toolchain.toml | 9 ++-- 14 files changed, 171 insertions(+), 6 deletions(-) create mode 100644 .gitignore create mode 100644 home/.aider.conf.yml create mode 100644 home/.config/aichat/config.yaml create mode 100644 home/.config/aichat/roles/spellcheck.md create mode 100644 home/.config/aichat/roles/to-emoji.md create mode 100644 home/.config/aichat/roles/translate#english#russian.md create mode 100644 home/.config/aichat/roles/translate#russian#english.md create mode 100644 home/.config/fish/completions/aichat.fish create mode 100644 home/.config/fish/functions/aichat_fish.fish diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d5ac763 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.aider* +.env diff --git a/home/.aider.conf.yml b/home/.aider.conf.yml new file mode 100644 index 0000000..5a5906c --- /dev/null +++ b/home/.aider.conf.yml @@ -0,0 +1,49 @@ +# main settings +auto-commits: false +watch-files: true +read: + - CONVENTIONS.md + - AI_RULES.md +vim: true +cache-prompts: true +editor: hx +architect: true + + +# theme settings +dark-mode: true +code-theme: lightbulb + +## Set the color for user input (default: #00cc00) +user-input-color: '#A6DA95' + +## Set the color for tool output (default: None) +tool-output-color: '#CAD3F5' + +## Set the color for tool error messages (default: #FF2222) +tool-error-color: '#ED8796' + +## Set the color for tool warning messages (default: #FFA500) +tool-warning-color: '#EED49F' + +## Set the color for assistant output (default: #0088ff) +assistant-output-color: '#8AADF4' + +## Set the color for the completion menu (default: terminal's default text color) +completion-menu-color: '#7DC4E4' + +## Set the background color for the completion menu (default: terminal's default background color) +completion-menu-bg-color: '#5B6078' + +## Set the color for the current item in the completion menu (default: terminal's default background color) +completion-menu-current-color: '#8087A2' + +## Set the background color for the current item in the completion menu (default: terminal's default text color) +completion-menu-current-bg-color: '#7DC4E4' + + +# models settings here +model: deepseek/deepseek-reasoner +editor-model: deepseek/deepseek-chat +api-key: +- deepseek=your_api_key # FIXME diff --git a/home/.config/aichat/config.yaml b/home/.config/aichat/config.yaml new file mode 100644 index 0000000..d00d8e5 --- /dev/null +++ b/home/.config/aichat/config.yaml @@ -0,0 +1,48 @@ +# model: ollama:llama3.2:3b +model: deepseek:deepseek-chat +keybindings: vi +function_calling: true +rag_embedding_model: nomic-embed-text:latest +clients: +- type: openai-compatible + name: ollama + api_base: http://127.0.0.1:11434/v1 + models: + - name: llama3.2:3b + max_input_tokens: 128000 + supports_function_calling: true + + - name: phi4:14b + max_input_tokens: 16000 + supports_function_calling: true + + - name: dolphin3:8b + max_input_tokens: 130000 + supports_function_calling: true + + - name: smallthinker:3b + max_input_tokens: 16384 + supports_function_calling: true + + - name: qwq:32b + max_input_tokens: 33000 + supports_function_calling: true + + - name: nomic-embed-text:latest + type: embedding + +- type: openai-compatible + name: deepseek + api_base: https://api.deepseek.com/v1 + api_key: your_api_key # FIXME + models: + - name: deepseek-chat + max_input_tokens: 64000 + supports_vision: true + supports_function_calling: true + + - name: deepseek-reasoner + max_input_tokens: 64000 + supports_vision: true + supports_function_calling: true + diff --git a/home/.config/aichat/roles/spellcheck.md b/home/.config/aichat/roles/spellcheck.md new file mode 100644 index 0000000..9681475 --- /dev/null +++ b/home/.config/aichat/roles/spellcheck.md @@ -0,0 +1,5 @@ +--- +model: deepseek:deepseek-chat + +--- +Your task is to take the text provided and rewrite it into a clear, grammatically correct version while preserving the original meaning as closely as possible. Correct any spelling mistakes, punctuation errors, verb tense issues, word choice problems, and other grammatical mistakes. Responde with just a varinat or varinats of improved text. diff --git a/home/.config/aichat/roles/to-emoji.md b/home/.config/aichat/roles/to-emoji.md new file mode 100644 index 0000000..5389fb3 --- /dev/null +++ b/home/.config/aichat/roles/to-emoji.md @@ -0,0 +1,6 @@ +--- +model: ollama:llama3.2:3b + +--- +convert __INPUT__ to emoji. +response: just an emoji or emojies, without words or explanations diff --git a/home/.config/aichat/roles/translate#english#russian.md b/home/.config/aichat/roles/translate#english#russian.md new file mode 100644 index 0000000..dd0294b --- /dev/null +++ b/home/.config/aichat/roles/translate#english#russian.md @@ -0,0 +1,5 @@ +--- +model: deepseek:deepseek-chat + +--- +translate text below from __ARG1__ to __ARG2__ diff --git a/home/.config/aichat/roles/translate#russian#english.md b/home/.config/aichat/roles/translate#russian#english.md new file mode 100644 index 0000000..dd0294b --- /dev/null +++ b/home/.config/aichat/roles/translate#russian#english.md @@ -0,0 +1,5 @@ +--- +model: deepseek:deepseek-chat + +--- +translate text below from __ARG1__ to __ARG2__ diff --git a/home/.config/fish/completions/aichat.fish b/home/.config/fish/completions/aichat.fish new file mode 100644 index 0000000..a9f6848 --- /dev/null +++ b/home/.config/fish/completions/aichat.fish @@ -0,0 +1,27 @@ +complete -c aichat -s m -l model -x -a "(aichat --list-models)" -d 'Select a LLM model' -r +complete -c aichat -l prompt -d 'Use the system prompt' +complete -c aichat -s r -l role -x -a "(aichat --list-roles)" -d 'Select a role' -r +complete -c aichat -s s -l session -x -a "(aichat --list-sessions)" -d 'Start or join a session' -r +complete -c aichat -l empty-session -d 'Ensure the session is empty' +complete -c aichat -l save-session -d 'Ensure the new conversation is saved to the session' +complete -c aichat -s a -l agent -x -a "(aichat --list-agents)" -d 'Start a agent' -r +complete -c aichat -l agent-variable -d 'Set agent variables' +complete -c aichat -l rag -x -a"(aichat --list-rags)" -d 'Start a RAG' -r +complete -c aichat -l rebuild-rag -d 'Rebuild the RAG to sync document changes' +complete -c aichat -l macro -x -a"(aichat --list-macros)" -d 'Execute a macro' -r +complete -c aichat -l serve -d 'Serve the LLM API and WebAPP' +complete -c aichat -s e -l execute -d 'Execute commands in natural language' +complete -c aichat -s c -l code -d 'Output code only' +complete -c aichat -s f -l file -d 'Include files, directories, or URLs' -r -F +complete -c aichat -s S -l no-stream -d 'Turn off stream mode' +complete -c aichat -l dry-run -d 'Display the message without sending it' +complete -c aichat -l info -d 'Display information' +complete -c aichat -l sync-models -d 'Sync models updates' +complete -c aichat -l list-models -d 'List all available chat models' +complete -c aichat -l list-roles -d 'List all roles' +complete -c aichat -l list-sessions -d 'List all sessions' +complete -c aichat -l list-agents -d 'List all agents' +complete -c aichat -l list-rags -d 'List all RAGs' +complete -c aichat -l list-macros -d 'List all macros' +complete -c aichat -s h -l help -d 'Print help' +complete -c aichat -s V -l version -d 'Print version' diff --git a/home/.config/fish/functions/aichat_fish.fish b/home/.config/fish/functions/aichat_fish.fish new file mode 100644 index 0000000..5754dca --- /dev/null +++ b/home/.config/fish/functions/aichat_fish.fish @@ -0,0 +1,8 @@ +function aichat_fish + set -l _old (commandline) + if test -n $_old + echo -n "⌛" + commandline -f repaint + commandline (aichat -e $_old) + end +end diff --git a/home/.config/fish/functions/fish_user_key_bindings.fish b/home/.config/fish/functions/fish_user_key_bindings.fish index 788bdee..f326969 100644 --- a/home/.config/fish/functions/fish_user_key_bindings.fish +++ b/home/.config/fish/functions/fish_user_key_bindings.fish @@ -21,4 +21,6 @@ function fish_user_key_bindings bind \eb back-op -M insert bind \eB backtrack-op -M insert bind \e/ list-op -M insert + + bind \ea aichat_fish -M insert end diff --git a/home/.config/helix/config.toml b/home/.config/helix/config.toml index 77d5422..17be542 100644 --- a/home/.config/helix/config.toml +++ b/home/.config/helix/config.toml @@ -5,7 +5,7 @@ shell = ["fish", "-c"] line-number = "relative" cursorline = true color-modes = true -auto-save = true +auto-save = false idle-timeout = 0 bufferline = "multiple" popup-border = "popup" diff --git a/home/.config/helix/languages.toml b/home/.config/helix/languages.toml index 67d08d4..3079b31 100644 --- a/home/.config/helix/languages.toml +++ b/home/.config/helix/languages.toml @@ -13,7 +13,7 @@ args = ["--stdio"] command = "helix-gpt" args = [ "--handler", "copilot", - "--copilotApiKey", "your_api_key", # TODO: write fixme + "--copilotApiKey", "your_api_key", # FIXME ] [language-server.lsp-ai] @@ -22,7 +22,7 @@ args = ["--stdio"] [[language]] name = "rust" -language-servers = [ "rust-analyzer", "copilot" ] +language-servers = [ "rust-analyzer" ] [language-server.rust-analyzer.config] checkOnSave = { command = "clippy" } diff --git a/home/.config/wezterm/wezterm.lua b/home/.config/wezterm/wezterm.lua index 7634134..89f817a 100644 --- a/home/.config/wezterm/wezterm.lua +++ b/home/.config/wezterm/wezterm.lua @@ -157,5 +157,10 @@ return { mods = 'CTRL|SHIFT', action = act.ClearSelection }, + { + key = 'Enter', + mods = 'ALT', + action = wezterm.action.DisableDefaultAssignment, + }, }, } diff --git a/nixos/rust-toolchain.toml b/nixos/rust-toolchain.toml index 028fdca..9fad256 100644 --- a/nixos/rust-toolchain.toml +++ b/nixos/rust-toolchain.toml @@ -1,9 +1,12 @@ [toolchain] -channel = "nightly" -components = [ "rust-src", "rust-analyzer", "rustc-codegen-cranelift", "miri", "llvm-tools", "rust-docs-json" ] +# channel = "nightly" +channel = "stable" +# components = [ "rust-src", "rust-analyzer", "rustc-codegen-cranelift", "miri", "llvm-tools", "rust-docs-json" ] +components = [ "rust-src", "rust-analyzer" ] targets = [ "wasm32-unknown-unknown", - "wasm32-wasi", + "wasm32-wasip1", + "wasm32-wasip2", "x86_64-pc-windows-gnu", "x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu",