From 2305fe92d5efeb25aeac541a40efbb09ccc8fe11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sat, 16 Mar 2024 18:23:56 +0100 Subject: [PATCH] Add riva command --- nvim/lua/plugins/codegen.lua | 22 ++++++++++++++++++++++ zsh/.zshrc | 5 ++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 nvim/lua/plugins/codegen.lua diff --git a/nvim/lua/plugins/codegen.lua b/nvim/lua/plugins/codegen.lua new file mode 100644 index 0000000..a8a565f --- /dev/null +++ b/nvim/lua/plugins/codegen.lua @@ -0,0 +1,22 @@ +return { + "David-Kunz/gen.nvim", + opts = { + model = "mistral", -- The default model to use. + host = "localhost", -- The host running the Ollama service. + port = "11434", -- The port on which the Ollama service is listening. + display_mode = "float", -- The display mode. Can be "float" or "split". + show_prompt = false, -- Shows the Prompt submitted to Ollama. + show_model = false, -- Displays which model you are using at the beginning of your chat session. + quit_map = "q", -- set keymap for quit + no_auto_close = false, -- Never closes the window automatically. + command = function(options) + return "curl --silent --no-buffer -X POST http://" .. options.host .. ":" .. options.port .. "/api/chat -d $body" + end, + -- The command for the Ollama service. You can use placeholders $prompt, $model and $body (shellescaped). + -- This can also be a command string. + -- The executed command must return a JSON object with { response, context } + -- (context property is optional). + -- list_models = '', -- Retrieves a list of model names + debug = false -- Prints errors and the command which is run. + } +} diff --git a/zsh/.zshrc b/zsh/.zshrc index 0633800..6a1b2e7 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -186,6 +186,10 @@ function s() { ssh server@mallorea -t "cd \"$(pwd)\" ; zsh --login" } +function riva() { + ssh user@riva -t "cd \"$(pwd)\" ; zsh --login" +} + if [ "$SSH_CLIENT" ] then source_port=$(echo $SSH_CLIENT | awk '{ print $2 }') @@ -207,7 +211,6 @@ alias ll='ls -lhat' alias clip="xsel --clipboard" alias compress="tar --use-compress-program=lbzip2 -cvf" alias vim="nvim" -alias v="nvim" alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts" alias xbindkeys="xbindkeys -f $XDG_CONFIG_HOME/xbindkeys/config" alias python=python3