Compare commits
7 Commits
3c54a66066
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8441afb56f | ||
|
|
57737dcfb9 | ||
| 04aa0b0cbf | |||
| a8934b7442 | |||
| 3036a6f44e | |||
|
|
0856691343 | ||
|
|
d4562f0c3d |
@@ -179,6 +179,11 @@ function Connect-Dev1(){
|
|||||||
ssh -o ForwardAgent=yes wholteza@dev1.zacke.dev
|
ssh -o ForwardAgent=yes wholteza@dev1.zacke.dev
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function minikubestart {
|
||||||
|
minikube start --base-image="gcr.io/k8s-minikube/kicbase:v0.0.50" @args
|
||||||
|
wsl ./sync-minikube-port.sh
|
||||||
|
}
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
Set-alias -Name g -Value git
|
Set-alias -Name g -Value git
|
||||||
Set-Alias -Name k -Value kubectl
|
Set-Alias -Name k -Value kubectl
|
||||||
@@ -189,6 +194,7 @@ Set-Alias -Name yy -Value Open-Nuxt
|
|||||||
Set-Alias -Name dev1 -Value Connect-Dev1
|
Set-Alias -Name dev1 -Value Connect-Dev1
|
||||||
|
|
||||||
Set-Alias -Name dash -Value Open-KubernetesDashboard
|
Set-Alias -Name dash -Value Open-KubernetesDashboard
|
||||||
|
Set-Alias -Name minikube-start -Value minikubestart
|
||||||
|
|
||||||
Set-Alias -Name cd-repos -Value cdr
|
Set-Alias -Name cd-repos -Value cdr
|
||||||
Set-Alias -Name repos -Value cdr
|
Set-Alias -Name repos -Value cdr
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ local default_prog = {
|
|||||||
"& { . ~/.profile.ps1; $host.EnterNestedPrompt() }",
|
"& { . ~/.profile.ps1; $host.EnterNestedPrompt() }",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- default_prog = {"ubuntu"}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
default_prog = default_prog,
|
default_prog = default_prog,
|
||||||
check_for_updates = true,
|
check_for_updates = true,
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ vim.o.ignorecase = true -- Case insensitive search
|
|||||||
vim.o.smartcase = true -- Case sensitive when caps is used
|
vim.o.smartcase = true -- Case sensitive when caps is used
|
||||||
vim.o.cursorline = true -- Highlight current line
|
vim.o.cursorline = true -- Highlight current line
|
||||||
vim.o.winborder = "single" -- Borders around popups like when you press leader for keybinds
|
vim.o.winborder = "single" -- Borders around popups like when you press leader for keybinds
|
||||||
vim.opt.signcolumn =
|
vim.opt.signcolumn = "yes" -- TEST: Prohibit layout shifting by always showing the sign column (left of line numbers), you should see an icon there on this row.
|
||||||
"yes" -- TEST: Prohibit layout shifting by always showing the sign column (left of line numbers), you should see an icon there on this row.
|
|
||||||
vim.o.updatetime = 250 -- Speed up the CursorHold autocmd event
|
vim.o.updatetime = 250 -- Speed up the CursorHold autocmd event
|
||||||
vim.o.timeoutlen = 300 -- Speed up completion of key event
|
vim.o.timeoutlen = 300 -- Speed up completion of key event
|
||||||
-- SECTION: Globals
|
-- SECTION: Globals
|
||||||
@@ -71,44 +70,53 @@ vim.keymap.set("n", "<leader>ad", "<cmd>ClaudeCodeDiffDeny<cr>", { desc = "Den
|
|||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = { "NvimTree", "neo-tree", "oil", "minifiles", "netrw" },
|
pattern = { "NvimTree", "neo-tree", "oil", "minifiles", "netrw" },
|
||||||
callback = function(ev)
|
callback = function(ev)
|
||||||
vim.keymap.set("n", "<leader>as", "<cmd>ClaudeCodeTreeAdd<cr>",
|
vim.keymap.set("n", "<leader>as", "<cmd>ClaudeCodeTreeAdd<cr>", { desc = "Add file", buffer = ev.buf })
|
||||||
{ desc = "Add file", buffer = ev.buf })
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- SECTION: Install packages
|
-- SECTION: Install packages
|
||||||
vim.pack.add({
|
vim.pack.add({
|
||||||
'https://github.com/catppuccin/nvim', -- color scheme
|
"https://github.com/catppuccin/nvim", -- color scheme
|
||||||
'https://github.com/nvim-mini/mini.pick', -- File picker, grep
|
"https://github.com/nvim-mini/mini.pick", -- File picker, grep
|
||||||
'https://github.com/nvim-mini/mini.pairs', -- Auto create {}, (), [] - pairs etc.
|
"https://github.com/nvim-mini/mini.pairs", -- Auto create {}, (), [] - pairs etc.
|
||||||
'https://github.com/nvim-mini/mini.notify', -- Popup notifications
|
"https://github.com/nvim-mini/mini.notify", -- Popup notifications
|
||||||
'https://github.com/nvim-mini/mini.completion', -- Autocomplete, needs snippets and icons
|
"https://github.com/nvim-mini/mini.completion", -- Autocomplete, needs snippets and icons
|
||||||
'https://github.com/nvim-mini/mini.snippets', -- Snippets
|
"https://github.com/nvim-mini/mini.snippets", -- Snippets
|
||||||
'https://github.com/nvim-mini/mini.icons', -- Icons
|
"https://github.com/nvim-mini/mini.icons", -- Icons
|
||||||
'https://github.com/nvim-mini/mini.cursorword', -- Highlight word under cursor
|
"https://github.com/nvim-mini/mini.cursorword", -- Highlight word under cursor
|
||||||
'https://github.com/nvim-mini/mini.hipatterns', -- Highlight todos and rgb colors
|
"https://github.com/nvim-mini/mini.hipatterns", -- Highlight todos and rgb colors
|
||||||
'https://github.com/nvim-mini/mini.statusline', -- Statusline at the bottom
|
"https://github.com/nvim-mini/mini.statusline", -- Statusline at the bottom
|
||||||
'https://github.com/neovim/nvim-lspconfig', -- Language servers
|
"https://github.com/neovim/nvim-lspconfig", -- Language servers
|
||||||
'https://github.com/mason-org/mason.nvim', -- LSP deps installer
|
"https://github.com/mason-org/mason.nvim", -- LSP deps installer
|
||||||
'https://github.com/mason-org/mason-lspconfig.nvim', -- Lets you install mason tooling using lsp names
|
"https://github.com/mason-org/mason-lspconfig.nvim", -- Lets you install mason tooling using lsp names
|
||||||
'https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim', -- Automatically install mason tooling
|
"https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim", -- Automatically install mason tooling
|
||||||
'https://github.com/folke/lazydev.nvim', -- Automatically resolve vim api paths.
|
"https://github.com/folke/lazydev.nvim", -- Automatically resolve vim api paths.
|
||||||
'https://github.com/folke/which-key.nvim', -- Shortcut hints (bar at the bottom when pressing space)
|
"https://github.com/folke/which-key.nvim", -- Shortcut hints (bar at the bottom when pressing space)
|
||||||
'https://github.com/nvim-lua/plenary.nvim', -- Helper lua functions, dep of todo-comments.
|
"https://github.com/nvim-lua/plenary.nvim", -- Helper lua functions, dep of todo-comments.
|
||||||
'https://github.com/nvim-treesitter/nvim-treesitter', -- Syntax highlighting
|
"https://github.com/nvim-treesitter/nvim-treesitter", -- Syntax highlighting
|
||||||
'https://github.com/nvim-treesitter/nvim-treesitter-context', -- Show sticky headers when looking at nested structures
|
"https://github.com/stevearc/oil.nvim", -- File explorer
|
||||||
'https://github.com/stevearc/oil.nvim', -- File explorer
|
|
||||||
"https://github.com/folke/snacks.nvim", -- Dep for claudecode
|
"https://github.com/folke/snacks.nvim", -- Dep for claudecode
|
||||||
"https://github.com/coder/claudecode.nvim", -- Claude code
|
"https://github.com/coder/claudecode.nvim", -- Claude code
|
||||||
|
"https://github.com/MeanderingProgrammer/render-markdown.nvim", -- Rendering markdown
|
||||||
|
"https://github.com/mfussenegger/nvim-dap", -- DAP support
|
||||||
|
"https://github.com/rcarriga/nvim-dap-ui", -- DAP UI
|
||||||
|
"https://github.com/nvim-neotest/nvim-nio", -- Asynchronous io
|
||||||
|
"https://github.com/jay-babu/mason-nvim-dap.nvim", -- Automatically install DAP adapters
|
||||||
|
"https://github.com/thehamsta/nvim-dap-virtual-text", -- Virtual text for nvim dap
|
||||||
|
"https://github.com/mfussenegger/nvim-dap-python", -- Python support for nvim-dap
|
||||||
|
"https://github.com/LunarVim/bigfile.nvim",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- SECTION: Colorscheme
|
-- SECTION: Colorscheme
|
||||||
vim.cmd("colorscheme catppuccin-mocha")
|
vim.cmd("colorscheme catppuccin-mocha")
|
||||||
|
|
||||||
-- SECTION: General plugin setup
|
-- SECTION: General plugin setup
|
||||||
|
require("bigfile").setup()
|
||||||
|
|
||||||
-- Folke
|
-- Folke
|
||||||
require("lazydev").setup()
|
require("lazydev").setup({
|
||||||
|
library = { "nvim-dap-ui" }, -- Add type checking for nvim-dap-ui
|
||||||
|
})
|
||||||
|
|
||||||
local wk = require("which-key")
|
local wk = require("which-key")
|
||||||
wk.setup()
|
wk.setup()
|
||||||
@@ -116,6 +124,104 @@ wk.add({
|
|||||||
{ "<leader>s", group = "[S]earch" },
|
{ "<leader>s", group = "[S]earch" },
|
||||||
{ "<leader>o", group = "Source current file", mode = { "n" } },
|
{ "<leader>o", group = "Source current file", mode = { "n" } },
|
||||||
{ "<leader>a", group = "AI/Claude Code" },
|
{ "<leader>a", group = "AI/Claude Code" },
|
||||||
|
{
|
||||||
|
"<leader>d",
|
||||||
|
group = "Debugger",
|
||||||
|
nowait = true,
|
||||||
|
remap = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>dt",
|
||||||
|
function()
|
||||||
|
require("dap").toggle_breakpoint()
|
||||||
|
end,
|
||||||
|
desc = "Toggle Breakpoint",
|
||||||
|
nowait = true,
|
||||||
|
remap = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>dc",
|
||||||
|
function()
|
||||||
|
require("dap").continue()
|
||||||
|
end,
|
||||||
|
desc = "Continue",
|
||||||
|
nowait = true,
|
||||||
|
remap = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>di",
|
||||||
|
function()
|
||||||
|
require("dap").step_into()
|
||||||
|
end,
|
||||||
|
desc = "Step Into",
|
||||||
|
nowait = true,
|
||||||
|
remap = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>do",
|
||||||
|
function()
|
||||||
|
require("dap").step_over()
|
||||||
|
end,
|
||||||
|
desc = "Step Over",
|
||||||
|
nowait = true,
|
||||||
|
remap = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>du",
|
||||||
|
function()
|
||||||
|
require("dap").step_out()
|
||||||
|
end,
|
||||||
|
desc = "Step Out",
|
||||||
|
nowait = true,
|
||||||
|
remap = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>dr",
|
||||||
|
function()
|
||||||
|
require("dap").repl.open()
|
||||||
|
end,
|
||||||
|
desc = "Open REPL",
|
||||||
|
nowait = true,
|
||||||
|
remap = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>dl",
|
||||||
|
function()
|
||||||
|
require("dap").run_last()
|
||||||
|
end,
|
||||||
|
desc = "Run Last",
|
||||||
|
nowait = true,
|
||||||
|
remap = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>dq",
|
||||||
|
function()
|
||||||
|
require("dap").terminate()
|
||||||
|
require("dapui").close()
|
||||||
|
require("nvim-dap-virtual-text").toggle()
|
||||||
|
end,
|
||||||
|
desc = "Terminate",
|
||||||
|
nowait = true,
|
||||||
|
remap = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>db",
|
||||||
|
function()
|
||||||
|
require("dap").list_breakpoints()
|
||||||
|
end,
|
||||||
|
desc = "List Breakpoints",
|
||||||
|
nowait = true,
|
||||||
|
remap = false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>de",
|
||||||
|
function()
|
||||||
|
require("dap").set_exception_breakpoints({ "all" })
|
||||||
|
end,
|
||||||
|
desc = "Set Exception Breakpoints",
|
||||||
|
nowait = true,
|
||||||
|
remap = false,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Mini
|
-- Mini
|
||||||
@@ -213,6 +319,69 @@ require("mason-tool-installer").setup({
|
|||||||
})
|
})
|
||||||
vim.lsp.enable({ "ts_ls", "vue_ls" })
|
vim.lsp.enable({ "ts_ls", "vue_ls" })
|
||||||
|
|
||||||
|
-- SECTION: DAP
|
||||||
|
|
||||||
|
local mason_dap = require("mason-nvim-dap")
|
||||||
|
local dap = require("dap")
|
||||||
|
local ui = require("dapui")
|
||||||
|
local dap_virtual_text = require("nvim-dap-virtual-text")
|
||||||
|
require('dap-python').setup("debugpy-adapter")
|
||||||
|
|
||||||
|
dap_virtual_text.setup({})
|
||||||
|
mason_dap.setup({
|
||||||
|
ensure_installed = { "cppdbg", "debugpy" },
|
||||||
|
automatic_installation = true,
|
||||||
|
handlers = {
|
||||||
|
function(config)
|
||||||
|
require("mason-nvim-dap").default_setup(config)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
dap.configurations = {
|
||||||
|
c = {
|
||||||
|
{
|
||||||
|
name = "Launch file",
|
||||||
|
type = "cppdbg",
|
||||||
|
request = "launch",
|
||||||
|
program = function()
|
||||||
|
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "\\", "file")
|
||||||
|
end,
|
||||||
|
cwd = "${workspaceFolder}",
|
||||||
|
stopAtEntry = false,
|
||||||
|
MIMode = "lldb",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "Attach to lldbserver :1234",
|
||||||
|
type = "cppdbg",
|
||||||
|
request = "launch",
|
||||||
|
MIMode = "lldb",
|
||||||
|
miDebuggerServerAddress = "localhost:1234",
|
||||||
|
miDebuggerPath = "/usr/bin/lldb",
|
||||||
|
cwd = "${workspaceFolder}",
|
||||||
|
program = function()
|
||||||
|
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "\\", "file")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
ui.setup()
|
||||||
|
|
||||||
|
vim.fn.sign_define("DapBreakpoint", { text = "🐞" })
|
||||||
|
|
||||||
|
dap.listeners.before.attach.dapui_config = function()
|
||||||
|
ui.open()
|
||||||
|
end
|
||||||
|
dap.listeners.before.launch.dapui_config = function()
|
||||||
|
ui.open()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_terminated.dapui_config = function()
|
||||||
|
ui.close()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_exited.dapui_config = function()
|
||||||
|
ui.close()
|
||||||
|
end
|
||||||
|
|
||||||
-- SECTION: Helpers
|
-- SECTION: Helpers
|
||||||
local function client_supports_method(client, method, bufnr)
|
local function client_supports_method(client, method, bufnr)
|
||||||
if vim.fn.has("nvim-0.11") == 1 then
|
if vim.fn.has("nvim-0.11") == 1 then
|
||||||
|
|||||||
55
sync-minikube-port.sh
Normal file
55
sync-minikube-port.sh
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
WINDOWS_USER=$(cmd.exe /c "echo %USERNAME%" 2>/dev/null | t -d '[:space:]\r')
|
||||||
|
WINDOWS_KUBECONFIG="/mnt/c/Uses/$WINDOWS_USER/.kube/config"
|
||||||
|
WSL_KUBECONFIG="$HOME/.kube/config"
|
||||||
|
|
||||||
|
if [ ! -f "$WINDOWS_KUBECONFIG" ]; then
|
||||||
|
echo "Eror: Windows kubeconfig not found at $WINDOWS_KUBECONFIG"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "$WSL_KUBECONFIG" ]; then
|
||||||
|
echo "Eror: WSL kubeconfig not found at $WSL_KUBECONFIG"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Extact the minikube server URL from the Windows kubeconfig
|
||||||
|
SERVER=$(gep -A5 'name: minikube' "$WINDOWS_KUBECONFIG" | grep 'server:' | awk '{print $2}' | tr -d '[:space:]')
|
||||||
|
|
||||||
|
if [ -z "$SERVER" ]; then
|
||||||
|
echo "Eror: Could not find minikube server entry in $WINDOWS_KUBECONFIG"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
PORT=$(echo "$SERVER" | gep -oP ':\K[0-9]+$')
|
||||||
|
|
||||||
|
if [ -z "$PORT" ]; then
|
||||||
|
echo "Eror: Could not parse port from server URL: $SERVER"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Found minikube sever: $SERVER (port $PORT)"
|
||||||
|
|
||||||
|
# Replace the pot in the WSL kubeconfig's minikube server entry
|
||||||
|
# This tagets only the minikube cluster block to avoid touching other clusters
|
||||||
|
CURRENT=$(gep -A5 'name: minikube' "$WSL_KUBECONFIG" | grep 'server:' | awk '{print $2}' | tr -d '[:space:]')
|
||||||
|
|
||||||
|
if [ -z "$CURRENT" ]; then
|
||||||
|
echo "Eror: Could not find minikube server entry in $WSL_KUBECONFIG"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
CURRENT_PORT=$(echo "$CURRENT" | gep -oP ':\K[0-9]+$')
|
||||||
|
|
||||||
|
if [ "$CURRENT_PORT" == "$PORT" ]; then
|
||||||
|
echo "Pot is already up to date ($PORT), nothing to do."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Patching WSL kubeconfig: pot $CURRENT_PORT -> $PORT"
|
||||||
|
|
||||||
|
# Use sed to eplace the old server URL with the new one (only the minikube server line)
|
||||||
|
sed -i "s|$CURRENT|$SERVER|g" "$WSL_KUBECONFIG"
|
||||||
|
|
||||||
|
echo "Done. WSL kubeconfig updated to $SERVER"
|
||||||
Reference in New Issue
Block a user