commit 7091f3e588f6d7d316be457671bbef8dca308211
parent 0da5f13bbc0e6764fb90b456f6ee016797a41767
Author: Alexander Balgavy <alexander.balgavy@spaceapplications.com>
Date: Thu, 2 Nov 2023 19:19:36 +0100
nvim: misc settings
Diffstat:
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/nvim/lua/llm.lua b/nvim/lua/llm.lua
@@ -90,11 +90,15 @@ end, { silent = true, desc = "Mistral" })
------------------------------------------------------------------
-- coding
vim.keymap.set("v", "<leader>cc", function()
+ local context = vim.fn.input("Prompt: ")
+ if context == "" then
+ return
+ end
local prompt = ollama.get_visual_lines(0)
plen.clear(win_options.bufnr)
local float = plen.percentage_range_window(0.8, 0.8, win_options)
local win_width = vim.api.nvim_win_get_width(float.win_id) - 5
- ollama.run("codellama:7b", "", prompt, float.bufnr, win_width)
+ ollama.run("codellama:7b", context, prompt, float.bufnr, win_width)
end, { silent = true, desc = "Codellama" })
------------------------------------------------------------------
diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua
@@ -156,4 +156,13 @@ return {
},
},
+ {
+ 'mhartington/formatter.nvim',
+ config = function()
+ require("formatter").setup {
+ filetype = { yaml = { require("formatter.filetypes.yaml").yamlfmt } }
+ }
+ end,
+ },
+
}
diff --git a/vim/after/ftplugin/yaml.vim b/vim/after/ftplugin/yaml.vim
@@ -1,4 +1,4 @@
-setlocal shiftwidth=4 tabstop=4 softtabstop=4 expandtab
+setlocal shiftwidth=2 tabstop=2 softtabstop=2 expandtab
if exists('b:undo_ftplugin')
let b:undo_ftplugin .= '| set shiftwidth< tabstop< softtabstop< expandtab<'
else