From 1af1f266a34300a56252ae753e4d0809809d33ef Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Sun, 19 Jan 2025 14:43:34 +0545 Subject: [PATCH] updates --- dotfyle.json | 138 ++++++++++- lua/core/keys.lua | 10 + lua/lib/icons.lua | 2 + lua/lib/util.lua | 15 ++ lua/plugins/lang/blink.lua | 17 +- lua/plugins/lang/bracketed.lua | 18 ++ lua/plugins/lang/copilot-chat.lua | 92 ------- lua/plugins/lang/copilot.lua | 45 ---- lua/plugins/lang/pairs.lua | 18 ++ lua/plugins/lang/ror.lua | 20 -- lua/plugins/{tools => lang}/spider.lua | 0 lua/plugins/lang/textobjects.lua | 65 ++--- lua/plugins/lang/treesitter.lua | 4 +- lua/plugins/list.lua | 306 ++++++++---------------- lua/plugins/lock.json | 58 ++--- lua/plugins/mason-lock.json | 3 +- lua/plugins/{lang => tools}/dap.lua | 0 lua/plugins/tools/files.lua | 39 +++ lua/plugins/{lang => tools}/neotest.lua | 0 lua/plugins/tools/tabout.lua | 22 -- lua/plugins/tools/telescope.lua | 13 - lua/plugins/tools/which-key.lua | 62 +---- 22 files changed, 408 insertions(+), 539 deletions(-) create mode 100644 lua/plugins/lang/bracketed.lua delete mode 100644 lua/plugins/lang/copilot-chat.lua delete mode 100644 lua/plugins/lang/copilot.lua create mode 100644 lua/plugins/lang/pairs.lua delete mode 100644 lua/plugins/lang/ror.lua rename lua/plugins/{tools => lang}/spider.lua (100%) rename lua/plugins/{lang => tools}/dap.lua (100%) create mode 100644 lua/plugins/tools/files.lua rename lua/plugins/{lang => tools}/neotest.lua (100%) delete mode 100644 lua/plugins/tools/tabout.lua diff --git a/dotfyle.json b/dotfyle.json index c8cd9ab..da953c2 100644 --- a/dotfyle.json +++ b/dotfyle.json @@ -1 +1,137 @@ -{"distribution": "custom", "masonTools": ["bash-language-server", "gopls", "hadolint", "jdtls", "lua-language-server", "pyright", "pyright-langserver", "rubocop", "ruff", "rust-analyzer", "shellcheck", "solargraph", "typescript-language-server", "typos-lsp", "vim-language-server", "vscode-eslint-language-server", "vscode-json-language-server"], "plugins": ["2kabhishek/markit.nvim", "2kabhishek/nerdy.nvim", "2kabhishek/termim.nvim", "CopilotC-Nvim/CopilotChat.nvim", "Exafunction/codeium.vim", "LudoPinelli/comment-box.nvim", "MunifTanjim/nui.nvim", "RRethy/nvim-treesitter-endwise", "RRethy/nvim-treesitter-textsubjects", "ThePrimeagen/refactoring.nvim", "ThePrimeagen/vim-be-good", "abecodes/tabout.nvim", "akinsho/toggleterm.nvim", "chrisgrieser/nvim-spider", "creativenull/dotfyle-metadata.nvim", "cvigilv/esqueleto.nvim", "debugloop/telescope-undo.nvim", "echasnovski/mini.ai", "echasnovski/mini.surround", "epwalsh/pomo.nvim", "folke/flash.nvim", "folke/lazy.nvim", "folke/lazydev.nvim", "folke/snacks.nvim", "folke/which-key.nvim", "giuxtaposition/blink-cmp-copilot", "iamcco/markdown-preview.nvim", "jay-babu/mason-null-ls.nvim", "lewis6991/gitsigns.nvim", "m4xshen/hardtime.nvim", "mfussenegger/nvim-dap", "michaelb/sniprun", "mistricky/codesnap.nvim", "navarasu/onedark.nvim", "neovim/nvim-lspconfig", "numToStr/Navigator.nvim", "nvchad/showkeys", "nvim-lua/plenary.nvim", "nvim-lualine/lualine.nvim", "nvim-neo-tree/neo-tree.nvim", "nvim-neotest/neotest", "nvim-neotest/neotest-jest", "nvim-neotest/neotest-python", "nvim-neotest/nvim-nio", "nvim-telescope/telescope-file-browser.nvim", "nvim-telescope/telescope-fzf-native.nvim", "nvim-telescope/telescope.nvim", "nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter-refactor", "nvim-treesitter/nvim-treesitter-textobjects", "nvimdev/lspsaga.nvim", "nvimtools/none-ls.nvim", "olimorris/neotest-rspec", "rafamadriz/friendly-snippets", "rcarriga/nvim-dap-ui", "rcarriga/nvim-notify", "ruifm/gitlinker.nvim", "saghen/blink.cmp", "stevearc/dressing.nvim", "tpope/vim-fugitive", "tpope/vim-rails", "uga-rosa/ccc.nvim", "wakatime/vim-wakatime", "weizheheng/ror.nvim", "williamboman/mason-lspconfig.nvim", "williamboman/mason.nvim", "windwp/nvim-autopairs", "windwp/nvim-spectre", "windwp/nvim-ts-autotag", "zapling/mason-lock.nvim", "zbirenbaum/copilot.lua"], "pluginManager": "lazy.nvim", "treesitterParsers": ["bash", "c", "css", "dart", "elixir", "gitcommit", "go", "html", "java", "javascript", "json", "lua", "markdown", "markdown_inline", "python", "ruby", "rust", "scss", "typescript", "vim", "vimdoc", "yaml"], "lspServers": ["bashls", "eslint", "gopls", "jdtls", "jsonls", "lua_ls", "pyright", "rubocop", "ruff", "rust_analyzer", "solargraph", "ts_ls", "typos_lsp", "vimls"], "leaderKey": ""} \ No newline at end of file +{ + "distribution": "custom", + "masonTools": [ + "bash-language-server", + "gopls", + "hadolint", + "jdtls", + "lua-language-server", + "pyright", + "pyright-langserver", + "rubocop", + "ruff", + "rust-analyzer", + "shellcheck", + "solargraph", + "typescript-language-server", + "typos-lsp", + "vim-language-server", + "vscode-eslint-language-server", + "vscode-json-language-server" + ], + "plugins": [ + "2kabhishek/markit.nvim", + "2kabhishek/nerdy.nvim", + "2kabhishek/termim.nvim", + "CopilotC-Nvim/CopilotChat.nvim", + "Exafunction/codeium.vim", + "LudoPinelli/comment-box.nvim", + "MunifTanjim/nui.nvim", + "RRethy/nvim-treesitter-endwise", + "RRethy/nvim-treesitter-textsubjects", + "ThePrimeagen/refactoring.nvim", + "ThePrimeagen/vim-be-good", + "abecodes/tabout.nvim", + "akinsho/toggleterm.nvim", + "chrisgrieser/nvim-spider", + "creativenull/dotfyle-metadata.nvim", + "cvigilv/esqueleto.nvim", + "debugloop/telescope-undo.nvim", + "echasnovski/mini.ai", + "echasnovski/mini.surround", + "epwalsh/pomo.nvim", + "folke/flash.nvim", + "folke/lazy.nvim", + "folke/lazydev.nvim", + "folke/snacks.nvim", + "folke/which-key.nvim", + "giuxtaposition/blink-cmp-copilot", + "iamcco/markdown-preview.nvim", + "jay-babu/mason-null-ls.nvim", + "lewis6991/gitsigns.nvim", + "m4xshen/hardtime.nvim", + "mfussenegger/nvim-dap", + "michaelb/sniprun", + "mistricky/codesnap.nvim", + "navarasu/onedark.nvim", + "neovim/nvim-lspconfig", + "numToStr/Navigator.nvim", + "nvchad/showkeys", + "nvim-lua/plenary.nvim", + "nvim-lualine/lualine.nvim", + "nvim-neo-tree/neo-tree.nvim", + "nvim-neotest/neotest", + "nvim-neotest/neotest-jest", + "nvim-neotest/neotest-python", + "nvim-neotest/nvim-nio", + "nvim-telescope/telescope-file-browser.nvim", + "nvim-telescope/telescope-fzf-native.nvim", + "nvim-telescope/telescope.nvim", + "nvim-treesitter/nvim-treesitter", + "nvim-treesitter/nvim-treesitter-refactor", + "nvim-treesitter/nvim-treesitter-textobjects", + "nvimdev/lspsaga.nvim", + "nvimtools/none-ls.nvim", + "olimorris/neotest-rspec", + "rafamadriz/friendly-snippets", + "rcarriga/nvim-dap-ui", + "rcarriga/nvim-notify", + "ruifm/gitlinker.nvim", + "saghen/blink.cmp", + "stevearc/dressing.nvim", + "tpope/vim-fugitive", + "tpope/vim-rails", + "uga-rosa/ccc.nvim", + "wakatime/vim-wakatime", + "weizheheng/ror.nvim", + "williamboman/mason-lspconfig.nvim", + "williamboman/mason.nvim", + "windwp/nvim-autopairs", + "windwp/nvim-spectre", + "windwp/nvim-ts-autotag", + "zapling/mason-lock.nvim", + "zbirenbaum/copilot.lua" + ], + "pluginManager": "lazy.nvim", + "treesitterParsers": [ + "bash", + "c", + "css", + "dart", + "elixir", + "gitcommit", + "go", + "html", + "java", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "ruby", + "rust", + "scss", + "typescript", + "vim", + "vimdoc", + "yaml" + ], + "lspServers": [ + "bashls", + "eslint", + "gopls", + "jdtls", + "jsonls", + "lua_ls", + "pyright", + "rubocop", + "ruff", + "rust_analyzer", + "solargraph", + "ts_ls", + "typos_lsp", + "vimls" + ], + "leaderKey": "" +} diff --git a/lua/core/keys.lua b/lua/core/keys.lua index 8398264..fbc2369 100644 --- a/lua/core/keys.lua +++ b/lua/core/keys.lua @@ -102,3 +102,13 @@ map('n', 'd', '"_d', { desc = 'Delete without replacing clipboard' }) map('n', 'x', '"_x', { desc = 'Cut without replacing clipboard' }) map('n', 'c', '"_c', { desc = 'Change without replacing clipboard' }) map('v', 'p', '"_dP', { desc = 'Paste without replacing clipboard' }) + +-- Toggle relative numbers off or on (for code presentation) +map({ 'n', 'v' }, 'tn', 'set rnu!', {}) + +--insert the following characters around the visual selection +map('v', '(', 's()Pll', { desc = 'wrap selection with parens' }) +map('v', '[', 's[]Pll', { desc = 'wrap selection with square braces' }) +map('v', '{', 's{}Pll', { desc = 'wrap selection with curly braces' }) +map('v', "'", "s''Pll", { desc = 'wrap selection with single quotes' }) +map('v', '"', 's""Pll', { desc = 'wrap selection with double quotes' }) diff --git a/lua/lib/icons.lua b/lua/lib/icons.lua index 40a5236..6936191 100644 --- a/lua/lib/icons.lua +++ b/lua/lib/icons.lua @@ -33,6 +33,7 @@ return { Repo = ' ', Tag = ' ', Untrack = ' ', + Directory = '', }, kind = { Class = ' ', @@ -164,3 +165,4 @@ return { Windows = ' ', }, } + diff --git a/lua/lib/util.lua b/lua/lib/util.lua index b2f3de1..e47cb81 100644 --- a/lua/lib/util.lua +++ b/lua/lib/util.lua @@ -28,6 +28,20 @@ util.get_root_dir = function() end end +util.get_file_path = function() + local buf_name = vim.api.nvim_buf_get_name(0) + if vim.fn.filereadable(buf_name) == 1 then + return buf_name + end + + local dir_name = vim.fn.fnamemodify(buf_name, ':p:h') + if vim.fn.isdirectory(dir_name) == 1 then + return dir_name + end + + return vim.loop.cwd() +end + util.get_file_type_cmd = function(extension) local root = util.get_root_dir() @@ -64,3 +78,4 @@ util.telescope_select = function(options, options_desc, select_prompt) end return util + diff --git a/lua/plugins/lang/blink.lua b/lua/plugins/lang/blink.lua index 79d616b..6008412 100644 --- a/lua/plugins/lang/blink.lua +++ b/lua/plugins/lang/blink.lua @@ -23,23 +23,8 @@ blink.setup({ kind_icons = icons.kind, }, sources = { - default = { 'lazydev', 'lsp', 'path', 'snippets', 'buffer', 'copilot' }, + default = { 'lazydev', 'lsp', 'path', 'snippets', 'buffer' }, providers = { - copilot = { - name = 'copilot', - module = 'blink-cmp-copilot', - score_offset = 90, - async = true, - transform_items = function(_, items) - local CompletionItemKind = require('blink.cmp.types').CompletionItemKind - local kind_idx = #CompletionItemKind + 1 - CompletionItemKind[kind_idx] = 'Copilot' - for _, item in ipairs(items) do - item.kind = kind_idx - end - return items - end, - }, lazydev = { name = 'LazyDev', module = 'lazydev.integrations.blink', diff --git a/lua/plugins/lang/bracketed.lua b/lua/plugins/lang/bracketed.lua new file mode 100644 index 0000000..24b3034 --- /dev/null +++ b/lua/plugins/lang/bracketed.lua @@ -0,0 +1,18 @@ +local bracketed = require('mini.bracketed') + +bracketed.setup({ + buffer = { suffix = 'b', options = {} }, + comment = { suffix = 'c', options = {} }, + conflict = { suffix = 'x', options = {} }, + diagnostic = { suffix = 'd', options = {} }, + file = { suffix = 'f', options = {} }, + indent = { suffix = 'i', options = {} }, + jump = { suffix = 'j', options = {} }, + location = { suffix = 'l', options = {} }, + oldfile = { suffix = 'r', options = {} }, + quickfix = { suffix = 'q', options = {} }, + treesitter = { suffix = 'n', options = {} }, + undo = { suffix = 'u', options = {} }, + window = { suffix = 'w', options = {} }, + yank = { suffix = 'y', options = {} }, +}) diff --git a/lua/plugins/lang/copilot-chat.lua b/lua/plugins/lang/copilot-chat.lua deleted file mode 100644 index 31de9a0..0000000 --- a/lua/plugins/lang/copilot-chat.lua +++ /dev/null @@ -1,92 +0,0 @@ -local chat = require('CopilotChat') -local icons = require('lib.icons') - -chat.setup({ - debug = false, -- Enable debug logging - proxy = nil, -- [protocol://]host[:port] Use this proxy - allow_insecure = false, -- Allow insecure server connections - model = 'gpt-4o', -- model to use, :CopilotChatModels for available models - agent = 'copilot', -- Default agent to use, see ':CopilotChatAgents' for available agents (can be specified manually in prompt via @). - context = 'buffers', -- Default context to use, 'buffers', 'buffer' or none (can be specified manually in prompt via @). - temperature = 0.1, -- temperature - - question_header = '# ' .. icons.ui.User .. 'User', -- Header to use for user questions - answer_header = '# ' .. icons.ui.Copilot .. 'Copilot', -- Header to use for AI answers - error_header = '## ' .. icons.ui.CopilotError .. 'Error', -- Header to use for errors - separator = ' ', -- Separator to use in chat - - show_folds = true, -- Shows folds for sections in chat - show_help = true, -- Shows help message as virtual lines when waiting for user input - auto_follow_cursor = false, -- Auto-follow cursor in chat - auto_insert_mode = false, -- Automatically enter insert mode when opening window and if auto follow cursor is enabled on new prompt - clear_chat_on_new_prompt = false, -- Clears chat on every new prompt - highlight_selection = true, -- Highlight selection in the source buffer when in the chat window - - chat_autocomplete = true, -- Enable chat autocompletion (when disabled, requires manual `mappings.complete` trigger) - history_path = vim.fn.stdpath('data') .. '/copilot_chat_history', -- Default path to stored history - callback = nil, -- Callback to use when ask response is received - - -- default window options - window = { - layout = 'vertical', -- 'vertical', 'horizontal', 'float', 'replace' - width = 0.45, -- fractional width of parent, or absolute width in columns when > 1 - height = 0.4, -- fractional height of parent, or absolute height in rows when > 1 - -- Options below only apply to floating windows - relative = 'editor', -- 'editor', 'win', 'cursor', 'mouse' - border = 'rounded', -- 'none', single', 'double', 'rounded', 'solid', 'shadow' - row = nil, -- row position of the window, default is centered - col = nil, -- column position of the window, default is centered - title = icons.ui.Copilot .. ' Copilot Chat', -- title of chat window - footer = nil, -- footer of chat window - zindex = 1, -- determines if window is on top or below other floating windows - }, - - -- default mappings - mappings = { - complete = { - insert = '', - }, - close = { - normal = 'q', - insert = '', - }, - reset = { - normal = '', - insert = '', - }, - submit_prompt = { - normal = '', - insert = '', - }, - toggle_sticky = { - detail = 'Makes line under cursor sticky or deletes sticky line.', - normal = 'gr', - }, - accept_diff = { - normal = '', - insert = '', - }, - jump_to_diff = { - normal = 'gj', - }, - quickfix_diffs = { - normal = 'gq', - }, - yank_diff = { - normal = 'gy', - register = '"', - }, - show_diff = { - normal = 'gd', - }, - show_info = { - normal = 'gi', - }, - show_context = { - normal = 'gc', - }, - show_help = { - normal = 'gh', - }, - }, -}) diff --git a/lua/plugins/lang/copilot.lua b/lua/plugins/lang/copilot.lua deleted file mode 100644 index c71f1ea..0000000 --- a/lua/plugins/lang/copilot.lua +++ /dev/null @@ -1,45 +0,0 @@ -local copilot = require('copilot') - -copilot.setup({ - panel = { - enabled = true, - auto_refresh = false, - keymap = { - jump_prev = '[[', - jump_next = ']]', - accept = '', - refresh = 'gr', - open = '', - }, - layout = { - position = 'bottom', - ratio = 0.4, - }, - }, - suggestion = { - enabled = true, - auto_trigger = false, - debounce = 75, - keymap = { - accept = '', - accept_word = false, - accept_line = false, - next = '', - prev = '', - dismiss = '', - }, - }, - filetypes = { - yaml = true, - markdown = true, - help = true, - gitcommit = true, - gitrebase = true, - hgcommit = true, - svn = true, - cvs = true, - ['.'] = true, - }, - copilot_node_command = 'node', -- Node.js version must be > 16.x - server_opts_overrides = {}, -}) diff --git a/lua/plugins/lang/pairs.lua b/lua/plugins/lang/pairs.lua new file mode 100644 index 0000000..29b6351 --- /dev/null +++ b/lua/plugins/lang/pairs.lua @@ -0,0 +1,18 @@ +local pairs = require('mini.pairs') + +pairs.setup({ + modes = { insert = true, command = true, terminal = false }, + mappings = { + ['('] = { action = 'open', pair = '()', neigh_pattern = '[^\\].' }, + ['['] = { action = 'open', pair = '[]', neigh_pattern = '[^\\].' }, + ['{'] = { action = 'open', pair = '{}', neigh_pattern = '[^\\].' }, + + [')'] = { action = 'close', pair = '()', neigh_pattern = '[^\\].' }, + [']'] = { action = 'close', pair = '[]', neigh_pattern = '[^\\].' }, + ['}'] = { action = 'close', pair = '{}', neigh_pattern = '[^\\].' }, + + ['"'] = { action = 'closeopen', pair = '""', neigh_pattern = '[^\\].', register = { cr = false } }, + ["'"] = { action = 'closeopen', pair = "''", neigh_pattern = '[^%a\\].', register = { cr = false } }, + ['`'] = { action = 'closeopen', pair = '``', neigh_pattern = '[^\\].', register = { cr = false } }, + }, +}) diff --git a/lua/plugins/lang/ror.lua b/lua/plugins/lang/ror.lua deleted file mode 100644 index 8c988d4..0000000 --- a/lua/plugins/lang/ror.lua +++ /dev/null @@ -1,20 +0,0 @@ -local ror = require('ror') -local icons = require('lib.icons') - -ror.setup({ - test = { - message = { - file = 'Running test file...', - line = 'Running single test...', - }, - coverage = { - up = 'DiffAdd', - down = 'DiffDelete', - }, - notification = { - timeout = false, - }, - pass_icon = icons.ui.Check, - fail_icon = icons.ui.Close, - }, -}) diff --git a/lua/plugins/tools/spider.lua b/lua/plugins/lang/spider.lua similarity index 100% rename from lua/plugins/tools/spider.lua rename to lua/plugins/lang/spider.lua diff --git a/lua/plugins/lang/textobjects.lua b/lua/plugins/lang/textobjects.lua index c335926..040e149 100644 --- a/lua/plugins/lang/textobjects.lua +++ b/lua/plugins/lang/textobjects.lua @@ -52,52 +52,52 @@ local textobjects = { enable = true, swap_next = { ['rna'] = '@parameter.inner', -- swap object property with next - ['rn:'] = '@property.outer', -- swap parameters/argument with next - ['rnm'] = '@function.outer', -- swap function with next + ['rn:'] = '@property.outer', -- swap parameters/argument with next + ['rnm'] = '@function.outer', -- swap function with next }, swap_previous = { ['rpa'] = '@parameter.inner', -- swap parameters/argument with prev - ['rp:'] = '@property.outer', -- swap object property with prev - ['rpm'] = '@function.outer', -- swap function with previous + ['rp:'] = '@property.outer', -- swap object property with prev + ['rpm'] = '@function.outer', -- swap function with previous }, }, move = { enable = true, set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - [']c'] = { query = '@class.outer', desc = 'Next class start' }, - [']f'] = { query = '@call.outer', desc = 'Next function call start' }, - [']i'] = { query = '@conditional.outer', desc = 'Next conditional start' }, - [']l'] = { query = '@loop.outer', desc = 'Next loop start' }, - [']m'] = { query = '@function.outer', desc = 'Next method/function def start' }, - [']z'] = { query = '@fold', query_group = 'folds', desc = 'Next fold' }, + goto_previous_start = { + ['[oc'] = { query = '@class.outer', desc = 'Prev class start' }, + ['[of'] = { query = '@call.outer', desc = 'Prev function call start' }, + ['[oi'] = { query = '@conditional.outer', desc = 'Prev conditional start' }, + ['[ol'] = { query = '@loop.outer', desc = 'Prev loop start' }, + ['[om'] = { query = '@function.outer', desc = 'Prev method def start' }, + ['[z'] = { query = '@fold', query_group = 'folds', desc = 'Prev fold' }, -- You can pass a query group to use query from `queries//.scm file in your runtime path. -- Above example nvim-treesitter's folds.scm`. They also provide locals.scm, highlights.scm and indent.scm. }, - goto_next_end = { - [']C'] = { query = '@class.outer', desc = 'Next class end' }, - [']F'] = { query = '@call.outer', desc = 'Next function call end' }, - [']I'] = { query = '@conditional.outer', desc = 'Next conditional end' }, - [']L'] = { query = '@loop.outer', desc = 'Next loop end' }, - [']M'] = { query = '@function.outer', desc = 'Next method/function def end' }, - [']Z'] = { query = '@fold', query_group = 'folds', desc = 'Next fold end' }, - }, - goto_previous_start = { - ['[c'] = { query = '@class.outer', desc = 'Prev class start' }, - ['[f'] = { query = '@call.outer', desc = 'Prev function call start' }, - ['[i'] = { query = '@conditional.outer', desc = 'Prev conditional start' }, - ['[l'] = { query = '@loop.outer', desc = 'Prev loop start' }, - ['[m'] = { query = '@function.outer', desc = 'Prev method/function def start' }, - ['[z'] = { query = '@fold', query_group = 'folds', desc = 'Prev fold' }, - }, goto_previous_end = { - ['[C'] = { query = '@class.outer', desc = 'Prev class end' }, - ['[F'] = { query = '@call.outer', desc = 'Prev function call end' }, - ['[I'] = { query = '@conditional.outer', desc = 'Prev conditional end' }, - ['[L'] = { query = '@loop.outer', desc = 'Prev loop end' }, - ['[M'] = { query = '@function.outer', desc = 'Prev method/function def end' }, + ['[oC'] = { query = '@class.outer', desc = 'Prev class end' }, + ['[oF'] = { query = '@call.outer', desc = 'Prev function call end' }, + ['[oI'] = { query = '@conditional.outer', desc = 'Prev conditional end' }, + ['[oL'] = { query = '@loop.outer', desc = 'Prev loop end' }, + ['[oM'] = { query = '@function.outer', desc = 'Prev method def end' }, ['[Z'] = { query = '@fold', query_group = 'folds', desc = 'Prev fold end' }, }, + goto_next_start = { + [']oc'] = { query = '@class.outer', desc = 'Next class start' }, + [']of'] = { query = '@call.outer', desc = 'Next function call start' }, + [']oi'] = { query = '@conditional.outer', desc = 'Next conditional start' }, + [']ol'] = { query = '@loop.outer', desc = 'Next loop start' }, + [']om'] = { query = '@function.outer', desc = 'Next method def start' }, + [']z'] = { query = '@fold', query_group = 'folds', desc = 'Next fold' }, + }, + goto_next_end = { + [']oC'] = { query = '@class.outer', desc = 'Next class end' }, + [']oF'] = { query = '@call.outer', desc = 'Next function call end' }, + [']oI'] = { query = '@conditional.outer', desc = 'Next conditional end' }, + [']oL'] = { query = '@loop.outer', desc = 'Next loop end' }, + [']oM'] = { query = '@function.outer', desc = 'Next method def end' }, + [']Z'] = { query = '@fold', query_group = 'folds', desc = 'Next fold end' }, + }, }, } @@ -114,3 +114,4 @@ vim.keymap.set({ 'n', 'x', 'o' }, 't', ts_repeat_move.builtin_t) vim.keymap.set({ 'n', 'x', 'o' }, 'T', ts_repeat_move.builtin_T) return textobjects + diff --git a/lua/plugins/lang/treesitter.lua b/lua/plugins/lang/treesitter.lua index 8d3d9d1..28e3984 100644 --- a/lua/plugins/lang/treesitter.lua +++ b/lua/plugins/lang/treesitter.lua @@ -14,9 +14,6 @@ treesitter.setup({ auto_install = true, textobjects = textobjects, - autopairs = { enable = true }, - endwise = { enable = true }, - autotag = { enable = true }, matchup = { enable = true }, indent = { enable = true }, @@ -82,3 +79,4 @@ treesitter.setup({ }, }, }) + diff --git a/lua/plugins/list.lua b/lua/plugins/list.lua index d3c8d45..fc5f328 100644 --- a/lua/plugins/list.lua +++ b/lua/plugins/list.lua @@ -1,3 +1,4 @@ +local util = require('lib.util') local function load_config(package) return function() require('plugins.' .. package) @@ -12,6 +13,7 @@ local plugins = { lazy = false, priority = 1000, }, + { 'nvim-tree/nvim-web-devicons' }, { 'folke/snacks.nvim', priority = 1000, @@ -30,25 +32,6 @@ local plugins = { }, -- Language - { - 'mfussenegger/nvim-dap', - dependencies = { - 'rcarriga/nvim-dap-ui', - }, - config = load_config('lang.dap'), - cmd = { 'DapUIToggle', 'DapToggleRepl', 'DapToggleBreakpoint' }, - }, - { - 'nvim-neotest/neotest', - dependencies = { - 'nvim-neotest/nvim-nio', - 'olimorris/neotest-rspec', - 'nvim-neotest/neotest-jest', - 'nvim-neotest/neotest-python', - }, - config = load_config('lang.neotest'), - cmd = 'Neotest', - }, { 'michaelb/sniprun', build = 'bash ./install.sh', @@ -59,11 +42,6 @@ local plugins = { 'ThePrimeagen/refactoring.nvim', config = load_config('lang.refactoring'), }, - { - 'windwp/nvim-autopairs', - config = load_config('lang.autopairs'), - event = 'InsertEnter', - }, { 'echasnovski/mini.surround', version = '*', @@ -76,6 +54,21 @@ local plugins = { config = load_config('lang.ai'), event = { 'BufReadPost', 'BufNewFile' }, }, + { + 'echasnovski/mini.bracketed', + config = load_config('lang.bracketed'), + event = { 'BufReadPost', 'BufNewFile' }, + }, + { + 'echasnovski/mini.pairs', + config = load_config('lang.pairs'), + event = 'InsertEnter', + }, + { + 'chrisgrieser/nvim-spider', + config = load_config('lang.spider'), + event = { 'BufReadPost', 'BufNewFile' }, + }, -- Tresitter { @@ -84,9 +77,7 @@ local plugins = { dependencies = { 'nvim-treesitter/nvim-treesitter-refactor', 'nvim-treesitter/nvim-treesitter-textobjects', - 'RRethy/nvim-treesitter-endwise', 'RRethy/nvim-treesitter-textsubjects', - 'windwp/nvim-ts-autotag', }, config = load_config('lang.treesitter'), event = { 'BufReadPost', 'BufNewFile' }, @@ -94,10 +85,7 @@ local plugins = { -- LSP { 'neovim/nvim-lspconfig', - dependencies = { - 'williamboman/mason-lspconfig.nvim', - 'saghen/blink.cmp', - }, + dependencies = { 'williamboman/mason-lspconfig.nvim' }, config = load_config('lang.lspconfig'), event = { 'BufReadPre', 'BufNewFile' }, }, @@ -117,7 +105,7 @@ local plugins = { }, { 'nvimtools/none-ls.nvim', - dependencies = { 'neovim/nvim-lspconfig', 'jay-babu/mason-null-ls.nvim' }, + dependencies = { 'jay-babu/mason-null-ls.nvim' }, config = load_config('lang.null-ls'), event = { 'BufReadPost', 'BufNewFile' }, }, @@ -125,43 +113,12 @@ local plugins = { -- Completion { 'saghen/blink.cmp', - dependencies = { 'rafamadriz/friendly-snippets', 'giuxtaposition/blink-cmp-copilot' }, + dependencies = { 'rafamadriz/friendly-snippets' }, version = '*', config = load_config('lang.blink'), opts_extend = { 'sources.default' }, event = { 'InsertEnter' }, }, - { - 'zbirenbaum/copilot.lua', - dependencies = { 'giuxtaposition/blink-cmp-copilot' }, - config = load_config('lang.copilot'), - event = 'InsertEnter', - }, - { - 'CopilotC-Nvim/CopilotChat.nvim', - dependencies = { - { 'zbirenbaum/copilot.lua' }, - { 'nvim-lua/plenary.nvim' }, - }, - branch = 'main', - build = 'make tiktoken', -- Only on MacOS or Linux - cmd = { - 'CopilotChat', - 'CopilotChatToggle', - 'CopilotChatDocs', - 'CopilotChatExplain', - 'CopilotChatFix', - 'CopilotChatFixDiagnostic', - 'CopilotChatCommit', - 'CopilotChatCommitStaged', - 'CopilotChatLoad', - 'CopilotChatOptimize', - 'CopilotChatReview', - 'CopilotChatSave', - 'CopilotChatTests', - }, - config = load_config('lang.copilot-chat'), - }, { 'Exafunction/codeium.vim', event = 'InsertEnter', @@ -183,69 +140,26 @@ local plugins = { }, -- Tools - { - 'nvim-neo-tree/neo-tree.nvim', - cmd = { 'Neotree' }, - opts = { - filesystem = { - filtered_items = { - visible = true, - show_hidden_count = true, - hide_dotfiles = false, - hide_gitignored = true, - hide_by_name = { - '.git', - '.DS_Store', - 'thumbs.db', - '.venv', - }, - never_show = {}, - }, - }, - window = { - position = 'right', - width = 35, + 'echasnovski/mini.files', + version = '*', + config = load_config('tools.files'), + event = { 'BufReadPost', 'BufNewFile' }, + keys = { + { + 'eM', + function() + require('mini.files').open(util.get_file_path(), true) + end, + desc = 'Explorer', }, }, }, - { - 'LudoPinelli/comment-box.nvim', - event = 'BufReadPre', - opts = { - box_width = 70, - }, - }, - { - 'mistricky/codesnap.nvim', - lazy = true, - build = 'make', - opts = { - save_path = '~/Pictures/screenshots/code', - has_breadcrumbs = false, - show_workspace = false, - bg_theme = 'default', - watermark = 'S4NKALP', - code_font_family = 'Iosevka NF', - code_font_size = 12, - }, - cmd = { 'CodeSnap', 'CodeSnapSave', 'CodeSnapHighlight', 'CodeSnapASCII' }, - }, - { - 'wakatime/vim-wakatime', - event = { 'VimEnter' }, - lazy = false, - }, { 'windwp/nvim-spectre', config = load_config('tools.spectre'), cmd = 'Spectre', }, - { - 'abecodes/tabout.nvim', - config = load_config('tools.tabout'), - event = 'InsertEnter', - }, { 'folke/flash.nvim', config = load_config('tools.flash'), @@ -277,19 +191,6 @@ local plugins = { end end, }, - { - 'm4xshen/hardtime.nvim', - dependencies = { 'MunifTanjim/nui.nvim', 'nvim-lua/plenary.nvim' }, - config = function() - require('hardtime').setup({ enabled = true }) - end, - cmd = 'Hardtime', - }, - { - 'chrisgrieser/nvim-spider', - config = load_config('tools.spider'), - event = { 'BufReadPost', 'BufNewFile' }, - }, { 'folke/which-key.nvim', config = load_config('tools.which-key'), @@ -297,8 +198,9 @@ local plugins = { }, { 'iamcco/markdown-preview.nvim', - build = function() - vim.fn['mkdp#util#install']() + build = 'cd app && yarn install', + init = function() + vim.g.mkdp_filetypes = { 'markdown' } end, ft = 'markdown', cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview' }, @@ -312,6 +214,69 @@ local plugins = { '2kabhishek/termim.nvim', cmd = { 'Fterm', 'FTerm', 'Sterm', 'STerm', 'Vterm', 'VTerm' }, }, + { + 'm4xshen/hardtime.nvim', + dependencies = { 'MunifTanjim/nui.nvim', 'nvim-lua/plenary.nvim' }, + cmd = 'Hardtime', + enabled = util.get_user_config('enable_trainer', false), + }, + { + 'kndndrj/nvim-dbee', + dependencies = { 'MunifTanjim/nui.nvim' }, + build = function() + -- "curl", "wget", "bitsadmin", "go" + require('dbee').install('curl') + end, + config = load_config('tools.dbee'), + cmd = 'DBToggle', + enabled = util.get_user_config('enable_db_explorer', false), + }, + { + 'mfussenegger/nvim-dap', + dependencies = { 'rcarriga/nvim-dap-ui' }, + config = load_config('tools.dap'), + cmd = { 'DapUIToggle', 'DapToggleRepl', 'DapToggleBreakpoint' }, + enabled = util.get_user_config('enable_debugger', false), + }, + { + 'nvim-neotest/neotest', + dependencies = { + 'nvim-neotest/nvim-nio', + 'olimorris/neotest-rspec', + 'nvim-neotest/neotest-jest', + 'nvim-neotest/neotest-python', + }, + config = load_config('tools.neotest'), + cmd = 'Neotest', + enabled = util.get_user_config('enable_test_runner', false), + }, + { + 'LudoPinelli/comment-box.nvim', + event = 'BufReadPre', + opts = { + box_width = 70, + }, + }, + { + 'mistricky/codesnap.nvim', + lazy = true, + build = 'make', + opts = { + save_path = '~/Pictures/screenshots/code', + has_breadcrumbs = false, + show_workspace = false, + bg_theme = 'default', + watermark = 'S4NKALP', + code_font_family = 'Iosevka NF', + code_font_size = 12, + }, + cmd = { 'CodeSnap', 'CodeSnapSave', 'CodeSnapHighlight', 'CodeSnapASCII' }, + }, + { + 'wakatime/vim-wakatime', + event = { 'VimEnter' }, + lazy = false, + }, { 'akinsho/toggleterm.nvim', @@ -344,19 +309,7 @@ local plugins = { 'creativenull/dotfyle-metadata.nvim', cmd = { 'DotfyleGenerate', 'DotfyleOpen' }, }, - { - 'kndndrj/nvim-dbee', - dependencies = { - 'MunifTanjim/nui.nvim', - }, - build = function() - -- "curl", "wget", "bitsadmin", "go" - require('dbee').install('curl') - end, - config = load_config('tools.dbee'), - cmd = 'DBToggle', - enabled = false, - }, + { 'zapling/mason-lock.nvim', cmd = { 'MasonLock', 'MasonLockRestore' }, @@ -366,36 +319,6 @@ local plugins = { }) end, }, - { - 'epwalsh/pomo.nvim', - cmd = { 'TimerStart', 'TimerStop', 'TimerRepeat' }, - dependencies = { - 'rcarriga/nvim-notify', - }, - opts = { - notifiers = { - { - name = 'Default', - opts = { - sticky = false, - }, - }, - }, - }, - }, - { - 'nvchad/showkeys', - cmd = 'ShowkeysToggle', - opts = { - timeout = 1, - maxkeys = 8, - }, - }, - { - 'ThePrimeagen/vim-be-good', - cmd = 'VimBeGood', - }, - { 'tweekmonster/django-plus.vim' }, -- Telescope { @@ -408,7 +331,6 @@ local plugins = { build = 'make', }, 'debugloop/telescope-undo.nvim', - 'nvim-telescope/telescope-file-browser.nvim', }, config = load_config('tools.telescope'), cmd = 'Telescope', @@ -478,44 +400,17 @@ local lsp_servers = { 'lua_ls', 'typos_lsp', -- check typos 'vimls', - 'jinja_lsp', 'tailwindcss', } -local util = require('lib.util') - if util.is_present('npm') then table.insert(lsp_servers, 'eslint') table.insert(lsp_servers, 'ts_ls') end if util.is_present('gem') then - local ror_nvim = { - 'weizheheng/ror.nvim', - branch = 'main', - ft = 'ruby', - config = load_config('lang.ror'), - keys = { - { - 'rc', - mode = { 'n' }, - function() - vim.cmd('RorCommands') - end, - desc = 'Rails Commands', - }, - }, - } - local vim_rails = { - 'tpope/vim-rails', - ft = 'ruby', - } - table.insert(lsp_servers, 'solargraph') - -- table.insert(lsp_servers, 'ruby_lsp') table.insert(lsp_servers, 'rubocop') - table.insert(plugins, ror_nvim) - table.insert(plugins, vim_rails) end if util.is_present('go') then @@ -543,6 +438,11 @@ if util.is_present('cargo') then table.insert(lsp_servers, 'rust_analyzer') end +vim.tbl_extend('force', plugins, util.get_user_config('user_plugins', {})) +vim.tbl_extend('force', lsp_servers, util.get_user_config('user_lsp_servers', {})) +vim.tbl_extend('force', null_ls_sources, util.get_user_config('user_null_ls_sources', {})) +vim.tbl_extend('force', treesitter_parsers, util.get_user_config('user_tresitter_parsers', {})) + return { plugins = plugins, lsp_servers = lsp_servers, diff --git a/lua/plugins/lock.json b/lua/plugins/lock.json index 8559822..0032cbd 100644 --- a/lua/plugins/lock.json +++ b/lua/plugins/lock.json @@ -1,74 +1,56 @@ { - "CopilotChat.nvim": { "branch": "main", "commit": "2ebe591cff06018e265263e71e1dbc4c5aa8281e" }, "Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" }, - "blink-cmp-copilot": { "branch": "main", "commit": "c5c5cbce5748d21073f1d5348a92ebe6ce63f387" }, - "blink.cmp": { "branch": "main", "commit": "e3b7cb4a1094377c3093a021300de123d9fc60d3" }, + "blink.cmp": { "branch": "main", "commit": "1cc3b1a908fbcfd15451c4772759549724f38524" }, "ccc.nvim": { "branch": "main", "commit": "b57cbaf8db3ac43c56c9e2c7f3812944638260ed" }, - "codeium.vim": { "branch": "main", "commit": "d152e6cd3d814a44f36447bb0d21d51f6787fe9c" }, + "codeium.vim": { "branch": "main", "commit": "000de972de76f357c03da14f4f8dd9a969d4fe8c" }, "codesnap.nvim": { "branch": "main", "commit": "6400480aa6cc366cbd931146c429aaa64680dab9" }, "comment-box.nvim": { "branch": "main", "commit": "06bb771690bc9df0763d14769b779062d8f12bc5" }, - "copilot.lua": { "branch": "master", "commit": "886ee73b6d464b2b3e3e6a7ff55ce87feac423a9" }, - "django-plus.vim": { "branch": "master", "commit": "220cfbc03e89c636606f0f4bc89f8135be5f765e" }, "dotfyle-metadata.nvim": { "branch": "main", "commit": "342ef8f3f98f3ccc451c9cf2be74e95149ced05d" }, "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, "esqueleto.nvim": { "branch": "main", "commit": "0f79ccafc931f706d175549c1339848eb8fa8470" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, - "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, + "gitsigns.nvim": { "branch": "main", "commit": "9541f5e8e24571723cb02a5c2bf078aeacc5a711" }, "hardtime.nvim": { "branch": "main", "commit": "5d9adcbe2f12741de79e435c8b85dca69a3b22e4" }, - "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, + "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }, "lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" }, - "lspsaga.nvim": { "branch": "main", "commit": "5fce15331ac6c3a3ec3ac91ab0e85ed82f5cbba0" }, + "lspsaga.nvim": { "branch": "main", "commit": "8084e8447bef3f94863949087707e6221a4e5df7" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, "markit.nvim": { "branch": "main", "commit": "6a59bcc5140bed8fcf9cec2cba8d442072b1b76d" }, "mason-lock.nvim": { "branch": "main", "commit": "86614f76c3442fba1c5c8d79aa1efcb3ad69de1c" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "e942edf5c85b6a2ab74059ea566cac5b3e1514a4" }, "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mini.ai": { "branch": "main", "commit": "40e380a589d07ec2c856940c6422aafe5d949a0d" }, - "mini.surround": { "branch": "main", "commit": "0e67c4bc147f2a15cee94e7c94dcc0e115b9f55e" }, - "neo-tree.nvim": { "branch": "main", "commit": "e6645ecfcba3e064446a6def1c10d788c9873f51" }, + "mini.bracketed": { "branch": "main", "commit": "0091e11fabe34973fc038a8d0d0485202742e403" }, + "mini.files": { "branch": "main", "commit": "d0f03a5c38836fd2cce3dc80734124959002078c" }, + "mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" }, + "mini.surround": { "branch": "main", "commit": "aa5e245829dd12d8ff0c96ef11da28681d6049aa" }, "neotest": { "branch": "master", "commit": "d66cf4e05a116957f0d3a7755a24291c7d1e1f72" }, - "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, - "neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" }, - "neotest-rspec": { "branch": "main", "commit": "f8c91edc5dd87ca467a624652f365ac217d7cc1c" }, "nerdy.nvim": { "branch": "main", "commit": "719ed52244b34ea9de08f074e0d22fd67d615640" }, - "none-ls.nvim": { "branch": "main", "commit": "00421b9dc7a4d132ca74cfb4c7e8030d05d6fd0b" }, - "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, - "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, - "nvim-dap": { "branch": "master", "commit": "0e673accbb512e1e191dfb4fecea89cc38c1bcdd" }, - "nvim-dap-ui": { "branch": "master", "commit": "e94d98649dccb6a3884b66aabc2e07beb279e535" }, - "nvim-lspconfig": { "branch": "master", "commit": "f4ed656e876e45cf914d7beb972830561178e232" }, - "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-notify": { "branch": "master", "commit": "bd9cd51f9ef2f6326fc2bc9931d0718c1794e247" }, - "nvim-spectre": { "branch": "master", "commit": "08be31c104df3b4b049607694ebb2b6ced4f928b" }, + "none-ls.nvim": { "branch": "main", "commit": "7bebb35a05871aeb99825f29d869cbd9a46bdbba" }, + "nvim-dap": { "branch": "master", "commit": "99807078c5089ed30e0547aa4b52c5867933f426" }, + "nvim-lspconfig": { "branch": "master", "commit": "339ccc81e08793c3af9b83882a6ebd90c9cc0d3b" }, + "nvim-spectre": { "branch": "master", "commit": "ddd7383e856a7c939cb4f5143278fe041bbb8cb9" }, "nvim-spider": { "branch": "main", "commit": "2b38e3e95e143313d78ca098eeecda7aebfce925" }, - "nvim-treesitter": { "branch": "master", "commit": "57713d079c3c2afcc31f3e0650bf8594a2a296ba" }, - "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, + "nvim-treesitter": { "branch": "master", "commit": "f0c928dbe93533b7e35894a8f957f40150d1f663" }, "nvim-treesitter-refactor": { "branch": "master", "commit": "d8b74fa87afc6a1e97b18da23e762efb032dc270" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, "nvim-treesitter-textsubjects": { "branch": "master", "commit": "a8d2844bba925d9450ef7ab215f3b054028288ca" }, - "nvim-ts-autotag": { "branch": "main", "commit": "1cca23c9da708047922d3895a71032bc0449c52d" }, + "nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" }, "onedark.nvim": { "branch": "master", "commit": "67a74c275d1116d575ab25485d1bfa6b2a9c38a6" }, - "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, - "pomo.nvim": { "branch": "main", "commit": "aa8decc421d89be0f10b1fc6a602cdd269f350ff" }, + "plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" }, "refactoring.nvim": { "branch": "master", "commit": "2db6d378e873de31d18ade549c2edba64ff1c2e3" }, - "ror.nvim": { "branch": "main", "commit": "9d31ad3953be83ac8dd542725ca4881c861f64a5" }, - "showkeys": { "branch": "main", "commit": "891f95ef94ac80bc7690a0df09c6112b4b822cac" }, - "snacks.nvim": { "branch": "main", "commit": "d312053f78b4fb55523def179ac502438dd93193" }, + "snacks.nvim": { "branch": "main", "commit": "60f79f98c2d03fcdc69cb85b3494b2aac2ae3ca5" }, "sniprun": { "branch": "master", "commit": "67ac2d84d03f3b857d59571ff5fefb6080dffa2d" }, - "tabout.nvim": { "branch": "master", "commit": "9a3499480a8e53dcaa665e2836f287e3b7764009" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, "telescope-undo.nvim": { "branch": "main", "commit": "2971cc9f193ec09e0c5de3563f99cbea16b63f10" }, - "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "415af52339215926d705cccc08145f3782c4d132" }, "termim.nvim": { "branch": "main", "commit": "58344167abb97bcef9bf720a762ea653a94e9daa" }, "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, - "vim-be-good": { "branch": "master", "commit": "0ae3de14eb8efc6effe7704b5e46495e91931cc5" }, "vim-fugitive": { "branch": "master", "commit": "174230d6a7f2df94705a7ffd8d5413e27ec10a80" }, - "vim-rails": { "branch": "master", "commit": "d3954dfe3946c9330dc91b4fbf79ccacb2c626c0" }, "vim-wakatime": { "branch": "master", "commit": "cf51327a9e08935569614d1cb24e779ee9f45519" }, - "which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" } + "which-key.nvim": { "branch": "main", "commit": "1f8d414f61e0b05958c342df9b6a4c89ce268766" } } diff --git a/lua/plugins/mason-lock.json b/lua/plugins/mason-lock.json index adaca40..cd14c19 100644 --- a/lua/plugins/mason-lock.json +++ b/lua/plugins/mason-lock.json @@ -13,7 +13,6 @@ "hadolint": "v2.12.0", "html-lsp": "4.10.0", "jdtls": "v1.43.0", - "jinja-lsp": "0.1.84", "json-lsp": "4.10.0", "lua-language-server": "3.13.5", "prettier": "3.4.2", @@ -35,4 +34,4 @@ "vim-language-server": "2.3.1", "vint": "0.3.21", "write-good": "1.0.8" -} \ No newline at end of file +} diff --git a/lua/plugins/lang/dap.lua b/lua/plugins/tools/dap.lua similarity index 100% rename from lua/plugins/lang/dap.lua rename to lua/plugins/tools/dap.lua diff --git a/lua/plugins/tools/files.lua b/lua/plugins/tools/files.lua new file mode 100644 index 0000000..71c5530 --- /dev/null +++ b/lua/plugins/tools/files.lua @@ -0,0 +1,39 @@ +local files = require('mini.files') + +files.setup({ + content = { + filter = nil, + prefix = nil, + sort = nil, + }, + mappings = { + close = 'q', + go_in = 'L', + go_in_plus = 'l', + go_out = 'h', + go_out_plus = 'H', + mark_goto = "'", + mark_set = 'm', + reset = '', + reveal_cwd = '@', + show_help = 'g?', + synchronize = '', + trim_left = '<', + trim_right = '>', + }, + options = { + permanent_delete = true, + use_as_default_explorer = true, + }, + windows = { + max_number = math.huge, + preview = false, + width_focus = 30, + width_nofocus = 20, + width_preview = 80, + }, +}) + +vim.api.nvim_set_hl(0, 'MiniFilesBorder', { bg = 'none' }) +vim.api.nvim_set_hl(0, 'MiniFilesNormal', { bg = 'none' }) +vim.api.nvim_set_hl(0, 'MiniFilesTitle', { bg = 'none' }) diff --git a/lua/plugins/lang/neotest.lua b/lua/plugins/tools/neotest.lua similarity index 100% rename from lua/plugins/lang/neotest.lua rename to lua/plugins/tools/neotest.lua diff --git a/lua/plugins/tools/tabout.lua b/lua/plugins/tools/tabout.lua deleted file mode 100644 index 465c290..0000000 --- a/lua/plugins/tools/tabout.lua +++ /dev/null @@ -1,22 +0,0 @@ -local tabout = require('tabout') - -tabout.setup({ - tabkey = '', - backwards_tabkey = '', - act_as_tab = true, - act_as_shift_tab = true, - default_tab = '', - default_shift_tab = '', - enable_backwards = false, - completion = true, - tabouts = { - { open = "'", close = "'" }, - { open = '"', close = '"' }, - { open = '`', close = '`' }, - { open = '(', close = ')' }, - { open = '[', close = ']' }, - { open = '{', close = '}' }, - }, - ignore_beginning = true, - exclude = { 'markdown' }, -}) diff --git a/lua/plugins/tools/telescope.lua b/lua/plugins/tools/telescope.lua index 45a6811..c73ef7c 100644 --- a/lua/plugins/tools/telescope.lua +++ b/lua/plugins/tools/telescope.lua @@ -115,18 +115,6 @@ telescope.setup({ override_file_sorter = true, case_mode = 'smart_case', }, - file_browser = { - theme = 'ivy', - hijack_netrw = true, - mappings = { - ['i'] = { - -- your custom insert mode mappings - }, - ['n'] = { - -- your custom normal mode mappings - }, - }, - }, undo = { use_delta = true, use_custom_command = nil, @@ -156,4 +144,3 @@ telescope.load_extension('fzf') telescope.load_extension('undo') telescope.load_extension('marks_nvim') telescope.load_extension('refactoring') -telescope.load_extension('file_browser') diff --git a/lua/plugins/tools/which-key.lua b/lua/plugins/tools/which-key.lua index 607d90f..9028b46 100644 --- a/lua/plugins/tools/which-key.lua +++ b/lua/plugins/tools/which-key.lua @@ -39,19 +39,6 @@ local setup = { local normal_mappings = { mode = 'n', - { 'a', group = ' AI' }, - { 'aF', 'CopilotChatFixDiagnostic', desc = 'Fix Diagnostic' }, - { 'aG', 'CopilotChatCommitStaged', desc = 'Commit Staged' }, - { 'ac', 'CopilotChatToggle', desc = 'Copilot Chat' }, - { 'ad', 'CopilotChatDocs', desc = 'Docs' }, - { 'ae', 'CopilotChatExplain', desc = 'Explain' }, - { 'af', 'CopilotChatFix', desc = 'Fix' }, - { 'ag', 'CopilotChatCommit', desc = 'Commit' }, - { 'al', 'CopilotChatLoad', desc = 'Load Chat' }, - { 'ao', 'CopilotChatOptimize', desc = 'Optimize' }, - { 'ar', 'CopilotChatReview', desc = 'Review' }, - { 'as', 'CopilotChatSave', desc = 'Save Chat' }, - { 'at', 'CopilotChatTests', desc = 'Tests' }, { 'b', group = ' Debug' }, { 'bO', 'DapStepOut', desc = 'Out' }, @@ -73,7 +60,6 @@ local normal_mappings = { { 'cd', 'RootDir', desc = 'Root Directory' }, { 'ce', '%SnipRun', desc = 'Execute File' }, { 'cf', 'lua vim.lsp.buf.format({async = true})', desc = 'Format File' }, - { 'ch', 'Hardtime toggle', desc = 'Hardtime' }, { 'cl', ':g/^\\s*$/d', desc = 'Clean Empty Lines' }, { 'cm', 'MarkdownPreviewToggle', desc = 'Markdown Preview' }, { 'cn', 'lua require("snacks").notifier.show_history()', desc = 'Notifications' }, @@ -118,10 +104,6 @@ local normal_mappings = { { 'ecn', 'e $MYVIMRC', desc = 'Neovim Init' }, { 'ecp', 'e ~/dotfiles/nvim/lua/plugins/list.lua', desc = 'Plugin List' }, { 'ect', 'e ~/dotfiles/tmux/tmux.conf', desc = 'Tmux Config' }, - - { 'ee', ':Neotree toggle float', silent = true, desc = 'Float File Explorer' }, - { 'eE', ':Neotree toggle left', silent = true, desc = 'Left File Explorer' }, - { 'ef', 'Telescope file_browser', desc = 'File Browser' }, { 'eF', 'gf', desc = 'File Under Cursor' }, { 'em', 'e README.md', desc = 'Readme' }, { 'en', 'enew', desc = 'New File' }, @@ -428,17 +410,6 @@ end local visual_mappings = { mode = 'v', - { 'a', group = ' AI' }, - { 'aF', 'CopilotChatFixDiagnostic', desc = 'Fix Diagnostic' }, - { 'aG', 'CopilotChatCommitStaged', desc = 'Commit Staged' }, - { 'ac', 'CopilotChatToggle', desc = 'Copilot Chat' }, - { 'ad', 'CopilotChatDocs', desc = 'Docs' }, - { 'ae', 'CopilotChatExplain', desc = 'Explain' }, - { 'af', 'CopilotChatFix', desc = 'Fix' }, - { 'ag', 'CopilotChatCommit', desc = 'Commit' }, - { 'ao', 'CopilotChatOptimize', desc = 'Optimize' }, - { 'ar', 'CopilotChatReview', desc = 'Review' }, - { 'at', 'CopilotChatTests', desc = 'Tests' }, { 'c', group = ' Code' }, { 'ce', "'<,'>SnipRun", desc = 'Execute Selection' }, @@ -540,43 +511,30 @@ local no_leader_mappings = { { '', 'l', desc = 'Move Right' }, { '', 'p', desc = 'Previous Pane' }, - { '', 'bprevious', desc = 'Previous Buffer' }, - { '', 'bnext', desc = 'Next Buffer' }, + { '', 'bprevious', desc = 'Previous Buffer' }, + { '', 'bnext', desc = 'Next Buffer' }, { 'K', 'Lspsaga hover_doc', desc = 'LSP Hover' }, { 'Q', 'qall!', desc = 'Force Quit!' }, { 'U', 'redo', desc = 'Redo' }, { '[', group = ' Previous' }, - { '[B', 'bfirst', desc = 'First Buffer' }, - { '[b', 'bprevious', desc = 'Buffer' }, - { '[d', 'Lspsaga diagnostic_jump_prev', desc = 'Diagnostic' }, { '[g', 'Gitsigns prev_hunk', desc = 'Git Hunk' }, - { '[j', '', desc = 'Jump' }, - { '[q', 'cprev', desc = 'Quickfix' }, + { '[o', group = 'Textobjects' }, { ']', group = ' Next' }, - { ']B', 'blast', desc = 'Buffer' }, - { ']b', 'bnext', desc = 'Buffer' }, - { ']d', 'Lspsaga diagnostic_jump_next', desc = 'Diagnostic' }, { ']g', 'Gitsigns next_hunk', desc = 'Git Hunk' }, - { ']j', '', desc = 'Jump' }, - { ']q', 'cnext', desc = 'Quickfix' }, + { ']o', group = 'Textobjects' }, } -local tmux_mappings = { - { '', 'NavigatorLeft', desc = 'Move Left' }, - { '', 'NavigatorDown', desc = 'Move Down' }, - { '', 'NavigatorUp', desc = 'Move Up' }, - { '', 'NavigatorRight', desc = 'Move Right' }, - { '', 'NavigatorPrevious', desc = 'Previous Pane' }, -} +if vim.fn.exists('$TMUX') == 1 then + vim.tbl_extend('force', no_leader_mappings, tmux_mappings) +end + +local user_keybindings = require('lib.util').get_user_config('user_keybindings', {}) which_key.setup(setup) which_key.add(normal_mappings) which_key.add(visual_mappings) which_key.add(no_leader_mappings) - -if vim.fn.exists('$TMUX') == 1 then - which_key.add(tmux_mappings) -end +which_key.add(user_keybindings)