yay updates

This commit is contained in:
Solomon Laing 2025-07-21 18:07:37 +09:30
parent e432b71f4e
commit 42d664d91f
5 changed files with 37 additions and 26 deletions

View File

@ -56,7 +56,7 @@ return {
"hrsh7th/cmp-path",
"hrsh7th/cmp-emoji",
"hrsh7th/cmp-buffer",
"saadparwaiz1/cmp_luasnip",
-- "saadparwaiz1/cmp_luasnip",
},
config = function()
local cmp = require("cmp")
@ -65,9 +65,9 @@ return {
completeopt = "menu,menuone,noinsert",
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
-- expand = function(args)
-- require("luasnip").lsp_expand(args.body)
-- end,
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
@ -80,7 +80,7 @@ return {
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
-- { name = "luasnip" },
{ name = "path" },
{ name = "emoji" },
{ name = "buffer" },

View File

@ -1,7 +1,7 @@
return {
{
"olimorris/codecompanion.nvim",
enabled = true,
enabled = require('lazyvim.utils').exists('$HOME/.config/openai/KEY'),
lazy = false,
dependencies = {
{ "nvim-lua/plenary.nvim", branch = "master" },

View File

@ -1,21 +1,21 @@
return {
{
"L3MON4D3/LuaSnip",
enabled = true,
dependencies = {
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
opts = {
history = true,
delete_check_events = "TextChanged",
},
-- stylua: ignore
keys = {
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s", },
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" }, },
},
},
-- {
-- "L3MON4D3/LuaSnip",
-- enabled = true,
-- dependencies = {
-- "rafamadriz/friendly-snippets",
-- config = function()
-- require("luasnip.loaders.from_vscode").lazy_load()
-- end,
-- },
-- opts = {
-- history = true,
-- delete_check_events = "TextChanged",
-- },
-- -- stylua: ignore
-- keys = {
-- { "<tab>", function() require("luasnip").jump(1) end, mode = "s", },
-- { "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" }, },
-- },
-- },
}

View File

@ -155,4 +155,15 @@ function M.trim_whitespace()
pcall(vim.cmd, 'cal cursor(currPos[1], currPos[2])')
end
function M.exists(path)
local exists = vim.fn.filereadable(vim.fn.expand(path))
if exists == 1 then
vim.notify(path .. " exists", vim.log.levels.INFO)
return true
else
vim.notify(path .. " doesn't exist", vim.log.levels.INFO)
return false
end
end
return M

View File

@ -71,7 +71,7 @@ export REPOS="$HOME/repos"
export GITUSER="inkletblot"
export NOTE_DIR="$HOME/notes/"
export DWM_DIR="$REPOS/gitlab.inkletblot.com/inkletblot/dwm-inkletblot/"
export OPENAI_API_KEY="$(cat "$HOME/.config/openai/KEY")"
export OPENAI_API_KEY="$(touch "$HOME/.config/openai/KEY" && cat "$HOME/.config/openai/KEY")"
# This is something luke smith has in his profile (which I have stolen, it's nice but
# doesn't work very nicely with my login manager, lightdm, and I prefer to just run