Added sqls and ogpt (llama integration) plugins
This commit is contained in:
22
lua/lsp.lua
22
lua/lsp.lua
@@ -94,7 +94,6 @@ require('mason-lspconfig').setup_handlers({
|
||||
-- and will be called for each installed server that doesn't have
|
||||
-- a dedicated handler.
|
||||
function(server_name) -- default handler (optional)
|
||||
|
||||
-- 2024-10-29 Solargraph shall handle ruby AND sonicpi files, add on_init according to documentation
|
||||
if server_name == "solargraph" then
|
||||
lspconfig[server_name].setup {
|
||||
@@ -137,6 +136,27 @@ require('mason-lspconfig').setup_handlers({
|
||||
})
|
||||
|
||||
|
||||
-- setup sqls support
|
||||
lspconfig.sqls.setup {
|
||||
on_attach = function(client, bufnr)
|
||||
require('sqls').on_attach(client, bufnr)
|
||||
end,
|
||||
settings = {
|
||||
sqls = {
|
||||
connections = {
|
||||
-- {
|
||||
-- driver = 'mysql',
|
||||
-- dataSourceName = 'root:root@tcp(127.0.0.1:13306)/world',
|
||||
-- },
|
||||
{
|
||||
driver = 'postgresql',
|
||||
dataSourceName = 'host=127.0.0.1 port=5432 sslmode=disable',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- use on_attach to get lsp related shortcuts
|
||||
vim.g.rustaceanvim = {
|
||||
-- LSP configuration
|
||||
|
||||
146
lua/plugins.lua
146
lua/plugins.lua
@@ -539,4 +539,150 @@ require("lazy").setup({
|
||||
---@type ibl.config
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- database connectivity
|
||||
{
|
||||
"nanotee/sqls.nvim"
|
||||
},
|
||||
|
||||
-- ollama and LLM integration
|
||||
{
|
||||
{
|
||||
"huynle/ogpt.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
default_provider = "ollama",
|
||||
edgy = true, -- enable this!
|
||||
single_window = false, -- set this to true if you want only one OGPT window to appear at a time
|
||||
providers = {
|
||||
ollama = {
|
||||
api_host = os.getenv("OLLAMA_API_HOST") or "http://localhost:11434",
|
||||
api_key = os.getenv("OLLAMA_API_KEY") or "",
|
||||
model = "llama3.2-vision:sl",
|
||||
}
|
||||
}
|
||||
},
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope.nvim"
|
||||
}
|
||||
},
|
||||
{
|
||||
"folke/edgy.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.opt.laststatus = 3
|
||||
vim.opt.splitkeep = "screen" -- or "topline" or "screen"
|
||||
end,
|
||||
opts = {
|
||||
exit_when_last = false,
|
||||
animate = {
|
||||
enabled = false,
|
||||
},
|
||||
wo = {
|
||||
winbar = true,
|
||||
winfixwidth = true,
|
||||
winfixheight = false,
|
||||
winhighlight = "WinBar:EdgyWinBar,Normal:EdgyNormal",
|
||||
spell = false,
|
||||
signcolumn = "no",
|
||||
},
|
||||
keys = {
|
||||
-- -- close window
|
||||
["q"] = function(win)
|
||||
win:close()
|
||||
end,
|
||||
-- close sidebar
|
||||
["Q"] = function(win)
|
||||
win.view.edgebar:close()
|
||||
end,
|
||||
-- increase width
|
||||
["<S-Right>"] = function(win)
|
||||
win:resize("width", 3)
|
||||
end,
|
||||
-- decrease width
|
||||
["<S-Left>"] = function(win)
|
||||
win:resize("width", -3)
|
||||
end,
|
||||
-- increase height
|
||||
["<S-Up>"] = function(win)
|
||||
win:resize("height", 3)
|
||||
end,
|
||||
-- decrease height
|
||||
["<S-Down>"] = function(win)
|
||||
win:resize("height", -3)
|
||||
end,
|
||||
},
|
||||
right = {
|
||||
{
|
||||
title = "OGPT Popup",
|
||||
ft = "ogpt-popup",
|
||||
size = { width = 0.2 },
|
||||
wo = {
|
||||
wrap = true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title = "OGPT Parameters",
|
||||
ft = "ogpt-parameters-window",
|
||||
size = { height = 6 },
|
||||
wo = {
|
||||
wrap = true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title = "OGPT Template",
|
||||
ft = "ogpt-template",
|
||||
size = { height = 6 },
|
||||
},
|
||||
{
|
||||
title = "OGPT Sessions",
|
||||
ft = "ogpt-sessions",
|
||||
size = { height = 6 },
|
||||
wo = {
|
||||
wrap = true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title = "OGPT System Input",
|
||||
ft = "ogpt-system-window",
|
||||
size = { height = 6 },
|
||||
},
|
||||
{
|
||||
title = "OGPT",
|
||||
ft = "ogpt-window",
|
||||
size = { height = 0.5 },
|
||||
wo = {
|
||||
wrap = true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title = "OGPT {{{selection}}}",
|
||||
ft = "ogpt-selection",
|
||||
size = { width = 80, height = 4 },
|
||||
wo = {
|
||||
wrap = true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title = "OGPt {{{instruction}}}",
|
||||
ft = "ogpt-instruction",
|
||||
size = { width = 80, height = 4 },
|
||||
wo = {
|
||||
wrap = true,
|
||||
},
|
||||
},
|
||||
{
|
||||
title = "OGPT Chat",
|
||||
ft = "ogpt-input",
|
||||
size = { width = 80, height = 4 },
|
||||
wo = {
|
||||
wrap = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user