my dotfiles for arch

neovim

+2198
+56
private_dot_config/nvim/Session.vim
··· 1 + let SessionLoad = 1 2 + let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1 3 + let v:this_session=expand("<sfile>:p") 4 + silent only 5 + silent tabonly 6 + cd ~/.config/nvim 7 + if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == '' 8 + let s:wipebuf = bufnr('%') 9 + endif 10 + let s:shortmess_save = &shortmess 11 + if &shortmess =~ 'A' 12 + set shortmess=aoOA 13 + else 14 + set shortmess=aoO 15 + endif 16 + badd +198 lua/thomasgen/lazy/mini.lua 17 + badd +1 lua/thomasgen/lazy/telescope.lua 18 + badd +3 lua/thomasgen/lazy/colors.lua 19 + badd +1 ~/.config/nvim/lua/thomasgen/lazy/alpha.lua 20 + argglobal 21 + %argdel 22 + edit ~/.config/nvim/lua/thomasgen/lazy/alpha.lua 23 + argglobal 24 + balt lua/thomasgen/lazy/mini.lua 25 + setlocal fdm=manual 26 + setlocal fde=0 27 + setlocal fmr={{{,}}} 28 + setlocal fdi=# 29 + setlocal fdl=0 30 + setlocal fml=1 31 + setlocal fdn=20 32 + setlocal fen 33 + silent! normal! zE 34 + let &fdl = &fdl 35 + let s:l = 10 - ((9 * winheight(0) + 29) / 59) 36 + if s:l < 1 | let s:l = 1 | endif 37 + keepjumps exe s:l 38 + normal! zt 39 + keepjumps 10 40 + normal! 0 41 + tabnext 1 42 + if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal' 43 + silent exe 'bwipe ' . s:wipebuf 44 + endif 45 + unlet! s:wipebuf 46 + set winheight=1 winwidth=20 47 + let &shortmess = s:shortmess_save 48 + let s:sx = expand("<sfile>:p:r")."x.vim" 49 + if filereadable(s:sx) 50 + exe "source " . fnameescape(s:sx) 51 + endif 52 + let &g:so = s:so_save | let &g:siso = s:siso_save 53 + nohlsearch 54 + doautoall SessionLoadPost 55 + unlet SessionLoad 56 + " vim: set ft=vim :
+1
private_dot_config/nvim/init.lua
··· 1 + require("thomasgen")
+38
private_dot_config/nvim/lazy-lock.json
··· 1 + { 2 + "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, 3 + "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, 4 + "chezmoi.nvim": { "branch": "main", "commit": "f5614261b77cb17df72ba2c4fdbc31f7ee42bc6c" }, 5 + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, 6 + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 7 + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, 8 + "codecompanion.nvim": { "branch": "main", "commit": "f20ebfbaf64a1c6d2a3268a80431df697a4d2bbe" }, 9 + "codeium.vim": { "branch": "main", "commit": "fc5a68d6273715f13a1257f02a63d668604d9f27" }, 10 + "conform.nvim": { "branch": "master", "commit": "cd75be867f2331b22905f47d28c0c270a69466aa" }, 11 + "fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" }, 12 + "gitsigns.nvim": { "branch": "main", "commit": "39b5b6f48bde0595ce68007ffce408c5d7ac1f79" }, 13 + "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, 14 + "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, 15 + "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, 16 + "marks.nvim": { "branch": "master", "commit": "bb25ae3f65f504379e3d08c8a02560b76eaf91e8" }, 17 + "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, 18 + "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, 19 + "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, 20 + "mini.icons": { "branch": "main", "commit": "54686be7d58807906cb2c8c2216e0bf9c044f19a" }, 21 + "mini.nvim": { "branch": "main", "commit": "73af55e44865f2ede67a772b0972a5d34dcedd0e" }, 22 + "multicursor.nvim": { "branch": "1.0", "commit": "88e4e27b021dce741945856ab6f6640b198ea425" }, 23 + "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, 24 + "nvim-lspconfig": { "branch": "master", "commit": "cf97d2485fc3f6d4df1b79a3ea183e24c272215e" }, 25 + "nvim-treesitter": { "branch": "master", "commit": "caf275382f91ec8a2498d455c4d7d3fd0265ebd3" }, 26 + "nvim-treesitter-context": { "branch": "master", "commit": "a45e576526f92766a05726ea3da809e9998c9694" }, 27 + "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, 28 + "oil.nvim": { "branch": "master", "commit": "8ea40b5506115b6d355e304dd9ee5089f7d78601" }, 29 + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, 30 + "rose-pine": { "branch": "main", "commit": "91548dca53b36dbb9d36c10f114385f759731be1" }, 31 + "snacks.nvim": { "branch": "main", "commit": "974bccb126b6b5d7170c519c380207069d23f557" }, 32 + "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, 33 + "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, 34 + "vim-abolish": { "branch": "master", "commit": "dcbfe065297d31823561ba787f51056c147aa682" }, 35 + "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, 36 + "vim-matchup": { "branch": "master", "commit": "1535a769d5dca851fe7d41b0be95f7c7203a4bef" }, 37 + "vim-suda": { "branch": "master", "commit": "9adda7d195222d4e2854efb2a88005a120296c47" } 38 + }
+41
private_dot_config/nvim/lua/thomasgen/init.lua
··· 1 + require("thomasgen.set") 2 + require("thomasgen.remap") 3 + require("thomasgen.lazy_init") 4 + 5 + local augroup = vim.api.nvim_create_augroup 6 + local ThomasgenGroup = augroup('Thomasgen', {}) 7 + 8 + local autocmd = vim.api.nvim_create_autocmd 9 + local yank_group = augroup('HighlightYank', {}) 10 + 11 + function R(name) 12 + require("plenary.reload").reload_module(name) 13 + end 14 + 15 + vim.filetype.add({ 16 + extension = { 17 + templ = 'templ', 18 + } 19 + }) 20 + 21 + autocmd('TextYankPost', { 22 + group = yank_group, 23 + pattern = '*', 24 + callback = function() 25 + vim.highlight.on_yank({ 26 + higroup = 'IncSearch', 27 + timeout = 100, 28 + }) 29 + end, 30 + }) 31 + 32 + autocmd({ "BufWritePre" }, { 33 + group = ThomasgenGroup, 34 + pattern = "*", 35 + command = [[%s/\s\+$//e]], 36 + }) 37 + 38 + -- vim.g.netrw_browse_split = 0 39 + -- vim.g.netrw_banner = 0 40 + vim.g.netrw_winsize = 25 41 + vim.g.netrw_bufsettings = 'noma nomod nu rnu nobl nowrap ro'
+4
private_dot_config/nvim/lua/thomasgen/lazy/abolish.lua
··· 1 + return { 2 + "tpope/vim-abolish", 3 + enabled = true, 4 + }
+135
private_dot_config/nvim/lua/thomasgen/lazy/alpha.lua
··· 1 + return { 2 + "goolord/alpha-nvim", 3 + dependencies = { 4 + "echasnovski/mini.icons", 5 + "nvim-lua/plenary.nvim", 6 + }, 7 + config = function() 8 + local function getLen(str, start_pos) 9 + local byte = string.byte(str, start_pos) 10 + if not byte then 11 + return nil 12 + end 13 + 14 + return (byte < 0x80 and 1) or (byte < 0xE0 and 2) or (byte < 0xF0 and 3) or (byte < 0xF8 and 4) or 1 15 + end 16 + 17 + local function colorize(header, header_color_map, colors) 18 + for letter, color in pairs(colors) do 19 + local color_name = "AlphaJemuelKwelKwelWalangTatay" .. letter 20 + vim.api.nvim_set_hl(0, color_name, color) 21 + colors[letter] = color_name 22 + end 23 + 24 + local colorized = {} 25 + 26 + for i, line in ipairs(header_color_map) do 27 + local colorized_line = {} 28 + local pos = 0 29 + 30 + for j = 1, #line do 31 + local start = pos 32 + pos = pos + getLen(header[i], start + 1) 33 + 34 + local color_name = colors[line:sub(j, j)] 35 + if color_name then 36 + table.insert(colorized_line, { color_name, start, pos }) 37 + end 38 + end 39 + 40 + table.insert(colorized, colorized_line) 41 + end 42 + 43 + return colorized 44 + end 45 + 46 + local alpha_c = function() 47 + local alpha = require("alpha") 48 + 49 + local dashboard = require("alpha.themes.dashboard") 50 + 51 + local header = { 52 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 53 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 54 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 55 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 56 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 57 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 58 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 59 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 60 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 61 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 62 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 63 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 64 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 65 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 66 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 67 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 68 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 69 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 70 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 71 + [[ ██████████████████████████████████████████████████████████████████████████████████████████████████████ ]], 72 + } 73 + 74 + local color_map = { 75 + [[ WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBWWWWWWWWWWWWWW ]], 76 + [[ RRRRWWWWWWWWWWWWWWWWRRRRRRRRRRRRRRRRWWWWWWWWWWWWWWWWBBPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPBBWWWWWWWWWWWW ]], 77 + [[ RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRBBPPPPPPHHHHHHHHHHHHHHHHHHHHHHHHHHPPPPPPBBWWWWWWWWWW ]], 78 + [[ RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRBBPPPPHHHHHHHHHHHHFFHHHHFFHHHHHHHHHHPPPPBBWWWWWWWWWW ]], 79 + [[ OOOORRRRRRRRRRRRRRRROOOOOOOOOOOOOOOORRRRRRRRRRRRRRBBPPHHHHFFHHHHHHHHHHHHHHHHHHHHHHHHHHHHPPBBWWWWWWWWWW ]], 80 + [[ OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBBPPHHHHHHHHHHHHHHHHHHHHBBBBHHHHFFHHHHPPBBWWBBBBWWWW ]], 81 + [[ OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBBPPHHHHHHHHHHHHHHHHHHBBMMMMBBHHHHHHHHPPBBBBMMMMBBWW ]], 82 + [[ YYYYOOOOOOOOOOOOOOOOYYYYYYYYYYYYYYYYOOBBBBBBBBOOOOBBPPHHHHHHHHHHHHFFHHHHBBMMMMMMBBHHHHHHPPBBMMMMMMBBWW ]], 83 + [[ YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYBBMMMMBBBBOOBBPPHHHHHHHHHHHHHHHHHHBBMMMMMMMMBBBBBBBBMMMMMMMMBBWW ]], 84 + [[ YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYBBBBMMMMBBBBBBPPHHHHHHFFHHHHHHHHHHBBMMMMMMMMMMMMMMMMMMMMMMMMBBWW ]], 85 + [[ GGGGYYYYYYYYYYYYYYYYGGGGGGGGGGGGGGGGYYYYBBBBMMMMBBBBPPHHHHHHHHHHHHHHFFBBMMMMMMMMMMMMMMMMMMMMMMMMMMMMBB ]], 86 + [[ GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGBBBBMMMMBBPPHHFFHHHHHHHHHHHHBBMMMMMMCCBBMMMMMMMMMMCCBBMMMMBB ]], 87 + [[ GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGBBBBBBBBPPHHHHHHHHHHHHHHHHBBMMMMMMBBBBMMMMMMBBMMBBBBMMMMBB ]], 88 + [[ UUUUGGGGGGGGGGGGGGGGUUUUUUUUUUUUUUUUGGGGGGGGGGGGBBBBPPHHHHHHHHHHFFHHHHBBMMRRRRMMMMMMMMMMMMMMMMMMRRRRBB ]], 89 + [[ UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUBBPPPPHHFFHHHHHHHHHHBBMMRRRRMMBBMMMMBBMMMMBBMMRRRRBB ]], 90 + [[ UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUBBPPPPPPHHHHHHHHHHHHHHBBMMMMMMBBBBBBBBBBBBBBMMMMBBWW ]], 91 + [[ VVVVUUUUUUUUUUUUUUUUVVVVVVVVVVVVVVVVUUUUUUUUUUUUBBBBBBPPPPPPPPPPPPPPPPPPPPBBMMMMMMMMMMMMMMMMMMMMBBWWWW ]], 92 + [[ VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVBBMMMMMMBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBWWWWWW ]], 93 + [[ VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVBBMMMMBBBBWWBBMMMMBBWWWWWWWWWWBBMMMMBBWWBBMMMMBBWWWWWWWW ]], 94 + [[ WWWWVVVVVVVVVVVVVVVVWWWWWWWWWWWWWWWWVVVVVVVVVVBBBBBBBBWWWWBBBBBBWWWWWWWWWWWWWWBBBBBBWWWWBBBBWWWWWWWWWW ]], 95 + } 96 + 97 + local palette = require("rose-pine.palette") 98 + 99 + local colors = { 100 + ["W"] = { fg = palette.base }, 101 + ["C"] = { fg = palette.text }, 102 + ["B"] = { fg = palette.surface }, 103 + ["R"] = { fg = palette.love }, 104 + ["O"] = { fg = palette.rose }, 105 + ["Y"] = { fg = palette.gold }, 106 + ["G"] = { fg = palette.foam }, 107 + ["U"] = { fg = palette.pine }, 108 + ["P"] = { fg = "#d7c08d" }, -- Using Yellow color (as specified in original) 109 + ["H"] = { fg = palette.iris }, 110 + ["F"] = { fg = palette.love }, 111 + ["M"] = { fg = palette.subtle }, 112 + ["V"] = { fg = palette.iris }, 113 + } 114 + dashboard.section.header.val = header 115 + dashboard.section.header.opts = { 116 + hl = colorize(header, color_map, colors), 117 + position = "center", 118 + } 119 + 120 + dashboard.section.buttons.val = { 121 + dashboard.button("n", " New file", "<Cmd>ene <CR>"), 122 + dashboard.button("SPC p f", " Find file"), 123 + dashboard.button("SPC w q", " Quit"), 124 + } 125 + for _, a in ipairs(dashboard.section.buttons.val) do 126 + a.opts.width = 49 127 + a.opts.cursor = -2 128 + end 129 + 130 + alpha.setup(dashboard.config) 131 + end 132 + 133 + alpha_c() 134 + end, 135 + }
+12
private_dot_config/nvim/lua/thomasgen/lazy/animate.lua
··· 1 + return { 2 + 'echasnovski/mini.animate', 3 + version = false, 4 + enabled = false, 5 + config = function() 6 + require('mini.animate').setup({ 7 + cursor = { 8 + enable = false 9 + } 10 + }) 11 + end 12 + }
+116
private_dot_config/nvim/lua/thomasgen/lazy/cmp.lua
··· 1 + return { -- Autocompletion 2 + "hrsh7th/nvim-cmp", 3 + event = "InsertEnter", 4 + dependencies = { 5 + -- Snippet Engine & its associated nvim-cmp source 6 + { 7 + "L3MON4D3/LuaSnip", 8 + build = (function() 9 + -- Build Step is needed for regex support in snippets. 10 + -- This step is not supported in many windows environments. 11 + -- Remove the below condition to re-enable on windows. 12 + if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then 13 + return 14 + end 15 + return "make install_jsregexp" 16 + end)(), 17 + dependencies = { 18 + -- `friendly-snippets` contains a variety of premade snippets. 19 + -- See the README about individual language/framework/plugin snippets: 20 + -- https://github.com/rafamadriz/friendly-snippets 21 + -- { 22 + -- 'rafamadriz/friendly-snippets', 23 + -- config = function() 24 + -- require('luasnip.loaders.from_vscode').lazy_load() 25 + -- end, 26 + -- }, 27 + }, 28 + }, 29 + "saadparwaiz1/cmp_luasnip", 30 + 31 + -- Adds other completion capabilities. 32 + -- nvim-cmp does not ship with all sources by default. They are split 33 + -- into multiple repos for maintenance purposes. 34 + "hrsh7th/cmp-nvim-lsp", 35 + "hrsh7th/cmp-path", 36 + }, 37 + config = function() 38 + -- See `:help cmp` 39 + local cmp = require("cmp") 40 + local luasnip = require("luasnip") 41 + luasnip.config.setup({}) 42 + 43 + cmp.setup({ 44 + snippet = { 45 + expand = function(args) 46 + luasnip.lsp_expand(args.body) 47 + end, 48 + }, 49 + completion = { completeopt = "menu,menuone,noinsert" }, 50 + 51 + -- For an understanding of why these mappings were 52 + -- chosen, you will need to read `:help ins-completion` 53 + -- 54 + -- No, but seriously. Please read `:help ins-completion`, it is really good! 55 + mapping = cmp.mapping.preset.insert({ 56 + -- Select the [n]ext item 57 + ["<C-n>"] = cmp.mapping.select_next_item(), 58 + -- Select the [p]revious item 59 + ["<C-p>"] = cmp.mapping.select_prev_item(), 60 + 61 + -- Scroll the documentation window [b]ack / [f]orward 62 + ["<C-b>"] = cmp.mapping.scroll_docs(-4), 63 + ["<C-f>"] = cmp.mapping.scroll_docs(4), 64 + 65 + -- Accept ([y]es) the completion. 66 + -- This will auto-import if your LSP supports it. 67 + -- This will expand snippets if the LSP sent a snippet. 68 + ["<C-y>"] = cmp.mapping.confirm({ select = true }), 69 + 70 + -- If you prefer more traditional completion keymaps, 71 + -- you can uncomment the following lines 72 + --['<CR>'] = cmp.mapping.confirm { select = true }, 73 + --['<Tab>'] = cmp.mapping.select_next_item(), 74 + --['<S-Tab>'] = cmp.mapping.select_prev_item(), 75 + 76 + -- Manually trigger a completion from nvim-cmp. 77 + -- Generally you don't need this, because nvim-cmp will display 78 + -- completions whenever it has completion options available. 79 + ["<C-Space>"] = cmp.mapping.complete({}), 80 + 81 + -- Think of <c-l> as moving to the right of your snippet expansion. 82 + -- So if you have a snippet that's like: 83 + -- function $name($args) 84 + -- $body 85 + -- end 86 + -- 87 + -- <c-l> will move you to the right of each of the expansion locations. 88 + -- <c-h> is similar, except moving you backwards. 89 + ["<C-l>"] = cmp.mapping(function() 90 + if luasnip.expand_or_locally_jumpable() then 91 + luasnip.expand_or_jump() 92 + end 93 + end, { "i", "s" }), 94 + ["<C-h>"] = cmp.mapping(function() 95 + if luasnip.locally_jumpable(-1) then 96 + luasnip.jump(-1) 97 + end 98 + end, { "i", "s" }), 99 + 100 + -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: 101 + -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps 102 + }), 103 + sources = { 104 + {name = "cody" }, 105 + { 106 + name = "lazydev", 107 + -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it 108 + group_index = 0, 109 + }, 110 + { name = "nvim_lsp" }, 111 + { name = "luasnip" }, 112 + { name = "path" }, 113 + }, 114 + }) 115 + end, 116 + }
+19
private_dot_config/nvim/lua/thomasgen/lazy/codecompanion.lua
··· 1 + return { 2 + "olimorris/codecompanion.nvim", 3 + dependencies = { 4 + "nvim-lua/plenary.nvim", 5 + "nvim-treesitter/nvim-treesitter", 6 + }, 7 + config = function() 8 + require("codecompanion").setup({ 9 + strategies = { 10 + chat = { 11 + adapter = "anthropic", 12 + }, 13 + inline = { 14 + adapter = "anthropic", 15 + }, 16 + }, 17 + }) 18 + end, 19 + }
+25
private_dot_config/nvim/lua/thomasgen/lazy/codeium.lua
··· 1 + return { 2 + "Exafunction/codeium.vim", 3 + -- enabled = false, 4 + config = function() 5 + local map = function(keys, func, desc, mode) 6 + mode = mode or "n" 7 + vim.keymap.set(mode, keys, func, { desc = desc }) 8 + end 9 + 10 + map("<leader>cd", function() 11 + vim.cmd("CodeiumDisable") 12 + vim.notify("Codeium disabled", vim.log.levels.INFO, { title = "Codeium" }) 13 + end, "Disable Codeium") 14 + 15 + map("<leader>ce", function() 16 + vim.cmd("CodeiumEnable") 17 + vim.notify("Codeium enabled", vim.log.levels.INFO, { title = "Codeium" }) 18 + end, "Enable Codeium") 19 + 20 + map("<leader>ct", function() 21 + vim.cmd("CodeiumToggle") 22 + vim.notify("Codeium toggled", vim.log.levels.INFO, { title = "Codeium" }) 23 + end, "Toggle Codeium") 24 + end, 25 + }
+89
private_dot_config/nvim/lua/thomasgen/lazy/colors.lua
··· 1 + return { 2 + { 3 + "rose-pine/neovim", 4 + name = "rose-pine", 5 + config = function() 6 + vim.opt.laststatus = 2 -- Or 3 for global statusline 7 + vim.opt.statusline = " %f %m %= %l:%c ♥ " 8 + 9 + require("rose-pine").setup({ 10 + variant = "moon", -- auto, main, moon, or dawn 11 + dark_variant = "moon", -- main, moon, or dawn 12 + dim_inactive_windows = false, 13 + extend_background_behind_borders = true, 14 + 15 + enable = { 16 + terminal = true, 17 + legacy_highlights = true, -- Improve compatibility for previous versions of Neovim 18 + migrations = true, -- Handle deprecated options automatically 19 + }, 20 + 21 + styles = { 22 + bold = true, 23 + italic = true, 24 + transparency = false, 25 + }, 26 + 27 + groups = { 28 + border = "muted", 29 + link = "iris", 30 + panel = "surface", 31 + 32 + error = "love", 33 + hint = "iris", 34 + info = "foam", 35 + note = "pine", 36 + todo = "rose", 37 + warn = "gold", 38 + 39 + git_add = "foam", 40 + git_change = "rose", 41 + git_delete = "love", 42 + git_dirty = "rose", 43 + git_ignore = "muted", 44 + git_merge = "iris", 45 + git_rename = "pine", 46 + git_stage = "iris", 47 + git_text = "rose", 48 + git_untracked = "subtle", 49 + 50 + h1 = "iris", 51 + h2 = "foam", 52 + h3 = "rose", 53 + h4 = "gold", 54 + h5 = "pine", 55 + h6 = "foam", 56 + }, 57 + 58 + highlight_groups = { 59 + -- Comment = { fg = "foam" }, 60 + -- VertSplit = { fg = "muted", bg = "muted" }, 61 + StatusLine = { fg = "love", bg = "love", blend = 10 }, 62 + StatusLineNC = { fg = "subtle", bg = "surface" }, 63 + 64 + -- Transparent Telescope 65 + TelescopeBorder = { fg = "highlight_high", bg = "none" }, 66 + TelescopeNormal = { bg = "none" }, 67 + TelescopePromptNormal = { bg = "base" }, 68 + TelescopeResultsNormal = { fg = "subtle", bg = "none" }, 69 + TelescopeSelection = { fg = "text", bg = "base" }, 70 + TelescopeSelectionCaret = { fg = "rose", bg = "rose" }, 71 + }, 72 + 73 + before_highlight = function(group, highlight, palette) 74 + -- Disable all undercurls 75 + -- if highlight.undercurl then 76 + -- highlight.undercurl = false 77 + -- end 78 + -- 79 + -- Change palette colour 80 + -- if highlight.fg == palette.pine then 81 + -- highlight.fg = palette.foam 82 + -- end 83 + end, 84 + }) 85 + 86 + vim.cmd("colorscheme rose-pine") 87 + end, 88 + }, 89 + }
+7
private_dot_config/nvim/lua/thomasgen/lazy/comment.lua
··· 1 + return { 2 + "numToStr/Comment.nvim", 3 + enabled = false, 4 + opts = { 5 + -- add any options here 6 + }, 7 + }
+66
private_dot_config/nvim/lua/thomasgen/lazy/conform.lua
··· 1 + return { 2 + "stevearc/conform.nvim", 3 + event = { "BufReadPre", "BufNewFile" }, 4 + config = function() 5 + local conform = require("conform") 6 + 7 + conform.setup({ 8 + formatters_by_ft = { 9 + javascript = { "prettier" }, 10 + typescript = { "prettier" }, 11 + javascriptreact = { "prettier" }, 12 + typescriptreact = { "prettier" }, 13 + svelte = { "prettier" }, 14 + vue = { "prettier" }, 15 + css = { "prettier" }, 16 + html = { "prettier" }, 17 + json = { "prettier" }, 18 + yaml = { "prettier" }, 19 + markdown = { "prettier" }, 20 + graphql = { "prettier" }, 21 + lua = { "stylua" }, 22 + python = { "isort", "black" }, 23 + astro = { "prettier" }, 24 + nix = { "alejandra" } 25 + }, 26 + format_on_save = function(bufnr) 27 + -- Disable with a global or buffer-local variable 28 + if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then 29 + return 30 + end 31 + return { timeout_ms = 1000, lsp_format = "fallback" } 32 + end, 33 + }) 34 + 35 + vim.api.nvim_create_user_command("Format", function(args) 36 + local range = nil 37 + if args.count ~= -1 then 38 + local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1] 39 + range = { 40 + start = { args.line1, 0 }, 41 + ["end"] = { args.line2, end_line:len() }, 42 + } 43 + end 44 + require("conform").format({ async = true, lsp_fallback = true, range = range }) 45 + end, { range = true }) 46 + 47 + vim.api.nvim_create_user_command("FormatDisable", function(args) 48 + if args.bang then 49 + -- FormatDisable! will disable formatting just for this buffer 50 + vim.b.disable_autoformat = true 51 + else 52 + vim.g.disable_autoformat = true 53 + end 54 + end, { 55 + desc = "Disable autoformat-on-save", 56 + bang = true, 57 + }) 58 + 59 + vim.api.nvim_create_user_command("FormatEnable", function() 60 + vim.b.disable_autoformat = false 61 + vim.g.disable_autoformat = false 62 + end, { 63 + desc = "Re-enable autoformat-on-save", 64 + }) 65 + end, 66 + }
+10
private_dot_config/nvim/lua/thomasgen/lazy/gitblame.lua
··· 1 + return { 2 + "f-person/git-blame.nvim", 3 + enabled = false, 4 + config = function() 5 + require("gitblame").setup({ enabled = false }) 6 + vim.keymap.set("n", "<leader>gb", ":GitBlameToggle<CR>", { 7 + desc = "Toggle git blame", 8 + }) 9 + end, 10 + }
+51
private_dot_config/nvim/lua/thomasgen/lazy/gitsigns.lua
··· 1 + return { 2 + "lewis6991/gitsigns.nvim", 3 + config = function(bufnr) 4 + require("gitsigns").setup({ 5 + on_attach = function(bufnr) 6 + local gitsigns = require("gitsigns") 7 + 8 + local function map(mode, l, r, opts) 9 + opts = opts or {} 10 + opts.buffer = bufnr 11 + vim.keymap.set(mode, l, r, opts) 12 + end 13 + 14 + -- Navigation 15 + -- map('n', ']c', function() 16 + -- if vim.wo.diff then 17 + -- vim.cmd.normal({ ']c', bang = true }) 18 + -- else 19 + -- gitsigns.nav_hunk('next') 20 + -- end 21 + -- end) 22 + 23 + -- map('n', '[c', function() 24 + -- if vim.wo.diff then 25 + -- vim.cmd.normal({ '[c', bang = true }) 26 + -- else 27 + -- gitsigns.nav_hunk('prev') 28 + -- end 29 + -- end) 30 + 31 + -- -- Actions 32 + -- map('n', '<leader>hs', gitsigns.stage_hunk) 33 + -- map('n', '<leader>hr', gitsigns.reset_hunk) 34 + -- map('v', '<leader>hs', function() gitsigns.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end) 35 + -- map('v', '<leader>hr', function() gitsigns.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end) 36 + -- map('n', '<leader>hS', gitsigns.stage_buffer) 37 + -- map('n', '<leader>hu', gitsigns.undo_stage_hunk) 38 + -- map('n', '<leader>hR', gitsigns.reset_buffer) 39 + map("n", "<leader>gp", gitsigns.preview_hunk, { desc = "Preview hunk" }) 40 + -- map('n', '<leader>hb', function() gitsigns.blame_line { full = true } end) 41 + -- map('n', '<leader>tb', gitsigns.toggle_current_line_blame) 42 + map("n", "<leader>gd", gitsigns.diffthis, { desc = "Diff this" }) 43 + -- map('n', '<leader>hD', function() gitsigns.diffthis('~') end) 44 + -- map('n', '<leader>td', gitsigns.toggle_deleted) 45 + 46 + -- -- Text object 47 + -- map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>') 48 + end, 49 + }) 50 + end, 51 + }
+79
private_dot_config/nvim/lua/thomasgen/lazy/harpoon.lua
··· 1 + return { 2 + "theprimeagen/harpoon", 3 + branch = "harpoon2", 4 + dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim" }, 5 + 6 + config = function() 7 + local harpoon = require("harpoon") 8 + harpoon:setup({ 9 + settings = { save_on_toggle = true }, 10 + }) 11 + 12 + vim.keymap.set("n", "<leader>a", function() 13 + harpoon:list():add() 14 + end) 15 + vim.keymap.set("n", "<leader>h", function() 16 + harpoon.ui:toggle_quick_menu(harpoon:list()) 17 + end) 18 + 19 + vim.keymap.set("n", "<leader>1", function() 20 + harpoon:list():select(1) 21 + end) 22 + vim.keymap.set("n", "<leader>2", function() 23 + harpoon:list():select(2) 24 + end) 25 + vim.keymap.set("n", "<leader>3", function() 26 + harpoon:list():select(3) 27 + end) 28 + vim.keymap.set("n", "<leader>4", function() 29 + harpoon:list():select(4) 30 + end) 31 + vim.keymap.set("n", "<leader>5", function() 32 + harpoon:list():select(5) 33 + end) 34 + vim.keymap.set("n", "<leader>6", function() 35 + harpoon:list():select(6) 36 + end) 37 + vim.keymap.set("n", "<leader>7", function() 38 + harpoon:list():select(7) 39 + end) 40 + vim.keymap.set("n", "<leader>8", function() 41 + harpoon:list():select(8) 42 + end) 43 + vim.keymap.set("n", "<leader>9", function() 44 + harpoon:list():select(9) 45 + end) 46 + 47 + -- Toggle previous & next buffers stored within Harpoon list 48 + vim.keymap.set("n", "<C-S-P>", function() 49 + harpoon:list():prev() 50 + end) 51 + vim.keymap.set("n", "<C-S-N>", function() 52 + harpoon:list():next() 53 + end) 54 + 55 + -- basic telescope configuration 56 + local conf = require("telescope.config").values 57 + local function toggle_telescope(harpoon_files) 58 + local file_paths = {} 59 + for _, item in ipairs(harpoon_files.items) do 60 + table.insert(file_paths, item.value) 61 + end 62 + 63 + require("telescope.pickers") 64 + .new({}, { 65 + prompt_title = "Harpoon", 66 + finder = require("telescope.finders").new_table({ 67 + results = file_paths, 68 + }), 69 + previewer = conf.file_previewer({}), 70 + sorter = conf.generic_sorter({}), 71 + }) 72 + :find() 73 + end 74 + 75 + vim.keymap.set("n", "<C-e>", function() 76 + toggle_telescope(harpoon:list()) 77 + end, { desc = "Open harpoon window" }) 78 + end, 79 + }
+7
private_dot_config/nvim/lua/thomasgen/lazy/indent_line.lua
··· 1 + return { 2 + "lukas-reineke/indent-blankline.nvim", 3 + enabled = false, 4 + config = function() 5 + require("ibl").setup() 6 + end 7 + }
+4
private_dot_config/nvim/lua/thomasgen/lazy/init.lua
··· 1 + return { 2 + "theprimeagen/vim-be-good", 3 + "nvim-treesitter/nvim-treesitter-context", 4 + }
+31
private_dot_config/nvim/lua/thomasgen/lazy/linting.lua
··· 1 + return { 2 + "mfussenegger/nvim-lint", 3 + enabled = false, 4 + event = { 5 + "BufReadPre", 6 + "BufNewFile", 7 + }, 8 + config = function() 9 + local lint = require("lint") 10 + 11 + lint.linters_by_ft = { 12 + javascript = { "eslint" }, 13 + typescript = { "eslint" }, 14 + javascriptreact = { "eslint" }, 15 + typescriptreact = { "eslint" }, 16 + svelte = { "eslint" }, 17 + vue = { "eslint" }, 18 + python = { "pylint" }, 19 + astro = { "eslint" }, 20 + } 21 + 22 + local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) 23 + 24 + vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave", "TextChanged" }, { 25 + group = lint_augroup, 26 + callback = function() 27 + lint.try_lint(nil, { ignore_errors = true }) 28 + end, 29 + }) 30 + end, 31 + }
+271
private_dot_config/nvim/lua/thomasgen/lazy/lsp.lua
··· 1 + return { 2 + -- Main LSP Configuration 3 + "neovim/nvim-lspconfig", 4 + dependencies = { 5 + -- Automatically install LSPs and related tools to stdpath for Neovim 6 + { "williamboman/mason.nvim", config = true }, -- NOTE: Must be loaded before dependants 7 + "williamboman/mason-lspconfig.nvim", 8 + "WhoIsSethDaniel/mason-tool-installer.nvim", 9 + 10 + -- Useful status updates for LSP. 11 + -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` 12 + { "j-hui/fidget.nvim", opts = {} }, 13 + 14 + -- Allows extra capabilities provided by nvim-cmp 15 + "hrsh7th/cmp-nvim-lsp", 16 + }, 17 + config = function() 18 + vim.api.nvim_create_autocmd("LspAttach", { 19 + group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }), 20 + callback = function(event) 21 + -- NOTE: Remember that Lua is a real programming language, and as such it is possible 22 + -- to define small helper and utility functions so you don't have to repeat yourself. 23 + -- 24 + -- In this case, we create a function that lets us more easily define mappings specific 25 + -- for LSP related items. It sets the mode, buffer and description for us each time. 26 + local map = function(keys, func, desc, mode) 27 + mode = mode or "n" 28 + vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc }) 29 + end 30 + 31 + -- Jump to the definition of the word under your cursor. 32 + -- This is where a variable was first declared, or where a function is defined, etc. 33 + -- To jump back, press <C-t>. 34 + map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition") 35 + 36 + map("<leader>lr", ":LspRestart<CR>", "Restart LSP") 37 + 38 + map("K", function() 39 + vim.lsp.buf.hover() 40 + end, "Show documentation for symbol under cursor") 41 + 42 + map("<leader>rr", function() 43 + vim.lsp.buf.references() 44 + end, "[R]eferences") 45 + 46 + -- Find references for the word under your cursor. 47 + map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences") 48 + 49 + -- Jump to the implementation of the word under your cursor. 50 + -- Useful when your language has ways of declaring types without an actual implementation. 51 + map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation") 52 + 53 + -- Jump to the type of the word under your cursor. 54 + -- Useful when you're not sure what type a variable is and you want to see 55 + -- the definition of its *type*, not where it was *defined*. 56 + map("<leader>D", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition") 57 + 58 + -- Fuzzy find all the symbols in your current document. 59 + -- Symbols are things like variables, functions, types, etc. 60 + map("<leader>ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols") 61 + 62 + -- Fuzzy find all the symbols in your current workspace. 63 + -- Similar to document symbols, except searches over your entire project. 64 + --map("<leader>ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols") 65 + 66 + -- Rename the variable under your cursor. 67 + -- Most Language Servers support renaming across files, etc. 68 + map("<leader>rn", function() 69 + vim.api.nvim_create_autocmd({ "CmdlineEnter" }, { 70 + callback = function() 71 + local key = vim.api.nvim_replace_termcodes("<C-f>", true, false, true) 72 + vim.api.nvim_feedkeys(key, "c", false) 73 + vim.api.nvim_feedkeys("0", "n", false) 74 + return true 75 + end, 76 + }) 77 + vim.lsp.buf.rename() 78 + end, "[R]e[n]ame") 79 + 80 + -- Execute a code action, usually your cursor needs to be on top of an error 81 + -- or a suggestion from your LSP for this to activate. 82 + map("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction", { "n", "x" }) 83 + 84 + -- WARN: This is not Goto Definition, this is Goto Declaration. 85 + -- For example, in C this would take you to the header. 86 + map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") 87 + 88 + map("<leader>vd", function() 89 + vim.diagnostic.open_float() 90 + end, "[V]iew [D]iagnostics") 91 + 92 + map("[d", function() 93 + vim.diagnostic.goto_prev() 94 + end, "Prev Diagnostic") 95 + map("]d", function() 96 + vim.diagnostic.goto_next() 97 + end, "Next Diagnostic") 98 + 99 + -- The following two autocommands are used to highlight references of the 100 + -- word under your cursor when your cursor rests there for a little while. 101 + -- See `:help CursorHold` for information about when this is executed 102 + -- 103 + -- When you move your cursor, the highlights will be cleared (the second autocommand). 104 + local client = vim.lsp.get_client_by_id(event.data.client_id) 105 + if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then 106 + local highlight_augroup = vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false }) 107 + vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { 108 + buffer = event.buf, 109 + group = highlight_augroup, 110 + callback = vim.lsp.buf.document_highlight, 111 + }) 112 + 113 + vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { 114 + buffer = event.buf, 115 + group = highlight_augroup, 116 + callback = vim.lsp.buf.clear_references, 117 + }) 118 + 119 + vim.api.nvim_create_autocmd("LspDetach", { 120 + group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }), 121 + callback = function(event2) 122 + vim.lsp.buf.clear_references() 123 + vim.api.nvim_clear_autocmds({ group = "kickstart-lsp-highlight", buffer = event2.buf }) 124 + end, 125 + }) 126 + end 127 + 128 + -- The following code creates a keymap to toggle inlay hints in your 129 + -- code, if the language server you are using supports them 130 + -- 131 + -- This may be unwanted, since they displace some of your code 132 + if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then 133 + map("<leader>th", function() 134 + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf })) 135 + end, "[T]oggle Inlay [H]ints") 136 + end 137 + end, 138 + }) 139 + 140 + -- LSP servers and clients are able to communicate to each other what features they support. 141 + -- By default, Neovim doesn't support everything that is in the LSP specification. 142 + -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities. 143 + -- So, we create new capabilities with nvim cmp, and then broadcast that to the servers. 144 + local capabilities = vim.lsp.protocol.make_client_capabilities() 145 + capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities()) 146 + 147 + local mason_registry = require("mason-registry") 148 + local vue_language_server_path = mason_registry.get_package("vue-language-server"):get_install_path() 149 + .. "/node_modules/@vue/language-server" 150 + 151 + -- Enable the following language servers 152 + -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. 153 + -- 154 + -- Add any additional override configuration in the following tables. Available keys are: 155 + -- - cmd (table): Override the default command used to start the server 156 + -- - filetypes (table): Override the default list of associated filetypes for the server 157 + -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features. 158 + -- - settings (table): Override the default settings passed when initializing the server. 159 + -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ 160 + local servers = { 161 + -- clangd = {}, 162 + -- gopls = {}, 163 + -- pyright = {}, 164 + -- rust_analyzer = {}, 165 + -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs 166 + -- 167 + -- Some languages (like typescript) have entire language plugins that can be useful: 168 + -- https://github.com/pmizio/typescript-tools.nvim 169 + -- 170 + -- But for many setups, the LSP (`tsserver`) will work just fine 171 + -- tsserver = {}, 172 + -- 173 + -- 174 + tsserver = { 175 + init_options = { 176 + plugins = { 177 + { 178 + -- this happneed to be installed, maybe it does not need to be added manually but if it does not work then try to install it 179 + name = "@vue/typescript-plugin", 180 + location = vue_language_server_path, 181 + languages = { "vue" }, 182 + }, 183 + }, 184 + }, 185 + filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" }, 186 + commands = { 187 + OrganizeImports = { 188 + function() 189 + local params = { 190 + command = "_typescript.organizeImports", 191 + arguments = { vim.api.nvim_buf_get_name(0) }, 192 + title = "", 193 + } 194 + vim.lsp.buf.execute_command(params) 195 + end, 196 + description = "Organize Imports", 197 + }, 198 + }, 199 + }, 200 + 201 + volar = {}, 202 + 203 + lua_ls = { 204 + -- cmd = {...}, 205 + -- filetypes = { ...}, 206 + -- capabilities = {}, 207 + settings = { 208 + Lua = { 209 + completion = { 210 + callSnippet = "Replace", 211 + }, 212 + diagnostics = { 213 + globals = { "vim" }, 214 + }, 215 + -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings 216 + -- diagnostics = { disable = { 'missing-fields' } }, 217 + }, 218 + }, 219 + }, 220 + } 221 + 222 + -- Ensure the servers and tools above are installed 223 + -- To check the current status of installed tools and/or manually install 224 + -- other tools, you can run 225 + -- :Mason 226 + -- 227 + -- You can press `g?` for help in this menu. 228 + require("mason").setup() 229 + 230 + -- You can add other tools here that you want Mason to install 231 + -- for you, so that they are available from within Neovim. 232 + local ensure_installed = vim.tbl_keys(servers or {}) 233 + vim.list_extend(ensure_installed, { 234 + "stylua", -- Used to format Lua code 235 + }) 236 + require("mason-tool-installer").setup({ ensure_installed = ensure_installed }) 237 + 238 + require("mason-lspconfig").setup({ 239 + handlers = { 240 + function(server_name) 241 + local server = servers[server_name] or {} 242 + -- This handles overriding only values explicitly passed 243 + -- by the server configuration above. Useful when disabling 244 + -- certain features of an LSP (for example, turning off formatting for tsserver) 245 + server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) 246 + require("lspconfig")[server_name].setup(server) 247 + end, 248 + }, 249 + }) 250 + 251 + -- Setup specific LSPs 252 + 253 + -- Styling 254 + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }) 255 + 256 + vim.lsp.handlers["textDocument/signatureHelp"] = 257 + vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" }) 258 + 259 + vim.diagnostic.config({ 260 + -- update_in_insert = true, 261 + float = { 262 + focusable = false, 263 + style = "minimal", 264 + border = "rounded", 265 + source = "always", 266 + header = "", 267 + prefix = "", 268 + }, 269 + }) 270 + end, 271 + }
+148
private_dot_config/nvim/lua/thomasgen/lazy/lualine.lua
··· 1 + local function setup_macro_refresh(lualine) 2 + vim.api.nvim_create_autocmd("RecordingEnter", { 3 + callback = function() 4 + lualine.refresh({ 5 + place = { "statusline" }, 6 + }) 7 + end, 8 + }) 9 + vim.api.nvim_create_autocmd("RecordingLeave", { 10 + callback = function() 11 + local timer = vim.loop.new_timer() 12 + timer:start( 13 + 50, 14 + 0, 15 + vim.schedule_wrap(function() 16 + lualine.refresh({ 17 + place = { "statusline" }, 18 + }) 19 + end) 20 + ) 21 + end, 22 + }) 23 + end 24 + 25 + local function macro_recording_status() 26 + local function current_status() 27 + local register = vim.fn.reg_recording() 28 + return register == "" and "" or "RECORDING @" .. register 29 + end 30 + return { "macro-recording", fmt = current_status } 31 + end 32 + 33 + return { 34 + "nvim-lualine/lualine.nvim", 35 + event = "VeryLazy", 36 + dependencies = { 37 + "nvim-tree/nvim-web-devicons", 38 + }, 39 + init = function() 40 + vim.opt.laststatus = 0 41 + end, 42 + config = function() 43 + vim.opt.laststatus = 3 44 + 45 + local lualine = require("lualine") 46 + setup_macro_refresh(lualine) 47 + 48 + local function heart() 49 + return [[♥ ]] 50 + --return [[󰋑]] 51 + end 52 + 53 + -- custom theme 54 + -- local custom_rose_pine = require 'lualine.themes.rose-pine' 55 + local p = require("rose-pine.palette") 56 + local config = require("rose-pine.config") 57 + 58 + local bg_base = p.base 59 + if config.options.styles.transparency then 60 + bg_base = "NONE" 61 + end 62 + 63 + local custom_rose_pine = { 64 + normal = { 65 + a = { bg = p.rose, fg = p.base, gui = "bold" }, 66 + b = { bg = p.overlay, fg = p.rose }, 67 + c = { bg = p.surface, fg = p.text }, 68 + }, 69 + insert = { 70 + a = { bg = p.foam, fg = p.base, gui = "bold" }, 71 + b = { bg = p.overlay, fg = p.foam }, 72 + --c = { bg = "#252834", fg = p.text }, 73 + }, 74 + visual = { 75 + a = { bg = p.iris, fg = p.base, gui = "bold" }, 76 + b = { bg = p.overlay, fg = p.iris }, 77 + --c = { bg = "#292436", fg = p.text }, 78 + }, 79 + replace = { 80 + a = { bg = p.pine, fg = p.base, gui = "bold" }, 81 + b = { bg = p.overlay, fg = p.pine }, 82 + -- c = { bg = "#1C2231", fg = p.text }, 83 + }, 84 + command = { 85 + a = { bg = p.love, fg = p.base, gui = "bold" }, 86 + b = { bg = p.overlay, fg = p.love }, 87 + -- c = { bg = "#2C1F2E", fg = p.text }, 88 + }, 89 + inactive = { 90 + a = { bg = bg_base, fg = p.muted, gui = "bold" }, 91 + b = { bg = bg_base, fg = p.muted }, 92 + -- c = { bg = bg_base, fg = p.muted }, 93 + }, 94 + } 95 + 96 + --- @param trunc_width number trunctates component when screen width is less then trunc_width 97 + --- @param trunc_len number truncates component to trunc_len number of chars 98 + --- @param hide_width number hides component when window width is smaller then hide_width 99 + --- @param no_ellipsis boolean whether to disable adding '...' at end after truncation 100 + --- return function that can format the component accordingly 101 + local function trunc(trunc_width, trunc_len, hide_width, no_ellipsis) 102 + return function(str) 103 + local win_width = vim.fn.winwidth(0) 104 + if hide_width and win_width < hide_width then 105 + return "" 106 + elseif trunc_width and trunc_len and win_width < trunc_width and #str > trunc_len then 107 + return str:sub(1, trunc_len) .. (no_ellipsis and "" or "...") 108 + end 109 + return str 110 + end 111 + end 112 + 113 + lualine.setup({ 114 + options = { 115 + theme = custom_rose_pine, 116 + component_separators = "", 117 + section_separators = { left = "", right = "" }, 118 + disabled_filetypes = { "alpha" }, 119 + }, 120 + sections = { 121 + lualine_a = { 122 + { "mode", separator = { left = "", right = "" }, right_padding = 2 }, 123 + macro_recording_status(), 124 + }, 125 + lualine_b = { 126 + { "branch", fmt = trunc(1200, 20, nil, false) }, 127 + "diff", 128 + "diagnostics", 129 + }, 130 + lualine_c = { { "filename", path = 1 } }, 131 + lualine_x = { "filetype" }, 132 + lualine_y = { "progress" }, 133 + lualine_z = { 134 + { 135 + "location", 136 + separator = { left = "" }, 137 + left_padding = 2, 138 + }, 139 + { 140 + heart, 141 + separator = { right = "" }, 142 + }, 143 + }, 144 + }, 145 + extensions = { "nvim-tree", "fzf" }, 146 + }) 147 + end, 148 + }
+5
private_dot_config/nvim/lua/thomasgen/lazy/marks.lua
··· 1 + return { 2 + "chentoast/marks.nvim", 3 + event = "VeryLazy", 4 + opts = {}, 5 + }
+3
private_dot_config/nvim/lua/thomasgen/lazy/matchup.lua
··· 1 + return { 2 + 'andymass/vim-matchup', 3 + }
+240
private_dot_config/nvim/lua/thomasgen/lazy/mini.lua
··· 1 + return { 2 + "echasnovski/mini.nvim", 3 + version = false, 4 + config = function() 5 + require("mini.ai").setup({ 6 + -- Table with textobject id as fields, textobject specification as values. 7 + -- Also use this to disable builtin textobjects. See |MiniAi.config|. 8 + custom_textobjects = nil, 9 + 10 + -- Module mappings. Use `''` (empty string) to disable one. 11 + mappings = { 12 + -- Main textobject prefixes 13 + around = "a", 14 + inside = "i", 15 + 16 + -- Next/last variants 17 + around_next = "an", 18 + inside_next = "in", 19 + around_last = "al", 20 + inside_last = "il", 21 + 22 + -- Move cursor to corresponding edge of `a` textobject 23 + goto_left = "g[", 24 + goto_right = "g]", 25 + }, 26 + 27 + -- Number of lines within which textobject is searched 28 + n_lines = 1000, 29 + 30 + -- How to search for object (first inside current line, then inside 31 + -- neighborhood). One of 'cover', 'cover_or_next', 'cover_or_prev', 32 + -- 'cover_or_nearest', 'next', 'previous', 'nearest'. 33 + search_method = "cover_or_next", 34 + 35 + -- Whether to disable showing non-error feedback 36 + -- This also affects (purely informational) helper messages shown after 37 + -- idle time if user input is required. 38 + silent = false, 39 + }) 40 + 41 + require("mini.surround").setup( 42 + -- No need to copy this inside `setup()`. Will be used automatically. 43 + { 44 + -- Add custom surroundings to be used on top of builtin ones. For more 45 + -- information with examples, see `:h MiniSurround.config`. 46 + custom_surroundings = nil, 47 + 48 + -- Duration (in ms) of highlight when calling `MiniSurround.highlight()` 49 + highlight_duration = 500, 50 + 51 + -- Module mappings. Use `''` (empty string) to disable one. 52 + mappings = { 53 + add = "sa", -- Add surrounding in Normal and Visual modes 54 + delete = "sd", -- Delete surrounding 55 + find = "sf", -- Find surrounding (to the right) 56 + find_left = "sF", -- Find surrounding (to the left) 57 + highlight = "sh", -- Highlight surrounding 58 + replace = "sr", -- Replace surrounding 59 + update_n_lines = "sn", -- Update `n_lines` 60 + 61 + suffix_last = "l", -- Suffix to search with "prev" method 62 + suffix_next = "n", -- Suffix to search with "next" method 63 + }, 64 + 65 + -- Number of lines within which surrounding is searched 66 + n_lines = 1000, 67 + 68 + -- Whether to respect selection type: 69 + -- - Place surroundings on separate lines in linewise mode. 70 + -- - Place surroundings on each line in blockwise mode. 71 + respect_selection_type = false, 72 + 73 + -- How to search for surrounding (first inside current line, then inside 74 + -- neighborhood). One of 'cover', 'cover_or_next', 'cover_or_prev', 75 + -- 'cover_or_nearest', 'next', 'prev', 'nearest'. For more details, 76 + -- see `:h MiniSurround.config`. 77 + search_method = "cover", 78 + 79 + -- Whether to disable showing non-error feedback 80 + -- This also affects (purely informational) helper messages shown after 81 + -- idle time if user input is required. 82 + silent = false, 83 + } 84 + ) 85 + 86 + require("mini.pairs").setup({ 87 + -- In which modes mappings from this `config` should be created 88 + modes = { insert = true, command = false, terminal = false }, 89 + 90 + -- Global mappings. Each right hand side should be a pair information, a 91 + -- table with at least these fields (see more in |MiniPairs.map|): 92 + -- - <action> - one of 'open', 'close', 'closeopen'. 93 + -- - <pair> - two character string for pair to be used. 94 + -- By default pair is not inserted after `\`, quotes are not recognized by 95 + -- `<CR>`, `'` does not insert pair after a letter. 96 + -- Only parts of tables can be tweaked (others will use these defaults). 97 + mappings = { 98 + ["("] = { action = "open", pair = "()", neigh_pattern = "[^\\]." }, 99 + ["["] = { action = "open", pair = "[]", neigh_pattern = "[^\\]." }, 100 + ["{"] = { action = "open", pair = "{}", neigh_pattern = "[^\\]." }, 101 + ["<"] = { action = "open", pair = "<>", neigh_pattern = "[^\\]." }, 102 + 103 + [")"] = { action = "close", pair = "()", neigh_pattern = "[^\\]." }, 104 + ["]"] = { action = "close", pair = "[]", neigh_pattern = "[^\\]." }, 105 + ["}"] = { action = "close", pair = "{}", neigh_pattern = "[^\\]." }, 106 + [">"] = { action = "close", pair = "<>", neigh_pattern = "[^\\]." }, 107 + 108 + ['"'] = { action = "closeopen", pair = '""', neigh_pattern = "[^\\].", register = { cr = false } }, 109 + ["'"] = { action = "closeopen", pair = "''", neigh_pattern = "[^%a\\].", register = { cr = false } }, 110 + ["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^\\].", register = { cr = false } }, 111 + }, 112 + }) 113 + 114 + require("mini.comment").setup({ 115 + -- Options which control module behavior 116 + options = { 117 + -- Function to compute custom 'commentstring' (optional) 118 + custom_commentstring = nil, 119 + 120 + -- Whether to ignore blank lines when commenting 121 + ignore_blank_line = false, 122 + 123 + -- Whether to recognize as comment only lines without indent 124 + start_of_line = false, 125 + 126 + -- Whether to force single space inner padding for comment parts 127 + pad_comment_parts = true, 128 + }, 129 + 130 + -- Module mappings. Use `''` (empty string) to disable one. 131 + mappings = { 132 + -- Toggle comment (like `gcip` - comment inner paragraph) for both 133 + -- Normal and Visual modes 134 + comment = "gc", 135 + 136 + -- Toggle comment on current line 137 + comment_line = "gcc", 138 + 139 + -- Toggle comment on visual selection 140 + comment_visual = "gc", 141 + 142 + -- Define 'comment' textobject (like `dgc` - delete whole comment block) 143 + -- Works also in Visual mode if mapping differs from `comment_visual` 144 + textobject = "gc", 145 + }, 146 + 147 + -- Hook functions to be executed at certain stage of commenting 148 + hooks = { 149 + -- Before successful commenting. Does nothing by default. 150 + pre = function() end, 151 + -- After successful commenting. Does nothing by default. 152 + post = function() end, 153 + }, 154 + }) 155 + 156 + local miniclue = require("mini.clue") 157 + miniclue.setup({ 158 + triggers = { 159 + -- Leader triggers 160 + { mode = "n", keys = "<Leader>" }, 161 + { mode = "x", keys = "<Leader>" }, 162 + 163 + -- Built-in completion 164 + { mode = "i", keys = "<C-x>" }, 165 + 166 + -- `g` key 167 + { mode = "n", keys = "g" }, 168 + { mode = "x", keys = "g" }, 169 + 170 + -- Marks 171 + { mode = "n", keys = "'" }, 172 + { mode = "n", keys = "`" }, 173 + { mode = "x", keys = "'" }, 174 + { mode = "x", keys = "`" }, 175 + 176 + -- Registers 177 + { mode = "n", keys = '"' }, 178 + { mode = "x", keys = '"' }, 179 + { mode = "i", keys = "<C-r>" }, 180 + { mode = "c", keys = "<C-r>" }, 181 + 182 + -- Window commands 183 + { mode = "n", keys = "<C-w>" }, 184 + 185 + -- `z` key 186 + { mode = "n", keys = "z" }, 187 + { mode = "x", keys = "z" }, 188 + }, 189 + 190 + clues = { 191 + -- Enhance this by adding descriptions for <Leader> mapping groups 192 + miniclue.gen_clues.builtin_completion(), 193 + miniclue.gen_clues.g(), 194 + miniclue.gen_clues.marks(), 195 + miniclue.gen_clues.registers(), 196 + miniclue.gen_clues.windows(), 197 + miniclue.gen_clues.z(), 198 + }, 199 + }) 200 + 201 + -- local starter = require("mini.starter") 202 + -- starter.setup({ 203 + -- evaluate_single = true, 204 + -- header = "hi", 205 + -- items = { 206 + -- starter.sections.builtin_actions(), 207 + -- starter.sections.telescope(), 208 + -- starter.sections.sessions(5, true), 209 + -- }, 210 + -- }) 211 + 212 + -- local sessions = require("mini.sessions") 213 + -- sessions.setup({ 214 + -- autoread = true, 215 + -- }) 216 + 217 + require("mini.move").setup({ 218 + -- Module mappings. Use `''` (empty string) to disable one. 219 + mappings = { 220 + -- Move visual selection in Visual mode. Defaults are Alt (Meta) + hjkl. 221 + left = "<M-left>", 222 + right = "<M-right>", 223 + down = "<M-down>", 224 + up = "<M-up>", 225 + 226 + -- Move current line in Normal mode 227 + line_left = "<M-left>", 228 + line_right = "<M-right>", 229 + line_down = "<M-down>", 230 + line_up = "<M-up>", 231 + }, 232 + 233 + -- Options which control moving behavior 234 + options = { 235 + -- Automatically reindent selection during linewise vertical move 236 + reindent_linewise = true, 237 + }, 238 + }) 239 + end, 240 + }
+85
private_dot_config/nvim/lua/thomasgen/lazy/multicursor.lua
··· 1 + return { 2 + "jake-stewart/multicursor.nvim", 3 + branch = "1.0", 4 + enabled = true, 5 + config = function() 6 + local mc = require("multicursor-nvim") 7 + 8 + mc.setup() 9 + 10 + -- Add cursors above/below the main cursor. 11 + vim.keymap.set({ "n", "v" }, "<C-up>", function() 12 + mc.addCursor("k") 13 + end) 14 + vim.keymap.set({ "n", "v" }, "<C-down>", function() 15 + mc.addCursor("j") 16 + end) 17 + 18 + -- Add a cursor and jump to the next word under cursor. 19 + vim.keymap.set({ "n", "v" }, "<c-n>", function() 20 + mc.addCursor("*") 21 + end) 22 + 23 + -- Jump to the next word under cursor but do not add a cursor. 24 + vim.keymap.set({ "n", "v" }, "<c-s>", function() 25 + mc.skipCursor("*") 26 + end) 27 + 28 + -- Rotate the main cursor. 29 + vim.keymap.set({ "n", "v" }, "<C-left>", mc.nextCursor) 30 + vim.keymap.set({ "n", "v" }, "<C-right>", mc.prevCursor) 31 + 32 + -- Delete the main cursor. 33 + vim.keymap.set({ "n", "v" }, "<leader>x", mc.deleteCursor) 34 + 35 + -- Add and remove cursors with control + left click. 36 + vim.keymap.set("n", "<c-leftmouse>", mc.handleMouse) 37 + 38 + vim.keymap.set({ "n", "v" }, "<c-q>", function() 39 + if mc.cursorsEnabled() then 40 + -- Stop other cursors from moving. 41 + -- This allows you to reposition the main cursor. 42 + mc.disableCursors() 43 + else 44 + mc.addCursor() 45 + end 46 + end) 47 + 48 + vim.keymap.set("n", "<esc>", function() 49 + if not mc.cursorsEnabled() then 50 + mc.enableCursors() 51 + elseif mc.hasCursors() then 52 + mc.clearCursors() 53 + else 54 + -- Default <esc> handler. 55 + end 56 + end) 57 + 58 + -- Align cursor columns. 59 + -- vim.keymap.set("n", "<leader>a", mc.alignCursors) 60 + 61 + -- Split visual selections by regex. 62 + vim.keymap.set("v", "S", mc.splitCursors) 63 + 64 + -- Append/insert for each line of visual selections. 65 + vim.keymap.set("v", "I", mc.insertVisual) 66 + vim.keymap.set("v", "A", mc.appendVisual) 67 + 68 + -- match new cursors within visual selections by regex. 69 + vim.keymap.set("v", "M", mc.matchCursors) 70 + 71 + -- Rotate visual selection contents. 72 + vim.keymap.set("v", "<leader>t", function() 73 + mc.transposeCursors(1) 74 + end) 75 + vim.keymap.set("v", "<leader>T", function() 76 + mc.transposeCursors(-1) 77 + end) 78 + 79 + -- Customize how cursors look. 80 + vim.api.nvim_set_hl(0, "MultiCursorCursor", { link = "Cursor" }) 81 + vim.api.nvim_set_hl(0, "MultiCursorVisual", { link = "Visual" }) 82 + vim.api.nvim_set_hl(0, "MultiCursorDisabledCursor", { link = "Visual" }) 83 + vim.api.nvim_set_hl(0, "MultiCursorDisabledVisual", { link = "Visual" }) 84 + end, 85 + }
+209
private_dot_config/nvim/lua/thomasgen/lazy/oil.lua
··· 1 + return { 2 + "stevearc/oil.nvim", 3 + ---@module 'oil' 4 + ---@type oil.SetupOpts 5 + opts = { 6 + -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`) 7 + -- Set to false if you want some other plugin (e.g. netrw) to open when you edit directories. 8 + default_file_explorer = true, 9 + -- Id is automatically added at the beginning, and name at the end 10 + -- See :help oil-columns 11 + columns = { 12 + "icon", 13 + -- "permissions", 14 + -- "size", 15 + -- "mtime", 16 + }, 17 + -- Buffer-local options to use for oil buffers 18 + buf_options = { 19 + buflisted = false, 20 + bufhidden = "hide", 21 + }, 22 + -- Window-local options to use for oil buffers 23 + win_options = { 24 + wrap = false, 25 + signcolumn = "no", 26 + cursorcolumn = false, 27 + foldcolumn = "0", 28 + spell = false, 29 + list = false, 30 + conceallevel = 3, 31 + concealcursor = "nvic", 32 + }, 33 + -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash) 34 + delete_to_trash = false, 35 + -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits) 36 + skip_confirm_for_simple_edits = false, 37 + -- Selecting a new/moved/renamed file or directory will prompt you to save changes first 38 + -- (:help prompt_save_on_select_new_entry) 39 + prompt_save_on_select_new_entry = true, 40 + -- Oil will automatically delete hidden buffers after this delay 41 + -- You can set the delay to false to disable cleanup entirely 42 + -- Note that the cleanup process only starts when none of the oil buffers are currently displayed 43 + cleanup_delay_ms = 2000, 44 + lsp_file_methods = { 45 + -- Enable or disable LSP file operations 46 + enabled = true, 47 + -- Time to wait for LSP file operations to complete before skipping 48 + timeout_ms = 1000, 49 + -- Set to true to autosave buffers that are updated with LSP willRenameFiles 50 + -- Set to "unmodified" to only save unmodified buffers 51 + autosave_changes = false, 52 + }, 53 + -- Constrain the cursor to the editable parts of the oil buffer 54 + -- Set to `false` to disable, or "name" to keep it on the file names 55 + constrain_cursor = "editable", 56 + -- Set to true to watch the filesystem for changes and reload oil 57 + watch_for_changes = true, 58 + -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap 59 + -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" }) 60 + -- Additionally, if it is a string that matches "actions.<name>", 61 + -- it will use the mapping at require("oil.actions").<name> 62 + -- Set to `false` to remove a keymap 63 + -- See :help oil-actions for a list of all available actions 64 + keymaps = { 65 + ["g?"] = "actions.show_help", 66 + ["<CR>"] = "actions.select", 67 + ["<C-s>"] = { "actions.select", opts = { vertical = true }, desc = "Open the entry in a vertical split" }, 68 + ["<C-h>"] = { 69 + "actions.select", 70 + opts = { horizontal = true }, 71 + desc = "Open the entry in a horizontal split", 72 + }, 73 + ["<C-t>"] = { "actions.select", opts = { tab = true }, desc = "Open the entry in new tab" }, 74 + ["<C-p>"] = "actions.preview", 75 + ["<C-c>"] = "actions.close", 76 + ["<C-l>"] = "actions.refresh", 77 + ["-"] = "actions.parent", 78 + ["_"] = "actions.open_cwd", 79 + ["`"] = "actions.cd", 80 + ["~"] = { "actions.cd", opts = { scope = "tab" }, desc = ":tcd to the current oil directory", mode = "n" }, 81 + ["gs"] = "actions.change_sort", 82 + ["gx"] = "actions.open_external", 83 + ["g."] = "actions.toggle_hidden", 84 + ["g\\"] = "actions.toggle_trash", 85 + }, 86 + -- Set to false to disable all of the above keymaps 87 + use_default_keymaps = true, 88 + view_options = { 89 + -- Show files and directories that start with "." 90 + show_hidden = false, 91 + -- This function defines what is considered a "hidden" file 92 + is_hidden_file = function(name, bufnr) 93 + local m = name:match("^%.") 94 + return m ~= nil 95 + end, 96 + -- This function defines what will never be shown, even when `show_hidden` is set 97 + is_always_hidden = function(name, bufnr) 98 + return false 99 + end, 100 + -- Sort file names with numbers in a more intuitive order for humans. 101 + -- Can be "fast", true, or false. "fast" will turn it off for large directories. 102 + natural_order = "fast", 103 + -- Sort file and directory names case insensitive 104 + case_insensitive = false, 105 + sort = { 106 + -- sort order can be "asc" or "desc" 107 + -- see :help oil-columns to see which columns are sortable 108 + { "type", "asc" }, 109 + { "name", "asc" }, 110 + }, 111 + }, 112 + -- Extra arguments to pass to SCP when moving/copying files over SSH 113 + extra_scp_args = {}, 114 + -- EXPERIMENTAL support for performing file operations with git 115 + git = { 116 + -- Return true to automatically git add/mv/rm files 117 + add = function(path) 118 + return false 119 + end, 120 + mv = function(src_path, dest_path) 121 + return false 122 + end, 123 + rm = function(path) 124 + return false 125 + end, 126 + }, 127 + -- Configuration for the floating window in oil.open_float 128 + float = { 129 + -- Padding around the floating window 130 + padding = 2, 131 + max_width = 0, 132 + max_height = 0, 133 + border = "rounded", 134 + win_options = { 135 + winblend = 0, 136 + }, 137 + -- optionally override the oil buffers window title with custom function: fun(winid: integer): string 138 + get_win_title = nil, 139 + -- preview_split: Split direction: "auto", "left", "right", "above", "below". 140 + preview_split = "auto", 141 + -- This is the config that will be passed to nvim_open_win. 142 + -- Change values here to customize the layout 143 + override = function(conf) 144 + return conf 145 + end, 146 + }, 147 + -- Configuration for the file preview window 148 + preview_win = { 149 + -- Whether the preview window is automatically updated when the cursor is moved 150 + update_on_cursor_moved = true, 151 + -- How to open the preview window "load"|"scratch"|"fast_scratch" 152 + preview_method = "fast_scratch", 153 + -- A function that returns true to disable preview on a file e.g. to avoid lag 154 + disable_preview = function(filename) 155 + return false 156 + end, 157 + -- Window-local options to use for preview window buffers 158 + win_options = {}, 159 + }, 160 + -- Configuration for the floating action confirmation window 161 + confirmation = { 162 + -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) 163 + -- min_width and max_width can be a single value or a list of mixed integer/float types. 164 + -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total" 165 + max_width = 0.9, 166 + -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total" 167 + min_width = { 40, 0.4 }, 168 + -- optionally define an integer/float for the exact width of the preview window 169 + width = nil, 170 + -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) 171 + -- min_height and max_height can be a single value or a list of mixed integer/float types. 172 + -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total" 173 + max_height = 0.9, 174 + -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total" 175 + min_height = { 5, 0.1 }, 176 + -- optionally define an integer/float for the exact height of the preview window 177 + height = nil, 178 + border = "rounded", 179 + win_options = { 180 + winblend = 0, 181 + }, 182 + }, 183 + -- Configuration for the floating progress window 184 + progress = { 185 + max_width = 0.9, 186 + min_width = { 40, 0.4 }, 187 + width = nil, 188 + max_height = { 10, 0.9 }, 189 + min_height = { 5, 0.1 }, 190 + height = nil, 191 + border = "rounded", 192 + minimized_border = "none", 193 + win_options = { 194 + winblend = 0, 195 + }, 196 + }, 197 + -- Configuration for the floating SSH window 198 + ssh = { 199 + border = "rounded", 200 + }, 201 + -- Configuration for the floating keymaps help window 202 + keymaps_help = { 203 + border = "rounded", 204 + }, 205 + }, 206 + -- Optional dependencies 207 + dependencies = { { "echasnovski/mini.icons", opts = {} } }, 208 + -- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if prefer nvim-web-devicons 209 + }
+7
private_dot_config/nvim/lua/thomasgen/lazy/smooth-scroll.lua
··· 1 + return { 2 + 'karb94/neoscroll.nvim', 3 + enabled = false, 4 + config = function() 5 + require("neoscroll").setup() 6 + end 7 + }
+129
private_dot_config/nvim/lua/thomasgen/lazy/snacks.lua
··· 1 + return { 2 + "folke/snacks.nvim", 3 + priority = 1000, 4 + lazy = false, 5 + opts = { 6 + -- your configuration comes here 7 + -- or leave it empty to use the default settings 8 + -- refer to the configuration section below 9 + bigfile = { enabled = true }, 10 + notifier = { enabled = true }, 11 + quickfile = { enabled = true }, 12 + statuscolumn = { enabled = true }, 13 + words = { enabled = true }, 14 + }, 15 + keys = { 16 + { 17 + "<leader>.", 18 + function() 19 + Snacks.scratch() 20 + end, 21 + desc = "Toggle Scratch Buffer", 22 + }, 23 + { 24 + "<leader>S", 25 + function() 26 + Snacks.scratch.select() 27 + end, 28 + desc = "Select Scratch Buffer", 29 + }, 30 + { 31 + "<leader>n", 32 + function() 33 + Snacks.notifier.show_history() 34 + end, 35 + desc = "Notification History", 36 + }, 37 + 38 + { 39 + "<leader>gB", 40 + function() 41 + Snacks.gitbrowse() 42 + end, 43 + desc = "Git Browse", 44 + }, 45 + { 46 + "<leader>gb", 47 + function() 48 + Snacks.git.blame_line() 49 + end, 50 + desc = "Git Blame Line", 51 + }, 52 + { 53 + "<leader>gf", 54 + function() 55 + Snacks.lazygit.log_file() 56 + end, 57 + desc = "Lazygit Current File History", 58 + }, 59 + { 60 + "<leader>lg", 61 + function() 62 + Snacks.lazygit() 63 + end, 64 + desc = "Lazygit", 65 + }, 66 + { 67 + "<leader>gl", 68 + function() 69 + Snacks.lazygit.log() 70 + end, 71 + desc = "Lazygit Log (cwd)", 72 + }, 73 + { 74 + "<leader>dn", 75 + function() 76 + Snacks.notifier.hide() 77 + end, 78 + desc = "Dismiss All Notifications", 79 + }, 80 + { 81 + "<c-/>", 82 + function() 83 + Snacks.terminal() 84 + end, 85 + desc = "Toggle Terminal", 86 + }, 87 + { 88 + "<c-_>", 89 + function() 90 + Snacks.terminal() 91 + end, 92 + desc = "which_key_ignore", 93 + }, 94 + { 95 + "]]", 96 + function() 97 + Snacks.words.jump(vim.v.count1) 98 + end, 99 + desc = "Next Reference", 100 + mode = { "n", "t" }, 101 + }, 102 + { 103 + "[[", 104 + function() 105 + Snacks.words.jump(-vim.v.count1) 106 + end, 107 + desc = "Prev Reference", 108 + mode = { "n", "t" }, 109 + }, 110 + { 111 + "<leader>N", 112 + desc = "Neovim News", 113 + function() 114 + Snacks.win({ 115 + file = vim.api.nvim_get_runtime_file("doc/news.txt", false)[1], 116 + width = 0.6, 117 + height = 0.6, 118 + wo = { 119 + spell = false, 120 + wrap = false, 121 + signcolumn = "yes", 122 + statuscolumn = " ", 123 + conceallevel = 3, 124 + }, 125 + }) 126 + end, 127 + }, 128 + }, 129 + }
+13
private_dot_config/nvim/lua/thomasgen/lazy/sourcegraph.lua
··· 1 + -- Use your favorite package manager to install, for example in lazy.nvim 2 + -- Optionally, you can also install nvim-telescope/telescope.nvim to use some search functionality. 3 + return { 4 + { 5 + --enabled: 6 + "sourcegraph/sg.nvim", 7 + dependencies = { "nvim-lua/plenary.nvim", --[[ "nvim-telescope/telescope.nvim ]] }, 8 + enabled = false, 9 + config = function() 10 + require("sg").setup() 11 + end, 12 + }, 13 + }
+18
private_dot_config/nvim/lua/thomasgen/lazy/spectre.lua
··· 1 + return { 2 + 'nvim-pack/nvim-spectre', 3 + enabled = false, 4 + config = function() 5 + vim.keymap.set('n', '<leader>ss', '<cmd>lua require("spectre").toggle()<CR>', { 6 + desc = "Toggle Spectre" 7 + }) 8 + vim.keymap.set('n', '<leader>sw', '<cmd>lua require("spectre").open_visual({select_word=true})<CR>', { 9 + desc = "Search current word" 10 + }) 11 + vim.keymap.set('v', '<leader>sw', '<esc><cmd>lua require("spectre").open_visual()<CR>', { 12 + desc = "Search current word" 13 + }) 14 + vim.keymap.set('n', '<leader>sp', '<cmd>lua require("spectre").open_file_search({select_word=true})<CR>', { 15 + desc = "Search on current file" 16 + }) 17 + end 18 + }
+3
private_dot_config/nvim/lua/thomasgen/lazy/suda.lua
··· 1 + return { 2 + 'lambdalisue/vim-suda' 3 + }
+7
private_dot_config/nvim/lua/thomasgen/lazy/supermaven.lua
··· 1 + return { 2 + 'supermaven-inc/supermaven-nvim', 3 + enabled = false, 4 + config = function() 5 + require('supermaven-nvim').setup({}) 6 + end 7 + }
+60
private_dot_config/nvim/lua/thomasgen/lazy/telescope.lua
··· 1 + return { 2 + "nvim-telescope/telescope.nvim", 3 + 4 + tag = "0.1.6", 5 + 6 + dependencies = { 7 + "nvim-lua/plenary.nvim", 8 + }, 9 + 10 + config = function() 11 + require("telescope").setup({ 12 + pickers = { 13 + find_files = { hidden = true }, 14 + }, 15 + }) 16 + 17 + local builtin = require("telescope.builtin") 18 + vim.keymap.set("n", "<leader>t", ":Telescope<CR>", {}) 19 + vim.keymap.set("n", "<leader>pf", builtin.find_files, { desc = "Find [F]iles" }) 20 + vim.keymap.set("n", "<leader>pg", builtin.git_files, { desc = "Find [G]it Files" }) 21 + vim.keymap.set("n", "<leader>pws", function() 22 + local word = vim.fn.expand("<cword>") 23 + builtin.grep_string({ search = word }) 24 + end) 25 + 26 + vim.keymap.set("n", "<leader>pWs", function() 27 + local word = vim.fn.expand("<cWORD>") 28 + builtin.grep_string({ search = word }) 29 + end) 30 + 31 + -- Project search 32 + vim.keymap.set("n", "<leader>ps", function() 33 + -- builtin.live_grep() 34 + builtin.grep_string({ search = vim.fn.input("Grep > ") }) 35 + end, { desc = "[P]roject [S]earch" }) 36 + 37 + -- Project search (live grep) 38 + vim.keymap.set("n", "<leader>plg", function() 39 + builtin.live_grep() 40 + end, { desc = "[P]roject [L]ive [G]rep" }) 41 + 42 + -- Project search with regex 43 + vim.keymap.set("n", "<leader>pR", function() 44 + builtin.grep_string({ search = vim.fn.input("Grep > "), use_regex = true }) 45 + end, { desc = "Project [R]egex Search" }) 46 + 47 + -- Local search 48 + vim.keymap.set("n", "<leader>ls", function() 49 + builtin.grep_string({ search = vim.fn.input("Grep > "), search_dirs = { vim.fn.expand("%:p") } }) 50 + end, { desc = "[L]ocal [S]earch" }) 51 + 52 + vim.keymap.set("n", "<leader>vh", builtin.help_tags, {}) 53 + 54 + -- Resume 55 + vim.keymap.set("n", "<leader>pr", builtin.resume, {}) 56 + 57 + vim.keymap.set("n", "<leader>ch", builtin.command_history, { desc = "[C]ommand [H]istory" }) 58 + vim.keymap.set("n", "<leader>cc", builtin.commands, { desc = "[C]ommands" }) 59 + end, 60 + }
+64
private_dot_config/nvim/lua/thomasgen/lazy/treesitter.lua
··· 1 + return { 2 + "nvim-treesitter/nvim-treesitter", 3 + build = ":TSUpdate", 4 + config = function() 5 + require("nvim-treesitter.configs").setup({ 6 + -- A list of parser names, or "all" 7 + ensure_installed = { 8 + "vimdoc", 9 + "javascript", 10 + "typescript", 11 + "c", 12 + "lua", 13 + "rust", 14 + "jsdoc", 15 + "bash", 16 + "svelte", 17 + "astro", 18 + "vue", 19 + "css", 20 + }, 21 + 22 + -- Install parsers synchronously (only applied to `ensure_installed`) 23 + sync_install = false, 24 + 25 + -- Automatically install missing parsers when entering buffer 26 + -- Recommendation: set to false if you don"t have `tree-sitter` CLI installed locally 27 + auto_install = true, 28 + 29 + indent = { 30 + enable = true, 31 + }, 32 + 33 + highlight = { 34 + -- `false` will disable the whole extension 35 + enable = true, 36 + 37 + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. 38 + -- Set this to `true` if you depend on "syntax" being enabled (like for indentation). 39 + -- Using this option may slow down your editor, and you may see some duplicate highlights. 40 + -- Instead of true it can also be a list of languages 41 + additional_vim_regex_highlighting = { "markdown" }, 42 + }, 43 + }) 44 + 45 + local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs() 46 + treesitter_parser_config.templ = { 47 + install_info = { 48 + url = "https://github.com/vrischmann/tree-sitter-templ.git", 49 + files = { "src/parser.c", "src/scanner.c" }, 50 + branch = "master", 51 + }, 52 + } 53 + 54 + vim.treesitter.language.register("templ", "templ") 55 + 56 + vim.filetype.add({ 57 + extension = { 58 + mdx = "mdx", 59 + }, 60 + }) 61 + 62 + vim.treesitter.language.register("markdown", "mdx") 63 + end, 64 + }
+7
private_dot_config/nvim/lua/thomasgen/lazy/undotree.lua
··· 1 + return { 2 + "mbbill/undotree", 3 + 4 + config = function() 5 + vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle) 6 + end 7 + }
+18
private_dot_config/nvim/lua/thomasgen/lazy_init.lua
··· 1 + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 + if not vim.loop.fs_stat(lazypath) then 3 + vim.fn.system({ 4 + "git", 5 + "clone", 6 + "--filter=blob:none", 7 + "https://github.com/folke/lazy.nvim.git", 8 + "--branch=stable", -- latest stable release 9 + lazypath, 10 + }) 11 + end 12 + vim.opt.rtp:prepend(lazypath) 13 + 14 + require("lazy").setup({ 15 + spec = "thomasgen.lazy", 16 + change_detection = { notify = false } 17 + }) 18 +
+87
private_dot_config/nvim/lua/thomasgen/remap.lua
··· 1 + local map = function(keys, func, desc, mode) 2 + mode = mode or "n" 3 + vim.keymap.set(mode, keys, func, { desc = desc }) 4 + end 5 + 6 + vim.g.mapleader = " " 7 + 8 + -- Project view 9 + map("<leader>pv", ":Oil<CR>", "Open Oil file explorer") 10 + 11 + -- Move lines around 12 + map("J", ":m '>+1<CR>gv=gv", "Move line down", "v") 13 + map("<S-Down>", ":m '>+1<CR>gv=gv", "Move line down", "v") 14 + map("K", ":m '<-2<CR>gv=gv", "Move line up", "v") 15 + map("<S-Up>", ":m '<-2<CR>gv=gv", "Move line up", "v") 16 + 17 + -- Keep cursor in center throughout operations 18 + map("J", "mzJ`z", "Join lines and keep cursor") 19 + map("<C-d>", "<C-d>zz", "Scroll down and center") 20 + map("<C-u>", "<C-u>zz", "Scroll up and center") 21 + map("n", "nzzzv", "Next search result and center") 22 + map("N", "Nzzzv", "Previous search result and center") 23 + 24 + -- Clipboard operations 25 + map("<leader>p", '"_dP', "Paste without updating register", "x") 26 + map("<leader>pc", '"+p', "Paste from system clipboard") 27 + map("<leader>y", '"+y', "Yank to system clipboard") 28 + map("<leader>y", '"+y', "Yank to system clipboard", "v") 29 + map("<leader>Y", '"+Y', "Yank line to system clipboard") 30 + map("<C-v>", '<Esc>"+pa', "Paste from system clipboard", "i") 31 + 32 + -- Delete without register 33 + map("<leader>d", '"_d', "Delete without updating register") 34 + map("<leader>d", '"_d', "Delete without updating register", "v") 35 + 36 + -- Disable Q 37 + map("Q", "<nop>", "Disable Q") 38 + 39 + -- Formatting 40 + map("<leader>f", function() 41 + vim.cmd("Format") 42 + vim.notify("Formatted file", vim.log.levels.INFO, { title = "Formatting" }) 43 + end, "Format file") 44 + map("<leader>ef", function() 45 + vim.cmd("FormatEnable") 46 + vim.notify("Enabled auto-format", vim.log.levels.INFO, { title = "Formatting" }) 47 + end, "Enable auto-format") 48 + map("<leader>df", function() 49 + vim.cmd("FormatDisable") 50 + vim.notify("Disabled auto-format", vim.log.levels.INFO, { title = "Formatting" }) 51 + end, "Disable auto-format") 52 + 53 + -- map("<leader>l", function() 54 + -- local lint = require("lint") 55 + -- lint.try_lint() 56 + -- end, "Lint file") 57 + 58 + map("<leader>esf", function() 59 + vim.cmd("EslintFixAll") 60 + end, "Fix ESLint issues") 61 + 62 + -- Window management 63 + map("<leader>ws", "<C-w>s", "Split window horizontally") 64 + map("<leader>wv", "<C-w>v", "Split window vertically") 65 + map("<leader>wh", "<C-w>h", "Move to left window") 66 + map("<leader>w<Left>", "<C-w>h", "Move to left window") 67 + map("<leader>wj", "<C-w>j", "Move to bottom window") 68 + map("<leader>w<Down>", "<C-w>j", "Move to bottom window") 69 + map("<leader>wk", "<C-w>k", "Move to top window") 70 + map("<leader>w<Up>", "<C-w>k", "Move to top window") 71 + map("<leader>wl", "<C-w>l", "Move to right window") 72 + map("<leader>w<Right>", "<C-w>l", "Move to right window") 73 + map("<leader>wq", "<C-w>q", "Close window") 74 + map("<leader>wf", "<C-w>f <C-w>L", "Open file under cursor in new window") 75 + 76 + -- Buffer operations 77 + map("<leader>rf", ":e<CR>", "Refresh buffer") 78 + map("<leader>sf", ":w<CR>", "Save file") 79 + 80 + -- Terminal 81 + map("<Esc>", [[<C-\><C-n>]], "Exit terminal insert mode", "t") 82 + 83 + -- Close quickfix menu after selecting choice 84 + vim.api.nvim_create_autocmd("FileType", { 85 + pattern = { "qf" }, 86 + command = [[nnoremap <buffer> <CR> <CR>:cclose<CR>]], 87 + })
+33
private_dot_config/nvim/lua/thomasgen/set.lua
··· 1 + vim.opt.nu = true 2 + vim.opt.relativenumber = true 3 + 4 + vim.opt.tabstop = 2 5 + vim.opt.softtabstop = 2 6 + vim.opt.shiftwidth = 2 7 + 8 + vim.opt.expandtab = false 9 + 10 + vim.opt.smartindent = true 11 + 12 + vim.opt.swapfile = false 13 + vim.opt.backup = false 14 + vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" 15 + vim.opt.undofile = true 16 + 17 + vim.opt.hlsearch = false 18 + vim.opt.incsearch = true 19 + 20 + vim.opt.termguicolors = true 21 + 22 + vim.opt.scrolloff = 8 23 + 24 + vim.opt.updatetime = 50 25 + 26 + vim.opt.ignorecase = true 27 + vim.opt.smartcase = true 28 + 29 + -- vim.opt.colorcolumn = "80" 30 + 31 + vim.opt.inccommand = "nosplit" 32 + 33 + vim.opt.cursorline = true