diff --git a/goose-x86_64-unknown-linux-gnu.tar.bz2 b/goose-x86_64-unknown-linux-gnu.tar.bz2 new file mode 100644 index 0000000..032ccdb Binary files /dev/null and b/goose-x86_64-unknown-linux-gnu.tar.bz2 differ diff --git a/init.lua b/init.lua index ce5e66a..f14ee20 100644 --- a/init.lua +++ b/init.lua @@ -15,6 +15,8 @@ require("lazy").setup({ { import = "plugins" }, -- import the following list of plugins -- this is where i put plugins with minial settings { + 'ThePrimeagen/vim-be-good', + "xiyaowong/transparent.nvim", "karb94/neoscroll.nvim", --Smooth Scrolling -- 'paretje/nvim-man', -- man page syntax highlighting 'fei6409/log-highlight.nvim', -- generic log syntax highlighting @@ -30,9 +32,9 @@ require("lazy").setup({ '0xm4n/resize.nvim', -- adds commands to resize panes 'nvim-tree/nvim-web-devicons', -- nerdfont! 'TamaMcGlinn/vim-termhere', --simple terminal QOL - 'smjonas/inc-rename.nvim', --lsp plugin for renaming variable 'basola21/PDFview', -- rendering pdfs in nvim 'rcarriga/nvim-notify', -- notification manager + { 'smjonas/inc-rename.nvim', config = true }, --lsp plugin for renaming variable { "m4xshen/hardtime.nvim", lazy = false, dependencies = { "MunifTanjim/nui.nvim" }}, --annoying { "nvzone/typr", dependencies = "nvzone/volt", cmd = { "Typr", "TyprStats" }, }, --typing practice { 'norcalli/nvim-colorizer.lua', config = function() require('colorizer').setup{"*"} end,}, -- preview colors diff --git a/layout_snap.vim b/layout_snap.vim new file mode 100644 index 0000000..5828c1f --- /dev/null +++ b/layout_snap.vim @@ -0,0 +1,113 @@ +let SessionLoad = 1 +let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1 +let v:this_session=expand(":p") +doautoall SessionLoadPre +silent only +silent tabonly +cd ~/.config/nvim +if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == '' + let s:wipebuf = bufnr('%') +endif +let s:shortmess_save = &shortmess +set shortmess+=aoO +badd +35 lua/keybinds.lua +badd +27 lua/custom-functions.lua +argglobal +%argdel +$argadd lua/keybinds.lua +edit lua/keybinds.lua +let s:save_splitbelow = &splitbelow +let s:save_splitright = &splitright +set splitbelow splitright +wincmd _ | wincmd | +vsplit +wincmd _ | wincmd | +vsplit +2wincmd h +wincmd w +wincmd w +let &splitbelow = s:save_splitbelow +let &splitright = s:save_splitright +wincmd t +let s:save_winminheight = &winminheight +let s:save_winminwidth = &winminwidth +set winminheight=0 +set winheight=1 +set winminwidth=0 +set winwidth=1 +exe 'vert 1resize ' . ((&columns * 30 + 106) / 212) +exe 'vert 2resize ' . ((&columns * 90 + 106) / 212) +exe 'vert 3resize ' . ((&columns * 90 + 106) / 212) +argglobal +enew +file NvimTree_1 +balt lua/keybinds.lua +setlocal foldmethod=manual +setlocal foldexpr=0 +setlocal foldmarker={{{,}}} +setlocal foldignore=# +setlocal foldlevel=0 +setlocal foldminlines=1 +setlocal foldnestmax=20 +setlocal nofoldenable +wincmd w +argglobal +balt lua/custom-functions.lua +setlocal foldmethod=marker +setlocal foldexpr=v:lua.vim.treesitter.foldexpr() +setlocal foldmarker={{{,}}} +setlocal foldignore=# +setlocal foldlevel=0 +setlocal foldminlines=1 +setlocal foldnestmax=20 +setlocal foldenable +let s:l = 35 - ((12 * winheight(0) + 24) / 48) +if s:l < 1 | let s:l = 1 | endif +keepjumps exe s:l +normal! zt +keepjumps 35 +normal! 0136| +wincmd w +argglobal +if bufexists(fnamemodify("term://~/.config/nvim//1942532:/usr/bin/zsh;\#toggleterm\#1", ":p")) | buffer term://~/.config/nvim//1942532:/usr/bin/zsh;\#toggleterm\#1 | else | edit term://~/.config/nvim//1942532:/usr/bin/zsh;\#toggleterm\#1 | endif +if &buftype ==# 'terminal' + silent file term://~/.config/nvim//1942532:/usr/bin/zsh;\#toggleterm\#1 +endif +balt lua/keybinds.lua +setlocal foldmethod=marker +setlocal foldexpr=0 +setlocal foldmarker={{{,}}} +setlocal foldignore=# +setlocal foldlevel=0 +setlocal foldminlines=1 +setlocal foldnestmax=20 +setlocal nofoldenable +let s:l = 3 - ((2 * winheight(0) + 24) / 48) +if s:l < 1 | let s:l = 1 | endif +keepjumps exe s:l +normal! zt +keepjumps 3 +normal! 033| +wincmd w +exe 'vert 1resize ' . ((&columns * 30 + 106) / 212) +exe 'vert 2resize ' . ((&columns * 90 + 106) / 212) +exe 'vert 3resize ' . ((&columns * 90 + 106) / 212) +tabnext 1 +if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal' + silent exe 'bwipe ' . s:wipebuf +endif +unlet! s:wipebuf +set winheight=1 winwidth=20 +let &shortmess = s:shortmess_save +let &winminheight = s:save_winminheight +let &winminwidth = s:save_winminwidth +let s:sx = expand(":p:r")."x.vim" +if filereadable(s:sx) + exe "source " . fnameescape(s:sx) +endif +let &g:so = s:so_save | let &g:siso = s:siso_save +set hlsearch +nohlsearch +doautoall SessionLoadPost +unlet SessionLoad +" vim: set ft=vim : diff --git a/lazy-lock.json b/lazy-lock.json index f595187..f12018e 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,18 +1,21 @@ { + "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "PDFview": { "branch": "main", "commit": "972dfcce5c0de578865649940f44bf57a700498d" }, - "base16-nvim": { "branch": "master", "commit": "23e5128eb5f629c29532c24a1e733cbe019f05bb" }, + "base16-nvim": { "branch": "master", "commit": "fd128e380624c34f12a201690944bf657f861361" }, + "blink-cmp-copilot": { "branch": "main", "commit": "439cff78780c033aa23cf061d7315314b347e3c1" }, "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "codecompanion.nvim": { "branch": "main", "commit": "7cc35b7f7f08d093469fa9ae67d3af716bd729c3" }, + "codecompanion.nvim": { "branch": "main", "commit": "15f39ba587154a97c912284646c1bd076b55a3be" }, "conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" }, + "copilot.lua": { "branch": "master", "commit": "2a849bc7bec4d175524c332c20d48ca9ece735df" }, "dashboard-nvim": { "branch": "master", "commit": "f787e3462c2ee2b6117b17c1aa4ddf66cb6f57fe" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "fd": { "branch": "master", "commit": "25461e5ce13dc12ff2a75993285a87e99b33db2d" }, - "fzf-lua": { "branch": "main", "commit": "988416cc782dfe28bff3f0da9b8c943b236cd86a" }, + "fd": { "branch": "master", "commit": "1bfeea237a48c9545211e5c21d623d398fa712c6" }, + "fzf-lua": { "branch": "main", "commit": "532d463f5c83595192fe740572d8fd6902b2217a" }, "gemini-cli.nvim": { "branch": "main", "commit": "c9fd62adda823628f5131a939d9c56ef7a898600" }, - "gitsigns.nvim": { "branch": "main", "commit": "25050e4ed39e628282831d4cbecb1850454ce915" }, + "gitsigns.nvim": { "branch": "main", "commit": "31d6fb2d618bca1482b9f274751ead5f03461408" }, "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, - "hardtime.nvim": { "branch": "main", "commit": "b4e431934af1fe224a3a801f632c008278cb7628" }, + "hardtime.nvim": { "branch": "main", "commit": "244753782b945def87472d8f4e9e6a9d4ec18689" }, "hex.nvim": { "branch": "master", "commit": "b46e63356a69e8d6f046c38a9708d55d17f15038" }, "hologram.nvim": { "branch": "main", "commit": "f5194f71ec1578d91b2e3119ff08e574e2eab542" }, "hyprlang-to-lua.nvim": { "branch": "main", "commit": "477430d9f379736bc2260086eb63517bb585b5d8" }, @@ -23,45 +26,52 @@ "log-highlight.nvim": { "branch": "main", "commit": "b2e00cfd41ca94338265a595f3f3f423d9f9322e" }, "ltex-ls.nvim": { "branch": "main", "commit": "968eac261279d88d7f1ed556aa2dbc535a7489fe" }, "lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "21c5b3ebeaa0412e28096bb0701434c51c1fbf76" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "7adc933dabcc7c86ae6b07aff7ee68eac398491f" }, "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, - "mini.nvim": { "branch": "main", "commit": "bf8169f3e518be8de3f88073ace37d91f576cb04" }, - "mini.pick": { "branch": "main", "commit": "0b3599e6df730f3ced3359d33c674288de0d186d" }, - "neogit": { "branch": "master", "commit": "5d1b65d6215928e941e1a6a4e76e02fd45ada31f" }, + "mini.nvim": { "branch": "main", "commit": "a35f08f63b73f0ffac045cd175fb2a22e167c39c" }, + "mini.pick": { "branch": "main", "commit": "04e73ab07222508361095bb6e27621b315e6b9f1" }, + "neogit": { "branch": "master", "commit": "f8674ec894315c02449b61c9de9a116c5aafeb90" }, "neoscroll.nvim": { "branch": "master", "commit": "c8d29979cb0cb3a2437a8e0ae683fd82f340d3b8" }, + "neotest": { "branch": "master", "commit": "4e2cd42c4252ee9d2435571d9adcdbc1d47931fe" }, + "neotest-plenary": { "branch": "master", "commit": "3523adcf9ffaad1911960c5813b0136c1b63a2ec" }, + "neotest-python": { "branch": "master", "commit": "1b56ca4ba51c6014f986d6548ee629bdc95589d1" }, + "neotest-vim-test": { "branch": "master", "commit": "75c4228882ae4883b11bfce9b8383e637eb44192" }, "nui-components.nvim": { "branch": "main", "commit": "1654dd709f13874089eefc80d82e0eb667f7fdfb" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, "nvim-colorpicker": { "branch": "main", "commit": "88f6aeac944570ebfb97ac67c9fea27a73ea0429" }, - "nvim-dap": { "branch": "master", "commit": "531771530d4f82ad2d21e436e3cc052d68d7aebb" }, - "nvim-java": { "branch": "main", "commit": "f36a376dfebbbb4cf382008ea6e8b70d40049112" }, - "nvim-lspconfig": { "branch": "master", "commit": "a683e0ddf0cf64c6cd689e18ffb480ade3c162b7" }, + "nvim-dap": { "branch": "master", "commit": "9e848e09a697ee95302a3ef2dd43fd6eb709e570" }, + "nvim-java": { "branch": "main", "commit": "9e8b842ea9eff3ebf25fb7360908ed4d4f87c56a" }, + "nvim-lspconfig": { "branch": "master", "commit": "e7ca2c95ba316a8b846d3f3546d407908c5c4ccb" }, + "nvim-nio": { "branch": "master", "commit": "edcc181a875301dd21840189aa2f2f9ad69fc172" }, "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, - "nvim-tree.lua": { "branch": "master", "commit": "fb343438d49fba8c35ecc4829d66fca7a1f0ed3d" }, - "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, - "nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" }, - "obsidian.nvim": { "branch": "main", "commit": "a0abc4f89d7228ee72091fcb31b46955e7d89a4c" }, + "nvim-tree.lua": { "branch": "master", "commit": "4213bd6eabac38b16dd6615002b6243b23cf3bf6" }, + "nvim-treesitter": { "branch": "main", "commit": "7248feaca45e4d944591497964bc19afa89ad1c6" }, + "nvim-web-devicons": { "branch": "master", "commit": "0ca28b61a04fe7426cefbdd52c2647ef0e335b5f" }, + "obsidian.nvim": { "branch": "main", "commit": "bf1616d46e72477ad978051363fdb5c839c1cce5" }, "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "remote-nvim.nvim": { "branch": "main", "commit": "9992c2fb8bf4f11aca2c8be8db286b506f92efcb" }, - "render-markdown.nvim": { "branch": "main", "commit": "5adf0895310c1904e5abfaad40a2baad7fe44a07" }, + "render-markdown.nvim": { "branch": "main", "commit": "f422cb5c6855f150e2ddcfaf44e7157b98b34f6a" }, "resize.nvim": { "branch": "main", "commit": "0b8943ef2ce54e65b9e56974e94dee593b28e7b5" }, - "ripgrep": { "branch": "master", "commit": "82313cf95849bfe425109ad9506a52154879b1b1" }, + "ripgrep": { "branch": "master", "commit": "227381db0ee83dfa4341f1e27ff9617c0f5ad992" }, "snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" }, "spring-boot.nvim": { "branch": "main", "commit": "218c0c26c14d99feca778e4d13f5ec3e8b1b60f0" }, "sudo.nvim": { "branch": "main", "commit": "10c211716f0f0149ea91732bc12338ade76d4af8" }, "telescope.nvim": { "branch": "master", "commit": "e69b434b968a33815e2f02a5c7bd7b8dd4c7d4b2" }, "themery.nvim": { "branch": "main", "commit": "bfa58f4b279d21cb515b28023e1b68ec908584b2" }, "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, + "transparent.nvim": { "branch": "main", "commit": "e00ca1cf09caef575edf8da7e5a8b9193893b4c7" }, "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, - "ts-comments.nvim": { "branch": "main", "commit": "123a9fb12e7229342f807ec9e6de478b1102b041" }, + "ts-comments.nvim": { "branch": "main", "commit": "a59d6092213447450191122c9346f309161504cb" }, "typr": { "branch": "main", "commit": "584e4ef34dea25a4035627794322f315b22d1253" }, + "vim-be-good": { "branch": "master", "commit": "0ae3de14eb8efc6effe7704b5e46495e91931cc5" }, "vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" }, "vim-signature": { "branch": "master", "commit": "6bc3dd1294a22e897f0dcf8dd72b85f350e306bc" }, "vim-termhere": { "branch": "main", "commit": "b66d429dd48b74802f09fd059bc499c253372a1c" }, "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, - "vimtex": { "branch": "master", "commit": "fedb7ffc1bebf254cc74e7419c3a5930b6719065" }, + "vimtex": { "branch": "master", "commit": "6368e31fdaf766ff908a2c06e9ee14fc66dec409" }, "volt": { "branch": "main", "commit": "620de1321f275ec9d80028c68d1b88b409c0c8b1" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } } diff --git a/lua/autocommands.lua b/lua/autocommands.lua index 8d5590c..ff9c1da 100644 --- a/lua/autocommands.lua +++ b/lua/autocommands.lua @@ -11,6 +11,8 @@ end local kitty_group = vim.api.nvim_create_augroup("KittyOpacity", { clear = true }) vim.api.nvim_create_autocmd("VimEnter", { + vim.api.nvim_set_hl(0, "Normal", { bg = "NONE", ctermbg = "NONE" }), + vim.api.nvim_set_hl(0, "NormalNC", { bg = "NONE", ctermbg = "NONE" }), group = kitty_group, callback = function() set_kitty_opacity(nvim_opacity) @@ -24,3 +26,18 @@ vim.api.nvim_create_autocmd("VimLeave", { end, }) + +vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + callback = function() + vim.hl.on_yank() + end, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = { "toggleterm", "NvimTree", "help", "dashboard" }, + callback = function() + vim.b.miniindentscope_disable = true + end, +}) diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua index 99ca0df..8ed3c63 100644 --- a/lua/config/lsp.lua +++ b/lua/config/lsp.lua @@ -3,6 +3,7 @@ require('lspconfig') local lsp_servers = { 'clangd', 'pyright', + 'bashls', 'lua_ls', } for _, server in ipairs(lsp_servers) do @@ -24,6 +25,9 @@ for _, server in ipairs(lsp_servers) do }, } end + if server == 'bashls' then + config.filetypes = { 'sh', 'bash', 'zsh' } + end -- Apply the config and enable vim.lsp.config(server, config) diff --git a/lua/custom-functions.lua b/lua/custom-functions.lua index 1c6aa61..3115e8f 100644 --- a/lua/custom-functions.lua +++ b/lua/custom-functions.lua @@ -16,6 +16,24 @@ function C.RunCommand(Command) end, 50) return "" end +-- Save current layout snapshot +-- vim.keymap.set("n", "ss", function() +function C.saveSnapshot() + vim.cmd("mksession! " .. vim.fn.stdpath("config") .. "/layout_snap.vim") + print("Layout snapshot saved.") +end + +-- Restore layout snapshot +-- vim.keymap.set("n", "sr", function() +function C.returnSnapshot() + local path = vim.fn.stdpath("config") .. "/layout_snap.vim" + if vim.fn.filereadable(path) == 1 then + vim.cmd("source " .. path) + print("Layout snapshot restored.") + else + print("No layout snapshot found.") + end +end return C diff --git a/lua/keybinds.lua b/lua/keybinds.lua index 2f5ff58..79dc88e 100644 --- a/lua/keybinds.lua +++ b/lua/keybinds.lua @@ -12,9 +12,14 @@ vim.cmd('silent! tmapclear') -- Clears Terminal maps package.loaded["custom-functions"] = nil local utils = require("custom-functions") --- move betwwen buffer easier +-- move betwwen buffers and tabs easier vim.keymap.set('n','' ,':bnext') vim.keymap.set('n','' ,':bprev') +vim.keymap.set('n','' ,':tabNext') --TODO fix these +vim.keymap.set('n','' ,':tabprevious') +vim.keymap.set('n','tx' ,':tabclose') +vim.keymap.set('n','tn' ,':tabnew') +vim.keymap.set('n','bx' ,':bdelete') vim.keymap.set('n','x' ,':bdelete') -- resizing pains with resize.lua shortcut vim.keymap.set('n','' ,"lua require('resize').ResizeLeft()") @@ -24,14 +29,35 @@ vim.keymap.set('n','' ,"lua require('resize').ResizeDown()") -- terminal interface shortcuts vim.keymap.set('n','' ,'nohlsearch') vim.keymap.set('t','' ,'' ,{ desc = 'Exit terminal mode' }) -vim.keymap.set('n','r' ,'TermExec cmd="clear && make"' ,{ desc = '[r]un make in terminal' }) +vim.keymap.set('t','' ,'' ,{ desc = 'Move focus to the left window' }) +-- vim.keymap.set('n','r' ,'TermExec cmd="clear && make"' ,{ desc = '[r]un make in terminal' }) vim.keymap.set('n','l' ,function() utils.RunCommand("l") end ,{ desc = 'run [l]ast command in terminal' }) -vim.keymap.set('n','nn' ,'ToggleTerm direction=vertical name=compile size=70', { desc = 'open a [n]ew terminal' }) -vim.keymap.set('n','nt' ,'ToggleTerm' ,{desc = '[T]oggle all terminals'}) +vim.keymap.set('n','ss' ,function() utils.saveSnapshot() end ,{ desc = '[S]ave a [S]napshot of the current windows' }) +vim.keymap.set('n','sr' ,function() utils.returnSnapshot() end ,{ desc = '[R]eturn to saved [S]napshot' }) +vim.keymap.set('n','n' ,'ToggleTerm direction=vertical name=compile size=70', { desc = 'open a [n]ew terminal' }) +vim.keymap.set('n','te' ,'ToggleTerm' ,{desc = '[T]oggle all terminals'}) vim.keymap.set("n","e" ,"NvimTreeToggle" ,{desc = 'open [E]xplorer'}) +vim.keymap.set("n","E" ,"e!" ,{desc = '[E]dit current file from disk'}) +vim.keymap.set("n","" ,"e!" ,{desc = '[E]dit current file from disk'}) -- Diagnostic keymaps vim.keymap.set('n', 'q' ,vim.diagnostic.setloclist ,{ desc = 'Open diagnostic [Q]uickfix list' }) vim.keymap.set("n", "R" ,"source %:echo 'Config reloaded!'" ,{ desc = "[S]ource config file"}) +vim.keymap.set("n", "k" ,"source /home/venus/.config/nvim/lua/keybinds.lua:echo 'Config reloaded!'" ,{ desc = "[R]eload [k]eybinds"}) +vim.keymap.set("n", "c" ,"source /home/venus/.config/nvim/lua/autocommands.lua:echo 'Config reloaded!'" ,{ desc = "[R]eload [a]utocommands"}) +vim.keymap.set("n", "o" ,"source /home/venus/.config/nvim/lua/options.lua:echo 'Config reloaded!'" ,{ desc = "[R]eload [o]ptions"}) +-- LSP functions +vim.keymap.set('n', 'gd' ,vim.lsp.buf.definition, { desc = "LSP Go to Definition" }) +vim.keymap.set('n', 'gr' ,'Telescope lsp_references' ,{ desc = "LSP [R]eferences" }) +vim.keymap.set('n', 'gi' ,'Telescope lsp_implementations' ,{ desc = "LSP [I]mplementations" }) +vim.keymap.set('n', 'gs' ,'Telescope lsp_document_symbols' ,{ desc = "LSP Document [S]ymbols" }) +vim.keymap.set('n', 'sk' ,'Telescope keymaps' ,{ desc = "[S]earch [K]eymaps" }) +vim.keymap.set('n', 'sd' ,'Telescope diagnostics' ,{ desc = "[S]earch [D]iagnostics" }) +vim.keymap.set('n', 'sw' ,'Telescope grep_string' ,{ desc = "[S]earch current [W]ord" }) +vim.keymap.set('n', 'ff' ,'Telescope find_files' ,{ desc = 'Telescope find files' }) +vim.keymap.set('n', 'fg' ,'Telescope live_grep' ,{ desc = 'Telescope live grep' }) +vim.keymap.set('n', 'fb' ,'Telescope buffers' ,{ desc = 'Telescope buffers' }) +vim.keymap.set('n', 'fh' ,'Telescope help_tags' ,{ desc = 'Telescope help tags' }) +vim.keymap.set('n', 'tt' ,'Telescope' ,{ desc = 'Open [T]elescope' }) -- Disable arrow keys in normal mode vim.keymap.set('n','' ,'echo "Use h to move!!"') @@ -52,13 +78,18 @@ vim.keymap.set("n","" ,"J" ,{ desc = "Move window to the lower vim.keymap.set("n","" ,"K" ,{ desc = "Move window to the upper" }) -- [[ Basic QOL --- vim.keymap.set("n", "a", ":IncRename ", {desc = 'ren[A]me variable under cursor'}) +vim.keymap.set("n", "rn" ,":IncRename " ,{ desc = '[R]e[n]ame variable under cursor'}) +vim.keymap.set('n', 'I' ,'GuessIndent' ,{ desc = '[G]uess Indent level' }) +vim.keymap.set("n", "i" ,"m'gg=G''" ,{ desc = "Re-indent whole file" }) +vim.keymap.set("n", "y" ,"m'ggyG''" ,{ desc = "[Y]ank whole file" }) +vim.keymap.set("n", "" ,"m'ggyG''" ,{ desc = "[Y]ank whole file" }) +vim.keymap.set("n", "sr" ,[[:%s/\<\>//gI]] ,{ desc = "[S]earch/[R]eplace word under cursor" }) -- PLUGIN KEYBINDS -vim.keymap.set({ "n", "v" } ,"aa" ,"CodeCompanionActions" ,{ desc = "CodeCompanion - Actions" }) -vim.keymap.set({ "n", "v" } ,"ac" ,"CodeCompanionChat Toggle" ,{ desc = "CodeCompanion - Chat" }) -vim.keymap.set({ "n", "v" } ,"ai" ,"CodeCompanion" ,{ desc = "CodeCompanion - Inline" }) -vim.keymap.set("v" ,"ad" ,"CodeCompanionChat Add" ,{ desc = "CodeCompanion - Add to Chat" }) +vim.keymap.set({ "n", "v" } ,"aa" ,"CodeCompanionActions" ,{ desc = "CodeCompanion - Actions" }) +vim.keymap.set({ "n", "v" } ,"ac" ,"CodeCompanionChat Toggle" ,{ desc = "CodeCompanion - Chat" }) +vim.keymap.set({ "n", "v" } ,"ai" ,"CodeCompanion" ,{ desc = "CodeCompanion - Inline" }) +vim.keymap.set("v" ,"ad" ,"CodeCompanionChat Add" ,{ desc = "CodeCompanion - Add to Chat" }) -- Expand 'cc' into 'CodeCompanion' in the command line vim.cmd([[cab cc CodeCompanion]]) @@ -73,21 +104,5 @@ vim.keymap.set('n', 'hh' ,'Hex' ,{ desc = 'open [H]ex view -- gg bound to UI toggle vim.keymap.set('n', 'gg' ,'Neogit' ,{ desc = 'open Neo[g]it interface' }) vim.keymap.set('n', 'gc' ,'Neogit commit' ,{ desc = 'open Neogit [c]ommit page' }) - - --- Telecope -vim.keymap.set('n', 'ff' ,'Telescope find_files' ,{ desc = 'Telescope find files' }) -vim.keymap.set('n', 'fg' ,'Telescope live_grep' ,{ desc = 'Telescope live grep' }) -vim.keymap.set('n', 'fb' ,'Telescope buffers' ,{ desc = 'Telescope buffers' }) -vim.keymap.set('n', 'fh' ,'Telescope help_tags' ,{ desc = 'Telescope help tags' }) -vim.keymap.set('n', 't' ,'Telescope' ,{ desc = 'Open [T]elescope' }) - - - - - - - - - - +vim.keymap.set('n', 'gd' ,'Neogit diff' ,{ desc = 'open Neogit [d]iff page' }) +vim.keymap.set('n', 'gt' ,'Neogit tagg' ,{ desc = 'open Neogit [t]agg page' }) diff --git a/lua/matugen.lua b/lua/matugen.lua index e5fd389..d0c4a26 100644 --- a/lua/matugen.lua +++ b/lua/matugen.lua @@ -3,24 +3,24 @@ function M.setup() require('base16-colorscheme').setup { -- Background tones - base00 = '#121316', -- Default Background - base01 = '#1e2022', -- Lighter Background (status bars) - base02 = '#282a2d', -- Selection Background - base03 = '#8d9199', -- Comments, Invisibles + base00 = '#000000', -- Default Background + base01 = '#110d1a', -- Lighter Background (status bars) + base02 = '#1a1428', -- Selection Background + base03 = '#644c94', -- Comments, Invisibles -- Foreground tones - base04 = '#c3c6cf', -- Dark Foreground (status bars) - base05 = '#e2e2e6', -- Default Foreground - base06 = '#e2e2e6', -- Light Foreground - base07 = '#e2e2e6', -- Lightest Foreground + base04 = '#b58fff', -- Dark Foreground (status bars) + base05 = '#e8d8ff', -- Default Foreground + base06 = '#e8d8ff', -- Light Foreground + base07 = '#e8d8ff', -- Lightest Foreground -- Accent colors - base08 = '#ffb4ab', -- Variables, XML Tags, Errors - base09 = '#d7bee4', -- Integers, Constants - base0A = '#bbc7db', -- Classes, Search Background - base0B = '#9fcaff', -- Strings, Diff Inserted - base0C = '#d7bee4', -- Regex, Escape Chars - base0D = '#9fcaff', -- Functions, Methods - base0E = '#bbc7db', -- Keywords, Storage - base0F = '#93000a', -- Deprecated, Embedded Tags + base08 = '#ff6f9b', -- Variables, XML Tags, Errors + base09 = '#d8b4ff', -- Integers, Constants + base0A = '#c79aff', -- Classes, Search Background + base0B = '#b58fff', -- Strings, Diff Inserted + base0C = '#bd80ff', -- Regex, Escape Chars + base0D = '#ab80ff', -- Functions, Methods + base0E = '#b880ff', -- Keywords, Storage + base0F = '#bc0039', -- Deprecated, Embedded Tags } end diff --git a/lua/options.lua b/lua/options.lua index e14d78d..2c36ce4 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -17,6 +17,7 @@ vim.opt.spellcapcheck = "" vim.o.number = true -- Make line numbers default vim.o.relativenumber = true vim.o.showmode = false +vim.o.foldmethod = "marker" -- Sync clipboard between OS and Neovim. -- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. diff --git a/lua/plugins/codecompanion.lua b/lua/plugins/codecompanion.lua index 88067dc..c4afa1b 100644 --- a/lua/plugins/codecompanion.lua +++ b/lua/plugins/codecompanion.lua @@ -4,7 +4,10 @@ return { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", }, + + --{{{ Options opts = { + --- {{{ Display display = { chat = { window = { @@ -24,17 +27,23 @@ return { } }, }, + -- }}} + -- + -- {{{ INTERACTIONS interactions = { chat = { - adapter = "gemini_pro", -- Removed the curly braces + adapter = "ollama_coder", -- Removed the curly braces }, inline = { adapter = "ollama_coder", -- Removed the curly braces }, + background = { + adapter = "ollama_bg", -- Pointed this to the new extended adapter string + } }, - background = { - adapter = "ollama_bg", -- Pointed this to the new extended adapter string - }, + -- }}} + -- + -- {{{ Adapters adapters = { http = { gemini_pro = function() @@ -81,5 +90,40 @@ return { end, }, }, + -- }}} + -- + -- {{{ Library + prompt_library = { + ["Local Executor"] = { + strategy = "chat", + description = "Executes implementation diffs locally and writes TDD test cases.", + opts = { + adapter = "ollama_coder", -- Force it to use your local hardware + is_default = false, + is_slash_cmd = false, + }, + prompts = { + { + role = "system", + content = [[You are the Last Mile Executor. + You run in a stateless context. I will provide you with a unified diff and a testing plan. + Your strict execution order is: + 1. Output the test case file modifications first (SDET-first). + 2. Output the production implementation code modifications. + + Do not write markdown headers (H1/H2). Use code blocks with the language ID. + Precede every code block with a line comment specifying the exact 'filepath:'. + Do not use bash syntax; adhere strictly to POSIX sh if writing shell automation. + Do not execute terminal commands directly. Output the code blocks for manual unstaged review.]], + }, + { + role = "user", + content = "I am ready to provide the Planner's diff. Await my input.", + }, + }, + }, + }, + -- }}} } + --}}} } diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua new file mode 100644 index 0000000..43fe358 --- /dev/null +++ b/lua/plugins/copilot.lua @@ -0,0 +1,17 @@ +return { + { + "zbirenbaum/copilot.lua", + cmd = "Copilot", + event = "InsertEnter", + opts = { + suggestion = { + enabled = false, + -- debounce = 150, + -- auto_trigger = true, + -- keymap = { accept = "M-CR"} + }, + panel = { enabled = false }, + }, + }, + { "giuxtaposition/blink-cmp-copilot", dependencies = { "zbirenbaum/copilot.lua" } } +} diff --git a/lua/plugins/guessIndent.lua b/lua/plugins/guessIndent.lua index c8b54fc..a84a3b2 100644 --- a/lua/plugins/guessIndent.lua +++ b/lua/plugins/guessIndent.lua @@ -1,8 +1,10 @@ return { 'NMAC427/guess-indent.nvim', - config = function() - require('guess-indent').setup ({ - filetype_exclude = {"lua"}, - }) + config = function() + require('guess-indent').setup { + auto_cmd = true, -- Set to false to disable automatic execution + filetype_exclude = { 'netrw', 'tutor' }, -- A list of filetypes for which the auto command gets disabled + buftype_exclude = { 'help', 'nofile', 'terminal', 'prompt' }, -- A list of buffer types for which the auto command gets disabled + } end, } -- Detect tabstop and shiftwidth automatically diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 983f227..204b539 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -10,71 +10,99 @@ return { -- adds lsp functionality and api for included languages opts = { keymap = { - preset = 'none', - [''] = { 'select_next', 'fallback' }, - [''] = { 'select_prev', 'fallback' }, - [''] = { 'accept', 'fallback' }, - [''] = { 'show', 'show_documentation', 'hide_documentation' }, + preset = 'none', + [''] = { 'show', 'show_documentation', 'hide_documentation' }, + [''] = { 'hide', 'fallback' }, + -- Use home-row modifications for navigation + [''] = { 'select_next', 'fallback' }, + [''] = { 'select_prev', 'fallback' }, + -- A robust Tab behavior that accepts selections and jumps through snippets + [''] = { + function(cmp) + if cmp.is_visible() then return cmp.accept() end + if cmp.snippet_active() then return cmp.snippet_forward() end + end, + 'fallback' + }, + [''] = { + function(cmp) + if cmp.snippet_active() then return cmp.snippet_backward() end + end, + 'fallback' + }, }, - sources = { - default = { 'lsp', 'path', 'snippets', 'buffer' }, + -- keymap = { + -- preset = 'none', + -- [''] = { 'select_next', 'fallback' }, + -- [''] = { 'select_prev', 'fallback' }, + -- [''] = { 'accept', 'fallback' }, + -- [''] = { 'show', 'show_documentation', 'hide_documentation' }, + -- }, + sources = { + default = { 'lsp', 'path', 'snippets', 'buffer', 'copilot' }, + providers = { + copilot = { name = 'copilot', module = 'blink-cmp-copilot', score_offset = 100, async = true } + }, + }, + completion = { + ghost_text = { enabled = true }, + }, }, }, - }, - { + { 'MeanderingProgrammer/render-markdown.nvim', dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.nvim' }, -- if you use the mini.nvim suite ---@module 'render-markdown' - }, - config = function() - local lspconfig = require('lspconfig') - -- Since you are using blink.cmp, extract its capabilities - local capabilities = require('blink.cmp').get_lsp_capabilities() + }, + config = function() + local lspconfig = require('lspconfig') + -- Since you are using blink.cmp, extract its capabilities + local capabilities = require('blink.cmp').get_lsp_capabilities() - -- Configure OmniSharp for C# / nanoFramework development - lspconfig.omnisharp.setup({ - capabilities = capabilities, - cmd = { "omnisharp" }, - settings = { - FormattingOptions = { - EnableEditorConfigSupport = true, + -- Configure OmniSharp for C# / nanoFramework development + lspconfig.omnisharp.setup({ + capabilities = capabilities, + cmd = { "omnisharp" }, + settings = { + FormattingOptions = { + EnableEditorConfigSupport = true, + }, + MsBuild = { + LoadProjectsOnDemand = false, + }, }, - MsBuild = { - LoadProjectsOnDemand = false, - }, - }, - on_attach = function(client, bufnr) - local opts = { buffer = bufnr, remap = false } - vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) - vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) - vim.keymap.set("n", "ca", function() vim.lsp.buf.code_action() end, opts) - end, - }) - end - }, - }, - { - "folke/lazydev.nvim", - ft = "lua", -- only load on lua files - opts = { - library = { - -- Only load luvit types when the `vim.uv` word is found - { path = "${3rd}/luv/library", words = { "vim%.uv" } }, - -- always load the LazyVim library - "LazyVim", - -- Only load the lazyvim library when the `LazyVim` global is found - { path = "LazyVim", words = { "LazyVim" } }, - -- Load the wezterm types when the `wezterm` module is required - -- Needs `DrKJeff16/wezterm-types` to be installed - { path = "wezterm-types", mods = { "wezterm" } }, - -- Load the xmake types when opening file named `xmake.lua` - -- Needs `LelouchHe/xmake-luals-addon` to be installed - { path = "xmake-luals-addon/library", files = { "xmake.lua" } }, + on_attach = function(client, bufnr) + local opts = { buffer = bufnr, remap = false } + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) + vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) + vim.keymap.set("n", "ca", function() vim.lsp.buf.code_action() end, opts) + end, + }) + end }, - -- disable when a .luarc.json file is found - enabled = function(root_dir) - return not vim.uv.fs_stat(root_dir .. "/.luarc.json") - end, }, - }, -} + { + "folke/lazydev.nvim", + ft = "lua", -- only load on lua files + opts = { + library = { + -- Only load luvit types when the `vim.uv` word is found + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + -- always load the LazyVim library + "LazyVim", + -- Only load the lazyvim library when the `LazyVim` global is found + { path = "LazyVim", words = { "LazyVim" } }, + -- Load the wezterm types when the `wezterm` module is required + -- Needs `DrKJeff16/wezterm-types` to be installed + { path = "wezterm-types", mods = { "wezterm" } }, + -- Load the xmake types when opening file named `xmake.lua` + -- Needs `LelouchHe/xmake-luals-addon` to be installed + { path = "xmake-luals-addon/library", files = { "xmake.lua" } }, + }, + -- disable when a .luarc.json file is found + enabled = function(root_dir) + return not vim.uv.fs_stat(root_dir .. "/.luarc.json") + end, + }, + }, + } diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua new file mode 100644 index 0000000..9ffe8fd --- /dev/null +++ b/lua/plugins/neotest.lua @@ -0,0 +1,34 @@ +return { + "nvim-neotest/neotest", + dependencies = { + "nvim-neotest/nvim-nio", + "antoinemadec/FixCursorHold.nvim", + "nvim-treesitter/nvim-treesitter", + "nvim-neotest/neotest-python", + "nvim-neotest/neotest-plenary", + "rcarriga/neotest-vim-test", + }, + config = function() + local neotest = require("neotest") + neotest.setup({ + adapters = { + require("neotest-python")({ + dap = { justMyCode = false }, + runner = "pytest", + python = ".venv/bin/python" + }), + require("neotest-plenary"), + require("neotest-vim-test")({ + ignore_file_types = { "python", "vim", "lua" }, + }), + }, + }) + vim.keymap.set('n', 'tr' ,function() neotest.run.run() end ,{ desc = 'Neo[T]est [R]un' }) + vim.keymap.set('n', 'tf' ,function() neotest.run.run(vim.fn.expand("%")) end ,{ desc = 'Neo[T]est Run [F]ile' }) + vim.keymap.set('n', 'td' ,function() neotest.run.run({ strategy = "dap" }) end ,{ desc = 'Neo[T]est [D]ebug' }) + vim.keymap.set('n', 'to' ,function() neotest.output_panel.toggle() end ,{ desc = 'Neo[T]est [O]utput Panel' }) + vim.keymap.set('n', 'ts' ,function() neotest.summary.toggle() end ,{ desc = 'Neo[T]est [S]ummary Sidebar' }) + vim.keymap.set('n', ']t' ,function() neotest.jump.next({ status = 'failed' }) end,{ desc = 'Next Failed Test' }) + vim.keymap.set('n', '[t' ,function() neotest.jump.prev({ status = 'failed' }) end,{ desc = 'Prev Failed Test' }) +end, +} diff --git a/tar_error.log b/tar_error.log new file mode 100644 index 0000000..e69de29