diff --git a/configs/dotfiles/nvim/init.lua b/configs/dotfiles/nvim/init.lua index f494e9b..dbc863e 100644 --- a/configs/dotfiles/nvim/init.lua +++ b/configs/dotfiles/nvim/init.lua @@ -1 +1 @@ -require("gib_nvim") +require("config") diff --git a/configs/dotfiles/nvim/lazy-lock.json b/configs/dotfiles/nvim/lazy-lock.json index e31d334..74efa55 100644 --- a/configs/dotfiles/nvim/lazy-lock.json +++ b/configs/dotfiles/nvim/lazy-lock.json @@ -1,48 +1,54 @@ { - "LuaSnip": { "branch": "master", "commit": "c1851d5c519611dfc451b6582961b2602e0af89b" }, - "avante.nvim": { "branch": "main", "commit": "d4672b7e1ee8bf94df5e1d3482e81418187f42aa" }, + "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, + "avante.nvim": { "branch": "main", "commit": "e2b34f6435edcb9ef0a051ddcf24693a5d8bba2b" }, "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": "5af306b30f699513669efdf51cf50a6deab53968" }, - "gitsigns.nvim": { "branch": "main", "commit": "e399f9748d7cfd8859747c8d6c4e9c8b4d50a1bd" }, - "golf": { "branch": "main", "commit": "abf1bc0c1c4a5482b4a4b36b950b49aaa0f39e69" }, + "fzf-lua": { "branch": "main", "commit": "1977a7648a264fabf453ee082e2398e38cc3b588" }, + "gitsigns.nvim": { "branch": "main", "commit": "d0f90ef51d4be86b824b012ec52ed715b5622e51" }, "image.nvim": { "branch": "master", "commit": "4c51d6202628b3b51e368152c053c3fb5c5f76f2" }, - "img-clip.nvim": { "branch": "main", "commit": "08a02e14c8c0d42fa7a92c30a98fd04d6993b35d" }, + "img-clip.nvim": { "branch": "main", "commit": "d8b6b030672f9f551a0e3526347699985a779d93" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "leetcode.nvim": { "branch": "master", "commit": "db7e1cd6b9191b34b4c1f2f96e4e3949cde9f951" }, - "lsp-zero.nvim": { "branch": "v3.x", "commit": "77550f2f6cbf0959ef1583d845661af075f3442b" }, "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, - "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" }, - "mason.nvim": { "branch": "main", "commit": "888d6ee499d8089a3a4be4309d239d6be1c1e6c0" }, + "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "bef29b653ba71d442816bf56286c2a686210be04" }, + "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, + "mcphub.nvim": { "branch": "main", "commit": "7752efc63da929683c5d4812e7d0d066189ee68f" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, "nerdcommenter": { "branch": "master", "commit": "02a3b6455fa07b61b9440a78732f1e9b7876c991" }, - "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, - "nvim-lspconfig": { "branch": "master", "commit": "ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57" }, + "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, + "nvim-lspconfig": { "branch": "master", "commit": "a182334ba933e58240c2c45e6ae2d9c7ae313e00" }, "nvim-notify": { "branch": "master", "commit": "b5825cf9ee881dd8e43309c93374ed5b87b7a896" }, - "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" }, - "nvim-treesitter-context": { "branch": "master", "commit": "5c48b8ba1b0b7b25feb6e34e7eb293ea893aedc4" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-treesitter-context": { "branch": "master", "commit": "464a443b5a6657f39772b20baa95d02ffe97b268" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, - "nvim-web-devicons": { "branch": "master", "commit": "d360317f8f509b99229bb31d42269987696df6ff" }, + "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, "nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "refactoring.nvim": { "branch": "master", "commit": "2be7ea3f10b7e59658f5abf6dffc50b5d61964d6" }, - "render-markdown.nvim": { "branch": "main", "commit": "a1b0988f5ab26698afb56b9c2f0525a4de1195c1" }, + "render-markdown.nvim": { "branch": "main", "commit": "6f5a4c36d9383b2a916facaa63dcd573afa11ee8" }, "rest.nvim": { "branch": "main", "commit": "2ded89dbda1fd3c1430685ffadf2df8beb28336d" }, "supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" }, - "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, - "undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" }, - "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" } + "undotree": { "branch": "master", "commit": "b951b87b46c34356d44aa71886aecf9dd7f5788a" } } diff --git a/configs/dotfiles/nvim/lua/config/init.lua b/configs/dotfiles/nvim/lua/config/init.lua new file mode 100644 index 0000000..f1b97b5 --- /dev/null +++ b/configs/dotfiles/nvim/lua/config/init.lua @@ -0,0 +1,69 @@ +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 +}) + +--vim.g.netrw_browse_split = 0 +--vim.g.netrw_banner = 0 +--vim.g.netrw_winsize = 25 diff --git a/configs/dotfiles/nvim/lua/config/lazy.lua b/configs/dotfiles/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..5c6c3c9 --- /dev/null +++ b/configs/dotfiles/nvim/lua/config/lazy.lua @@ -0,0 +1,27 @@ +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/gib_nvim/remap.lua b/configs/dotfiles/nvim/lua/config/remap.lua similarity index 93% rename from configs/dotfiles/nvim/lua/gib_nvim/remap.lua rename to configs/dotfiles/nvim/lua/config/remap.lua index 72af2c2..aac72e7 100644 --- a/configs/dotfiles/nvim/lua/gib_nvim/remap.lua +++ b/configs/dotfiles/nvim/lua/config/remap.lua @@ -3,9 +3,6 @@ -- Set leader to space vim.g.mapleader = " " --- Easily get back to Normal mode. -vim.keymap.set("i", "", "") - -- 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") @@ -51,9 +48,6 @@ vim.keymap.set("n", "Q", "") -- Format the current buffer using the language server protocol (LSP) vim.keymap.set("n", "kf", vim.lsp.buf.format) --- Toggle Supermaven with :SupermavenToggle -vim.keymap.set("n", "sm", ":SupermavenToggle") - -- Perform a search and replace operation using the word under the cursor vim.keymap.set("n", "sr", [[:%s/\<\>//gI]]) @@ -75,4 +69,3 @@ vim.keymap.set("n", "", vim.cmd.so) -- 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/gib_nvim/set.lua b/configs/dotfiles/nvim/lua/config/set.lua similarity index 74% rename from configs/dotfiles/nvim/lua/gib_nvim/set.lua rename to configs/dotfiles/nvim/lua/config/set.lua index d0f92ba..f5bc403 100644 --- a/configs/dotfiles/nvim/lua/gib_nvim/set.lua +++ b/configs/dotfiles/nvim/lua/config/set.lua @@ -4,7 +4,7 @@ vim.opt.relativenumber = true vim.opt.tabstop = 2 vim.opt.softtabstop = 2 vim.opt.shiftwidth = 2 -vim.opt.expandtab = true +--vim.opt.expandtab = true vim.opt.smartindent = true @@ -26,8 +26,9 @@ vim.opt.isfname:append("@-@") vim.opt.updatetime = 50 vim.cmd([[set list]]) -vim.cmd([[set listchars=trail:⋅]]) +--vim.cmd([[set listchars=trail:⋅]]) +vim.cmd([[set listchars=trail:⋅,nbsp:⋅,tab:\ \ ]]) -vim.opt.colorcolumn = "120" +vim.opt.colorcolumn = "100" vim.o.background = "dark" -- or "light" for light mode -vim.cmd([[colorscheme tokyonight-moon]]) +--vim.cmd([[colorscheme tokyonight-moon]]) diff --git a/configs/dotfiles/nvim/lua/gib_nvim/avante.lua b/configs/dotfiles/nvim/lua/gib_nvim/avante.lua deleted file mode 100644 index 8e64359..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/avante.lua +++ /dev/null @@ -1,126 +0,0 @@ -require('avante').setup({ - --provider = "openai", - --openai = { - --endpoint = "https://api.openai.com/v1", - --model = "gpt-4o", -- your desired model (or use gpt-4o, etc.) - --timeout = 30000, -- Timeout in milliseconds, increase this for reasoning models - --temperature = 0, - --max_completion_tokens = 8192, -- Increase this to include reasoning tokens (for reasoning models) - ----reasoning_effort = "medium", -- low|medium|high, only used for reasoning models - --}, - provider = "claude", - mode = "agentic", - auto_suggestions_provider = "claude", - claude = { - endpoint = "https://api.anthropic.com", - model = "claude-3-7-sonnet-latest", - temperature = 0, - max_tokens = 4096, - }, - 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, -- in milliseconds - }, - 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, -- 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 = 30, -- 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, - }, -}) diff --git a/configs/dotfiles/nvim/lua/gib_nvim/barbar.lua b/configs/dotfiles/nvim/lua/gib_nvim/barbar.lua deleted file mode 100644 index cdf6f2e..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/barbar.lua +++ /dev/null @@ -1,19 +0,0 @@ --- Move to previous/next -vim.keymap.set("n", "", "BufferPrevious") -vim.keymap.set("n", "", "BufferNext") --- Re-order to previous/next -vim.keymap.set("n", "", "BufferMovePrevious") -vim.keymap.set("n", "", "BufferMoveNext") --- Goto buffer in position... -vim.keymap.set("n", "1", "BufferGoto 1") -vim.keymap.set("n", "2", "BufferGoto 2") -vim.keymap.set("n", "3", "BufferGoto 3") -vim.keymap.set("n", "4", "BufferGoto 4") -vim.keymap.set("n", "5", "BufferGoto 5") -vim.keymap.set("n", "6", "BufferGoto 6") -vim.keymap.set("n", "7", "BufferGoto 7") -vim.keymap.set("n", "8", "BufferGoto 8") -vim.keymap.set("n", "9", "BufferGoto 9") -vim.keymap.set("n", "0", "BufferLast") -vim.keymap.set("n", "", "BufferClose") -vim.keymap.set("n", "", "BufferCloseAllButCurrent") diff --git a/configs/dotfiles/nvim/lua/gib_nvim/cloak.lua b/configs/dotfiles/nvim/lua/gib_nvim/cloak.lua deleted file mode 100644 index 3addbb6..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/cloak.lua +++ /dev/null @@ -1,22 +0,0 @@ -require("cloak").setup({ - enabled = false, - cloak_character = "*", - -- The applied highlight group (colors) on the cloaking, see `:h highlight`. - highlight_group = "Comment", - patterns = { - { - -- Match any file starting with ".env". - -- This can be a table to match multiple file patterns. - file_pattern = { - ".env*", - "wrangler.toml", - ".dev.vars", - }, - -- Match an equals sign and any character after it. - -- This can also be a table of patterns to cloak, - -- example: cloak_pattern = { ":.+", "-.+" } for yaml files. - cloak_pattern = "=.+" - }, - }, -}) - diff --git a/configs/dotfiles/nvim/lua/gib_nvim/colors.lua b/configs/dotfiles/nvim/lua/gib_nvim/colors.lua deleted file mode 100644 index 2dfa3f3..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/colors.lua +++ /dev/null @@ -1,24 +0,0 @@ -require("tokyonight").setup({ - -- your configuration comes here - -- or leave it empty to use the default settings - style = "moon", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day` - light_style = "day", -- 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](https://github.com/neovim/neovim) - styles = { - -- Style to be applied to different syntax groups - -- Value is any valid attr-list value for `:help nvim_set_hl` - 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 - }, - sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]` - day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors - hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**. - dim_inactive = false, -- dims inactive windows - lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold -}) diff --git a/configs/dotfiles/nvim/lua/gib_nvim/fugitive.lua b/configs/dotfiles/nvim/lua/gib_nvim/fugitive.lua deleted file mode 100644 index 031fa6f..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/fugitive.lua +++ /dev/null @@ -1,35 +0,0 @@ -vim.keymap.set("n", "gs", vim.cmd.Git) - -local gib_nvim_Fugitive = vim.api.nvim_create_augroup("gib_nvim_Fugitive", {}) - -local autocmd = vim.api.nvim_create_autocmd -autocmd("BufWinEnter", { - group = gib_nvim_Fugitive, - pattern = "*", - callback = function() - if vim.bo.ft ~= "fugitive" then - return - end - - local bufnr = vim.api.nvim_get_current_buf() - local opts = {buffer = bufnr, remap = false} - vim.keymap.set("n", "gp", function() - vim.cmd.Git('push') - end, opts) - - -- rebase always - vim.keymap.set("n", "gP", function() - vim.cmd.Git({'pull', '--rebase'}) - end, opts) - - -- Git commit - vim.keymap.set("n", "gc", function() - local message = vim.fn.input('Commit message: ') - vim.cmd('Git commit -m "' .. message .. '"') - end, opts) - - -- NOTE: It allows me to easily set the branch i am pushing and any tracking - -- needed if i did not set the branch up correctly - vim.keymap.set("n", "gt", ":Git push -u origin ", opts); - end, -}) diff --git a/configs/dotfiles/nvim/lua/gib_nvim/harpoon.lua b/configs/dotfiles/nvim/lua/gib_nvim/harpoon.lua deleted file mode 100644 index b978261..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/harpoon.lua +++ /dev/null @@ -1,11 +0,0 @@ ---local mark = require("harpoon.mark") ---local ui = require("harpoon.ui") - ---vim.keymap.set("n", "ha", mark.add_file) ---vim.keymap.set("n", "hh", ui.toggle_quick_menu) - ---vim.keymap.set("n", "h1", function() ui.nav_file(1) end) ---vim.keymap.set("n", "h2", function() ui.nav_file(2) end) ---vim.keymap.set("n", "h3", function() ui.nav_file(3) end) ---vim.keymap.set("n", "h4", function() ui.nav_file(4) end) - diff --git a/configs/dotfiles/nvim/lua/gib_nvim/image.lua b/configs/dotfiles/nvim/lua/gib_nvim/image.lua deleted file mode 100644 index 692d7d6..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/image.lua +++ /dev/null @@ -1,24 +0,0 @@ -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" }, -- 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", -}) diff --git a/configs/dotfiles/nvim/lua/gib_nvim/init.lua b/configs/dotfiles/nvim/lua/gib_nvim/init.lua deleted file mode 100644 index cbdc02f..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/init.lua +++ /dev/null @@ -1,17 +0,0 @@ -require("gib_nvim.lazy") -require("gib_nvim.remap") -require("gib_nvim.set") -require("gib_nvim.colors") -require("gib_nvim.cloak") -require("gib_nvim.fugitive") -require("gib_nvim.lsp") -require("gib_nvim.lualine") -require("gib_nvim.neotree") -require("gib_nvim.nerdcomments") -require("gib_nvim.refactoring") -require("gib_nvim.telescope") -require("gib_nvim.treesitter") -require("gib_nvim.undotree") -require("gib_nvim.barbar") -require("gib_nvim.avante") -require("gib_nvim.image") diff --git a/configs/dotfiles/nvim/lua/gib_nvim/lazy.lua b/configs/dotfiles/nvim/lua/gib_nvim/lazy.lua deleted file mode 100644 index 88a79b2..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/lazy.lua +++ /dev/null @@ -1,252 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup({ - { - 'nvim-telescope/telescope.nvim', tag = '0.1.5', - dependencies = { 'nvim-lua/plenary.nvim' } - }, - { - 'folke/tokyonight.nvim', - priority = 1000, - }, - { - "folke/trouble.nvim", - dependencies = { - "nvim-tree/nvim-web-devicons", - }, - opts = {}, -- for default options, refer to the configuration section for custom setup. - cmd = "Trouble", - keys = { - { - "xx", - "Trouble diagnostics toggle", - desc = "Diagnostics (Trouble)", - }, - { - "xX", - "Trouble diagnostics toggle filter.buf=0", - desc = "Buffer Diagnostics (Trouble)", - }, - { - "cs", - "Trouble symbols toggle focus=false", - desc = "Symbols (Trouble)", - }, - { - "cl", - "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)", - }, - }, - }, - { - 'nvim-treesitter/nvim-treesitter', - build = ':TSUpdate' - }, - { - 'nvim-treesitter/playground' - }, - { - 'nvim-treesitter/nvim-treesitter-context' - }, - { - "ThePrimeagen/refactoring.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - } - }, - { - 'mbbill/undotree' - }, - { - 'tpope/vim-fugitive' - }, - { - 'VonHeikemen/lsp-zero.nvim', branch = 'v3.x' - }, - {'williamboman/mason.nvim'}, - {'williamboman/mason-lspconfig.nvim'}, - {'neovim/nvim-lspconfig'}, - {'hrsh7th/cmp-nvim-lsp'}, - {'hrsh7th/nvim-cmp'}, - {'hrsh7th/cmp-path'}, - {'hrsh7th/cmp-buffer'}, - {'hrsh7th/cmp-nvim-lua'}, - {'onsails/lspkind.nvim'}, - {'L3MON4D3/LuaSnip'}, - {'saadparwaiz1/cmp_luasnip'}, - {'rafamadriz/friendly-snippets'}, - { - 'supermaven-inc/supermaven-nvim', - config = function() - require('supermaven-nvim').setup({ - keymaps = { - accept_suggestion = '', - clear_suggestion = '', - accept_word = '', - }, - disable_inline_completion = true, -- for cmp - }) - end, - }, - { - 'laytan/cloak.nvim' - }, - { - 'nvim-lualine/lualine.nvim', - dependencies = { - 'nvim-tree/nvim-web-devicons', - 'folke/tokyonight.nvim', - } - }, - { - 'scrooloose/nerdcommenter' - }, - { - 'nvim-neo-tree/neo-tree.nvim', - branch = 'v3.x', - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', - 'MunifTanjim/nui.nvim', - '3rd/image.nvim', - { - 's1n7ax/nvim-window-picker', - version = '2.*', - config = function() - require 'window-picker'.setup({ - filter_rules = { - include_current_win = false, - autoselect_one = true, - bo = { - filetype = { 'neo-tree', "neo-tree-popup", "notify" }, - buftype = { 'terminal', "quickfix" }, - }, - }, - }) - end, - }, - }, - }, - { - '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', - }, - { - 'windwp/nvim-autopairs', - event = "InsertEnter", - config = true - }, - { - 'windwp/nvim-ts-autotag', - config = function () - require('nvim-ts-autotag').setup() - end - }, - { - '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, - }, - }, - { - "3rd/image.nvim", - event = "VeryLazy", - dependencies = { - "nvim-treesitter/nvim-treesitter", - }, - }, - { - "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, - } - }, - { - "yetone/avante.nvim", - event = "VeryLazy", - version = false, -- Never set this value to "*"! Never! - build = "make", -- or `make BUILD_FROM_SOURCE=true` - -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows - dependencies = { - "nvim-treesitter/nvim-treesitter", - "stevearc/dressing.nvim", - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - --- The below dependencies are optional, - "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, - }, - }, - }, - }, - { - -- Make sure to set this up properly if you have lazy=true - 'MeanderingProgrammer/render-markdown.nvim', - opts = { - file_types = { "markdown", "Avante" }, - }, - ft = { "markdown", "Avante" }, - }, - }, - }, - { 'vuciv/golf' }, -}) diff --git a/configs/dotfiles/nvim/lua/gib_nvim/lsp.lua b/configs/dotfiles/nvim/lua/gib_nvim/lsp.lua deleted file mode 100644 index 9f115bd..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/lsp.lua +++ /dev/null @@ -1,123 +0,0 @@ -local lsp = require('lsp-zero') -local lspkind = require('lspkind') - -lsp.preset('recommended') - -lsp.on_attach(function(client, bufnr) - local opts = {buffer = bufnr, remap = false} - - vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) - vim.keymap.set("n", "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", "[d", function() vim.diagnostic.goto_next() end, opts) - vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) - vim.keymap.set("n", "ka", 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) - -require('mason').setup({ - ui = { - icons = { - package_installed = "✓", - package_pending = "➜", - package_uninstalled = "✗" - } - } -}) -require('mason-lspconfig').setup({ - ensure_installed = { - 'bashls', - 'docker_compose_language_service', - 'dockerls', - 'eslint', - 'intelephense', - 'jsonls', - 'lua_ls', - 'pyright', - 'rust_analyzer', - 'sqlls', - 'tailwindcss', - 'yamlls', -}, - handlers = { - lsp.default_setup, - lua_ls = function() - local lua_opts = lsp.nvim_lua_ls() - require('lspconfig').lua_ls.setup(lua_opts) - end, - } -}) - -local cmp = require('cmp') -local cmp_select = {behavior = cmp.SelectBehavior.Select} - -cmp.setup({ - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) - end, - }, - sources = { - {name = 'supermaven'}, - {name = 'path'}, - {name = 'nvim_lsp'}, - {name = 'nvim_lua'}, - {name = 'luasnip', keyword_length = 2}, - {name = 'buffer', keyword_length = 3}, - }, - 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', - } - --mapping = cmp.mapping.preset.insert({ - --[''] = cmp.mapping.select_prev_item(cmp_select), - --[''] = cmp.mapping.select_next_item(cmp_select), - --[''] = cmp.mapping.confirm({ select = true }), - --[''] = cmp.mapping.complete(), - --}), -}) - -lsp.setup() diff --git a/configs/dotfiles/nvim/lua/gib_nvim/lualine.lua b/configs/dotfiles/nvim/lua/gib_nvim/lualine.lua deleted file mode 100644 index c5c63c3..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/lualine.lua +++ /dev/null @@ -1,40 +0,0 @@ -require('lualine').setup { - options = { - icons_enabled = true, - theme = 'tokyonight', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - globalstatus = false, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - } - }, - 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/gib_nvim/neotree.lua b/configs/dotfiles/nvim/lua/gib_nvim/neotree.lua deleted file mode 100644 index 5308d9b..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/neotree.lua +++ /dev/null @@ -1,300 +0,0 @@ -vim.keymap.set({'n','v'}, 't', 'Neotree toggle') -vim.keymap.set({'n', 'v'}, 'h', 'h') -vim.keymap.set({'n', 'v'}, 'l', 'l') -vim.keymap.set({'n', 'v'}, 'T', 'Neotree focus') - --- If you want icons for diagnostic errors, you'll need to define them somewhere: -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"}) - -require("neo-tree").setup({ - close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab - popup_border_style = "rounded", - enable_git_status = true, - enable_diagnostics = true, - --enable_normal_mode_for_inputs = false, -- Enable normal mode for input dialogs. - open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes - sort_case_insensitive = false, -- used when sorting files and directories in the tree - sort_function = nil , - 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 = "󰜌", - -- 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, - required_width = 64, -- min width of window required to show this column - }, - type = { - enabled = true, - required_width = 122, -- min width of window required to show this column - }, - last_modified = { - enabled = true, - required_width = 88, -- min width of window required to show this column - }, - created = { - enabled = true, - 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 = 35, - 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", - ["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", - ["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", - } - }, - 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" - }, - hide_by_pattern = { -- uses glob style patterns - --"*.meta", - --"*/src/*/tsconfig.json", - }, - always_show = { -- remains visible even if other settings would normally hide it - --".gitignored", - }, - 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 - - 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, - }, - -- instead of relying on nvim autocmd events. - 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 }, - }, - 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", - }, - }, - - }, - 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 = { - ["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", - ["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 }, - } - } - } -}) diff --git a/configs/dotfiles/nvim/lua/gib_nvim/nerdcomments.lua b/configs/dotfiles/nvim/lua/gib_nvim/nerdcomments.lua deleted file mode 100644 index a169b62..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/nerdcomments.lua +++ /dev/null @@ -1,2 +0,0 @@ --- Toggle Comments in Visual/Normal Mode -vim.keymap.set({"n", "v"}, "c", "NERDCommenterToggle") diff --git a/configs/dotfiles/nvim/lua/gib_nvim/refactoring.lua b/configs/dotfiles/nvim/lua/gib_nvim/refactoring.lua deleted file mode 100644 index 92db3b2..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/refactoring.lua +++ /dev/null @@ -1,3 +0,0 @@ -require('refactoring').setup({}) - -vim.api.nvim_set_keymap("v", "rf", [[ lua require('refactoring').refactor('Inline Variable')]], {noremap = true, silent = true, expr = false}) diff --git a/configs/dotfiles/nvim/lua/gib_nvim/telescope.lua b/configs/dotfiles/nvim/lua/gib_nvim/telescope.lua deleted file mode 100644 index 6c906b2..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/telescope.lua +++ /dev/null @@ -1,14 +0,0 @@ -local telescope = require('telescope') -local builtin = require('telescope.builtin') - -telescope.setup{ - defaults = { - file_ignore_patterns = {"node_modules", ".git", ".cache", ".DS_Store", "Steam", "Media", "Pictures", "Downloads", "Videos", "Music", ".venv", ".conda", "School"}, - }, -} - -vim.keymap.set('n', 'ff', builtin.find_files, {}) -vim.keymap.set('n', 'fg', builtin.git_files, {}) -vim.keymap.set('n', 'fs', function() - builtin.grep_string({ search = vim.fn.input("Grep > ") }) -end) diff --git a/configs/dotfiles/nvim/lua/gib_nvim/treesitter.lua b/configs/dotfiles/nvim/lua/gib_nvim/treesitter.lua deleted file mode 100644 index dfc3205..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/treesitter.lua +++ /dev/null @@ -1,64 +0,0 @@ -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" - ensure_installed = { - "bash", - "c", - "cmake", - "cpp", - "css", - "dockerfile", - "git_config", - "git_rebase", - "gitattributes", - "gitcommit", - "gitignore", - "haskell", - "html", - "java", - "javascript", - "json", - "kotlin", - "lua", - "make", - "php", - "python", - "rust", - "scala", - "sql", - "svelte", - "swift", - "tsx", - "typescript", - "vimdoc", - "yaml", - "zig" - }, - - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, - - - - highlight = { - enable = true, - disable = function(lang, buf) - local max_filesize = 80 * 1024 -- 80 KB - if lang == "tsx" then - 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 - 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 = true, - additional_vim_regex_highlighting = {"tsx"}, - }, -} diff --git a/configs/dotfiles/nvim/lua/gib_nvim/trouble.lua b/configs/dotfiles/nvim/lua/gib_nvim/trouble.lua deleted file mode 100644 index cf1256a..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/trouble.lua +++ /dev/null @@ -1,3 +0,0 @@ -vim.keymap.set("n", "xq", "TroubleToggle quickfix", - {silent = true, noremap = true} -) diff --git a/configs/dotfiles/nvim/lua/gib_nvim/undotree.lua b/configs/dotfiles/nvim/lua/gib_nvim/undotree.lua deleted file mode 100644 index b6b9276..0000000 --- a/configs/dotfiles/nvim/lua/gib_nvim/undotree.lua +++ /dev/null @@ -1 +0,0 @@ -vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) diff --git a/configs/dotfiles/nvim/lua/plugins/avante.lua b/configs/dotfiles/nvim/lua/plugins/avante.lua new file mode 100644 index 0000000..1356799 --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/avante.lua @@ -0,0 +1,247 @@ +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 = 30, -- 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, + }, + }, + }, + }, + { + 'MeanderingProgrammer/render-markdown.nvim', + opts = { + file_types = { "markdown", "Avante" }, + }, + ft = { "markdown", "Avante" }, + }, + }, + }, + { + "ravitemer/mcphub.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + 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", + }, +} diff --git a/configs/dotfiles/nvim/lua/plugins/barbar.lua b/configs/dotfiles/nvim/lua/plugins/barbar.lua new file mode 100644 index 0000000..775c982 --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/barbar.lua @@ -0,0 +1,38 @@ +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" }, + }, + }, +} diff --git a/configs/dotfiles/nvim/lua/plugins/cloak.lua b/configs/dotfiles/nvim/lua/plugins/cloak.lua new file mode 100644 index 0000000..867e3d0 --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/cloak.lua @@ -0,0 +1,20 @@ +return { + { + 'laytan/cloak.nvim', + opts = { + 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/image.lua b/configs/dotfiles/nvim/lua/plugins/image.lua new file mode 100644 index 0000000..c17e00b --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/image.lua @@ -0,0 +1,33 @@ +return { + { + "3rd/image.nvim", + event = "VeryLazy", + dependencies = { + "nvim-treesitter/nvim-treesitter", + }, + 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", + }, + }, +} diff --git a/configs/dotfiles/nvim/lua/plugins/leetcode.lua b/configs/dotfiles/nvim/lua/plugins/leetcode.lua new file mode 100644 index 0000000..5255161 --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/leetcode.lua @@ -0,0 +1,20 @@ +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 new file mode 100644 index 0000000..5e991bd --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/lsp.lua @@ -0,0 +1,254 @@ +local root_files = { + '.luarc.json', + '.luarc.jsonc', + '.luacheckrc', + '.stylua.toml', + 'stylua.toml', + 'selene.toml', + 'selene.yml', + '.git', +} + +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 + }, + "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 + --}, + }, + + 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 + }, +} diff --git a/configs/dotfiles/nvim/lua/plugins/lualine.lua b/configs/dotfiles/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..0271ea1 --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/lualine.lua @@ -0,0 +1,49 @@ +return { + { + 'nvim-lualine/lualine.nvim', + dependencies = { + 'nvim-tree/nvim-web-devicons', + 'folke/tokyonight.nvim', + }, + 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, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + } + }, + 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 new file mode 100644 index 0000000..edc3a39 --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/neotree.lua @@ -0,0 +1,422 @@ +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, + }, + }, + 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 = false, -- 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 = 35, + 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 }, + }, + }, + }, + }, + }, +} diff --git a/configs/dotfiles/nvim/lua/plugins/nerdcommenter.lua b/configs/dotfiles/nvim/lua/plugins/nerdcommenter.lua new file mode 100644 index 0000000..d4e3fa6 --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/nerdcommenter.lua @@ -0,0 +1,13 @@ +return { + { + 'scrooloose/nerdcommenter', + keys = { + { + 'c', + 'NERDCommenterToggle', + mode = { 'n', 'v' }, + desc = 'Toggle comment' + } + } + }, +} diff --git a/configs/dotfiles/nvim/lua/plugins/rest.lua b/configs/dotfiles/nvim/lua/plugins/rest.lua new file mode 100644 index 0000000..7cd18ef --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/rest.lua @@ -0,0 +1,12 @@ +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/telescope.lua b/configs/dotfiles/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..1127214 --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/telescope.lua @@ -0,0 +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' + }, + }, + }, +} diff --git a/configs/dotfiles/nvim/lua/plugins/tokyonight.lua b/configs/dotfiles/nvim/lua/plugins/tokyonight.lua new file mode 100644 index 0000000..1109b41 --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/tokyonight.lua @@ -0,0 +1,29 @@ +return { + { + 'folke/tokyonight.nvim', + lazy = false, + priority = 1000, + opts = { + style = 'moon', + light_style = 'day', + transparent = true, + terminal_colors = true, -- Configure the colors used when opening a `:terminal` in [Neovim](https://github.com/neovim/neovim) + styles = { + -- Style to be applied to different syntax groups + -- Value is any valid attr-list value for `:help nvim_set_hl` + 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 + }, + sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]` + day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors + hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**. + dim_inactive = false, -- dims inactive windows + lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold + }, + }, +} diff --git a/configs/dotfiles/nvim/lua/plugins/treesitter.lua b/configs/dotfiles/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..475bfbd --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,80 @@ +return { + { + 'nvim-treesitter/nvim-treesitter', + branch = 'master', + lazy = false, + build = ':TSUpdate', + opts = { + 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 = 100 * 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, + }, + }, + }, + { + 'nvim-treesitter/playground', + }, + { + 'nvim-treesitter/nvim-treesitter-context' + }, +} + diff --git a/configs/dotfiles/nvim/lua/plugins/trouble.lua b/configs/dotfiles/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..16873b9 --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/trouble.lua @@ -0,0 +1,39 @@ +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)", + }, + }, + }, +} diff --git a/configs/dotfiles/nvim/lua/plugins/undotree.lua b/configs/dotfiles/nvim/lua/plugins/undotree.lua new file mode 100644 index 0000000..f87c1bc --- /dev/null +++ b/configs/dotfiles/nvim/lua/plugins/undotree.lua @@ -0,0 +1,13 @@ +return { + { + 'mbbill/undotree', + keys = { + { + 'u', + vim.cmd.UndotreeToggle, + mode = 'n', + desc = 'UndoTree' + }, + }, + }, +}