Compare commits

...

4 Commits

Author SHA1 Message Date
3c54a66066 Add layout for sf 2026-04-02 10:45:16 +02:00
d73cabb72d Merge 2026-03-30 07:51:27 +02:00
889b2c4cca Adding treesitter context 2026-03-30 07:48:32 +02:00
Zackarias Montell
dfa1b7c2fc work 2026-03-23 08:41:35 +01:00
3 changed files with 150 additions and 86 deletions

View File

@@ -15,6 +15,14 @@ function Set-Title {
Set-Alias -Name title -Value Set-Title Set-Alias -Name title -Value Set-Title
Set-Alias -Name python3 -Value python Set-Alias -Name python3 -Value python
function To-Gif {
param(
[string]$inputFilePath,
[string]$outputFilePath
)
ffmpeg -i $inputFilePath -vf "fps=10,scale=1080:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 $outputFilePath
}
# Functions # Functions
function d-up { function d-up {
@@ -45,6 +53,34 @@ function cdsf {
Set-Location "C:\repos\storefront" Set-Location "C:\repos\storefront"
} }
function cdsfdev {
cdsf
$cwd = (Get-Location).Path
$w = "wezterm"
$vimPane = $env:WEZTERM_PANE
function Send-Command($paneId, $cmd) {
& $w cli send-text --pane-id $paneId $cmd
& $w cli send-text --pane-id $paneId "`n"
}
Send-Command $vimPane "vim ."
$yarnPane = & $w cli split-pane --pane-id $vimPane --right --cwd $cwd
Start-Sleep -Milliseconds 300
Send-Command $yarnPane "yarn install && yarn dev"
$proxyPane = & $w cli split-pane --pane-id $yarnPane --bottom --cwd $cwd
Start-Sleep -Milliseconds 300
Send-Command $proxyPane ".\proxy-win.ps1"
$gitPane = & $w cli split-pane --pane-id $proxyPane --bottom --cwd $cwd
Start-Sleep -Milliseconds 300
Send-Command $gitPane "git status"
& $w cli activate-pane --pane-id $vimPane
}
function cdr { function cdr {
Set-Location "C:\repos" Set-Location "C:\repos"
} }
@@ -64,6 +100,11 @@ function card {
& "gpg" "--card-status" & "gpg" "--card-status"
} }
function spot {
title ncspot
ncspot
}
function Open-KubernetesDashboard { function Open-KubernetesDashboard {
Write-Host "Ensuring doctl.." Write-Host "Ensuring doctl.."
if ($os -eq 'Unix') { if ($os -eq 'Unix') {
@@ -152,7 +193,7 @@ Set-Alias -Name dash -Value Open-KubernetesDashboard
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
Set-Alias -Name cd-sf -Value cdsf Set-Alias -Name cd-sf -Value cdsf
Set-Alias -Name sf -Value cdsf Set-Alias -Name sf -Value cdsfdev
Set-Alias -Name cd-li -Value cdli Set-Alias -Name cd-li -Value cdli
Set-Alias -Name li -Value cdli Set-Alias -Name li -Value cdli
@@ -160,3 +201,7 @@ Set-Alias -Name notes -Value Open-Notes
# Set up docker environment # Set up docker environment
#$Env:DOCKER_HOST="ssh://wholteza@localhost:22/" #$Env:DOCKER_HOST="ssh://wholteza@localhost:22/"
# Set all files in .kube as kubeconfig paths.
# This allows for dynamic kubeconfig use.
$env:KUBECONFIG = (Get-ChildItem "$HOME\.kube" -File | ForEach-Object { $_.FullName }) -join ";"

View File

@@ -5,9 +5,9 @@ vim.o.tabstop = 2 -- 2 space tab width
vim.o.shiftwidth = 2 -- 2 space tab width vim.o.shiftwidth = 2 -- 2 space tab width
vim.o.swapfile = false -- Disable swap files (annoying) vim.o.swapfile = false -- Disable swap files (annoying)
vim.o.undofile = true -- Enable undo between sessions vim.o.undofile = true -- Enable undo between sessions
vim.o.mouse = 'a' -- Enable mouse support vim.o.mouse = "a" -- Enable mouse support
vim.o.showmode = false -- Don't show mode in status bar vim.o.showmode = false -- Don't show mode in status bar
vim.o.inccommand = 'split' -- Preview replace commands inline vim.o.inccommand = "split" -- Preview replace commands inline
vim.o.scrolloff = 20 -- Scroll if cursor is X lines to edge vim.o.scrolloff = 20 -- Scroll if cursor is X lines to edge
vim.o.confirm = true -- Add confirmation on some destructive actions vim.o.confirm = true -- Add confirmation on some destructive actions
vim.o.ignorecase = true -- Case insensitive search vim.o.ignorecase = true -- Case insensitive search
@@ -15,47 +15,66 @@ 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
vim.g.mapleader = ' ' -- Mapping leader to space. vim.g.mapleader = " " -- Mapping leader to space.
vim.g.maplocalleader = ' ' -- Mapping leader to space. vim.g.maplocalleader = " " -- Mapping leader to space.
vim.g.have_nerd_font = true -- Enable nerd font vim.g.have_nerd_font = true -- Enable nerd font
-- SECTION: Lazy settings -- SECTION: Lazy settings
-- INFO: Lines in this function will be executed after main event loop is free, prohibiting startup lag. -- INFO: Lines in this function will be executed after main event loop is free, prohibiting startup lag.
vim.schedule(function() vim.schedule(function()
vim.opt.clipboard = 'unnamedplus' -- Share clipboard with system, comment if you want to keep it separate. vim.opt.clipboard = "unnamedplus" -- Share clipboard with system, comment if you want to keep it separate.
end) end)
-- SECTION: Keybinds -- SECTION: Keybinds
-- Source current file, helpful when editing this file. -- Source current file, helpful when editing this file.
vim.keymap.set('n', '<leader>o', ':update<CR> :source<CR>') vim.keymap.set("n", "<leader>o", ":update<CR> :source<CR>")
-- Restart vim completely, you can then press CTRL + o to go back to the last file you had open. -- Restart vim completely, you can then press CTRL + o to go back to the last file you had open.
vim.keymap.set('n', '<leader>r', ':restart<CR>') vim.keymap.set("n", "<leader>r", ":restart<CR>")
-- Lets you use ESC to stop highlighting text that you have searched with '/' -- Lets you use ESC to stop highlighting text that you have searched with '/'
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>') vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
-- Format the current buffer using the active lsp -- Format the current buffer using the active lsp
vim.keymap.set('n', '<leader>f', vim.lsp.buf.format, { desc = "Format buffer" }) vim.keymap.set("n", "<leader>f", vim.lsp.buf.format, { desc = "Format buffer" })
-- Start the file picker in different modes -- Start the file picker in different modes
vim.keymap.set('n', '<leader>sf', function() vim.keymap.set("n", "<leader>sf", function()
require('mini.pick').builtin.files() require("mini.pick").builtin.files()
end, { desc = "Search files" }) end, { desc = "Search files" })
vim.keymap.set('n', '<leader>sg', ":Pick grep_live<CR>", { desc = "Search file contents" }) vim.keymap.set("n", "<leader>sg", ":Pick grep_live<CR>", { desc = "Search file contents" })
vim.keymap.set('n', '<leader>sh', ":Pick help<CR>", { desc = "Search help pages" }) vim.keymap.set("n", "<leader>sh", ":Pick help<CR>", { desc = "Search help pages" })
vim.keymap.set('n', '<leader>sr', ":Pick resume<CR>", { desc = "Resume last search" }) vim.keymap.set("n", "<leader>sr", ":Pick resume<CR>", { desc = "Resume last search" })
vim.keymap.set('n', '<leader>sb', ":Pick buffers<CR>", { desc = "Search buffers" }) vim.keymap.set("n", "<leader>sb", ":Pick buffers<CR>", { desc = "Search buffers" })
-- Get help with keybinds -- Get help with keybinds
vim.keymap.set('n', '<leader>?', ":WhichKey<CR>", { desc = "Show keybinds" }) vim.keymap.set("n", "<leader>?", ":WhichKey<CR>", { desc = "Show keybinds" })
-- File explorer -- File explorer
vim.keymap.set('n', '\\', ":Oil --float<CR>", { desc = "File explorer" }) vim.keymap.set("n", "\\", ":Oil --float<CR>", { desc = "File explorer" })
-- Ai
vim.keymap.set("n", "<leader>ac", "<cmd>ClaudeCode<cr>", { desc = "Toggle Claude" })
vim.keymap.set("n", "<leader>af", "<cmd>ClaudeCodeFocus<cr>", { desc = "Focus Claude" })
vim.keymap.set("n", "<leader>ar", "<cmd>ClaudeCode --resume<cr>", { desc = "Resume Claude" })
vim.keymap.set("n", "<leader>aC", "<cmd>ClaudeCode --continue<cr>", { desc = "Continue Claude" })
vim.keymap.set("n", "<leader>am", "<cmd>ClaudeCodeSelectModel<cr>", { desc = "Select Claude model" })
vim.keymap.set("n", "<leader>ab", "<cmd>ClaudeCodeAdd %<cr>", { desc = "Add current buffer" })
vim.keymap.set("v", "<leader>as", "<cmd>ClaudeCodeSend<cr>", { desc = "Send to Claude" })
vim.keymap.set("n", "<leader>aa", "<cmd>ClaudeCodeDiffAccept<cr>", { desc = "Accept diff" })
vim.keymap.set("n", "<leader>ad", "<cmd>ClaudeCodeDiffDeny<cr>", { desc = "Deny diff" })
-- File tree keymap (conditional on filetype)
vim.api.nvim_create_autocmd("FileType", {
pattern = { "NvimTree", "neo-tree", "oil", "minifiles", "netrw" },
callback = function(ev)
vim.keymap.set("n", "<leader>as", "<cmd>ClaudeCodeTreeAdd<cr>",
{ desc = "Add file", buffer = ev.buf })
end,
})
-- SECTION: Install packages -- SECTION: Install packages
vim.pack.add({ vim.pack.add({
@@ -77,7 +96,10 @@ vim.pack.add({
'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/coder/claudecode.nvim", -- Claude code
}) })
-- SECTION: Colorscheme -- SECTION: Colorscheme
@@ -88,59 +110,55 @@ vim.cmd("colorscheme catppuccin-mocha")
-- Folke -- Folke
require("lazydev").setup() require("lazydev").setup()
local wk = require('which-key') local wk = require("which-key")
wk.setup() wk.setup()
wk.add({ 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" },
}) })
-- require('todo-comments').setup({
-- keywords = {
-- SECTION = {
-- icon = "󰚟 ",
-- color = "hint",
-- }
-- }
-- })
-- Mini -- Mini
local MiniPicker = require('mini.pick').setup({ local MiniPicker = require("mini.pick").setup({
source = { source = {
show = require('mini.pick').default_show, show = require("mini.pick").default_show,
}, },
}) })
require('mini.pairs').setup() require("mini.pairs").setup()
require('mini.notify').setup() require("mini.notify").setup()
require('mini.icons').setup() require("mini.icons").setup()
MiniIcons.tweak_lsp_kind() MiniIcons.tweak_lsp_kind()
require('mini.snippets').setup() require("mini.snippets").setup()
require('mini.completion').setup() require("mini.completion").setup()
require('mini.cursorword').setup() require("mini.cursorword").setup()
require('mini.hipatterns').setup({ require("mini.hipatterns").setup({
highlighters = { highlighters = {
todo = { pattern = '%f[%w]()TODO()%f[%W]', group = 'MiniHipatternsTodo' }, todo = { pattern = "%f[%w]()TODO()%f[%W]", group = "MiniHipatternsTodo" },
section = { pattern = '%f[%w]()SECTION()%f[%W]', group = 'MiniHipatternsNote' }, section = { pattern = "%f[%w]()SECTION()%f[%W]", group = "MiniHipatternsNote" },
warning = { pattern = '%f[%w]()WARNING()%f[%W]', group = 'MiniHipatternsHack' }, warning = { pattern = "%f[%w]()WARNING()%f[%W]", group = "MiniHipatternsHack" },
error = { pattern = '%f[%w]()ERROR()%f[%W]', group = 'MiniHipatternsTodo' }, error = { pattern = "%f[%w]()ERROR()%f[%W]", group = "MiniHipatternsTodo" },
} },
}) })
require('mini.statusline').setup() require("mini.statusline").setup()
require('oil').setup() require("oil").setup()
require('nvim-treesitter').setup({ require("claudecode").setup()
auto_install = true
require("nvim-treesitter").setup({
auto_install = true,
})
require('treesitter-context').setup({
enable = true
}) })
local vue_language_server_path = vim.fn.stdpath('data') .. local vue_language_server_path = vim.fn.stdpath('data') ..
"/mason/packages/vue-language-server/node_modules/@vue/language-server" "/mason/packages/vue-language-server/node_modules/@vue/language-server"
local tsserver_filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' } local tsserver_filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' }
local vue_plugin = { local vue_plugin = {
name = '@vue/typescript-plugin', name = "@vue/typescript-plugin",
location = vue_language_server_path, location = vue_language_server_path,
languages = { 'vue' }, languages = { "vue" },
configNamespace = 'typescript', configNamespace = "typescript",
} }
local vtsls_config = { local vtsls_config = {
settings = { settings = {
@@ -166,39 +184,38 @@ local ts_ls_config = {
local vue_ls_config = {} local vue_ls_config = {}
-- If you are on most recent `nvim-lspconfig` -- If you are on most recent `nvim-lspconfig`
-- nvim 0.11 or above -- nvim 0.11 or above
vim.lsp.config('vtsls', vtsls_config) vim.lsp.config("vtsls", vtsls_config)
vim.lsp.config('vue_ls', vue_ls_config) vim.lsp.config("vue_ls", vue_ls_config)
vim.lsp.config('ts_ls', ts_ls_config) vim.lsp.config("ts_ls", ts_ls_config)
-- LSP Language Server -- LSP Language Server
require("mason").setup() require("mason").setup()
require("mason-lspconfig").setup({ require("mason-lspconfig").setup({
-- Install lsp deps here -- Install lsp deps here
ensure_installed = { ensure_installed = {
'lua_ls', "lua_ls",
'ts_ls', "ts_ls",
'vue_ls', "vue_ls",
'ansiblels', "ansiblels",
'eslint', "eslint",
}, },
automatic_enable = { automatic_enable = {
exclude = { 'ts_ls', 'vue_ls' } exclude = { "ts_ls", "vue_ls" },
} },
}) })
require("mason-tool-installer").setup({ require("mason-tool-installer").setup({
-- Install deps of lsp deps here -- Install deps of lsp deps here
ensure_installed = { ensure_installed = {
'tree-sitter-cli', "tree-sitter-cli",
'markdownlint', "markdownlint",
'vue-language-server' "vue-language-server",
} },
}) })
vim.lsp.enable({ 'ts_ls', 'vue_ls' }) vim.lsp.enable({ "ts_ls", "vue_ls" })
-- 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
return client:supports_method(method, bufnr) return client:supports_method(method, bufnr)
else else
return client.supports_method(method, { bufnr = bufnr }) return client.supports_method(method, { bufnr = bufnr })
@@ -206,16 +223,16 @@ local function client_supports_method(client, method, bufnr)
end end
-- SECTION: Autocommands -- SECTION: Autocommands
vim.api.nvim_create_autocmd('TextYankPost', { vim.api.nvim_create_autocmd("TextYankPost", {
desc = 'Highlight when yanking (copying) text', desc = "Highlight when yanking (copying) text",
group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }), group = vim.api.nvim_create_augroup("highlight-yank", { clear = true }),
callback = function() callback = function()
vim.highlight.on_yank() vim.highlight.on_yank()
end, end,
}) })
-- Actions on LspAttach -- Actions on LspAttach
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup('my.lsp', {}), group = vim.api.nvim_create_augroup("my.lsp", {}),
callback = function(ev) callback = function(ev)
local client = assert(vim.lsp.get_client_by_id(ev.data.client_id)) local client = assert(vim.lsp.get_client_by_id(ev.data.client_id))
@@ -233,20 +250,20 @@ vim.api.nvim_create_autocmd('LspAttach', {
-- end -- end
-- Swap out the icons in the leftmost column and show inlay hints -- Swap out the icons in the leftmost column and show inlay hints
vim.diagnostic.config { vim.diagnostic.config({
severity_sort = true, severity_sort = true,
float = { border = 'rounded', source = 'if_many' }, float = { border = "rounded", source = "if_many" },
underline = { severity = vim.diagnostic.severity.ERROR }, underline = { severity = vim.diagnostic.severity.ERROR },
signs = vim.g.have_nerd_font and { signs = vim.g.have_nerd_font and {
text = { text = {
[vim.diagnostic.severity.ERROR] = '󰅚 ', [vim.diagnostic.severity.ERROR] = "󰅚 ",
[vim.diagnostic.severity.WARN] = '󰀪 ', [vim.diagnostic.severity.WARN] = "󰀪 ",
[vim.diagnostic.severity.INFO] = '󰋽 ', [vim.diagnostic.severity.INFO] = "󰋽 ",
[vim.diagnostic.severity.HINT] = '󰌶 ', [vim.diagnostic.severity.HINT] = "󰌶 ",
}, },
} or {}, } or {},
virtual_text = { virtual_text = {
source = 'if_many', source = "if_many",
spacing = 2, spacing = 2,
format = function(diagnostic) format = function(diagnostic)
local diagnostic_message = { local diagnostic_message = {
@@ -258,6 +275,6 @@ vim.api.nvim_create_autocmd('LspAttach', {
return diagnostic_message[diagnostic.severity] return diagnostic_message[diagnostic.severity]
end, end,
}, },
} })
end, end,
}) })

View File

@@ -159,7 +159,8 @@ $packages = @(
"GnuWin32.gzip", "GnuWin32.gzip",
"rustlang.rustup", "rustlang.rustup",
"Mozilla.Firefox", "Mozilla.Firefox",
"SlackTechnologies.Slack" "SlackTechnologies.Slack",
"Anthropic.ClaudeCode"
) )
$ExtraPackages = @( $ExtraPackages = @(
"mRemoteNG.mRemoteNG", "mRemoteNG.mRemoteNG",
@@ -189,7 +190,8 @@ if ($Flags.WingetEnabled)
$toolPaths = @( $toolPaths = @(
"C:\ProgramData\chocolatey\tools", "C:\ProgramData\chocolatey\tools",
"C:\Program Files (x86)\GnuWin32\bin", "C:\Program Files (x86)\GnuWin32\bin",
"$env:LOCALAPPDATA\bob_bin" "$env:LOCALAPPDATA\bob_bin",
"$env:LOCALAPPDATA\Programs\Git\git-bash.exe"
) )
$currentPath = [Environment]::GetEnvironmentVariable("Path", "User") $currentPath = [Environment]::GetEnvironmentVariable("Path", "User")
@@ -235,7 +237,7 @@ if ($Flags.ChocoEnabled)
Write-Divider Write-Divider
Write-Host "Installing Chocolatey Packages" Write-Host "Installing Chocolatey Packages"
## Nvim requirements from choco, needs to be run as admin ## Nvim requirements from choco, needs to be run as admin
Start-Process pwsh -Verb RunAs -ArgumentList "-Command", "choco install make unzip ripgrep zig" Start-Process pwsh -Verb RunAs -ArgumentList "-Command", "choco install make unzip ripgrep zig kubelogin"
} }
if ($Flags.PipEnabled) if ($Flags.PipEnabled)