From f5fd3c03445d90dda32adc4b62408ffac39b5a56 Mon Sep 17 00:00:00 2001 From: gibbyb Date: Fri, 15 Aug 2025 16:37:31 -0500 Subject: [PATCH] chillin --- configs/dotfiles/nvim/.luarc.json | 10 + configs/dotfiles/nvim/init.lua | 2 +- configs/dotfiles/nvim/lazy-lock.json | 55 -- configs/dotfiles/nvim/lua/config/autocmd.lua | 61 ++ configs/dotfiles/nvim/lua/config/init.lua | 69 +- configs/dotfiles/nvim/lua/config/keymaps.lua | 40 + configs/dotfiles/nvim/lua/config/lazy.lua | 27 - configs/dotfiles/nvim/lua/config/options.lua | 21 + configs/dotfiles/nvim/lua/config/remap.lua | 71 -- configs/dotfiles/nvim/lua/config/set.lua | 34 - configs/dotfiles/nvim/lua/plugins/avante.lua | 455 +++++------ configs/dotfiles/nvim/lua/plugins/barbar.lua | 53 +- configs/dotfiles/nvim/lua/plugins/cloak.lua | 38 +- configs/dotfiles/nvim/lua/plugins/colors.lua | 13 + configs/dotfiles/nvim/lua/plugins/image.lua | 57 +- configs/dotfiles/nvim/lua/plugins/init.lua | 14 + .../dotfiles/nvim/lua/plugins/leetcode.lua | 20 - configs/dotfiles/nvim/lua/plugins/lsp.lua | 497 ++++++------ configs/dotfiles/nvim/lua/plugins/lualine.lua | 120 ++- configs/dotfiles/nvim/lua/plugins/neotree.lua | 731 ++++++++---------- .../nvim/lua/plugins/nerdcommenter.lua | 17 +- configs/dotfiles/nvim/lua/plugins/rest.lua | 12 - configs/dotfiles/nvim/lua/plugins/snacks.lua | 11 + .../dotfiles/nvim/lua/plugins/telescope.lua | 62 +- .../dotfiles/nvim/lua/plugins/tokyonight.lua | 55 -- .../dotfiles/nvim/lua/plugins/treesitter.lua | 191 ++--- configs/dotfiles/nvim/lua/plugins/trouble.lua | 46 +- .../dotfiles/nvim/lua/plugins/undotree.lua | 17 +- defaults/bash/aliases | 2 + themes/openbar | 286 +++++++ 30 files changed, 1482 insertions(+), 1605 deletions(-) create mode 100644 configs/dotfiles/nvim/.luarc.json delete mode 100644 configs/dotfiles/nvim/lazy-lock.json create mode 100644 configs/dotfiles/nvim/lua/config/autocmd.lua create mode 100644 configs/dotfiles/nvim/lua/config/keymaps.lua delete mode 100644 configs/dotfiles/nvim/lua/config/lazy.lua create mode 100644 configs/dotfiles/nvim/lua/config/options.lua delete mode 100644 configs/dotfiles/nvim/lua/config/remap.lua delete mode 100644 configs/dotfiles/nvim/lua/config/set.lua create mode 100644 configs/dotfiles/nvim/lua/plugins/colors.lua create mode 100644 configs/dotfiles/nvim/lua/plugins/init.lua delete mode 100644 configs/dotfiles/nvim/lua/plugins/leetcode.lua delete mode 100644 configs/dotfiles/nvim/lua/plugins/rest.lua create mode 100644 configs/dotfiles/nvim/lua/plugins/snacks.lua delete mode 100755 configs/dotfiles/nvim/lua/plugins/tokyonight.lua create mode 100644 themes/openbar diff --git a/configs/dotfiles/nvim/.luarc.json b/configs/dotfiles/nvim/.luarc.json new file mode 100644 index 0000000..8d7ba94 --- /dev/null +++ b/configs/dotfiles/nvim/.luarc.json @@ -0,0 +1,10 @@ +{ + "runtime.version": "LuaJIT", + "runtime.path": [ + "lua/?.lua", + "lua/?/init.lua" + ], + "diagnostics.globals": ["vim"], + "workspace.checkThirdParty": false, + "workspace.library": [ "$VIMRUNTIME" ] +} diff --git a/configs/dotfiles/nvim/init.lua b/configs/dotfiles/nvim/init.lua index dbc863e..b3fe4e3 100644 --- a/configs/dotfiles/nvim/init.lua +++ b/configs/dotfiles/nvim/init.lua @@ -1 +1 @@ -require("config") +require('config') diff --git a/configs/dotfiles/nvim/lazy-lock.json b/configs/dotfiles/nvim/lazy-lock.json deleted file mode 100644 index 3d7fcad..0000000 --- a/configs/dotfiles/nvim/lazy-lock.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, - "avante.nvim": { "branch": "main", "commit": "c10e383019280edf6433b422603be45294c9ccf5" }, - "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, - "cloak.nvim": { "branch": "main", "commit": "648aca6d33ec011dc3166e7af3b38820d01a71e4" }, - "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, - "cmp-dotenv": { "branch": "main", "commit": "4dd53aab60982f1f75848aec5e6214986263325e" }, - "cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" }, - "cmp-nerdfont": { "branch": "main", "commit": "e97482344ebed29093015a18c155057adf5c842b" }, - "cmp-npm": { "branch": "main", "commit": "2337f109f51a09297596dd6b538b70ccba92b4e4" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, - "cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f94f7ba948e32cd302caba1c2ca3f7c697fb4fcf" }, - "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, - "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, - "cmp-tw2css": { "branch": "main", "commit": "1abe0eebcb57fcbd5538d054f0db61f4e4a1302b" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "8132ec733eed3bf415b97b76797ca41b59f51d7d" }, - "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, - "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, - "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "fzf-lua": { "branch": "main", "commit": "3d4342120cf12f36b60a8161a8835b111ec5ec9a" }, - "gitsigns.nvim": { "branch": "main", "commit": "1b0350ab707713b2bc6c236151f1a324175347b1" }, - "image.nvim": { "branch": "master", "commit": "4c51d6202628b3b51e368152c053c3fb5c5f76f2" }, - "img-clip.nvim": { "branch": "main", "commit": "d8b6b030672f9f551a0e3526347699985a779d93" }, - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "leetcode.nvim": { "branch": "master", "commit": "db7e1cd6b9191b34b4c1f2f96e4e3949cde9f951" }, - "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, - "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "c4c84f4521d62de595c0d0f718a9a40c1890c8ce" }, - "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "mcphub.nvim": { "branch": "main", "commit": "1eb7bec18f3927ee7fa468e0a176812383669596" }, - "mini.hipatterns": { "branch": "main", "commit": "d71c21167d6bd5f21c9ecf90912c510f9edfc02b" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, - "nerdcommenter": { "branch": "master", "commit": "02a3b6455fa07b61b9440a78732f1e9b7876c991" }, - "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-autopairs": { "branch": "master", "commit": "2647cce4cb64fb35c212146663384e05ae126bdf" }, - "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, - "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, - "nvim-lspconfig": { "branch": "master", "commit": "6bba673aa8993eceec233be17b42ddfb9540794b" }, - "nvim-notify": { "branch": "master", "commit": "a22f5d7ac511c2df2fd3290a9f04c48d5a822e2e" }, - "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-treesitter-context": { "branch": "master", "commit": "1a1a7c5d6d75cb49bf64049dafab15ebe294a79f" }, - "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, - "nvim-web-devicons": { "branch": "master", "commit": "19d6211c78169e78bab372b585b6fb17ad974e82" }, - "nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" }, - "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "render-markdown.nvim": { "branch": "main", "commit": "24aacee83544ca113055564ed22be7852067c342" }, - "rest.nvim": { "branch": "main", "commit": "de9726ab956e30202aafbcdea83c1d6bffe54227" }, - "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, - "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, - "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, - "undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" } -} diff --git a/configs/dotfiles/nvim/lua/config/autocmd.lua b/configs/dotfiles/nvim/lua/config/autocmd.lua new file mode 100644 index 0000000..dedbf77 --- /dev/null +++ b/configs/dotfiles/nvim/lua/config/autocmd.lua @@ -0,0 +1,61 @@ +local augroup = vim.api.nvim_create_augroup +local gib_group = augroup('Gib', {}) +local autocmd = vim.api.nvim_create_autocmd +local createcmd = vim.api.nvim_create_user_command +local yank_group = augroup('HighlightYank', {}) + +function R(name) + require("plenary.reload").reload_module(name) +end + +autocmd('TextYankPost', { + group = yank_group, + pattern = '*', + callback = function() + vim.highlight.on_yank({ + higroup = 'IncSearch', + timeout = 40, + }) + end, +}) + +autocmd({"BufWritePre"}, { + group = gib_group, + pattern = "*", + command = [[%s/\s\+$//e]], +}) + +autocmd({'BufWritePost'}, { + pattern = 'init.lua', + command = 'source ', +}) + +autocmd('LspAttach', { + group = gib_group, + callback = function(e) + local opts = { buffer = e.buf } + vim.keymap.set('n', 'kf', vim.lsp.buf.format) + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) + vim.keymap.set("n", "kw", function() vim.lsp.buf.workspace_symbol() end, opts) + vim.keymap.set("n", "kd", function() vim.diagnostic.open_float() end, opts) + vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) + vim.keymap.set("n", "re", function() vim.lsp.buf.references() end, opts) + vim.keymap.set("n", "rn", function() vim.lsp.buf.rename() end, opts) + vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) + end +}) + +createcmd("Format", function(args) + local range + if args.count ~= -1 then + local start_line = vim.fn.line("'<") + local end_line = vim.fn.line("'>") + range = { start = { start_line, 0 }, ["end"] = { end_line, 0 } } + end + require("conform").format({ + async = true, + lsp_fallback = true, -- if no external formatter, use LSP + range = range, + }) +end, { range = true, desc = "Format current buffer or range" }) +vim.keymap.set({ "n", "v" }, "fk", ":Format", { silent = true, desc = "Format" }) diff --git a/configs/dotfiles/nvim/lua/config/init.lua b/configs/dotfiles/nvim/lua/config/init.lua index bbdc550..ed53431 100644 --- a/configs/dotfiles/nvim/lua/config/init.lua +++ b/configs/dotfiles/nvim/lua/config/init.lua @@ -1,65 +1,4 @@ -require('config.set') -require('config.remap') -require("config.lazy") - -local augroup = vim.api.nvim_create_augroup -local GibGroup = augroup('Gib', {}) - -local autocmd = vim.api.nvim_create_autocmd -local yank_group = augroup('HighlightYank', {}) - -function R(name) - require("plenary.reload").reload_module(name) -end - -vim.filetype.add({ - extension = { - templ = 'templ', - } -}) - -autocmd('TextYankPost', { - group = yank_group, - pattern = '*', - callback = function() - vim.highlight.on_yank({ - higroup = 'IncSearch', - timeout = 40, - }) - end, -}) - -autocmd({"BufWritePre"}, { - group = GibGroup, - pattern = "*", - command = [[%s/\s\+$//e]], -}) - -autocmd('BufEnter', { - group = GibGroup, - callback = function() - if vim.bo.filetype == "zig" then - vim.cmd.colorscheme("tokyonight-moon") - else - vim.cmd.colorscheme("tokyonight-moon") - end - end -}) - - -autocmd('LspAttach', { - group = GibGroup, - callback = function(e) - local opts = { buffer = e.buf } - vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) - vim.keymap.set("n", "H", function() vim.lsp.buf.hover() end, opts) - vim.keymap.set("n", "kw", function() vim.lsp.buf.workspace_symbol() end, opts) - vim.keymap.set("n", "kd", function() vim.diagnostic.open_float() end, opts) - vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) - vim.keymap.set("n", "re", function() vim.lsp.buf.references() end, opts) - vim.keymap.set("n", "rn", function() vim.lsp.buf.rename() end, opts) - vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) - vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) - vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) - end -}) +require('config.options') +require('config.keymaps') +require('plugins') +require('config.autocmd') diff --git a/configs/dotfiles/nvim/lua/config/keymaps.lua b/configs/dotfiles/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..11e48e9 --- /dev/null +++ b/configs/dotfiles/nvim/lua/config/keymaps.lua @@ -0,0 +1,40 @@ +vim.g.mapleader = ' ' +vim.keymap.set('n', 's', ':update :source') +vim.keymap.set('n', 'x', ':!chmod +x %', { silent = true }) +vim.keymap.set({'n', 'v', 'x'}, 'h', 'h') +vim.keymap.set({'n', 'v', 'x'}, 'j', 'j') +vim.keymap.set({'n', 'v', 'x'}, 'k', 'k') +vim.keymap.set({'n', 'v', 'x'}, 'l', 'l') +vim.keymap.set('n', 'w', ':write') +vim.keymap.set('n', 'q', ':quit') +-- Move the selected lines up or down one line and reselect +vim.keymap.set('v', 'J', ':m \'>+1gv=gv') +vim.keymap.set('v', 'K', ':m \'<-2gv=gv') +-- Join the current line with the line below and reposition the cursor +vim.keymap.set('n', 'J', 'mzJ`z') +-- Scroll down or up and reposition the cursor +vim.keymap.set('n', '', 'zz') +vim.keymap.set('n', '', 'zz') +-- Search forward and reposition the cursor +vim.keymap.set('n', 'n', 'nzzzv') +-- Search backward and reposition the cursor +vim.keymap.set('n', 'N', 'Nzzzv') +-- Paste the selection from the system clipboard +vim.keymap.set({'n', 'v', 'x'}, 'p', [["+p]]) +vim.keymap.set({'n', 'v', 'x'}, 'P', [["+P]]) +-- Move selected text to the black hole register & replace with copied text. +vim.keymap.set('x', 'v', [["_dP]]) +-- Yank (copy) the selection to the system clipboard +vim.keymap.set({'n', 'v'}, 'y', [["+y]]) +-- Yank (copy) the entire buffer to the system clipboard +vim.keymap.set('n', 'yy', [["+Y]]) +-- Yank all the text in the file to the system clipboard +vim.keymap.set('n', 'YY', 'gg"+yG') +-- Delete the selection without yanking (copying) it +vim.keymap.set({'n', 'v'}, 'd', [["_d]]) +-- Delete the line without yanking (copying) it +vim.keymap.set('n', 'dd', [["_dd]]) +-- Map Q in Normal mode to do nothing (nop) +vim.keymap.set('n', 'Q', '') +-- Perform a search and replace operation using the word under the cursor +vim.keymap.set('n', 'sr', [[:%s/\<\>//gI]]) diff --git a/configs/dotfiles/nvim/lua/config/lazy.lua b/configs/dotfiles/nvim/lua/config/lazy.lua deleted file mode 100644 index 92a90f0..0000000 --- a/configs/dotfiles/nvim/lua/config/lazy.lua +++ /dev/null @@ -1,27 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) ---vim.g.mapleader = " " ---vim.g.maplocalleader = "\\" - --- Setup lazy.nvim -require("lazy").setup({ - spec = { - { import = 'plugins' }, - }, - install = { colorscheme = { "tokyonight-moon" } }, - -- automatically check for plugin updates - --checker = { enabled = true }, -}) diff --git a/configs/dotfiles/nvim/lua/config/options.lua b/configs/dotfiles/nvim/lua/config/options.lua new file mode 100644 index 0000000..42c3c2b --- /dev/null +++ b/configs/dotfiles/nvim/lua/config/options.lua @@ -0,0 +1,21 @@ +vim.o.number = true +vim.o.relativenumber = true +vim.o.winborder = 'rounded' +vim.o.tabstop = 2 +vim.o.softtabstop = 2 +vim.o.shiftwidth = 2 +vim.o.expandtab = true +vim.o.smartindent = true +vim.o.swapfile = false +vim.o.undodir = os.getenv('HOME') .. '/.vim/undodir' +vim.o.undofile = true +vim.o.hlsearch = true +vim.o.incsearch = true +vim.o.termguicolors = true +vim.o.scrolloff = 4 +vim.o.signcolumn = 'yes' +vim.o.updatetime = 50 +vim.opt.isfname:append('@-@') +vim.cmd([[set list]]) +vim.cmd([[set listchars=trail:⋅,nbsp:⋅,tab:\ \ ]]) +vim.cmd(':hi statusline guibg=NONE') diff --git a/configs/dotfiles/nvim/lua/config/remap.lua b/configs/dotfiles/nvim/lua/config/remap.lua deleted file mode 100644 index aac72e7..0000000 --- a/configs/dotfiles/nvim/lua/config/remap.lua +++ /dev/null @@ -1,71 +0,0 @@ --- Remaps ---------------------------------------------- --- Set leader to space -vim.g.mapleader = " " - --- Move the selected lines up or down one line and reselect -vim.keymap.set("v", "J", ":m '>+1gv=gv") -vim.keymap.set("v", "K", ":m '<-2gv=gv") - --- Join the current line with the line below and reposition the cursor -vim.keymap.set("n", "J", "mzJ`z") - --- Scroll down or up and reposition the cursor -vim.keymap.set("n", "", "zz") -vim.keymap.set("n", "", "zz") - --- Search forward and reposition the cursor -vim.keymap.set("n", "n", "nzzzv") - --- Search backward and reposition the cursor -vim.keymap.set("n", "N", "Nzzzv") - --- Paste the selection from the system clipboard -vim.keymap.set({"n", "v"}, "v", [["+p]]) -vim.keymap.set({"n", "v"}, "V", [["+P]]) - --- Move selected text to the black hole register & replace with copied text. -vim.keymap.set("x", "p", [["_dP]]) - --- Yank (copy) the selection to the system clipboard -vim.keymap.set({"n", "v"}, "y", [["+y]]) - --- Yank (copy) the entire buffer to the system clipboard -vim.keymap.set("n", "Y", [["+Y]]) - --- Yank all the text in the file to the system clipboard -vim.keymap.set("n", "YY", "gg\"+yG") - --- Delete the selection without yanking (copying) it -vim.keymap.set({"n", "v"}, "d", [["_d]]) - --- Delete the line without yanking (copying) it -vim.keymap.set("n", "dd", [["_dd]]) - --- Map Q in Normal mode to do nothing (nop) -vim.keymap.set("n", "Q", "") - --- Format the current buffer using the language server protocol (LSP) -vim.keymap.set("n", "kf", vim.lsp.buf.format) - --- Perform a search and replace operation using the word under the cursor -vim.keymap.set("n", "sr", [[:%s/\<\>//gI]]) - --- Make the current file executable (chmod +x) -vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) - --- Source the current file -vim.keymap.set("n", "", vim.cmd.so) - - --- Jump to the next location in the quickfix list and reposition the cursor --- vim.keymap.set("n", "", "cnextzz") - --- Jump to the previous location in the quickfix list and reposition the cursor --- vim.keymap.set("n", "", "cprevzz") - --- Jump to the next location in the location list and reposition the cursor ---vim.keymap.set("n", "k", "lnextzz") - --- Jump to the previous location in the location list and reposition the cursor ---vim.keymap.set("n", "j", "lprevzz") diff --git a/configs/dotfiles/nvim/lua/config/set.lua b/configs/dotfiles/nvim/lua/config/set.lua deleted file mode 100644 index 4d817b2..0000000 --- a/configs/dotfiles/nvim/lua/config/set.lua +++ /dev/null @@ -1,34 +0,0 @@ -vim.opt.nu = true -vim.opt.relativenumber = true - -vim.opt.tabstop = 2 -vim.opt.softtabstop = 2 -vim.opt.shiftwidth = 2 -vim.opt.expandtab = true - -vim.opt.smartindent = true - -vim.opt.wrap = true - -vim.opt.swapfile = false -vim.opt.backup = false -vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" -vim.opt.undofile = true - -vim.opt.hlsearch = false -vim.opt.incsearch = true - -vim.opt.termguicolors = true - -vim.opt.scrolloff = 8 -vim.opt.signcolumn = "yes" -vim.opt.isfname:append("@-@") - -vim.opt.updatetime = 50 -vim.cmd([[set list]]) ---vim.cmd([[set listchars=trail:⋅]]) -vim.cmd([[set listchars=trail:⋅,nbsp:⋅,tab:\ \ ]]) - -vim.opt.colorcolumn = "100" -vim.o.background = "dark" -- or "light" for light mode ---vim.cmd([[colorscheme tokyonight-moon]]) diff --git a/configs/dotfiles/nvim/lua/plugins/avante.lua b/configs/dotfiles/nvim/lua/plugins/avante.lua index 79a14fe..5ccff7b 100644 --- a/configs/dotfiles/nvim/lua/plugins/avante.lua +++ b/configs/dotfiles/nvim/lua/plugins/avante.lua @@ -1,247 +1,220 @@ -return { - { - "yetone/avante.nvim", - event = "VeryLazy", - version = false, -- Never set this value to "*"! Never! - opts = { - ---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string - provider = "claude", -- The provider used in Aider mode or in the planning phase of Cursor Planning Mode - ---@alias Mode "agentic" | "legacy" - mode = "agentic", -- The default mode for interaction. "agentic" uses tools to automatically generate code, "legacy" uses the old planning method to generate code. - -- WARNING: Since auto-suggestions are a high-frequency operation and therefore expensive, - -- currently designating it as `copilot` provider is dangerous because: https://github.com/yetone/avante.nvim/issues/1048 - -- Of course, you can reduce the request frequency by increasing `suggestion.debounce`. - auto_suggestions_provider = "claude", - providers = { - claude = { - endpoint = "https://api.anthropic.com", - model = "claude-sonnet-4-20250514", - extra_request_body = { - temperature = 0.75, - max_tokens = 4096, - }, - }, - openai = { - endpoint = "https://api.openai.com/v1", - model = "gpt-4o", - extra_request_body = { - timeout = 30000, - temperature = 0, - max_completion_tokens = 8192, - }, - }, - }, - web_search_engine = { - provider = "searxng", - proxy = nil, - }, - system_prompt = function() - local hub = require("mcphub").get_hub_instance() - return hub and hub:get_active_servers_prompt() or "" - end, - custom_tools = function() - return { - require("mcphub.extensions.avante").mcp_tool(), - } - end, - ---Specify the special dual_boost mode - ---1. enabled: Whether to enable dual_boost mode. Default to false. - ---2. first_provider: The first provider to generate response. Default to "openai". - ---3. second_provider: The second provider to generate response. Default to "claude". - ---4. prompt: The prompt to generate response based on the two reference outputs. - ---5. timeout: Timeout in milliseconds. Default to 60000. - ---How it works: - --- When dual_boost is enabled, avante will generate two responses from the first_provider and second_provider respectively. Then use the response from the first_provider as provider1_output and the response from the second_provider as provider2_output. Finally, avante will generate a response based on the prompt and the two reference outputs, with the default Provider as normal. - ---Note: This is an experimental feature and may not work as expected. - dual_boost = { - enabled = false, - first_provider = "openai", - second_provider = "claude", - prompt = "Based on the two reference outputs below, generate a response that incorporates elements from both but reflects your own judgment and unique perspective. Do not provide any explanation, just give the response directly. Reference Output 1: [{{provider1_output}}], Reference Output 2: [{{provider2_output}}]", - timeout = 60000, -- Timeout in milliseconds - }, - behaviour = { - auto_suggestions = false, -- Experimental stage - auto_set_highlight_group = true, - auto_set_keymaps = true, - auto_apply_diff_after_generation = false, - support_paste_from_clipboard = false, - minimize_diff = true, -- Whether to remove unchanged lines when applying a code block - enable_token_counting = true, -- Whether to enable token counting. Default to true. - }, - mappings = { - --- @class AvanteConflictMappings - diff = { - ours = "co", - theirs = "ct", - all_theirs = "ca", - both = "cb", - cursor = "cc", - next = "]x", - prev = "[x", - }, - suggestion = { - accept = "", - next = "", - prev = "", - dismiss = "", - }, - jump = { - next = "]]", - prev = "[[", - }, - submit = { - normal = "", - insert = "", - }, - cancel = { - normal = { "", "", "q" }, - insert = { "" }, - }, - sidebar = { - apply_all = "A", - apply_cursor = "a", - retry_user_request = "r", - edit_user_request = "e", - switch_windows = "", - reverse_switch_windows = "", - remove_file = "d", - add_file = "@", - close = { "", "q" }, - close_from_input = nil, -- e.g., { normal = "", insert = "" } - }, - }, - hints = { enabled = true }, - windows = { - ---@type "right" | "left" | "top" | "bottom" - position = "right", -- the position of the sidebar - wrap = true, -- similar to vim.o.wrap - width = 35, -- default % based on available width - sidebar_header = { - enabled = true, -- true, false to enable/disable the header - align = "center", -- left, center, right for title - rounded = true, - }, - input = { - prefix = "> ", - height = 8, -- Height of the input window in vertical layout - }, - edit = { - border = "rounded", - start_insert = true, -- Start insert mode when opening the edit window - }, - ask = { - floating = false, -- Open the 'AvanteAsk' prompt in a floating window - start_insert = true, -- Start insert mode when opening the ask window - border = "rounded", - ---@type "ours" | "theirs" - focus_on_apply = "ours", -- which diff to focus after applying - }, - }, - highlights = { - ---@type AvanteConflictHighlights - diff = { - current = "DiffText", - incoming = "DiffAdd", - }, - }, - --- @class AvanteConflictUserConfig - diff = { - autojump = true, - ---@type string | fun(): any - list_opener = "copen", - --- Override the 'timeoutlen' setting while hovering over a diff (see :help timeoutlen). - --- Helps to avoid entering operator-pending mode with diff mappings starting with `c`. - --- Disable by setting to -1. - override_timeoutlen = 500, - }, - suggestion = { - debounce = 600, - throttle = 600, - }, - }, - build = "make", -- or `make BUILD_FROM_SOURCE=true` - dependencies = { - "nvim-treesitter/nvim-treesitter", - "stevearc/dressing.nvim", - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions - "ibhagwan/fzf-lua", -- for file_selector provider fzf - "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons - { - -- support for image pasting - "HakonHarnes/img-clip.nvim", - event = "VeryLazy", - opts = { - -- recommended settings - default = { - embed_image_as_base64 = false, - prompt_for_file_name = false, - drag_and_drop = { - insert_mode = true, - }, - }, - }, +vim.pack.add({ + { src = 'https://github.com/yetone/avante.nvim' }, + { src = 'https://github.com/nvim-lua/plenary.nvim' }, + { src = 'https://github.com/MunifTanjim/nui.nvim' }, + { src = 'https://github.com/hrsh7th/nvim-cmp' }, + { src = 'https://github.com/nvim-treesitter/nvim-treesitter' }, + { src = 'https://github.com/stevearc/dressing.nvim' }, + { src = 'https://github.com/nvim-tree/nvim-web-devicons' }, + { src = 'https://github.com/HakonHarnes/img-clip.nvim' }, + { src = 'https://github.com/MeanderingProgrammer/render-markdown.nvim' }, + { src = 'https://github.com/ravitemer/mcphub.nvim' }, +}) +require'avante'.setup({ + provider = 'openai', + auto_suggestions_provider = 'openai', + providers = { + claude = { + endpoint = 'https://api.anthropic.com', + model = 'claude-sonnet-4-20250514', + timeout = 30000, + extra_request_body = { + temperature = 0.75, + max_tokens = 4096, }, - { - 'MeanderingProgrammer/render-markdown.nvim', - opts = { - file_types = { "markdown", "Avante" }, - }, - ft = { "markdown", "Avante" }, + }, + openai = { + endpoint = 'https://api.openai.com/v1', + model = 'gpt-5', + extra_request_body = { + timeout = 30000, + temperature = 0, + max_completion_tokens = 8192, }, }, }, - { - "ravitemer/mcphub.nvim", - dependencies = { - "nvim-lua/plenary.nvim", + rag_service = { + enabled = false, + host_path = '/home/gib/Documents/Code', + runner = 'docker', + llm = { + provider = 'openai', + endpoint = 'https://api.openai.com/v1', + api_key = 'OPENAI_API_KEY', + model = 'gpt-4o-mini', + extra = { + temperature = 0.7, + max_tokens = 512, + timeout = 60, + }, }, - opts = { - config = vim.fn.expand("~/.config/mcphub/servers.json"), -- Absolute path to MCP Servers config file (will create if not exists) - port = 37373, -- The port `mcp-hub` server listens to - shutdown_delay = 60 * 10 * 000, -- Delay in ms before shutting down the server when last instance closes (default: 10 minutes) - use_bundled_binary = false, -- Use local `mcp-hub` binary (set this to true when using build = "bundled_build.lua") - mcp_request_timeout = 60000, --Max time allowed for a MCP tool or resource to execute in milliseconds, set longer for long running tasks - - ---Chat-plugin related options----------------- - auto_approve = false, -- Auto approve mcp tool calls - auto_toggle_mcp_servers = true, -- Let LLMs start and stop MCP servers automatically - extensions = { - avante = { - make_slash_commands = true, -- make /slash commands from MCP server prompts - } - }, - - --- Plugin specific options------------------- - native_servers = {}, -- add your custom lua native servers here - ui = { - window = { - width = 0.8, -- 0-1 (ratio); "50%" (percentage); 50 (raw number) - height = 0.8, -- 0-1 (ratio); "50%" (percentage); 50 (raw number) - align = "center", -- "center", "top-left", "top-right", "bottom-left", "bottom-right", "top", "bottom", "left", "right" - relative = "editor", - zindex = 50, - border = "rounded", -- "none", "single", "double", "rounded", "solid", "shadow" - }, - wo = { -- window-scoped options (vim.wo) - winhl = "Normal:MCPHubNormal,FloatBorder:MCPHubBorder", - }, - }, - on_ready = function(hub) - -- Called when hub is ready - end, - on_error = function(err) - -- Called on errors - end, - log = { - level = vim.log.levels.WARN, - to_file = false, - file_path = nil, - prefix = "MCPHub", - }, - }, - build = "npm install -g mcp-hub@latest", + embed = { + provider = 'openai', + endpoint = 'https://api.openai.com/v1', + api_key = 'OPENAI_API_KEY', + model = 'text-embedding-3-large', + extra = nil, + }, + docker_extra_args = '', }, -} + web_search_engine = { + provider = 'searxng', + proxy = nil, + }, + system_prompt = function() + local hub = require('mcphub').get_hub_instance() + return hub and hub:get_active_servers_prompt() or '' + end, + custom_tools = function() + return { + require('mcphub.extensions.avante').mcp_tool(), + } + end, + behaviour = { + auto_suggestions = false, + auto_set_highlight_group = true, + auto_set_keymaps = true, + auto_apply_diff_after_generation = false, + support_paste_from_clipboard = false, + minimize_diff = true, + enable_token_counting = true, + auto_approve_tool_permissions = true, + }, + mappings = { + --- @class AvanteConflictMappings + diff = { + ours = 'co', + theirs = 'ct', + all_theirs = 'ca', + both = 'cb', + cursor = 'cc', + next = ']x', + prev = '[x', + }, + suggestion = { + accept = '', + next = '', + prev = '', + dismiss = '', + }, + jump = { + next = ']]', + prev = '[[', + }, + submit = { + normal = '', + insert = '', + }, + cancel = { + normal = { '', '', 'q' }, + insert = { '' }, + }, + sidebar = { + apply_all = 'A', + apply_cursor = 'a', + retry_user_request = 'r', + edit_user_request = 'e', + switch_windows = '', + reverse_switch_windows = '', + remove_file = 'd', + add_file = '@', + close = { '', 'q' }, + close_from_input = nil, + }, + }, + hints = { enabled = true }, + windows = { + ---@type 'right' | 'left' | 'top' | 'bottom' + position = 'right', + wrap = true, + width = 35, + sidebar_header = { + enabled = true, + align = 'center', + rounded = true, + }, + input = { + prefix = '> ', + height = 8, + }, + edit = { + border = 'rounded', + start_insert = true, + }, + ask = { + floating = false, + start_insert = true, + border = 'rounded', + ---@type 'ours' | 'theirs' + focus_on_apply = 'ours', + }, + }, + highlights = { + diff = { + current = 'DiffText', + incoming = 'DiffAdd', + }, + }, + --- @class AvanteConflictUserConfig + diff = { + autojump = true, + ---@type string | fun(): any + list_opener = 'copen', + override_timeoutlen = 500, + }, + suggestion = { + debounce = 1000, + throttle = 1000, + }, +}) +require'img-clip'.setup({ + default = { + embed_image_as_base64 = false, + prompt_for_file_name = false, + drag_and_drop = { + insert_mode = true, + }, + }, +}) +require'render-markdown'.setup({ + file_types = { 'markdown', 'Avante' }, +}) +require'mcphub'.setup({ + config = vim.fn.expand('/home/gib/.config/mcphub/servers.json'), + port = 37373, + shutdown_delay = 60 * 10 * 000, + use_bundled_binary = false, + mcp_request_timeout = 60000, + auto_approve = true, + auto_toggle_mcp_servers = true, + extensions = { + avante = { + make_slash_commands = true, + }, + }, + + native_servers = {}, + ui = { + window = { + width = 0.8, + height = 0.8, + align = 'center', + relative = 'editor', + zindex = 50, + border = 'rounded', + }, + wo = { + winhl = 'Normal:MCPHubNormal,FloatBorder:MCPHubBorder', + }, + }, + --on_ready = function(hub) + --end, + --on_error = function(err) + --end, + log = { + level = vim.log.levels.WARN, + to_file = false, + file_path = nil, + prefix = 'MCPHub', + }, +}) diff --git a/configs/dotfiles/nvim/lua/plugins/barbar.lua b/configs/dotfiles/nvim/lua/plugins/barbar.lua index 775c982..6b14052 100644 --- a/configs/dotfiles/nvim/lua/plugins/barbar.lua +++ b/configs/dotfiles/nvim/lua/plugins/barbar.lua @@ -1,38 +1,15 @@ -return { - { - 'romgrk/barbar.nvim', dependencies = { - 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status - 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons - }, - init = function() - vim.g.barbar_auto_setup = false - end, - opts = { - animation = true, - insert_at_start = true, - }, - version = '^1.0.0', - keys = { - -- Move to prev/next tab - { "", "BufferPrevious", mode = "n", desc = "Prev tab" }, - { "", "BufferNext", mode = "n", desc = "Next tab" }, - -- Re-order buffers - { "", "BufferMovePrevious", mode = "n", desc = "Move tab left" }, - { "", "BufferMoveNext", mode = "n", desc = "Move tab right" }, - -- Close buffers - { "", "BufferClose", mode = "n", desc = "Close tab" }, - { "", "BufferCloseAllButCurrent", mode = "n", desc = "Close all but current" }, - -- Goto tab in position… - { "1", "BufferGoto 1", mode = "n", desc = "Go to tab 1" }, - { "2", "BufferGoto 2", mode = "n", desc = "Go to tab 2" }, - { "3", "BufferGoto 3", mode = "n", desc = "Go to tab 3" }, - { "4", "BufferGoto 4", mode = "n", desc = "Go to tab 4" }, - { "5", "BufferGoto 5", mode = "n", desc = "Go to tab 5" }, - { "6", "BufferGoto 6", mode = "n", desc = "Go to tab 6" }, - { "7", "BufferGoto 7", mode = "n", desc = "Go to tab 7" }, - { "8", "BufferGoto 8", mode = "n", desc = "Go to tab 8" }, - { "9", "BufferGoto 9", mode = "n", desc = "Go to tab 9" }, - { "0", "BufferLast", mode = "n", desc = "Go to last tab" }, - }, - }, -} +vim.pack.add({ + { src = 'https://github.com/romgrk/barbar.nvim' }, + { src = 'https://github.com/lewis6991/gitsigns.nvim' }, + { src = 'https://github.com/nvim-tree/nvim-web-devicons' }, +}) +require'barbar'.setup({ + animation = true, + insert_at_start = true +}) +vim.keymap.set({'n'}, '', ':BufferPrevious') +vim.keymap.set({'n'}, '', ':BufferNext') +vim.keymap.set({'n'}, '', ':BufferMovePrevious') +vim.keymap.set({'n'}, '', ':BufferMoveNext') +vim.keymap.set({'n'}, '', ':BufferClose') +vim.keymap.set({'n'}, '', ':BufferCloseAllButCurrent') diff --git a/configs/dotfiles/nvim/lua/plugins/cloak.lua b/configs/dotfiles/nvim/lua/plugins/cloak.lua index 867e3d0..78af1a1 100644 --- a/configs/dotfiles/nvim/lua/plugins/cloak.lua +++ b/configs/dotfiles/nvim/lua/plugins/cloak.lua @@ -1,20 +1,18 @@ -return { - { - 'laytan/cloak.nvim', - opts = { - enabled = false, - cloak_character = "•", - highlight_group = "Comment", - patterns = { - { - file_pattern = { - '.env*', - 'wrangler.toml', - '.dev.vars', - }, - cloak_pattern = "=.+" - }, - }, - }, - }, -} +vim.pack.add({ + { src = 'https://github.com/laytan/cloak.nvim' }, +}) +require'cloak'.setup({ + enabled = false, + cloak_character = "•", + highlight_group = "Comment", + patterns = { + { + file_pattern = { + '.env*', + 'wrangler.toml', + '.dev.vars', + }, + cloak_pattern = "=.+" + }, + }, +}) diff --git a/configs/dotfiles/nvim/lua/plugins/colors.lua b/configs/dotfiles/nvim/lua/plugins/colors.lua new file mode 100644 index 0000000..8a6b3ec --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/colors.lua @@ -0,0 +1,13 @@ +vim.pack.add({ + { src = 'https://github.com/folke/tokyonight.nvim' }, +}) +require('tokyonight').setup({ + style = 'moon', + transparent = true, + on_colors = function(colors) + colors.comment = '#a0a7c5' + colors.fg_gutter = '#787f93' + colors.terminal_black = '#828bb8' + end, +}) +vim.cmd('colorscheme tokyonight-moon') diff --git a/configs/dotfiles/nvim/lua/plugins/image.lua b/configs/dotfiles/nvim/lua/plugins/image.lua index c17e00b..d630fbd 100644 --- a/configs/dotfiles/nvim/lua/plugins/image.lua +++ b/configs/dotfiles/nvim/lua/plugins/image.lua @@ -1,33 +1,28 @@ -return { - { - "3rd/image.nvim", - event = "VeryLazy", - dependencies = { - "nvim-treesitter/nvim-treesitter", +vim.pack.add({ + { src = 'https://github.com/3rd/image.nvim' }, + { src = 'https://github.com/nvim-treesitter/nvim-treesitter'} +}) +require'image'.setup({ + backend = "kitty", + integrations = { + markdown = { + enabled = true, + clear_in_insert_mode = false, + download_remote_images = true, + only_render_image_at_cursor = false, + filetypes = { "markdown", "vimwiki" }, + }, + neorg = { + enabled = true, + clear_in_insert_mode = false, + download_remote_images = true, + only_render_image_at_cursor = false, + filetypes = { "norg" }, }, - opts = { - backend = "kitty", - integrations = { - markdown = { - enabled = true, - clear_in_insert_mode = false, - download_remote_images = true, - only_render_image_at_cursor = false, - filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here - }, - neorg = { - enabled = true, - clear_in_insert_mode = false, - download_remote_images = true, - only_render_image_at_cursor = false, - filetypes = { "norg" }, - }, - }, - max_width = nil, - max_height = nil, - max_width_window_percentage = nil, - max_height_window_percentage = 50, - kitty_method = "normal", - }, }, -} + max_width = nil, + max_height = nil, + max_width_window_percentage = nil, + max_height_window_percentage = 50, + kitty_method = "normal", +}) diff --git a/configs/dotfiles/nvim/lua/plugins/init.lua b/configs/dotfiles/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..b7bffcb --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/init.lua @@ -0,0 +1,14 @@ +require'plugins.avante' +require'plugins.barbar' +require'plugins.colors' +require'plugins.cloak' +require'plugins.image' +require'plugins.lsp' +require'plugins.lualine' +require'plugins.neotree' +require'plugins.nerdcommenter' +require'plugins.snacks' +require'plugins.telescope' +require'plugins.treesitter' +require'plugins.trouble' +require'plugins.undotree' diff --git a/configs/dotfiles/nvim/lua/plugins/leetcode.lua b/configs/dotfiles/nvim/lua/plugins/leetcode.lua deleted file mode 100644 index 5255161..0000000 --- a/configs/dotfiles/nvim/lua/plugins/leetcode.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - { - 'kawre/leetcode.nvim', - build = ':TSUpdate html', - dependencies = { - 'nvim-telescope/telescope.nvim', - 'nvim-lua/plenary.nvim', - 'MunifTanjim/nui.nvim', - 'nvim-treesitter/nvim-treesitter', - 'rcarriga/nvim-notify', - 'nvim-tree/nvim-web-devicons', - '3rd/image.nvim', - }, - opts = { - arg = "lc", - lang = "typescript", - image_support = false, - }, - }, -} diff --git a/configs/dotfiles/nvim/lua/plugins/lsp.lua b/configs/dotfiles/nvim/lua/plugins/lsp.lua index 5e991bd..77b4dc6 100644 --- a/configs/dotfiles/nvim/lua/plugins/lsp.lua +++ b/configs/dotfiles/nvim/lua/plugins/lsp.lua @@ -1,254 +1,251 @@ -local root_files = { - '.luarc.json', - '.luarc.jsonc', - '.luacheckrc', - '.stylua.toml', - 'stylua.toml', - 'selene.toml', - 'selene.yml', - '.git', -} +vim.pack.add({ + { src = 'https://github.com/mason-org/mason.nvim' }, + { src = 'https://github.com/neovim/nvim-lspconfig' }, + { src = 'https://github.com/mason-org/mason-lspconfig.nvim' }, + { src = 'https://github.com/hrsh7th/nvim-cmp' }, + { src = 'https://github.com/hrsh7th/cmp-nvim-lsp' }, + { src = 'https://github.com/nvim-lua/plenary.nvim' }, + { src = 'https://github.com/hrsh7th/cmp-nvim-lsp-document-symbol' }, + { src = 'https://github.com/hrsh7th/cmp-nvim-lua' }, + { src = 'https://github.com/hrsh7th/cmp-path' }, + { src = 'https://github.com/hrsh7th/cmp-buffer' }, + { src = 'https://github.com/hrsh7th/cmp-emoji' }, + { src = 'https://github.com/chrisgrieser/cmp-nerdfont' }, + { src = 'https://github.com/jcha0713/cmp-tw2css' }, + { src = 'https://github.com/SergioRibera/cmp-dotenv' }, + { src = 'https://github.com/saadparwaiz1/cmp_luasnip' }, + { src = 'https://github.com/onsails/lspkind.nvim' }, + { src = 'https://github.com/rafamadriz/friendly-snippets' }, + { src = 'https://github.com/j-hui/fidget.nvim' }, + { src = 'https://github.com/David-Kunz/cmp-npm' }, + { src = 'https://github.com/stevearc/conform.nvim' }, + { + src = 'https://github.com/L3MON4D3/LuaSnip', + version = vim.version.range('2') + }, + { src = 'https://github.com/supermaven-inc/supermaven-nvim' }, + { src = 'https://github.com/garyhurtz/cmp_kitty' }, + { src = 'https://github.com/windwp/nvim-autopairs' }, + { src = 'https://github.com/windwp/nvim-ts-autotag' }, + --{ src = 'https://github.com/hrsh7th/cmp-cmdline' }, + --{ src = 'https://github.com/chrisgrieser/cmp-yanky' }, +}) -return { - { - "neovim/nvim-lspconfig", - dependencies = { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - "hrsh7th/nvim-cmp", - "hrsh7th/cmp-nvim-lsp", - 'hrsh7th/cmp-nvim-lsp-document-symbol', - 'hrsh7th/cmp-nvim-lua', - "hrsh7th/cmp-path", - "hrsh7th/cmp-buffer", - 'hrsh7th/cmp-emoji', - 'chrisgrieser/cmp-nerdfont', - 'jcha0713/cmp-tw2css', - 'SergioRibera/cmp-dotenv', - 'saadparwaiz1/cmp_luasnip', - 'onsails/lspkind.nvim', - 'rafamadriz/friendly-snippets', - "j-hui/fidget.nvim", - { - "David-Kunz/cmp-npm", - dependencies = { 'nvim-lua/plenary.nvim' }, - ft = "json", - config = function() - require('cmp-npm').setup({}) - end +local cmp = require 'cmp' +local cmp_lsp = require 'cmp_nvim_lsp' +local lspconfig = require 'lspconfig' +local capabilities = vim.tbl_deep_extend( + 'force', + {}, + vim.lsp.protocol.make_client_capabilities(), + cmp_lsp.default_capabilities() +) +local cmp_select = { behavior = cmp.SelectBehavior.Select } +local lspkind = require 'lspkind' +local cmp_autopairs = require'nvim-autopairs.completion.cmp' +require 'mason'.setup({}) +require 'mason-lspconfig'.setup({ + handlers = { + function(server_name) + require 'lspconfig'[server_name].setup({ + capabilities = capabilities + }) + end, + zls = function() + lspconfig.zls.setup({ + root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"), + settings = { + zls = { + enable_inlay_hints = true, + enable_snippets = true, + warn_style = true, + }, + }, + }) + vim.g.zig_fmt_parse_errors = 0 + vim.g.zig_fmt_autosave = 0 + end, + ["lua_ls"] = function() + lspconfig.lua_ls.setup({ + capabilities = capabilities, + settings = { + Lua = { + format = { + enable = true, + defaultConfig = { + indent_style = "space", + indent_size = "2", + }, + }, + }, + }, + }) + end, + } +}) +cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'buffer' }, + { name = 'supermaven' }, + --{ name = 'luasnip', keyword_length = 2 }, + --{ name = 'buffer', keyword_length = 3 }, + --{ name = 'supermaven', keyword_length = 2 }, + { + name = 'path', + option = { + pathMappings = { + ['@'] = '${folder}/src', + ['/'] = '${folder}/src/public', + ['/components'] = '${folder}/src/components', + }, + trailing_slash = true, }, - "stevearc/conform.nvim", - { - 'L3MON4D3/LuaSnip', - version = 'v2.*', - build = 'make install_jsregexp', - }, - { - 'supermaven-inc/supermaven-nvim', - config = function() - require('supermaven-nvim').setup({ - --keymaps = { - --accept_suggestion = '', - --clear_suggestion = '', - --accept_word = '', - --}, - disable_inline_completion = true, -- for cmp - }) - end, - }, - --{ 'hrsh7th/cmp-cmdline' }, - --{ 'kbwo/cmp-yank' }, - --{ - --'garyhurtz/cmp_kitty', - --init = function() - --require('cmp_kitty'):setup() - --end - --}, }, + { name = 'nvim_lsp_document_symbol' }, + { name = 'nvim_lsp_signature_health' }, + { name = 'nvim_lua' }, + { name = 'nerdfont' }, + { name = 'emoji' }, + { name = 'npm' }, + { name = 'cmp-tw2css' }, + { name = 'dotenv' }, + { name = 'kitty' }, + { name = 'render-markdown' }, + { name = 'cmdline' }, + --{ name = 'cmp_yanky' }, + }, + formatting = { + format = lspkind.cmp_format({ + mode = 'symbol', + maxwidth = { + menu = 50, + abbr = 50, + }, + symbol_map = { + Supermaven = '', + }, + ellipsis_char = '...', + show_labelDetails = true, + before = function(entry, vim_item) + return vim_item + end, + }), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + if cmp.get_selected_entry() then + cmp.confirm({ select = false }) + else + cmp.select_next_item() + end + else + fallback() + end + end, { 'i', 's' }), - config = function() - require("conform").setup({ - formatters_by_ft = { - } - }) - local cmp = require('cmp') - local cmp_lsp = require("cmp_nvim_lsp") - local capabilities = vim.tbl_deep_extend( - "force", - {}, - vim.lsp.protocol.make_client_capabilities(), - cmp_lsp.default_capabilities()) - - require("fidget").setup({}) - require("mason").setup() - require("mason-lspconfig").setup({ - ensure_installed = { - 'bashls', - 'docker_compose_language_service', - 'dockerls', - 'eslint', - 'intelephense', - 'jsonls', - 'gopls', - 'lua_ls', - 'pyright', - 'rust_analyzer', - 'sqlls', - 'tailwindcss', - 'yamlls', - }, - handlers = { - function(server_name) -- default handler (optional) - require("lspconfig")[server_name].setup { - capabilities = capabilities - } - end, - - zls = function() - local lspconfig = require("lspconfig") - lspconfig.zls.setup({ - root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"), - settings = { - zls = { - enable_inlay_hints = true, - enable_snippets = true, - warn_style = true, - }, - }, - }) - vim.g.zig_fmt_parse_errors = 0 - vim.g.zig_fmt_autosave = 0 - - end, - ["lua_ls"] = function() - local lspconfig = require("lspconfig") - lspconfig.lua_ls.setup { - capabilities = capabilities, - settings = { - Lua = { - format = { - enable = true, - -- Put format options here - -- NOTE: the value should be STRING!! - defaultConfig = { - indent_style = "space", - indent_size = "2", - } - }, - } - } - } - end, - } - }) - local cmp_select = { behavior = cmp.SelectBehavior.Select } - - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { - name = 'cmdline', - option = { - ignore_cmds = { 'Man', '!' } - } - } - }) - }) - - local lspkind = require('lspkind') - cmp.setup({ - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) - end, - }, - sources = { - {name = 'supermaven'}, - {name = 'path'}, - {name = 'buffer', keyword_length = 3}, - {name = 'nvim_lsp'}, - {name = 'nvim_lsp_document_symbol'}, - {name = 'nvim_lsp_signature_health'}, - {name = 'nvim_lua'}, - {name = 'luasnip', keyword_length = 2}, - {name = 'nerdfont'}, - {name = 'emoji'}, - {name = 'npm'}, - {name = 'cmp-tw2css'}, - {name = 'dotenv'}, - --{name = 'cmdline'}, - --{name = 'kitty'}, - --{name = 'yank'}, - }, - formatting = { - format = lspkind.cmp_format({ - mode = 'symbol', - maxwidth = { - menu = 50, - abbr = 50, - }, - symbol_map = { - Supermaven = "", - }, - ellipsis_char = '...', - show_labelDetails = true, - before = function (entry, vim_item) - return vim_item - end - }) - }, - mapping = cmp.mapping.preset.insert({ - -- Tab to select the next item - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - if cmp.get_selected_entry() then - cmp.confirm({select = false}) - else - cmp.select_next_item() - end - else - fallback() - end - end, { 'i', 's' }), - - [''] = cmp.mapping.confirm({ select = true }), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.select_prev_item(cmp_select), - [''] = cmp.mapping.select_next_item(cmp_select), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.scroll_docs(-4), - }), - preselect = cmp.PreselectMode.Item, - completion = { - completeopt = 'menu,menuone,noinsert', - } - }) - - vim.diagnostic.config({ - -- update_in_insert = true, - float = { - focusable = false, - style = "minimal", - border = "rounded", - source = "always", - header = "", - prefix = "", - }, - }) - end - }, - { - 'windwp/nvim-autopairs', - event = "InsertEnter", - config = true - }, - { - 'windwp/nvim-ts-autotag', - config = function () - require('nvim-ts-autotag').setup() - end - }, -} + [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.select_prev_item(cmp_select), + [''] = cmp.mapping.select_next_item(cmp_select), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.scroll_docs(-4), + }), + preselect = cmp.PreselectMode.Item, + completion = { + completeopt = 'menu,menuone,noinsert', + }, +}) +cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) +require 'cmp_kitty':setup({}) +require 'cmp-npm'.setup({}) +require 'supermaven-nvim'.setup({ + disable_inline_completion = true, +}) +require 'conform'.setup({ + formatters_by_ft = { + cs = { 'csharpier', 'lsp' }, + javascript = { 'prettierd', 'prettier' }, + javascriptreact = { 'prettierd', 'prettier' }, + typescript = { 'prettierd', 'prettier' }, + typescriptreact = { 'prettierd', 'prettier' }, + json = { 'prettierd', 'prettier' }, + html = { 'prettierd', 'prettier' }, + css = { 'prettierd', 'prettier' }, + lua = { 'stylua' }, + }, +}) +require 'fidget'.setup({}) +require 'nvim-autopairs'.setup({}) +require 'nvim-ts-autotag'.setup({}) +--cmp.setup.cmdline('/', { + --mapping = cmp.mapping.preset.cmdline(), + --sources = { + --{ name = 'buffer' } + --} +--}) +--cmp.setup.cmdline(':', { + --mapping = cmp.mapping.preset.cmdline(), + --sources = cmp.config.sources({ + --{ name = 'path' } + --}, { + --{ + --name = 'cmdline', + --} + --}) +--}) +vim.lsp.enable({ + 'asm_lsp', + 'bashls', + 'cmake', + 'cssls', + 'css_variables', + 'cssmodules_ls', + 'docker_compose_language_service', + 'dockerls', + 'eslint', + 'gopls', + 'gradle_ls', + 'graphql', + 'html', + 'htmx', + 'intelephense', + 'jsonls', + 'kotlin_lsp', + 'lua_ls', + 'markdown_oxide', + 'nginx_language_server', + 'prismals', + 'pyright', + 'rust-analyzer', + 'sqlls', + 'svelte_language_server', + 'tailwindcss', + 'ts_ls', + 'tinymist', + 'yamlls', +}) +vim.diagnostic.config({ + float = { + focusable = false, + style = "minimal", + border = "rounded", + source = true, + header = "", + prefix = "", + }, +}) diff --git a/configs/dotfiles/nvim/lua/plugins/lualine.lua b/configs/dotfiles/nvim/lua/plugins/lualine.lua index fa542f6..925531d 100644 --- a/configs/dotfiles/nvim/lua/plugins/lualine.lua +++ b/configs/dotfiles/nvim/lua/plugins/lualine.lua @@ -1,63 +1,59 @@ -return { - { - 'nvim-lualine/lualine.nvim', - dependencies = { - 'nvim-tree/nvim-web-devicons', - 'folke/tokyonight.nvim', +vim.pack.add({ + { src = 'https://github.com/nvim-lualine/lualine.nvim' }, + { src = 'https://github.com/nvim-tree/nvim-web-devicons' }, + { src = 'https://github.com/folke/tokyonight.nvim' }, +}) +require'lualine'.setup({ + options = { + icons_enabled = true, + theme = 'tokyonight-moon', + component_separators = { left = '', right = ''}, + section_separators = { left = '', right = ''}, + disabled_filetypes = { + statusline = {}, + winbar = {}, }, - opts = { - options = { - icons_enabled = true, - theme = 'tokyonight', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - always_show_tabline = true, - globalstatus = false, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - refresh_time = 16, -- ~60fps - events = { - 'WinEnter', - 'BufEnter', - 'BufWritePost', - 'SessionLoadPost', - 'FileChangedShellPost', - 'VimResized', - 'Filetype', - 'CursorMoved', - 'CursorMovedI', - 'ModeChanged', - }, - } - }, - sections = { - lualine_a = {'mode'}, - lualine_b = {'branch', 'diff', 'diagnostics'}, - lualine_c = {'filename'}, - lualine_x = {'encoding', 'fileformat', 'filetype'}, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {'filename'}, - lualine_x = {'location'}, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {} - }, - } -} + ignore_focus = {}, + always_divide_middle = true, + always_show_tabline = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + refresh_time = 16, + events = { + 'WinEnter', + 'BufEnter', + 'BufWritePost', + 'SessionLoadPost', + 'FileChangedShellPost', + 'VimResized', + 'Filetype', + 'CursorMoved', + 'CursorMovedI', + 'ModeChanged', + }, + } + }, + sections = { + lualine_a = {'mode'}, + lualine_b = {'branch', 'diff', 'diagnostics'}, + lualine_c = {'filename'}, + lualine_x = {'encoding', 'fileformat', 'filetype'}, + lualine_y = {'progress'}, + lualine_z = {'location'} + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = {'filename'}, + lualine_x = {'location'}, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {} +}) diff --git a/configs/dotfiles/nvim/lua/plugins/neotree.lua b/configs/dotfiles/nvim/lua/plugins/neotree.lua index 9d1b564..a7b8c03 100644 --- a/configs/dotfiles/nvim/lua/plugins/neotree.lua +++ b/configs/dotfiles/nvim/lua/plugins/neotree.lua @@ -1,422 +1,315 @@ -return { - -- If you want neo-tree's file operations to work with LSP (updating imports, etc.), you can use a plugin like - -- https://github.com/antosha417/nvim-lsp-file-operations: - { - "antosha417/nvim-lsp-file-operations", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-neo-tree/neo-tree.nvim", - }, - config = function() - require("lsp-file-operations").setup() - end, - }, - { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - {"3rd/image.nvim", opts = {}}, -- Optional image support in preview window: See `# Preview Mode` for more information - { - "s1n7ax/nvim-window-picker", -- for open_with_window_picker keymaps - version = "2.*", - config = function() - require("window-picker").setup({ - filter_rules = { - include_current_win = false, - autoselect_one = true, - -- filter using buffer options - bo = { - -- if the file type is one of following, the window will be ignored - filetype = { "neo-tree", "neo-tree-popup", "notify" }, - -- if the buffer type is one of following, the window will be ignored - buftype = { "terminal", "quickfix" }, - }, - }, - }) - end, +vim.pack.add({ + { + src = 'https://github.com/nvim-neo-tree/neo-tree.nvim', + version = vim.version.range('3') + }, + 'https://github.com/nvim-lua/plenary.nvim', + 'https://github.com/MunifTanjim/nui.nvim', + 'https://github.com/nvim-tree/nvim-web-devicons', + 'https://github.com/antosha417/nvim-lsp-file-operations', + 'https://github.com/3rd/image.nvim', + { + src = 'https://github.com/s1n7ax/nvim-window-picker', + version = vim.version.range('2'), + }, +}) +require('lsp-file-operations').setup() +require('window-picker').setup({ + filter_rules = { + include_current_win = false, + autoselect_one = true, + bo = { + filetype = { "neo-tree", "neo-tree-popup", "notify" }, + buftype = { "terminal", "quickfix" }, + }, + }, +}) +require('neo-tree').setup({ + vim.diagnostic.config({ + signs = { + text = { + [vim.diagnostic.severity.ERROR] = '', + [vim.diagnostic.severity.WARN] = '', + [vim.diagnostic.severity.INFO] = '', + [vim.diagnostic.severity.HINT] = '󰌵', + }, + } + }), + close_if_last_window = true, + enable_git_status = true, + enable_diagnostics = true, + open_files_do_not_replace_types = { 'terminal', 'trouble', 'qf' }, + open_files_using_relative_paths = false, + sort_case_insensitive = true, + sort_function = nil, + default_component_configs = { + container = { + enable_character_fade = true, + }, + indent = { + indent_size = 2, + padding = 1, + with_markers = true, + indent_marker = '│', + last_indent_marker = '└', + highlight = 'NeoTreeIndentMarker', + with_expanders = nil, + expander_collapsed = '', + expander_expanded = '', + expander_highlight = 'NeoTreeExpander', + }, + icon = { + folder_closed = '', + folder_open = '', + folder_empty = '󰜌', + provider = function(icon, node, state) + if node.type == 'file' or node.type == 'terminal' then + local success, web_devicons = pcall(require, 'nvim-web-devicons') + local name = node.type == 'terminal' and 'terminal' or node.name + if success then + local devicon, hl = web_devicons.get_icon(name) + icon.text = devicon or icon.text + icon.highlight = hl or icon.highlight + end + end + end, + default = '*', + highlight = 'NeoTreeFileIcon', + }, + modified = { + symbol = '[+]', + highlight = 'NeoTreeModified', + }, + name = { + trailing_slash = false, + use_git_status_colors = true, + highlight = 'NeoTreeFileName', + }, + git_status = { + symbols = { + added = '', + modified = '', + deleted = '✖', + renamed = '󰁕', + untracked = '', + ignored = '', + unstaged = '󰄱', + staged = '', + conflict = '', }, }, - keys = { - { - 't', - 'Neotree toggle', - mode = { 'n', 'v' }, - desc = 'Toggle neo-tree' - }, - { - 'T', - 'Neotree focus', - mode = { 'n', 'v' }, - desc = 'Focus neo-tree' - }, - { 'h', 'h', mode = { 'n', 'v' }, desc = 'Left' }, - { 'j', 'j', mode = { 'n', 'v' }, desc = 'Down' }, - { 'k', 'k', mode = { 'n', 'v' }, desc = 'Up' }, - { 'l', 'l', mode = { 'n', 'v' }, desc = 'Right' }, - }, - lazy = false, - -----Instead of using `config`, you can use `opts` instead, if you'd like: - ---@module "neo-tree" - ---@type neotree.Config - opts = { - vim.diagnostic.config({ - signs = { - text = { - [vim.diagnostic.severity.ERROR] = '', - [vim.diagnostic.severity.WARN] = '', - [vim.diagnostic.severity.INFO] = '', - [vim.diagnostic.severity.HINT] = '󰌵', - }, - } - }), - -- In older versions, you can define the signs manually: - -- vim.fn.sign_define("DiagnosticSignError", { text = " ", texthl = "DiagnosticSignError" }) - -- vim.fn.sign_define("DiagnosticSignWarn", { text = " ", texthl = "DiagnosticSignWarn" }) - -- vim.fn.sign_define("DiagnosticSignInfo", { text = " ", texthl = "DiagnosticSignInfo" }) - -- vim.fn.sign_define("DiagnosticSignHint", { text = "󰌵", texthl = "DiagnosticSignHint" }) - close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab - popup_border_style = "NC", -- or "" to use 'winborder' on Neovim v0.11+ - enable_git_status = true, - enable_diagnostics = true, - open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes - open_files_using_relative_paths = false, - sort_case_insensitive = true, -- used when sorting files and directories in the tree - sort_function = nil, -- use a custom function for sorting files and directories in the tree - --sort_function = function (a,b) - --if a.type == b.type then - --return a.path > b.path - --else - --return a.type > b.type - --end - --end, -- this sorts files and directories descendantly - default_component_configs = { - container = { - enable_character_fade = true, - }, - indent = { - indent_size = 2, - padding = 1, -- extra padding on left hand side - -- indent guides - with_markers = true, - indent_marker = "│", - last_indent_marker = "└", - highlight = "NeoTreeIndentMarker", - -- expander config, needed for nesting files - with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders - expander_collapsed = "", - expander_expanded = "", - expander_highlight = "NeoTreeExpander", - }, - icon = { - folder_closed = "", - folder_open = "", - folder_empty = "󰜌", - provider = function(icon, node, state) -- default icon provider utilizes nvim-web-devicons if available - if node.type == "file" or node.type == "terminal" then - local success, web_devicons = pcall(require, "nvim-web-devicons") - local name = node.type == "terminal" and "terminal" or node.name - if success then - local devicon, hl = web_devicons.get_icon(name) - icon.text = devicon or icon.text - icon.highlight = hl or icon.highlight - end - end - end, - -- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there - -- then these will never be used. - default = "*", - highlight = "NeoTreeFileIcon", - }, - modified = { - symbol = "[+]", - highlight = "NeoTreeModified", - }, - name = { - trailing_slash = false, - use_git_status_colors = true, - highlight = "NeoTreeFileName", - }, - git_status = { - symbols = { - -- Change type - added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name - modified = "", -- or "", but this is redundant info if you use git_status_colors on the name - deleted = "✖", -- this can only be used in the git_status source - renamed = "󰁕", -- this can only be used in the git_status source - -- Status type - untracked = "", - ignored = "", - unstaged = "󰄱", - staged = "", - conflict = "", - }, - }, - -- If you don't want to use these columns, you can set `enabled = false` for each of them individually - file_size = { - enabled = true, - width = 12, -- width of the column - required_width = 64, -- min width of window required to show this column - }, - type = { - enabled = true, - width = 10, -- width of the column - required_width = 122, -- min width of window required to show this column - }, - last_modified = { - enabled = true, - width = 20, -- width of the column - required_width = 88, -- min width of window required to show this column - }, - created = { - enabled = true, - width = 20, -- width of the column - required_width = 110, -- min width of window required to show this column - }, - symlink_target = { - enabled = false, - }, - }, - -- A list of functions, each representing a global custom command - -- that will be available in all sources (if not overridden in `opts[source_name].commands`) - -- see `:h neo-tree-custom-commands-global` - commands = {}, - window = { - position = "left", - width = 30, - mapping_options = { - noremap = true, - nowait = true, - }, - mappings = { - [""] = { - "toggle_node", - nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use - }, - ["<2-LeftMouse>"] = "open", - [""] = "open", - [""] = "cancel", -- close preview or floating neo-tree window - ["P"] = { "toggle_preview", config = { use_float = true, use_image_nvim = true } }, - -- Read `# Preview Mode` for more information - ["l"] = "focus_preview", - ["S"] = "open_split", - ["s"] = "open_vsplit", - -- ["S"] = "split_with_window_picker", - -- ["s"] = "vsplit_with_window_picker", - ["t"] = "open_tabnew", - -- [""] = "open_drop", - -- ["t"] = "open_tab_drop", - ["w"] = "open_with_window_picker", - --["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing - ["C"] = "close_node", - -- ['C'] = 'close_all_subnodes', - ["z"] = "close_all_nodes", - --["Z"] = "expand_all_nodes", - --["Z"] = "expand_all_subnodes", - ["a"] = { - "add", - -- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details - -- some commands may take optional config options, see `:h neo-tree-mappings` for details - config = { - show_path = "none", -- "none", "relative", "absolute" - }, - }, - ["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion. - ["d"] = "delete", - ["r"] = "rename", - ["b"] = "rename_basename", - ["y"] = "copy_to_clipboard", - ["x"] = "cut_to_clipboard", - ["p"] = "paste_from_clipboard", - ["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add": - -- ["c"] = { - -- "copy", - -- config = { - -- show_path = "none" -- "none", "relative", "absolute" - -- } - --} - ["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add". - ["q"] = "close_window", - ["R"] = "refresh", - ["?"] = "show_help", - ["<"] = "prev_source", - [">"] = "next_source", - ["i"] = "show_file_details", - -- ["i"] = { - -- "show_file_details", - -- -- format strings of the timestamps shown for date created and last modified (see `:h os.date()`) - -- -- both options accept a string or a function that takes in the date in seconds and returns a string to display - -- -- config = { - -- -- created_format = "%Y-%m-%d %I:%M %p", - -- -- modified_format = "relative", -- equivalent to the line below - -- -- modified_format = function(seconds) return require('neo-tree.utils').relative_date(seconds) end - -- -- } - -- }, - }, - }, - nesting_rules = {}, - filesystem = { - filtered_items = { - visible = false, -- when true, they will just be displayed differently than normal items - hide_dotfiles = true, - hide_gitignored = true, - hide_hidden = true, -- only works on Windows for hidden files/directories - hide_by_name = { - "node_modules", - ".next", - ".vscode", - ".idea", - }, - hide_by_pattern = { -- uses glob style patterns - "*.meta", - "*/src/*/tsconfig.json", - }, - always_show = { -- remains visible even if other settings would normally hide it - --".gitignored", - }, - always_show_by_pattern = { -- uses glob style patterns - ".env*", - }, - never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show - ".DS_Store", - "thumbs.db" - }, - never_show_by_pattern = { -- uses glob style patterns - --".null-ls_*", - }, - }, - follow_current_file = { - enabled = false, -- This will find and focus the file in the active buffer every time - -- -- the current file is changed while the tree is open. - leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` - }, - group_empty_dirs = false, -- when true, empty folders will be grouped together - hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree - -- in whatever position is specified in window.position - -- "open_current", -- netrw disabled, opening a directory opens within the - -- window like netrw would, regardless of window.position - -- "disabled", -- netrw left alone, neo-tree does not handle opening dirs - use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes - -- instead of relying on nvim autocmd events. - - commands = { - avante_add_files = function(state) - local node = state.tree:get_node() - local filepath = node:get_id() - local relative_path = require('avante.utils').relative_path(filepath) - - local sidebar = require('avante').get() - - local open = sidebar:is_open() - -- ensure avante sidebar is open - if not open then - require('avante.api').ask() - sidebar = require('avante').get() - end - - sidebar.file_selector:add_selected_file(relative_path) - - -- remove neo tree buffer - if not open then - sidebar.file_selector:remove_selected_file('neo-tree filesystem [1]') - end - end, - }, - - window = { - mappings = { - [""] = "navigate_up", - ["."] = "set_root", - ["H"] = "toggle_hidden", - ["/"] = "fuzzy_finder", - ["D"] = "fuzzy_finder_directory", - ["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm - -- ["D"] = "fuzzy_sorter_directory", - ["f"] = "filter_on_submit", - [""] = "clear_filter", - ["[g"] = "prev_git_modified", - ["]g"] = "next_git_modified", - ["o"] = { - "show_help", - nowait = false, - config = { title = "Order by", prefix_key = "o" }, - }, - ['oa'] = 'avante_add_files', - ["oc"] = { "order_by_created", nowait = false }, - ["od"] = { "order_by_diagnostics", nowait = false }, - ["og"] = { "order_by_git_status", nowait = false }, - ["om"] = { "order_by_modified", nowait = false }, - ["on"] = { "order_by_name", nowait = false }, - ["os"] = { "order_by_size", nowait = false }, - ["ot"] = { "order_by_type", nowait = false }, - -- [''] = function(state) ... end, - }, - fuzzy_finder_mappings = { -- define keymaps for filter popup window in fuzzy_finder_mode - [""] = "move_cursor_down", - [""] = "move_cursor_down", - [""] = "move_cursor_up", - [""] = "move_cursor_up", - [""] = "close", - -- [''] = function(state, scroll_padding) ... end, - }, - }, - }, - buffers = { - follow_current_file = { - enabled = true, -- This will find and focus the file in the active buffer every time - -- -- the current file is changed while the tree is open. - leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` - }, - group_empty_dirs = true, -- when true, empty folders will be grouped together - show_unloaded = true, - window = { - mappings = { - ["d"] = "buffer_delete", - ["bd"] = "buffer_delete", - [""] = "navigate_up", - ["."] = "set_root", - ["o"] = { - "show_help", - nowait = false, - config = { title = "Order by", prefix_key = "o" }, - }, - ["oc"] = { "order_by_created", nowait = false }, - ["od"] = { "order_by_diagnostics", nowait = false }, - ["om"] = { "order_by_modified", nowait = false }, - ["on"] = { "order_by_name", nowait = false }, - ["os"] = { "order_by_size", nowait = false }, - ["ot"] = { "order_by_type", nowait = false }, - }, - }, - }, - git_status = { - window = { - position = "float", - mappings = { - ["A"] = "git_add_all", - ["gu"] = "git_unstage_file", - ["gU"] = "git_undo_last_commit", - ["ga"] = "git_add_file", - ["gr"] = "git_revert_file", - ["gc"] = "git_commit", - ["gp"] = "git_push", - ["gg"] = "git_commit_and_push", - ["o"] = { - "show_help", - nowait = false, - config = { title = "Order by", prefix_key = "o" }, - }, - ["oc"] = { "order_by_created", nowait = false }, - ["od"] = { "order_by_diagnostics", nowait = false }, - ["om"] = { "order_by_modified", nowait = false }, - ["on"] = { "order_by_name", nowait = false }, - ["os"] = { "order_by_size", nowait = false }, - ["ot"] = { "order_by_type", nowait = false }, - }, - }, - }, - }, + file_size = { + enabled = true, + width = 12, + required_width = 64, + }, + type = { + enabled = true, + width = 10, + required_width = 122, + }, + last_modified = { + enabled = true, + width = 20, + required_width = 88, + }, + created = { + enabled = true, + width = 20, + required_width = 110, + }, + symlink_target = { + enabled = false, + }, }, -} + window = { + position = 'left', + width = 30, + mapping_options = { + noremap = true, + nowait = true, + }, + mappings = { + [''] = { + 'toggle_node', + nowait = false, + }, + ['<2-LeftMouse>'] = 'open', + [''] = 'open', + [''] = 'cancel', + ['P'] = { 'toggle_preview', config = { use_float = true, use_image_nvim = true } }, + ['l'] = 'focus_preview', + ['S'] = 'open_split', + ['s'] = 'open_vsplit', + ['t'] = 'open_tabnew', + ['w'] = 'open_with_window_picker', + ['C'] = 'close_node', + ['z'] = 'close_all_nodes', + ['a'] = { + 'add', + config = { + show_path = 'relative', + }, + }, + ['A'] = 'add_directory', + ['d'] = 'delete', + ['r'] = 'rename', + ['b'] = 'rename_basename', + ['y'] = 'copy_to_clipboard', + ['x'] = 'cut_to_clipboard', + ['p'] = 'paste_from_clipboard', + ['c'] = { 'copy', config = { show_path = 'relative' } }, + ['m'] = { 'move', config = { show_path = 'relative' } }, + ['q'] = 'close_window', + ['R'] = 'refresh', + ['?'] = 'show_help', + ['<'] = 'prev_source', + ['>'] = 'next_source', + ['i'] = 'show_file_details', + }, + }, + filesystem = { + filtered_items = { + visible = false, + hide_dotfiles = true, + hide_gitignored = true, + hide_hidden = true, + hide_by_name = { + 'node_modules', + '.next', + '.vscode', + '.idea', + }, + hide_by_pattern = { + '*.meta', + '*/src/*/tsconfig.json', + }, + always_show = { + '.gitignored', + }, + always_show_by_pattern = { -- uses glob style patterns + '.env*', + }, + never_show = { + '.DS_Store', + 'thumbs.db' + }, + never_show_by_pattern = {}, + }, + follow_current_file = { + enabled = false, + leave_dirs_open = false, + }, + group_empty_dirs = false, + hijack_netrw_behavior = 'open_default', + use_libuv_file_watcher = false, + commands = { + avante_add_files = function(state) + local node = state.tree:get_node() + local filepath = node:get_id() + local relative_path = require('avante.utils').relative_path(filepath) + local sidebar = require('avante').get() + local open = sidebar:is_open() + if not open then + require('avante.api').ask() + sidebar = require('avante').get() + end + sidebar.file_selector:add_selected_file(relative_path) + if not open then + sidebar.file_selector:remove_selected_file('neo-tree filesystem [1]') + end + end, + }, + window = { + mappings = { + [''] = 'navigate_up', + ['.'] = 'set_root', + ['H'] = 'toggle_hidden', + ['/'] = 'fuzzy_finder', + ['D'] = 'fuzzy_finder_directory', + ['#'] = 'fuzzy_sorter', + -- ['D'] = 'fuzzy_sorter_directory', + ['f'] = 'filter_on_submit', + [''] = 'clear_filter', + ['[g'] = 'prev_git_modified', + [']g'] = 'next_git_modified', + ['o'] = { + 'show_help', + nowait = false, + config = { title = 'Order by', prefix_key = 'o' }, + }, + ['oa'] = 'avante_add_files', + ['oc'] = { 'order_by_created', nowait = false }, + ['od'] = { 'order_by_diagnostics', nowait = false }, + ['og'] = { 'order_by_git_status', nowait = false }, + ['om'] = { 'order_by_modified', nowait = false }, + ['on'] = { 'order_by_name', nowait = false }, + ['os'] = { 'order_by_size', nowait = false }, + ['ot'] = { 'order_by_type', nowait = false }, + }, + fuzzy_finder_mappings = { + [''] = 'move_cursor_down', + [''] = 'move_cursor_down', + [''] = 'move_cursor_up', + [''] = 'move_cursor_up', + [''] = 'close', + }, + }, + }, + buffers = { + follow_current_file = { + enabled = true, + leave_dirs_open = false, + }, + group_empty_dirs = true, + show_unloaded = true, + window = { + mappings = { + ['d'] = 'buffer_delete', + ['bd'] = 'buffer_delete', + [''] = 'navigate_up', + ['.'] = 'set_root', + ['o'] = { + 'show_help', + nowait = false, + config = { title = 'Order by', prefix_key = 'o' }, + }, + ['oc'] = { 'order_by_created', nowait = false }, + ['od'] = { 'order_by_diagnostics', nowait = false }, + ['om'] = { 'order_by_modified', nowait = false }, + ['on'] = { 'order_by_name', nowait = false }, + ['os'] = { 'order_by_size', nowait = false }, + ['ot'] = { 'order_by_type', nowait = false }, + }, + }, + }, + git_status = { + window = { + position = 'float', + mappings = { + ['A'] = 'git_add_all', + ['gu'] = 'git_unstage_file', + ['gU'] = 'git_undo_last_commit', + ['ga'] = 'git_add_file', + ['gr'] = 'git_revert_file', + ['gc'] = 'git_commit', + ['gp'] = 'git_push', + ['gg'] = 'git_commit_and_push', + ['o'] = { + 'show_help', + nowait = false, + config = { title = 'Order by', prefix_key = 'o' }, + }, + ['oc'] = { 'order_by_created', nowait = false }, + ['od'] = { 'order_by_diagnostics', nowait = false }, + ['om'] = { 'order_by_modified', nowait = false }, + ['on'] = { 'order_by_name', nowait = false }, + ['os'] = { 'order_by_size', nowait = false }, + ['ot'] = { 'order_by_type', nowait = false }, + }, + }, + }, +}) +-- Neotree +vim.keymap.set({'n', 'v', 'x' }, 't', ':Neotree toggle') +vim.keymap.set({'n', 'v', 'x' }, 'T', ':Neotree focus') diff --git a/configs/dotfiles/nvim/lua/plugins/nerdcommenter.lua b/configs/dotfiles/nvim/lua/plugins/nerdcommenter.lua index d4e3fa6..dc66542 100644 --- a/configs/dotfiles/nvim/lua/plugins/nerdcommenter.lua +++ b/configs/dotfiles/nvim/lua/plugins/nerdcommenter.lua @@ -1,13 +1,4 @@ -return { - { - 'scrooloose/nerdcommenter', - keys = { - { - 'c', - 'NERDCommenterToggle', - mode = { 'n', 'v' }, - desc = 'Toggle comment' - } - } - }, -} +vim.pack.add({ + { src = 'https://github.com/preservim/nerdcommenter' } +}) +vim.keymap.set({ 'n', 'v', 'x'}, 'c', 'NERDCommenterToggle') diff --git a/configs/dotfiles/nvim/lua/plugins/rest.lua b/configs/dotfiles/nvim/lua/plugins/rest.lua deleted file mode 100644 index 7cd18ef..0000000 --- a/configs/dotfiles/nvim/lua/plugins/rest.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - { - "rest-nvim/rest.nvim", - dependencies = { - "nvim-treesitter/nvim-treesitter", - opts = function (_, opts) - opts.ensure_installed = opts.ensure_installed or {} - table.insert(opts.ensure_installed, "http") - end, - } - }, -} diff --git a/configs/dotfiles/nvim/lua/plugins/snacks.lua b/configs/dotfiles/nvim/lua/plugins/snacks.lua new file mode 100644 index 0000000..95ce209 --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/snacks.lua @@ -0,0 +1,11 @@ +vim.pack.add({ + { src = 'https://github.com/folke/snacks.nvim' }, + { src = 'https://github.com/echasnovski/mini.icons' }, +}) +require'snacks'.setup({ + animate = { enabled = true }, + bigfile = { enabled = true }, + image = { enabled = true }, + indent = { enabled = true }, + scroll = { enabled = true }, +}) diff --git a/configs/dotfiles/nvim/lua/plugins/telescope.lua b/configs/dotfiles/nvim/lua/plugins/telescope.lua index 1127214..b176770 100644 --- a/configs/dotfiles/nvim/lua/plugins/telescope.lua +++ b/configs/dotfiles/nvim/lua/plugins/telescope.lua @@ -1,31 +1,31 @@ -local builtin = require('telescope.builtin') - -return { - { - 'nvim-telescope/telescope.nvim', - tag = '0.1.8', - dependencies = { 'nvim-lua/plenary.nvim' }, - cmd = 'Telescope', - opts = { - defaults = { - file_ignore_patterns = {"node_modules", ".git", ".cache", ".DS_Store", "Steam", "Media", "Pictures", "Downloads", "Videos", "Music", ".venv", ".conda", "School"}, - }, - }, - keys = { - { - 'ff', builtin.find_files, mode = { 'n'}, desc = 'Find files' - }, - { - 'fg', builtin.git_files, mode = { 'n'}, desc = 'Find files' - }, - { - 'fs', - function() - builtin.grep_string({ search = vim.fn.input("Grep > ") }) - end, - mode = { 'n'}, - desc = 'Find files' - }, - }, - }, -} +vim.pack.add({ + { + src = 'https://github.com/nvim-telescope/telescope.nvim', + version = vim.version.range('0.1'), + }, + { src = 'https://github.com/nvim-lua/plenary.nvim' }, +}) +require'telescope'.setup({ + defaults = { + file_ignore_patterns = { + 'node_modules', + '.git', + '.next', + '.cache', + '.DS_Store', + '.venv', + '.conda', + }, + }, +}) +local builtin = require'telescope.builtin' +vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Find files' }) +vim.keymap.set('n', 'fg', builtin.git_files, { desc = 'Find git files' }) +vim.keymap.set( + 'n', + 'fs', + function() + builtin.grep_string({ search = vim.fn.input('Grep > ')}) + end, + { desc = 'Find string' } +) diff --git a/configs/dotfiles/nvim/lua/plugins/tokyonight.lua b/configs/dotfiles/nvim/lua/plugins/tokyonight.lua deleted file mode 100755 index f8106b2..0000000 --- a/configs/dotfiles/nvim/lua/plugins/tokyonight.lua +++ /dev/null @@ -1,55 +0,0 @@ -return { - { - "folke/tokyonight.nvim", - lazy = false, - priority = 1000, - opts = { - style = "moon", -- The theme comes in three styles, `storm`, a darker variant `night` and `day` - light_style = "night", -- The theme is used when the background is set to light - transparent = true, -- Enable this to disable setting the background color - terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim - styles = { - comments = { italic = true }, - keywords = { italic = true }, - functions = {}, - variables = {}, - -- Background styles. Can be "dark", "transparent" or "normal" - sidebars = "dark", -- style for sidebars, see below - floats = "dark", -- style for floating windows - }, - day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors - dim_inactive = false, -- dims inactive windows - lualine_bold = true, -- When `true`, section headers in the lualine theme will be bold - - --- You can override specific color groups to use other groups or a hex color - --- function will be called with a ColorScheme table - ---@param colors ColorScheme - on_colors = function(colors) - colors.comment = "#a0a7c5" - colors.terminal_black = "#828bb8" - end, - - --- You can override specific highlights to use other groups or a hex color - --- function will be called with a Highlights and ColorScheme table - ---@param highlights tokyonight.Highlights - ---@param colors ColorScheme - on_highlights = function(highlights, colors) end, - - cache = true, -- When set to true, the theme will be cached for better performance - - ---@type table - plugins = { - -- enable all plugins when not using lazy.nvim - -- set to false to manually enable/disable plugins - all = package.loaded.lazy == nil, - -- uses your plugin manager to automatically enable needed plugins - -- currently only lazy.nvim is supported - auto = true, - -- add any plugins here that you want to enable - -- for all possible plugins, see: - -- * https://github.com/folke/tokyonight.nvim/tree/main/lua/tokyonight/groups - telescope = true, - }, - }, - }, -} diff --git a/configs/dotfiles/nvim/lua/plugins/treesitter.lua b/configs/dotfiles/nvim/lua/plugins/treesitter.lua index 72885fc..c59cf42 100644 --- a/configs/dotfiles/nvim/lua/plugins/treesitter.lua +++ b/configs/dotfiles/nvim/lua/plugins/treesitter.lua @@ -1,109 +1,84 @@ -return { - { - 'nvim-treesitter/nvim-treesitter', - branch = 'master', - lazy = false, - build = ':TSUpdate', - config = function() - require'nvim-treesitter.configs'.setup ({ - ensure_installed = { - 'bash', - 'c', - 'cmake', - 'cpp', - 'css', - 'diff', - 'dockerfile', - 'git_config', - 'git_rebase', - 'gitattributes', - 'gitcommit', - 'gitignore', - 'html', - 'java', - 'javascript', - 'jsdoc', - 'json', - 'jsonc', - 'kotlin', - 'lua', - 'luadoc', - 'luap', - 'make', - 'markdown', - 'markdown_inline', - 'php', - 'printf', - 'python', - 'query', - 'regex', - 'rust', - 'scala', - 'sql', - 'svelte', - 'swift', - 'toml', - 'tsx', - 'typescript', - 'vim', - 'vimdoc', - 'xml', - 'yaml', - 'zig' - }, - sync_install = false, - auto_install = true, - indent = { enable = true }, - highlight = { - enable = true, - disable = function(lang, buf) - local max_filesize = 500 * 1024 -- 100 KB - local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) - if ok and stats and stats.size > max_filesize then - return true - end - end, - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, - }) - local treesitter_parser_config = require("nvim-treesitter.parsers").get_parser_configs() - treesitter_parser_config.templ = { - install_info = { - url = "https://github.com/vrischmann/tree-sitter-templ.git", - files = {"src/parser.c", "src/scanner.c"}, - branch = "master", - }, - } - vim.treesitter.language.register("templ", "templ") - end - }, - { - 'nvim-treesitter/playground', - }, - { - "nvim-treesitter/nvim-treesitter-context", - after = "nvim-treesitter", - config = function() - require'treesitter-context'.setup{ - enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) - multiwindow = false, -- Enable multiwindow support. - max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. - min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit. - line_numbers = true, - multiline_threshold = 20, -- Maximum number of lines to show for a single context - trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' - mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline' - -- Separator between context and content. Should be a single character string, like '-'. - -- When separator is set, the context will only show up when there are at least 2 lines above cursorline. - separator = nil, - zindex = 20, -- The Z-index of the context window - on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching - } - end - }, -} +vim.pack.add({ + { + src = 'https://github.com/nvim-treesitter/nvim-treesitter', + version = 'master' + }, + { src = 'https://github.com/nvim-treesitter/playground' }, + { src = 'https://github.com/nvim-treesitter/nvim-treesitter-context' }, +}) +require'nvim-treesitter.install'.update({ with_sync = true })() +require'nvim-treesitter.configs'.setup({ + ensure_installed = { + 'bash', + 'c', + 'cmake', + 'cpp', + 'css', + 'diff', + 'dockerfile', + 'git_config', + 'git_rebase', + 'gitattributes', + 'gitcommit', + 'gitignore', + 'html', + 'java', + 'javascript', + 'jsdoc', + 'json', + 'jsonc', + 'kotlin', + 'lua', + 'luadoc', + 'luap', + 'make', + 'markdown', + 'markdown_inline', + 'php', + 'printf', + 'python', + 'query', + 'regex', + 'rust', + 'scala', + 'sql', + 'svelte', + 'swift', + 'toml', + 'tsx', + 'typescript', + 'vim', + 'vimdoc', + 'xml', + 'yaml', + 'zig' + }, + sync_install = false, + auto_install = true, + indent = { enable = true }, + highlight = { + enable = true, + disable = function(lang, buf) + local max_filesize = 500 * 1024 -- 100 KB + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > max_filesize then + return true + end + end, + additional_vim_regex_highlighting = false, + }, +}) +require'treesitter-context'.setup{ + enable = true, + multiwindow = false, + max_lines = 10, + min_window_height = 0, + line_numbers = true, + multiline_threshold = 20, + trim_scope = 'outer', + mode = 'topline', + separator = nil, + zindex = 20, + on_attach = nil, +} diff --git a/configs/dotfiles/nvim/lua/plugins/trouble.lua b/configs/dotfiles/nvim/lua/plugins/trouble.lua index 16873b9..f42117d 100644 --- a/configs/dotfiles/nvim/lua/plugins/trouble.lua +++ b/configs/dotfiles/nvim/lua/plugins/trouble.lua @@ -1,39 +1,7 @@ -return { - { - "folke/trouble.nvim", - opts = {}, - cmd = "Trouble", - keys = { - { - "xx", - "Trouble diagnostics toggle", - desc = "Diagnostics (Trouble)", - }, - { - "xX", - "Trouble diagnostics toggle filter.buf=0", - desc = "Buffer Diagnostics (Trouble)", - }, - { - "xcs", - "Trouble symbols toggle focus=false", - desc = "Symbols (Trouble)", - }, - { - "xcl", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP Definitions / references / ... (Trouble)", - }, - { - "xL", - "Trouble loclist toggle", - desc = "Location List (Trouble)", - }, - { - "xQ", - "Trouble qflist toggle", - desc = "Quickfix List (Trouble)", - }, - }, - }, -} +vim.pack.add({ + { src = 'https://github.com/folke/trouble.nvim.git' }, +}) +vim.api.nvim_create_user_command('Trouble', function() + require("trouble").open() +end, { desc = "Open Trouble" }) +vim.keymap.set({'n'}, 'x', ':Trouble diagnostics toggle') diff --git a/configs/dotfiles/nvim/lua/plugins/undotree.lua b/configs/dotfiles/nvim/lua/plugins/undotree.lua index f87c1bc..320f6fa 100644 --- a/configs/dotfiles/nvim/lua/plugins/undotree.lua +++ b/configs/dotfiles/nvim/lua/plugins/undotree.lua @@ -1,13 +1,4 @@ -return { - { - 'mbbill/undotree', - keys = { - { - 'u', - vim.cmd.UndotreeToggle, - mode = 'n', - desc = 'UndoTree' - }, - }, - }, -} +vim.pack.add({ + { src = 'https://github.com/mbbill/undotree' }, +}) +vim.keymap.set({'n'}, 'u', ':UndotreeToggle') diff --git a/defaults/bash/aliases b/defaults/bash/aliases index 531d996..b50debd 100644 --- a/defaults/bash/aliases +++ b/defaults/bash/aliases @@ -23,6 +23,8 @@ alias docker-down='sudo docker compose down' alias docker-stop='sudo docker compose stop' alias docker-update='sudo docker compose down && sudo docker compose up -d' alias docker-restart='sudo docker compose restart' +alias fprint-on='sudo authselect enable-feature with-fingerprint' +alias fprint-off='sudo authselect disable-feature with-fingerprint' # File system diff --git a/themes/openbar b/themes/openbar new file mode 100644 index 0000000..405cd45 --- /dev/null +++ b/themes/openbar @@ -0,0 +1,286 @@ +[/] +accent-color=['0.510', '0.667', '1.000'] +accent-override=false +apply-accent-shell=true +apply-all-shell=true +apply-flatpak=false +apply-gtk=false +apply-menu-notif=true +apply-menu-shell=true +auto-bgalpha=false +autofg-bar=false +autofg-menu=true +autohg-bar=false +autohg-menu=true +autotheme-dark='Dark' +autotheme-font=false +autotheme-light='Light' +autotheme-refresh=false +balpha=0.12 +bartype='Floating' +bcolor=['0.510', '0.667', '1.000'] +bg-change=false +bgalpha=0.0 +bgalpha-wmax=0.0 +bgalpha2=0.0 +bgcolor=['0.180', '0.184', '0.239'] +bgcolor-wmax=['0.118', '0.118', '0.118'] +bgcolor2=['0.247', '0.220', '0.251'] +bgpalette=true +bguri='file:///home/gib/.local/share/backgrounds/2025-08-04-13-42-53-faroe_islands.jpg' +border-wmax=false +bordertype='solid' +bottom-margin=0.0 +boxalpha=0.0 +boxcolor=['0.180', '0.184', '0.239'] +bradius=50.0 +buttonbg-wmax=false +bwidth=0.5 +candy1=['0', '0.61', '0.74'] +candy10=['0.09', '0.19', '0.72'] +candy11=['0.75', '0.49', '0.44'] +candy12=['1', '0.92', '0.12'] +candy13=['0.38', '0.63', '0.92'] +candy14=['0.37', '0.36', '0.39'] +candy15=['0.40', '0.23', '0.72'] +candy16=['1', '0.32', '0.32'] +candy2=['1', '0.41', '0.41'] +candy3=['0.63', '0.16', '0.8'] +candy4=['0.94', '0.60', '0.23'] +candy5=['0.03', '0.41', '0.62'] +candy6=['0.56', '0.18', '0.43'] +candy7=['0.95', '0.12', '0.67'] +candy8=['0.18', '0.76', '0.49'] +candy9=['0.93', '0.20', '0.23'] +candyalpha=0.0 +candybar=false +card-hint=6 +color-scheme='prefer-dark' +corner-radius=false +count1=384385 +count10=289 +count11=128 +count12=7 +count2=52561 +count3=42265 +count4=40816 +count5=24718 +count6=23775 +count7=20816 +count8=16249 +count9=4991 +cust-margin-wmax=true +dark-accent-color=['0.510', '0.667', '1.000'] +dark-bcolor=['0.510', '0.667', '1.000'] +dark-bgcolor=['0.180', '0.184', '0.239'] +dark-bgcolor-wmax=['0.118', '0.118', '0.118'] +dark-bgcolor2=['0.247', '0.220', '0.251'] +dark-bguri='file:///home/gib/.local/share/backgrounds/2025-08-04-13-42-53-faroe_islands.jpg' +dark-boxcolor=['0.180', '0.184', '0.239'] +dark-candy1=['0', '0.61', '0.74'] +dark-candy10=['0.09', '0.19', '0.72'] +dark-candy11=['0.75', '0.49', '0.44'] +dark-candy12=['1', '0.92', '0.12'] +dark-candy13=['0.38', '0.63', '0.92'] +dark-candy14=['0.37', '0.36', '0.39'] +dark-candy15=['0.40', '0.23', '0.72'] +dark-candy16=['1', '0.32', '0.32'] +dark-candy2=['1', '0.41', '0.41'] +dark-candy3=['0.63', '0.16', '0.8'] +dark-candy4=['0.94', '0.60', '0.23'] +dark-candy5=['0.03', '0.41', '0.62'] +dark-candy6=['0.56', '0.18', '0.43'] +dark-candy7=['0.95', '0.12', '0.67'] +dark-candy8=['0.18', '0.76', '0.49'] +dark-candy9=['0.93', '0.20', '0.23'] +dark-dbgcolor=['0.180', '0.184', '0.239'] +dark-fgcolor=['1.0', '1.0', '1.0'] +dark-hcolor=['0.510', '0.667', '1.000'] +dark-hscd-color=['0.510', '0.667', '1.000'] +dark-iscolor=['0.043', '0.086', '0.114'] +dark-mbcolor=['0.180', '0.184', '0.239'] +dark-mbgcolor=['0.180', '0.184', '0.239'] +dark-mfgcolor=['1.0', '1.0', '1.0'] +dark-mhcolor=['0.510', '0.667', '1.000'] +dark-mscolor=['0.510', '0.667', '1.000'] +dark-mshcolor=['0.180', '0.184', '0.239'] +dark-palette1=['25', '42', '62'] +dark-palette10=['148', '100', '104'] +dark-palette11=['151', '108', '100'] +dark-palette12=['121', '124', '144'] +dark-palette2=['224', '173', '139'] +dark-palette3=['111', '96', '112'] +dark-palette4=['53', '73', '103'] +dark-palette5=['70', '86', '113'] +dark-palette6=['46', '68', '91'] +dark-palette7=['67', '68', '88'] +dark-palette8=['13', '27', '35'] +dark-palette9=['107', '106', '132'] +dark-shcolor=['0.000', '0.000', '0.000'] +dark-smbgcolor=['0.128', '0.132', '0.193'] +dark-vw-color=['0.510', '0.667', '1.000'] +dark-winbcolor=['0.510', '0.667', '1.000'] +dashdock-style='Default' +dbgalpha=0.84999999999999998 +dbgcolor=['0.180', '0.184', '0.239'] +dborder=false +dbradius=100.0 +default-font='Sans 12' +destruct-color=['0.75', '0.11', '0.16'] +disize=16.0 +dshadow=true +fgalpha=1.0 +fgcolor=['1.0', '1.0', '1.0'] +fitts-widgets=false +font='' +gradient=false +gradient-direction='vertical' +gtk-popover=false +gtk-shadow='Default' +gtk-transparency=1.0 +halpha=0.25 +handle-border=20.0 +hbar-gtk3only=false +hcolor=['0.510', '0.667', '1.000'] +headerbar-hint=0 +heffect=false +height=36.0 +hpad=0.0 +hscd-color=['0.510', '0.667', '1.000'] +import-export=true +isalpha=0.0 +iscolor=['0.043', '0.086', '0.114'] +light-accent-color=['0', '0.75', '0.75'] +light-bcolor=['0.051', '0.106', '0.137'] +light-bgcolor=['0.835', '0.839', '0.863'] +light-bgcolor-wmax=['0.922', '0.922', '0.922'] +light-bgcolor2=['0.722', '0.753', '0.800'] +light-bguri='file:///home/gib/.local/share/backgrounds/2025-08-04-13-42-53-faroe_islands.jpg' +light-boxcolor=['0.835', '0.839', '0.863'] +light-candy1=['0', '0.61', '0.74'] +light-candy10=['0.09', '0.19', '0.72'] +light-candy11=['0.75', '0.49', '0.44'] +light-candy12=['1', '0.92', '0.12'] +light-candy13=['0.38', '0.63', '0.92'] +light-candy14=['0.37', '0.36', '0.39'] +light-candy15=['0.40', '0.23', '0.72'] +light-candy16=['1', '0.32', '0.32'] +light-candy2=['1', '0.41', '0.41'] +light-candy3=['0.63', '0.16', '0.8'] +light-candy4=['0.94', '0.60', '0.23'] +light-candy5=['0.03', '0.41', '0.62'] +light-candy6=['0.56', '0.18', '0.43'] +light-candy7=['0.95', '0.12', '0.67'] +light-candy8=['0.18', '0.76', '0.49'] +light-candy9=['0.93', '0.20', '0.23'] +light-dbgcolor=['0.125', '0.125', '0.125'] +light-fgcolor=['1.0', '1.0', '1.0'] +light-hcolor=['0.098', '0.165', '0.243'] +light-hscd-color=['0.894', '0.659', '0.502'] +light-iscolor=['0.835', '0.839', '0.863'] +light-mbcolor=['0.098', '0.165', '0.243'] +light-mbgcolor=['0.922', '0.906', '0.922'] +light-mfgcolor=['1.0', '1.0', '1.0'] +light-mhcolor=['0.098', '0.165', '0.243'] +light-mscolor=['0.894', '0.659', '0.502'] +light-mshcolor=['0.000', '0.000', '0.000'] +light-palette1=['25', '42', '62'] +light-palette10=['148', '100', '104'] +light-palette11=['151', '108', '100'] +light-palette12=['121', '124', '144'] +light-palette2=['224', '173', '139'] +light-palette3=['111', '96', '112'] +light-palette4=['53', '73', '103'] +light-palette5=['70', '86', '113'] +light-palette6=['46', '68', '91'] +light-palette7=['67', '68', '88'] +light-palette8=['13', '27', '35'] +light-palette9=['107', '106', '132'] +light-shcolor=['0.000', '0.000', '0.000'] +light-smbgcolor=['0.722', '0.753', '0.800'] +light-vw-color=['0.894', '0.659', '0.502'] +light-winbcolor=['0.894', '0.659', '0.502'] +margin=1.0 +margin-wmax=0.0 +mbalpha=0.0 +mbcolor=['0.180', '0.184', '0.239'] +mbg-gradient=false +mbgalpha=0.92000000000000004 +mbgcolor=['0.180', '0.184', '0.239'] +menu-radius=30.0 +menustyle=true +mfgalpha=1.0 +mfgcolor=['1.0', '1.0', '1.0'] +mhalpha=0.25 +mhcolor=['0.510', '0.667', '1.000'] +monitor-height=960 +monitor-width=1440 +monitors='all' +msalpha=0.80000000000000004 +mscolor=['0.510', '0.667', '1.000'] +mshalpha=1.0 +mshcolor=['0.180', '0.184', '0.239'] +neon=false +neon-wmax=false +notif-radius=20.0 +palette1=['25', '42', '62'] +palette10=['148', '100', '104'] +palette11=['151', '108', '100'] +palette12=['121', '124', '144'] +palette2=['224', '173', '139'] +palette3=['111', '96', '112'] +palette4=['53', '73', '103'] +palette5=['70', '86', '113'] +palette6=['46', '68', '91'] +palette7=['67', '68', '88'] +palette8=['13', '27', '35'] +palette9=['107', '106', '132'] +pause-reload=false +position='Top' +prominent1=['100', '100', '100'] +prominent2=['100', '100', '100'] +prominent3=['100', '100', '100'] +prominent4=['100', '100', '100'] +prominent5=['100', '100', '100'] +prominent6=['100', '100', '100'] +qtoggle-radius=50.0 +radius-bottomleft=true +radius-bottomright=true +radius-topleft=true +radius-topright=true +reloadstyle=true +removestyle=false +sbar-gradient='none' +set-bottom-margin=true +set-fullscreen=false +set-notif-position=true +set-notifications=false +set-overview=false +set-yarutheme=false +shadow=false +shalpha=0.0 +shcolor=['0.000', '0.000', '0.000'] +sidebar-hint=0 +slider-height=20.0 +smbgalpha=0.94999999999999996 +smbgcolor=['0.128', '0.132', '0.193'] +smbgoverride=true +success-color=['0.15', '0.635', '0.41'] +traffic-light=false +trigger-autotheme=true +trigger-reload=true +view-hint=0 +vpad=2.5 +vw-color=['0.510', '0.667', '1.000'] +warning-color=['0.96', '0.83', '0.17'] +width-bottom=true +width-left=true +width-right=true +width-top=true +winbalpha=0.75 +winbcolor=['0.510', '0.667', '1.000'] +winbradius=15.0 +winbwidth=0.0 +window-hint=0 +wmax-hbarhint=false +wmaxbar=true