Compare commits

...

3 Commits

Author SHA1 Message Date
don philipe
434df00be3 Add LSP helper plugin for python lang 2026-02-17 14:26:00 +01:00
don philipe
6a82e1dc6f Add detection of ansible files in nvim 2026-02-17 14:24:19 +01:00
don philipe
081a2f5498 Switch to parrot as LLM plugin for nvim 2026-02-17 13:27:31 +01:00
6 changed files with 62 additions and 27 deletions

View File

@@ -1,3 +1,6 @@
-- utilities functions
require("utils")
require("config.remap") require("config.remap")
require("config.set") require("config.set")
require("config.commands") require("config.commands")
@@ -11,7 +14,6 @@ require("config.lazy")
-- plugins -- plugins
require("config.cmp") require("config.cmp")
require("config.gen-private")
require("config.lsp") require("config.lsp")
require("config.mason") require("config.mason")
require("config.treesitter") require("config.treesitter")
@@ -22,6 +24,8 @@ require("config.telescope")
require("config.indentline") require("config.indentline")
require("config.redmine") require("config.redmine")
require("config.diffview") require("config.diffview")
require("config.dap")
require("config.parrot")
-- for some reason this must be placed in init.lua file -- for some reason this must be placed in init.lua file
-- it doesn't work in any lua/config/*.lua files -- it doesn't work in any lua/config/*.lua files

View File

@@ -21,3 +21,47 @@ vim.api.nvim_create_autocmd('Filetype', {
}, },
command = 'setlocal shiftwidth=2 tabstop=2 expandtab' command = 'setlocal shiftwidth=2 tabstop=2 expandtab'
}) })
if vim.filetype then
vim.filetype.add({
pattern = {
[".*/defaults/.*%.ya?ml"] = "yaml.ansible",
[".*/host_vars/.*%.ya?ml"] = "yaml.ansible",
[".*/group_vars/.*%.ya?ml"] = "yaml.ansible",
[".*/group_vars/.*/.*%.ya?ml"] = "yaml.ansible",
[".*/playbook.*%.ya?ml"] = "yaml.ansible",
[".*/playbooks/.*%.ya?ml"] = "yaml.ansible",
[".*/roles/.*/tasks/.*%.ya?ml"] = "yaml.ansible",
[".*/roles/.*/handlers/.*%.ya?ml"] = "yaml.ansible",
[".*/tasks/.*%.ya?ml"] = "yaml.ansible",
[".*/molecule/.*%.ya?ml"] = "yaml.ansible",
},
})
else
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = {
"*/defaults/*.yml",
"*/defaults/*.yaml",
"*/host_vars/*.yml",
"*/host_vars/*.yaml",
"*/group_vars/*.yml",
"*/group_vars/*.yaml",
"*/group_vars/*/*.yml",
"*/group_vars/*/*.yaml",
"*/playbook*.yml",
"*/playbook*.yaml",
"*/playbooks/*.yml",
"*/playbooks/*.yaml",
"*/roles/*/tasks/*.yml",
"*/roles/*/tasks/*.yaml",
"*/roles/*/handlers/*.yml",
"*/roles/*/handlers/*.yaml",
"*/tasks/*.yml",
"*/tasks/*.yaml",
"*/molecule/*.yml",
"*/molecule/*.yaml",
},
callback = function()
vim.bo.filetype = "yaml.ansible"
end,
})
end

View File

@@ -32,3 +32,10 @@ vim.api.nvim_create_autocmd('LspAttach', {
vim.keymap.set('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>', opts) vim.keymap.set('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>', opts)
end, end,
}) })
-- helper plugin configuration
require'py_lsp'.setup{
host_python = '/usr/bin/python3',
default_venv_name = "venv",
language_server = "pylsp",
}

View File

@@ -1,26 +0,0 @@
local ok, vars = pcall(require, 'config.gen-private')
if not ok then
print("Missing gen-private configuration file.")
end
return {
{ "David-Kunz/gen.nvim",
opts = {
model = vars["model"],
host = vars["host"],
port = vars["port"],
https = vars["https"],
show_prompt = true,
debug = false,
-- https://github.com/David-Kunz/gen.nvim/issues/116
command = function(options)
local body = { model = options.model, stream = true }
local schema = "http"
if options.https then
schema = "https"
end
return "curl --silent --no-buffer -X POST " .. schema .. "://" .. options.host .. ":" .. options.port .. "/api/chat -d $body"
end,
}},
}

View File

@@ -2,4 +2,6 @@ return {
{'neovim/nvim-lspconfig', tag = 'v1.7.0'}, -- pin to a version thats compatible with nvim < 0.10 {'neovim/nvim-lspconfig', tag = 'v1.7.0'}, -- pin to a version thats compatible with nvim < 0.10
{'hrsh7th/cmp-nvim-lsp'}, {'hrsh7th/cmp-nvim-lsp'},
{'hrsh7th/nvim-cmp'}, {'hrsh7th/nvim-cmp'},
-- helper plugins
{'HallerPatrick/py_lsp.nvim'},
} }

View File

@@ -0,0 +1,4 @@
return {
"frankroeder/parrot.nvim",
dependencies = { "ibhagwan/fzf-lua", "nvim-lua/plenary.nvim" },
}