Compare commits

...

6 Commits

Author SHA1 Message Date
Oliver
7a61ac5437 fix(nvim): better copilot and nvim 2025-12-23 14:05:51 +01:00
Oliver
3311977bf4 feat(tmux): update plugins 2025-12-23 14:03:38 +01:00
652f21f2e9 fix(nvim): fix memory leak 2025-12-23 14:01:42 +01:00
e0909040eb fix(sh) 2025-12-17 16:58:55 +01:00
d1d68a2865 Merge branch 'master' of ssh://gitea.hnat-dev.com:2222/olinpin/dotfiles 2025-12-17 16:55:45 +01:00
214fe4313a feat(aoc): add aoc utility to custom commands 2025-12-17 16:55:15 +01:00
9 changed files with 101 additions and 21 deletions

7
.gitignore vendored
View File

@@ -3,10 +3,15 @@ glab-cli/config.yml
glab-cli/**/mr.json glab-cli/**/mr.json
**/.DS_Store **/.DS_Store
**/lazy-lock.json **/lazy-lock.json
github-copilot/hosts.json github-copilot/
omz-custom/plugins omz-custom/plugins
omz-custom/vrm.sh omz-custom/vrm.sh
omz omz
testDir testDir
tmuxinator/*.yml tmuxinator/*.yml
!tmuxinator/template.yml.temp !tmuxinator/template.yml.temp
uv/
gcloud/
htop/
mcphub
spicetify

View File

@@ -1 +1 @@
{"copilot.lua":"1.384.0"} {"copilot.lua":"1.393.0"}

View File

@@ -4,9 +4,13 @@ return {
event = "InsertEnter", event = "InsertEnter",
config = function() config = function()
require("copilot").setup({ require("copilot").setup({
-- get the node path from env variable $NODE_PATH if it's set
-- copilot_node_command = "/Users/oliverhnat/.nvm/versions/node/v22.21.1/bin/node",
copilot_node_command = os.getenv("NODE_PATH"),
suggestion = { suggestion = {
enabled = true, enabled = true,
auto_trigger = true, auto_trigger = true,
debounce = 150, -- Add debounce to reduce API calls
keymap = { keymap = {
accept = "", accept = "",
}, },
@@ -17,6 +21,14 @@ return {
filetypes = { filetypes = {
["."] = false, ["."] = false,
}, },
server_opts_overrides = {
-- Reduce timeout-related errors
settings = {
advanced = {
inlineSuggestCount = 3,
},
},
},
}) })
end, end,
} }

View File

@@ -19,6 +19,9 @@ local PACKAGES = {
"pyright", "pyright",
"typescript-language-server", "typescript-language-server",
"yaml-language-server", "yaml-language-server",
"vue-language-server",
"ts_ls",
"typescript-tools",
-- Format -- Format
"black", "black",
"flake8", "flake8",
@@ -93,22 +96,22 @@ local function syncPackages(ensurePacks)
end) end)
-- Auto-clean unused packages -- Auto-clean unused packages
local installedPackages = masonReg.get_installed_package_names() -- local installedPackages = masonReg.get_installed_package_names()
vim.iter(installedPackages):each(function(packName) -- vim.iter(installedPackages):each(function(packName)
-- Check if installed package is in our ensure list (without version suffix) -- -- Check if installed package is in our ensure list (without version suffix)
local isEnsured = vim.iter(ensurePacks):any(function(ensurePack) -- local isEnsured = vim.iter(ensurePacks):any(function(ensurePack)
local name = ensurePack:match("([^@]+)") -- local name = ensurePack:match("([^@]+)")
return name == packName -- return name == packName
end) -- end)
--
if not isEnsured then -- if not isEnsured then
masonReg.get_package(packName):uninstall() -- masonReg.get_package(packName):uninstall()
local msg = ("[%s] uninstalled."):format(packName) -- local msg = ("[%s] uninstalled."):format(packName)
vim.defer_fn(function() -- vim.defer_fn(function()
vim.notify(msg, nil, { title = "Mason", icon = "󰅗" }) -- vim.notify(msg, nil, { title = "Mason", icon = "󰅗" })
end, 0) -- end, 0)
end -- end
end) -- end)
end end
masonReg.refresh(refreshCallback) masonReg.refresh(refreshCallback)
@@ -183,7 +186,12 @@ return {
}, },
}) })
vim.lsp.config("ts_ls", { on_attach = on_attach, capabilities = capabilities }) vim.lsp.config("ts_ls", {
on_attach = on_attach,
capabilities = capabilities,
})
vim.lsp.enable("ts_ls")
vim.lsp.config("pyright", { on_attach = on_attach, capabilities = capabilities }) vim.lsp.config("pyright", { on_attach = on_attach, capabilities = capabilities })
vim.lsp.config("html", { on_attach = on_attach, capabilities = capabilities }) vim.lsp.config("html", { on_attach = on_attach, capabilities = capabilities })
vim.lsp.config("cssls", { on_attach = on_attach, capabilities = capabilities }) vim.lsp.config("cssls", { on_attach = on_attach, capabilities = capabilities })
@@ -201,6 +209,11 @@ return {
}, },
}) })
vim.lsp.config("eslint", { on_attach = on_attach, capabilities = capabilities }) vim.lsp.config("eslint", { on_attach = on_attach, capabilities = capabilities })
vim.lsp.config("vue_ls", {
on_attach = on_attach,
capabilities = capabilities,
})
vim.lsp.enable("vue_ls")
require("mason-lspconfig").setup({ require("mason-lspconfig").setup({
ensure_installed = { ensure_installed = {
@@ -213,6 +226,7 @@ return {
"yamlls", "yamlls",
"intelephense", "intelephense",
"eslint", "eslint",
"vue_ls",
}, },
automatic_installation = true, automatic_installation = true,
}) })

View File

@@ -42,3 +42,7 @@ vim.opt.foldenable = false
vim.opt.foldlevel = 99 vim.opt.foldlevel = 99
-- g.markdown_folding = 1 -- enable markdown folding -- g.markdown_folding = 1 -- enable markdown folding
-- Set LSP log level to WARN to reduce log spam (was filling 107MB!)
-- Options: "trace", "debug", "info", "warn", "error", "off"
vim.lsp.set_log_level("warn")

44
omz-custom/custom_commands.sh Executable file → Normal file
View File

@@ -402,6 +402,50 @@ function gpla() {
echo "Finished fetching branches." echo "Finished fetching branches."
} }
function aoc() {
if [ -z "$1" ]; then
echo "Usage: aoc <day> [year]"
echo "Example: aoc 5 (creates Day5 for current year)"
echo " aoc 12 2024 (creates Day12 for 2024)"
return 1
fi
local AOC_DIR="$HOME/Developer/AOC"
local TEMPLATE_DIR="$AOC_DIR/templates"
if [ ! -d "$AOC_DIR" ]; then
echo "Error: AOC directory not found at $AOC_DIR"
return 1
fi
local day=$1
local year=${2:-$(date +%Y)}
local dir="$AOC_DIR/$year/Day$day"
if [ -d "$dir" ]; then
echo "Error: $year/Day$day already exists!"
return 1
fi
echo "Creating $year/Day$day..."
mkdir -p "$dir"
touch "$dir/input.in"
touch "$dir/example.in"
if [ -f "$TEMPLATE_DIR/ans.py" ]; then
cp "$TEMPLATE_DIR/ans.py" "$dir/"
else
echo "Warning: Template file not found at $TEMPLATE_DIR/ans.py"
fi
echo "✓ Created $year/Day$day with template files"
echo " - $dir/ans.py"
echo " - $dir/input.in"
echo " - $dir/example.in"
}
# source the tmux-sessions.sh in the same folder # source the tmux-sessions.sh in the same folder
source $(dirname "$0")/tmux-sessions.sh source $(dirname "$0")/tmux-sessions.sh
source $(dirname "$0")/completion.sh source $(dirname "$0")/completion.sh

1
tmux/plugins/tmux-fzf Submodule

Submodule tmux/plugins/tmux-fzf added at 1547f18083

Submodule tmux/plugins/tmux-sessionx updated: 42c18389e7...c2eb0e19bf

Submodule tmux/plugins/tmux-which-key updated: 1f419775ca...545831eb95