9 Commits

8 changed files with 109 additions and 53 deletions

View File

@@ -4,3 +4,15 @@ vim.opt.tabstop = 2
vim.opt.expandtab = true vim.opt.expandtab = true
vim.bo.commentstring = '# %s' vim.bo.commentstring = '# %s'
local surround = require('nvim-surround')
surround.buffer_setup({
surrounds = {
['v'] = {
add = { '${', '}' },
find = '%${[^}]-}',
delete = '(%${)().+(})()$',
}
}
})

View File

@@ -0,0 +1,15 @@
-- update this configuration of nvim-surround
-- to handle {{ }} structure in ansible
-- I want to be able to add and delete those braces
local surround = require('nvim-surround')
surround.buffer_setup({
surrounds = {
['v'] = {
add = { '{{ ', ' }}' },
find = '{{[^}]-}}',
delete = '({{%s+)().+(%s+}})()$',
}
}
})

View File

@@ -28,7 +28,7 @@
"nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" }, "nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" },
"nvim-web-devicons": { "branch": "master", "commit": "6788013bb9cb784e606ada44206b0e755e4323d7" }, "nvim-web-devicons": { "branch": "master", "commit": "6788013bb9cb784e606ada44206b0e755e4323d7" },
"oil.nvim": { "branch": "master", "commit": "81b8a91735ad5cd24a6b3137f14a89f19176364f" }, "oil.nvim": { "branch": "master", "commit": "81b8a91735ad5cd24a6b3137f14a89f19176364f" },
"parrot.nvim": { "branch": "main", "commit": "dcae923c7070431c8cb628b19594ab640168684c" }, "parrot.nvim": { "branch": "main", "commit": "5d7e72bdc3efe2638e1bd94ff55028ecc40edd7a" },
"plenary": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "plenary": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" },

View File

@@ -7,7 +7,7 @@ return {
{ 'L3MON4D3/LuaSnip', version = 'v2.*' } { 'L3MON4D3/LuaSnip', version = 'v2.*' }
}, },
-- use a release tag to download pre-built binaries -- use a release tag to download pre-built binaries
version = 'v1.8.*', version = 'v1.9.*',
---@module 'blink-cmp' ---@module 'blink-cmp'
---@type blink.cmp.Config ---@type blink.cmp.Config
@@ -19,10 +19,13 @@ return {
active = function(filter) active = function(filter)
local snippet = require('luasnip') local snippet = require('luasnip')
local blink = require('blink.cmp') local blink = require('blink.cmp')
if snippet.in_snippet() and not blink.is_visible() then if snippet.in_snippet() then
return true return true
else else
if not snippet.in_snippet() and vim.fn.mode() == 'n' then snippet.unlink_current() end if not snippet.in_snippet() and vim.fn.mode() == 'n' then
snippet.unlink_current()
vim.snippet.stop()
end
return false return false
end end
end end

View File

@@ -24,8 +24,6 @@ return {
config = function() config = function()
vim.diagnostic.config({ virtual_text = false }) vim.diagnostic.config({ virtual_text = false })
local lspconfig = require('lspconfig')
-- load snippets from friendly-snippets -- load snippets from friendly-snippets
require('luasnip.loaders.from_vscode').lazy_load() require('luasnip.loaders.from_vscode').lazy_load()
@@ -52,11 +50,11 @@ return {
}) })
local lazydev = require('lazydev') local lazydev = require('lazydev')
lazydev.setup()
vim.lsp.config('lua_ls', { vim.lsp.config('lua_ls', {
root_dir = function(bufnr, on_dir) on_dir(lazydev.find_workspace(bufnr)) end root_dir = function(bufnr, on_dir) on_dir(lazydev.find_workspace(bufnr)) end
}) })
---@module 'lspconfig'
---@type lspconfig.Config ---@type lspconfig.Config
vim.lsp.config('pylsp', { vim.lsp.config('pylsp', {
settings = { settings = {

View File

@@ -1,44 +1,50 @@
return { return {
'frankroeder/parrot.nvim', 'frankroeder/parrot.nvim',
version = '2.3.0', version = '2.5.1',
dependencies = { 'ibhagwan/fzf-lua', 'nvim-lua/plenary.nvim' }, dependencies = { 'ibhagwan/fzf-lua', 'nvim-lua/plenary.nvim' },
opts = { config = function()
providers = { local parrot_opts = {
anthropic = { providers = {
name = 'anthropic', anthropic = {
endpoint = 'https://api.anthropic.com/v1/messages', name = 'anthropic',
model_endpoint = 'https://api.anthropic.com/v1/models', endpoint = 'https://api.anthropic.com/v1/messages',
api_key = { '/usr/local/bin/sops', "--config", "/dev/null", "-d", vim.fn.expand("$HOME") .. "/.claude-api" }, model_endpoint = 'https://api.anthropic.com/v1/models',
headers = function(self) api_key = { '/usr/local/bin/sops', '--config', '/dev/null', '-d', vim.fn.expand('$HOME') .. '/.claude-api' },
return { headers = function(self)
['Content-Type'] = "application/json", return {
['x-api-key'] = self.api_key, ['Content-Type'] = 'application/json',
['anthropic-version'] = "2023-06-01", ['x-api-key'] = self.api_key,
} ['anthropic-version'] = '2023-06-01',
end, }
params = { end,
chat = { max_tokens = 4096 }, params = {
command = { max_tokens = 4096 }, chat = { max_tokens = 4096 },
}, command = { max_tokens = 4096 },
models = { },
'claude-opus-4-5-20251101', models = {
'claude-haiku-4-5-20251001', 'claude-opus-4-6',
}, 'claude-sonet-4-5',
preprocess_payload = function(payload) 'claude-haiku-4-5',
for _, message in ipairs(payload.messages) do },
message.content = message.content:gsub('^%s*(.-)%s*$', "%1") preprocess_payload = function(payload)
end for _, message in ipairs(payload.messages) do
if payload.messages[1] and payload.messages[1].role == 'system' then message.content = message.content:gsub('^%s*(.-)%s*$', "%1")
-- remove the first message that serves as the system prompt as anthropic end
-- expects the system prompt to be part of the API call body and not the messages if payload.messages[1] and payload.messages[1].role == 'system' then
payload.system = payload.messages[1].content -- remove the first message that serves as the system prompt as anthropic
table.remove(payload.messages, 1) -- expects the system prompt to be part of the API call body and not the messages
end payload.system = payload.messages[1].content
return payload table.remove(payload.messages, 1)
end, end
} return payload
}, end,
user_input_ui = "buffer", }
} },
user_input_ui = 'buffer',
}
local parrot = require('parrot')
parrot.setup(parrot_opts)
end
} }

View File

@@ -1,11 +1,33 @@
local theme = {
fill = 'TabLineFill',
head = 'TabLine',
current_tab = 'TabLineSel',
tab = 'TabLine',
win = 'TabLine',
tail = 'TabLine',
}
-- I literally need this for Dadbod for a nicer name in tabs. I don't use tabs -- I literally need this for Dadbod for a nicer name in tabs. I don't use tabs
-- in any other way -- in any other way
return { return {
'nanozuki/tabby.nvim', 'nanozuki/tabby.nvim',
---@module 'tabby' ---@module 'tabby'
---@type TabbyConfig ---@type TabbyConfig
opts = { opts = {
-- configs... line = function(line)
}, return {
line.tabs().foreach(function(tab)
local hl = tab.is_current() and theme.current_tab or theme.tab
return {
line.sep('', hl, theme.head),
tab.number(),
tab.name(),
hl = hl,
margin = ' ',
}
end),
hl = theme.fill,
}
end,
},
} }

View File

@@ -66,7 +66,7 @@ return {
available = function() available = function()
return vim.fn.isdirectory('.git') == 1 return vim.fn.isdirectory('.git') == 1
end end
} },
}, },
}) })