diff --git a/.config/nvim/lua/lazyvim/config/keymaps.lua b/.config/nvim/lua/lazyvim/config/keymaps.lua index 8bd173c..528ea79 100644 --- a/.config/nvim/lua/lazyvim/config/keymaps.lua +++ b/.config/nvim/lua/lazyvim/config/keymaps.lua @@ -40,8 +40,8 @@ map("n", "", '"+p', opts) map("n", "", ":w", opts) -- Switch between buffers -map("n", "", ":CybuNext", opts) -map("n", "", ":CybuPrev", opts) +map("n", "", ":bnext", opts) +map("n", "", ":bprevious", opts) -- center after up and down movements map("n", "", "zz", opts) @@ -64,5 +64,33 @@ map("v", ">", ">gv", opts) map("v", "", ":m .+1==V", opts) map("v", "", ":m .-2==V", opts) --- Copy -map("v", "", '"+y', opts) +local util = require("lazyvim.functions") + +-- lazygit +vim.keymap.set("n", "gg", function() + require("lazyvim.util").float_term({ "lazygit" }) +end, { desc = "Lazygit (cwd)" }) +vim.keymap.set("n", "gG", function() + util.float_term({ "lazygit" }, { cwd = util.get_root() }) +end, { desc = "Lazygit (root dir)" }) + +-- toggle options +vim.keymap.set("n", "of", require("lazyvim.plugins.lsp.format").toggle, { desc = "Toggle format on Save" }) +vim.keymap.set("n", "os", function() + util.toggle("spell") +end, { desc = "Toggle Spelling" }) +vim.keymap.set("n", "ow", function() + util.toggle("wrap") +end, { desc = "Toggle Word Wrap" }) +vim.keymap.set("n", "on", function() + util.toggle("relativenumber", true) + util.toggle("number") +end, { desc = "Toggle Line Numbers" }) +vim.keymap.set("n", "od", util.toggle_diagnostics, { desc = "Toggle Diagnostics" }) +local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3 +vim.keymap.set("n", "oc", function() + util.toggle("conceallevel", false, { 0, conceallevel }) +end, { desc = "Toggle Conceal" }) + +vim.keymap.set("n", "ll", "lopen", { desc = "Open Location List" }) +vim.keymap.set("n", "lq", "copen", { desc = "Open Quickfix List" }) diff --git a/.config/nvim/lua/lazyvim/init.lua b/.config/nvim/lua/lazyvim/init.lua index 4270c00..b0d1277 100644 --- a/.config/nvim/lua/lazyvim/init.lua +++ b/.config/nvim/lua/lazyvim/init.lua @@ -33,7 +33,7 @@ require("lazy").setup({ }, }) -vim.keymap.set("n", "l", ":Lazy") +vim.keymap.set("n", "L", ":Lazy") local colorscheme = "base16-gruvbox-dark-medium" diff --git a/.config/nvim/lua/lazyvim/plugins/alpha.lua b/.config/nvim/lua/lazyvim/plugins/alpha.lua index ce25793..de04535 100644 --- a/.config/nvim/lua/lazyvim/plugins/alpha.lua +++ b/.config/nvim/lua/lazyvim/plugins/alpha.lua @@ -1,47 +1,48 @@ return { - { - "goolord/alpha-nvim" , - config = function() - local dashboard = require"alpha.themes.dashboard" + { + "goolord/alpha-nvim", + event = "VimEnter", + config = function() + local dashboard = require("alpha.themes.dashboard") - local function button(sc, txt, key, key_opts) - local b = dashboard.button(sc, txt, key, key_opts) - b.opts.hl_shortcut = "Macro" - return b - end + local function button(sc, txt, key, key_opts) + local b = dashboard.button(sc, txt, key, key_opts) + b.opts.hl_shortcut = "Macro" + return b + end - local icons = require"user.icons" + local icons = require("lazyvim.config.icons") - dashboard.section.header.val = { - [[ , __ ___ __. _ __ ` , _ , _ ]], - [[ |' `. .' ` .' \ | / | |' `|' `.]], - [[ | | |----' | | ` / | | | |]], - [[ / | `.___, `._.' \/ / / ' /]], - } + dashboard.section.header.val = { + [[ , __ ___ __. _ __ ` , _ , _ ]], + [[ |' `. .' ` .' \ | / | |' `|' `.]], + [[ | | |----' | | ` / | | | |]], + [[ / | `.___, `._.' \/ / / ' /]], + } - dashboard.section.buttons.val = { - button("f", icons.documents.Files .. " Find file", ":Telescope find_files "), - button("e", icons.ui.NewFile .. " New file", ":ene startinsert "), - button("r", icons.ui.History .. " Recent files", ":Telescope oldfiles "), - button("t", icons.ui.List .. " Find text", ":Telescope live_grep "), - button("c", icons.ui.Gear .. " Config", ":e ~/.config/nvim/init.lua "), - button("u", icons.ui.CloudDownload .. " Update", ":PackerSync"), - button("q", icons.ui.SignOut .. " Quit", ":qa"), - } + dashboard.section.buttons.val = { + button("f", icons.documents.Files .. " Find file", ":Telescope find_files "), + button("e", icons.ui.NewFile .. " New file", ":ene startinsert "), + button("r", icons.ui.History .. " Recent files", ":Telescope oldfiles "), + button("t", icons.ui.List .. " Find text", ":Telescope live_grep "), + button("c", icons.ui.Gear .. " Config", ":e ~/.config/nvim/init.lua "), + button("u", icons.ui.CloudDownload .. " Update", ":Lazy"), + button("q", icons.ui.SignOut .. " Quit", ":qa"), + } - dashboard.section.footer.val = { - [[┬┌┐┌┬┌─┬ ┌─┐┌┬┐┌┐ ┬ ┌─┐┌┬┐┌─┐┌─┐┌┬┐]], - [[││││├┴┐│ ├┤ │ ├┴┐│ │ │ │ │ │ ││││]], - [[┴┘└┘┴ ┴┴─┘└─┘ ┴ └─┘┴─┘└─┘ ┴o└─┘└─┘┴ ┴]], - } + dashboard.section.footer.val = { + [[┬┌┐┌┬┌─┬ ┌─┐┌┬┐┌┐ ┬ ┌─┐┌┬┐┌─┐┌─┐┌┬┐]], + [[││││├┴┐│ ├┤ │ ├┴┐│ │ │ │ │ │ ││││]], + [[┴┘└┘┴ ┴┴─┘└─┘ ┴ └─┘┴─┘└─┘ ┴o└─┘└─┘┴ ┴]], + } - dashboard.section.header.opts.hl = "Include" - dashboard.section.buttons.opts.hl = "Macro" - dashboard.section.footer.opts.hl = "Type" + dashboard.section.header.opts.hl = "Include" + dashboard.section.buttons.opts.hl = "Macro" + dashboard.section.footer.opts.hl = "Type" - dashboard.opts.opts.noautocmd = true + dashboard.opts.opts.noautocmd = true - require"alpha".setup(dashboard.opts) - end, - } + require("alpha").setup(dashboard.opts) + end, + }, } diff --git a/.config/nvim/lua/lazyvim/plugins/cmp.lua b/.config/nvim/lua/lazyvim/plugins/cmp.lua index 04733f5..9d68e48 100644 --- a/.config/nvim/lua/lazyvim/plugins/cmp.lua +++ b/.config/nvim/lua/lazyvim/plugins/cmp.lua @@ -26,6 +26,26 @@ return { [""] = cmp.mapping.complete(), [""] = cmp.mapping.abort(), [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + -- fallback() + end + end, { + "i", + "s", + }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + -- fallback() + end + end, { + "i", + "s", + }), }), sources = cmp.config.sources({ { name = "nvim_lsp" }, diff --git a/.config/nvim/lua/lazyvim/plugins/comments.lua b/.config/nvim/lua/lazyvim/plugins/comments.lua new file mode 100644 index 0000000..2dd9c01 --- /dev/null +++ b/.config/nvim/lua/lazyvim/plugins/comments.lua @@ -0,0 +1,31 @@ +return { + { + "folke/todo-comments.nvim", + cmd = { "TodoTrouble", "TodoTelescope" }, + event = "BufReadPost", + config = true, + -- stylua: ignore + keys = { + { "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" }, + { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" }, + { "tt", "TodoTrouble", desc = "Todo Trouble" }, + { "tT", "TodoTrouble keywords=TODO,FIX,FIXME", desc = "Todo Trouble" }, + { "tf", "TodoTelescope", desc = "Todo Telescope" }, + }, + }, + { "JoosepAlviste/nvim-ts-context-commentstring" }, + { + "echasnovski/mini.comment", + event = "VeryLazy", + opts = { + hooks = { + pre = function() + require("ts_context_commentstring.internal").update_commentstring({}) + end, + }, + }, + config = function(_, opts) + require("mini.comment").setup(opts) + end, + }, +} diff --git a/.config/nvim/lua/lazyvim/plugins/core.lua b/.config/nvim/lua/lazyvim/plugins/core.lua index 3d66252..f577f67 100644 --- a/.config/nvim/lua/lazyvim/plugins/core.lua +++ b/.config/nvim/lua/lazyvim/plugins/core.lua @@ -1,5 +1,5 @@ return { { - "folke/lazy.nvim" + "folke/lazy.nvim", }, -} +} diff --git a/.config/nvim/lua/lazyvim/plugins/editor.lua b/.config/nvim/lua/lazyvim/plugins/editor.lua deleted file mode 100644 index c87558c..0000000 --- a/.config/nvim/lua/lazyvim/plugins/editor.lua +++ /dev/null @@ -1,228 +0,0 @@ -local util = require("lazyvim.functions") - -return { - { - "kyazdani42/nvim-tree.lua", - cmd = "NvimTreeToggle", - config = function() - local nvim_tree = require("nvim-tree") - local nvim_tree_config = require("nvim-tree.config") - local icons = require("lazyvim.config.icons") - - local tree_cb = nvim_tree_config.nvim_tree_callback - - nvim_tree.setup({ - hijack_directories = { - enable = false, - }, - ignore_ft_on_setup = { - "alpha", - }, - filters = { - custom = { ".git" }, - exclude = { ".gitignore" }, - }, - hijack_cursor = false, - update_cwd = true, - renderer = { - add_trailing = false, - group_empty = false, - highlight_git = false, - highlight_opened_files = "none", - root_folder_modifier = ":t", - indent_markers = { - enable = false, - icons = { - corner = "└ ", - edge = "│ ", - none = " ", - }, - }, - icons = { - webdev_colors = true, - git_placement = "before", - padding = " ", - symlink_arrow = " ➛ ", - show = { - file = true, - folder = true, - folder_arrow = true, - git = true, - }, - glyphs = { - default = "", - symlink = "", - folder = { - arrow_open = icons.ui.ArrowOpen, - arrow_closed = icons.ui.ArrowClosed, - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - symlink_open = "", - }, - git = { - unstaged = "", - staged = "S", - unmerged = "", - renamed = "➜", - untracked = "U", - deleted = "", - ignored = "◌", - }, - }, - }, - }, - diagnostics = { - enable = true, - icons = { - hint = icons.diagnostics.Hint, - info = icons.diagnostics.Information, - warning = icons.diagnostics.Warning, - error = icons.diagnostics.Error, - }, - }, - update_focused_file = { - enable = true, - update_cwd = true, - ignore_list = {}, - }, - git = { - enable = true, - ignore = true, - timeout = 500, - }, - view = { - width = 30, - hide_root_folder = false, - side = "left", - mappings = { - custom_only = false, - list = { - { key = { "l", "", "o" }, cb = tree_cb("edit") }, - { key = "h", cb = tree_cb("close_node") }, - { key = "v", cb = tree_cb("vsplit") }, - }, - }, - number = false, - relativenumber = false, - }, - actions = { - open_file = { - quit_on_open = true, - }, - }, - }) - end, - }, - { - "windwp/nvim-spectre", - -- stylua: ignore - keys = { - { "sr", function() require("spectre").open() end, desc = "Replace in files (Spectre)" }, - }, - }, - { - "nvim-telescope/telescope.nvim", - cmd = "Telescope", - keys = { - { "/", util.telescope("live_grep"), desc = "Find in Files (Grep)" }, - { "", util.telescope("find_files"), desc = "Find Files (root dir)" }, - { "fb", "Telescope buffers", desc = "Buffers" }, - { "ff", util.telescope("find_files"), desc = "Find Files (root dir)" }, - { "fF", util.telescope("find_files", { cwd = false }), desc = "Find Files (cwd)" }, - { "fr", "Telescope oldfiles", desc = "Recent" }, - { "gc", "Telescope git_commits", desc = "commits" }, - { "gs", "Telescope git_status", desc = "status" }, - { "ha", "Telescope autocommands", desc = "Auto Commands" }, - { "hc", "Telescope commands", desc = "Commands" }, - { "hf", "Telescope filetypes", desc = "File Types" }, - { "hh", "Telescope help_tags", desc = "Help Pages" }, - { "hk", "Telescope keymaps", desc = "Key Maps" }, - { "hm", "Telescope man_pages", desc = "Man Pages" }, - { "ho", "Telescope vim_options", desc = "Options" }, - { "hs", "Telescope highlights", desc = "Search Highlight Groups" }, - { "ht", "Telescope builtin", desc = "Telescope" }, - { "sb", "Telescope current_buffer_fuzzy_find", desc = "Buffer" }, - { "sc", "Telescope command_history", desc = "Command History" }, - { "sg", util.telescope("live_grep"), desc = "Grep (root dir)" }, - { "sG", util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" }, - { "sm", "Telescope marks", desc = "Jump to Mark" }, - { ",", "Telescope buffers show_all_buffers=true", desc = "Switch Buffer" }, - { ":", "Telescope command_history", desc = "Command History" }, - { - "ss", - util.telescope("lsp_document_symbols", { - symbols = { - "Class", - "Function", - "Method", - "Constructor", - "Interface", - "Module", - "Struct", - "Trait", - "Field", - "Property", - }, - }), - desc = "Goto Symbol", - }, - }, - config = { - defaults = { - prompt_prefix = " ", - selection_caret = " ", - mappings = { - i = { - [""] = function(...) - return require("trouble.providers.telescope").open_with_trouble(...) - end, - [""] = function() - util.telescope("find_files", { no_ignore = true })() - end, - [""] = function() - util.telescope("find_files", { hidden = true })() - end, - [""] = function(...) - return require("telescope.actions").cycle_history_next(...) - end, - [""] = function(...) - return require("telescope.actions").cycle_history_prev(...) - end, - }, - }, - }, - }, - }, - { - "folke/trouble.nvim", - cmd = { "TroubleToggle", "Trouble" }, - config = { use_diagnostic_signs = true }, - keys = { - { "xx", "TroubleToggle document_diagnostics", desc = "Document Diagnostics (Trouble)" }, - { "xX", "TroubleToggle workspace_diagnostics", desc = "Workspace Diagnostics (Trouble)" }, - }, - }, - { - "folke/todo-comments.nvim", - cmd = { "TodoTrouble", "TodoTelescope" }, - event = "BufReadPost", - config = true, - -- stylua: ignore - keys = { - { "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" }, - { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" }, - { "xt", "TodoTrouble", desc = "Todo Trouble" }, - { "xtt", "TodoTrouble keywords=TODO,FIX,FIXME", desc = "Todo Trouble" }, - { "xT", "TodoTelescope", desc = "Todo Telescope" }, - }, - }, - { - "numToStr/Comment.nvim", - config = function() - require("Comment").setup({}) - end, - }, -} diff --git a/.config/nvim/lua/lazyvim/plugins/git.lua b/.config/nvim/lua/lazyvim/plugins/git.lua index 5323b32..5ef557c 100644 --- a/.config/nvim/lua/lazyvim/plugins/git.lua +++ b/.config/nvim/lua/lazyvim/plugins/git.lua @@ -1,22 +1,22 @@ return { - { - "lewis6991/gitsigns.nvim", - event = "BufReadPre", - config = { - signs = { - add = { text = "▎" }, - change = { text = "▎" }, - delete = { text = "契" }, - topdelete = { text = "契" }, - changedelete = { text = "▎" }, - untracked = { text = "▎" }, - }, - on_attach = function(buffer) - local gs = package.loaded.gitsigns + { + "lewis6991/gitsigns.nvim", + event = "BufReadPre", + config = { + signs = { + add = { text = "▎" }, + change = { text = "▎" }, + delete = { text = "契" }, + topdelete = { text = "契" }, + changedelete = { text = "▎" }, + untracked = { text = "▎" }, + }, + on_attach = function(buffer) + local gs = package.loaded.gitsigns - local function map(mode, l, r, desc) - vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc }) - end + local function map(mode, l, r, desc) + vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc }) + end -- stylua: ignore start map("n", "]h", gs.prev_hunk, "Next Hunk") @@ -31,13 +31,11 @@ return { map("n", "ghd", gs.diffthis, "Diff This") map("n", "ghD", function() gs.diffthis("~") end, "Diff This ~") map({ "o", "x" }, "ih", ":Gitsigns select_hunk", "GitSigns Select Hunk") - end, - }, - }, - { - "f-person/git-blame.nvim", - }, - { - "tpope/vim-fugitive", - }, + end, + }, + }, + { + "f-person/git-blame.nvim", + event = "BufEnter", + }, } diff --git a/.config/nvim/lua/lazyvim/plugins/harpoon.lua b/.config/nvim/lua/lazyvim/plugins/harpoon.lua new file mode 100644 index 0000000..43532d3 --- /dev/null +++ b/.config/nvim/lua/lazyvim/plugins/harpoon.lua @@ -0,0 +1,16 @@ +return { + { + "ThePrimeagen/harpoon", + keys = { + { "]m", 'lua require("harpoon.ui").nav_next()', desc = "Harpoon Next" }, + { "[m", 'lua require("harpoon.ui").nav_prev()', desc = "Harpoon Prev" }, + { "mm", 'lua require("harpoon.mark").add_file()', desc = "Harpoon" }, + { "ms", "Telescope harpoon marks", desc = "Search Files" }, + { "mu", 'lua require("harpoon.ui").toggle_quick_menu()', desc = "Harpoon UI" }, + { "m1", ' lua require("harpoon.ui").nav_file(1)', desc = "Goto 1" }, + { "m2", ' lua require("harpoon.ui").nav_file(2)', desc = "Goto 2" }, + { "m3", ' lua require("harpoon.ui").nav_file(3)', desc = "Goto 3" }, + { "m4", ' lua require("harpoon.ui").nav_file(4)', desc = "Goto 4" }, + }, + }, +} diff --git a/.config/nvim/lua/lazyvim/plugins/lsp/init.lua b/.config/nvim/lua/lazyvim/plugins/lsp/init.lua index ea0a84f..da2b12c 100644 --- a/.config/nvim/lua/lazyvim/plugins/lsp/init.lua +++ b/.config/nvim/lua/lazyvim/plugins/lsp/init.lua @@ -33,7 +33,6 @@ return { setup_server = function(server, opts) return false end, - config = function(plugin) -- setup formatting and keymaps require("lazyvim.functions").on_attach(function(client, buffer) @@ -63,7 +62,7 @@ return { function(server) local opts = servers[server] or {} opts.capabilities = capabilities - if not plugin.setup_server(opts) then + if not plugin.setup_server(server, opts) then require("lspconfig")[server].setup(opts) end end, @@ -79,10 +78,25 @@ return { config = function() local nls = require("null-ls") nls.setup({ + debug = false, sources = { - -- nls.builtins.formatting.prettierd, nls.builtins.formatting.stylua, nls.builtins.diagnostics.flake8, + nls.builtins.formatting.prettier.with({ + filetypes = { + "javascript", + "typescript", + "css", + "scss", + "html", + "json", + "yaml", + }, + }), + nls.builtins.formatting.black.with({ extra_args = { "--fast" } }), + nls.builtins.formatting.bibclean, + nls.builtins.formatting.beautysh, + nls.builtins.diagnostics.shellcheck, }, }) end, @@ -90,10 +104,9 @@ return { -- cmdline tools and lsp servers { - "williamboman/mason.nvim", cmd = "Mason", - keys = { { "cm", "Mason", desc = "Mason" } }, + keys = { { "lM", "Mason", desc = "Mason" } }, ensure_installed = { "stylua", "shellcheck", diff --git a/.config/nvim/lua/lazyvim/plugins/lsp/keymaps.lua b/.config/nvim/lua/lazyvim/plugins/lsp/keymaps.lua index cadec6d..1eb59f3 100644 --- a/.config/nvim/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/.config/nvim/lua/lazyvim/plugins/lsp/keymaps.lua @@ -3,9 +3,9 @@ local M = {} function M.on_attach(client, buffer) local self = M.new(client, buffer) - self:map("cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" }) - self:map("cl", "LspInfo", { desc = "Lsp Info" }) - self:map("xd", "Telescope diagnostics", { desc = "Telescope Diagnostics" }) + self:map("ld", vim.diagnostic.open_float, { desc = "Line Diagnostics" }) + self:map("lI", "LspInfo", { desc = "Lsp Info" }) + self:map("ls", "Telescope diagnostics", { desc = "Telescope Diagnostics" }) self:map("gd", "Telescope lsp_definitions", { desc = "Goto Definition" }) self:map("gr", "Telescope lsp_references", { desc = "References" }) self:map("gD", "Telescope lsp_declarations", { desc = "Goto Declaration" }) @@ -19,16 +19,16 @@ function M.on_attach(client, buffer) self:map("[e", M.diagnostic_goto(false, "ERROR"), { desc = "Prev Error" }) self:map("]w", M.diagnostic_goto(true, "WARNING"), { desc = "Next Warning" }) self:map("[w", M.diagnostic_goto(false, "WARNING"), { desc = "Prev Warning" }) - self:map("ca", vim.lsp.buf.code_action, { desc = "Code Action", mode = { "n", "v" }, has = "codeAction" }) + self:map("la", vim.lsp.buf.code_action, { desc = "Code Action", mode = { "n", "v" }, has = "codeAction" }) local format = require("lazyvim.plugins.lsp.format").format - self:map("cf", format, { desc = "Format Document", has = "documentFormatting" }) - self:map("cf", format, { desc = "Format Range", mode = "v", has = "documentRangeFormatting" }) - self:map("cr", M.rename, { expr = true, desc = "Rename", has = "rename" }) + self:map("lf", format, { desc = "Format Document", has = "documentFormatting" }) + self:map("lF", format, { desc = "Format Range", mode = "v", has = "documentRangeFormatting" }) + self:map("lr", M.rename, { expr = true, desc = "Rename", has = "rename" }) if client.name == "tsserver" and pcall(require, "typescript") then - self:map("co", "TypescriptOrganizeImports", { desc = "Organize Imports" }) - self:map("cR", "TypescriptRenameFile", { desc = "Rename File" }) + self:map("lo", "TypescriptOrganizeImports", { desc = "Organize Imports" }) + self:map("lR", "TypescriptRenameFile", { desc = "Rename File" }) end end diff --git a/.config/nvim/lua/lazyvim/plugins/noice.lua b/.config/nvim/lua/lazyvim/plugins/noice.lua index 3150d5f..1daaeae 100644 --- a/.config/nvim/lua/lazyvim/plugins/noice.lua +++ b/.config/nvim/lua/lazyvim/plugins/noice.lua @@ -1,28 +1,28 @@ return { { - -- "folke/noice.nvim", - -- event = "VeryLazy", - -- config = { - -- lsp = { - -- override = { - -- ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - -- ["vim.lsp.util.stylize_markdown"] = true, - -- }, - -- }, - -- presets = { - -- bottom_search = true, - -- command_palette = true, - -- long_message_to_split = true, - -- }, - -- }, - -- -- stylua: ignore - -- keys = { - -- { "", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" }, - -- { "nl", function() require("noice").cmd("last") end, desc = "Noice Last Message" }, - -- { "nh", function() require("noice").cmd("history") end, desc = "Noice History" }, - -- { "na", function() require("noice").cmd("all") end, desc = "Noice All" }, - -- { "", function() if not require("noice.lsp").scroll(4) then return "" end end, silent = true, expr = true }, - -- { "", function() if not require("noice.lsp").scroll(-4) then return "" end end, silent = true, expr = true }, - -- }, + "folke/noice.nvim", + event = "VeryLazy", + config = { + lsp = { + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + }, + }, + presets = { + bottom_search = true, + command_palette = true, + long_message_to_split = true, + }, + }, + -- stylua: ignore + keys = { + { "", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" }, + { "Nl", function() require("noice").cmd("last") end, desc = "Noice Last Message" }, + { "Nh", function() require("noice").cmd("history") end, desc = "Noice History" }, + { "Na", function() require("noice").cmd("all") end, desc = "Noice All" }, + { "", function() if not require("noice.lsp").scroll(4) then return "" end end, silent = true, expr = true }, + { "", function() if not require("noice.lsp").scroll(-4) then return "" end end, silent = true, expr = true }, + }, }, } diff --git a/.config/nvim/lua/lazyvim/plugins/nvim-tree.lua b/.config/nvim/lua/lazyvim/plugins/nvim-tree.lua new file mode 100644 index 0000000..4a7b507 --- /dev/null +++ b/.config/nvim/lua/lazyvim/plugins/nvim-tree.lua @@ -0,0 +1,117 @@ +return { + { + "kyazdani42/nvim-tree.lua", + cmd = "NvimTreeToggle", + config = function() + local nvim_tree = require("nvim-tree") + local nvim_tree_config = require("nvim-tree.config") + local icons = require("lazyvim.config.icons") + + local tree_cb = nvim_tree_config.nvim_tree_callback + + nvim_tree.setup({ + hijack_directories = { + enable = false, + }, + ignore_ft_on_setup = { + "alpha", + }, + filters = { + custom = { ".git" }, + exclude = { ".gitignore" }, + }, + hijack_cursor = false, + update_cwd = true, + renderer = { + add_trailing = false, + group_empty = false, + highlight_git = false, + highlight_opened_files = "none", + root_folder_modifier = ":t", + indent_markers = { + enable = false, + icons = { + corner = "└ ", + edge = "│ ", + none = " ", + }, + }, + icons = { + webdev_colors = true, + git_placement = "before", + padding = " ", + symlink_arrow = " ➛ ", + show = { + file = true, + folder = true, + folder_arrow = true, + git = true, + }, + glyphs = { + default = "", + symlink = "", + folder = { + arrow_open = icons.ui.ArrowOpen, + arrow_closed = icons.ui.ArrowClosed, + default = "", + open = "", + empty = "", + empty_open = "", + symlink = "", + symlink_open = "", + }, + git = { + unstaged = "", + staged = "S", + unmerged = "", + renamed = "➜", + untracked = "U", + deleted = "", + ignored = "◌", + }, + }, + }, + }, + diagnostics = { + enable = true, + icons = { + hint = icons.diagnostics.Hint, + info = icons.diagnostics.Information, + warning = icons.diagnostics.Warning, + error = icons.diagnostics.Error, + }, + }, + update_focused_file = { + enable = true, + update_cwd = true, + ignore_list = {}, + }, + git = { + enable = true, + ignore = true, + timeout = 500, + }, + view = { + width = 30, + hide_root_folder = false, + side = "left", + mappings = { + custom_only = false, + list = { + { key = { "l", "", "o" }, cb = tree_cb("edit") }, + { key = "h", cb = tree_cb("close_node") }, + { key = "v", cb = tree_cb("vsplit") }, + }, + }, + number = false, + relativenumber = false, + }, + actions = { + open_file = { + quit_on_open = true, + }, + }, + }) + end, + }, +} diff --git a/.config/nvim/lua/lazyvim/plugins/spectre.lua b/.config/nvim/lua/lazyvim/plugins/spectre.lua new file mode 100644 index 0000000..25e61c8 --- /dev/null +++ b/.config/nvim/lua/lazyvim/plugins/spectre.lua @@ -0,0 +1,11 @@ +return { + { + "windwp/nvim-spectre", + -- stylua: ignore + keys = { + { "rr", function() require("spectre").open() end, desc = "Replace in files" }, + { "rw", function() require("spectre").open_visual({ select_word = true }) end, desc = "Relpace Word" }, + { "rb", function() require("spectre").open_file_search() end, desc = "Relpace in Buffer" }, + }, + }, +} diff --git a/.config/nvim/lua/lazyvim/plugins/starter.lua b/.config/nvim/lua/lazyvim/plugins/starter.lua index bb48c10..88206ce 100644 --- a/.config/nvim/lua/lazyvim/plugins/starter.lua +++ b/.config/nvim/lua/lazyvim/plugins/starter.lua @@ -1,24 +1,24 @@ return { -{ - "echasnovski/mini.starter", - enabled = false, - version = false, -- wait till new 0.7.0 release to put it back on semver - event = "VimEnter", - config = function() - local logo = table.concat({ - "██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z", - "██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z", - "██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z", - "██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z", - "███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║", - "╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝", - }, "\n") - local pad = string.rep(" ", 22) - local new_section = function(name, action, section) - return { name = name, action = action, section = pad .. section } - end + { + "echasnovski/mini.starter", + enabled = false, + version = false, -- wait till new 0.7.0 release to put it back on semver + event = "VimEnter", + config = function() + local logo = table.concat({ + "██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z", + "██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z", + "██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z", + "██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z", + "███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║", + "╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝", + }, "\n") + local pad = string.rep(" ", 22) + local new_section = function(name, action, section) + return { name = name, action = action, section = pad .. section } + end - local starter = require("mini.starter") + local starter = require("mini.starter") --stylua: ignore local config = { evaluate_single = true, @@ -38,29 +38,34 @@ return { }, } - -- close Lazy and re-open when starter is ready - if vim.o.filetype == "lazy" then - vim.cmd.close() - vim.api.nvim_create_autocmd("User", { - pattern = "MiniStarterOpened", - callback = function() - require("lazy").show() - end, - }) - end + -- close Lazy and re-open when starter is ready + if vim.o.filetype == "lazy" then + vim.cmd.close() + vim.api.nvim_create_autocmd("User", { + pattern = "MiniStarterOpened", + callback = function() + require("lazy").show() + end, + }) + end - starter.setup(config) + starter.setup(config) - vim.api.nvim_create_autocmd("User", { - pattern = "LazyVimStarted", - callback = function() - local stats = require("lazy").stats() - local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) - local pad_footer = string.rep(" ", 8) - MiniStarter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms" - pcall(MiniStarter.refresh) - end, - }) - end, - }, + vim.api.nvim_create_autocmd("User", { + pattern = "LazyVimStarted", + callback = function() + local stats = require("lazy").stats() + local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) + local pad_footer = string.rep(" ", 8) + MiniStarter.config.footer = pad_footer + .. "⚡ Neovim loaded " + .. stats.count + .. " plugins in " + .. ms + .. "ms" + pcall(MiniStarter.refresh) + end, + }) + end, + }, } diff --git a/.config/nvim/lua/lazyvim/plugins/telescope.lua b/.config/nvim/lua/lazyvim/plugins/telescope.lua new file mode 100644 index 0000000..089a720 --- /dev/null +++ b/.config/nvim/lua/lazyvim/plugins/telescope.lua @@ -0,0 +1,80 @@ +local util = require("lazyvim.functions") + +return { + { + "nvim-telescope/telescope.nvim", + cmd = "Telescope", + keys = { + { "/", util.telescope("live_grep"), desc = "Find in Files (Grep)" }, + { "", util.telescope("find_files"), desc = "Find Files (root dir)" }, + { "fb", "Telescope buffers", desc = "Buffers" }, + { "ff", util.telescope("find_files"), desc = "Find Files (root dir)" }, + { "fF", util.telescope("find_files", { cwd = false }), desc = "Find Files (cwd)" }, + { "fr", "Telescope oldfiles", desc = "Recent" }, + { "gc", "Telescope git_commits", desc = "commits" }, + { "gs", "Telescope git_status", desc = "status" }, + { "gb", "Telescope git_branches", desc = "branches" }, + { "ha", "Telescope autocommands", desc = "Auto Commands" }, + { "hc", "Telescope commands", desc = "Commands" }, + { "hf", "Telescope filetypes", desc = "File Types" }, + { "hh", "Telescope help_tags", desc = "Help Pages" }, + { "hk", "Telescope keymaps", desc = "Key Maps" }, + { "hm", "Telescope man_pages", desc = "Man Pages" }, + { "ho", "Telescope vim_options", desc = "Options" }, + { "hs", "Telescope highlights", desc = "Search Highlight Groups" }, + { "ht", "Telescope builtin", desc = "Telescope" }, + { "sb", "Telescope current_buffer_fuzzy_find", desc = "Buffer" }, + { "sc", "Telescope command_history", desc = "Command History" }, + { "sg", util.telescope("live_grep"), desc = "Grep (root dir)" }, + { "sG", util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" }, + { "sm", "Telescope marks", desc = "Jump to Mark" }, + { "so", "Telescope resume", desc = "Resume last search" }, + { "sC", "Telescope colorscheme", desc = "Colorscheme" }, + { + "ss", + util.telescope("lsp_document_symbols", { + symbols = { + "Class", + "Function", + "Method", + "Constructor", + "Interface", + "Module", + "Struct", + "Trait", + "Field", + "Property", + }, + }), + desc = "Goto Symbol", + }, + { ",", "Telescope buffers show_all_buffers=true", desc = "Switch Buffer" }, + { ":", "Telescope command_history", desc = "Command History" }, + }, + config = { + defaults = { + prompt_prefix = " ", + selection_caret = " ", + mappings = { + i = { + [""] = function(...) + return require("trouble.providers.telescope").open_with_trouble(...) + end, + [""] = function() + util.telescope("find_files", { no_ignore = true })() + end, + [""] = function() + util.telescope("find_files", { hidden = true })() + end, + [""] = function(...) + return require("telescope.actions").cycle_history_next(...) + end, + [""] = function(...) + return require("telescope.actions").cycle_history_prev(...) + end, + }, + }, + }, + }, + }, +} diff --git a/.config/nvim/lua/lazyvim/plugins/treesitter.lua b/.config/nvim/lua/lazyvim/plugins/treesitter.lua index b355e2b..2ba44c3 100644 --- a/.config/nvim/lua/lazyvim/plugins/treesitter.lua +++ b/.config/nvim/lua/lazyvim/plugins/treesitter.lua @@ -1,19 +1,19 @@ return { - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - event = "BufReadPost", - ensure_installed = "all", - config = function(plugin) - require("nvim-treesitter.configs").setup({ - sync_install = false, - ensure_installed = plugin.ensure_installed, - matchup = { enable = true }, - highlight = { enable = true }, - autopairs = { enable = true }, - indent = { enable = true }, - context_commentstring = { enable = true, enable_autocmd = false }, - }) - end, - }, + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + event = "BufReadPost", + ensure_installed = "all", + config = function(plugin) + require("nvim-treesitter.configs").setup({ + sync_install = false, + ensure_installed = plugin.ensure_installed, + matchup = { enable = true }, + highlight = { enable = true }, + autopairs = { enable = true }, + indent = { enable = true }, + context_commentstring = { enable = true, enable_autocmd = false }, + }) + end, + }, } diff --git a/.config/nvim/lua/lazyvim/plugins/trouble.lua b/.config/nvim/lua/lazyvim/plugins/trouble.lua new file mode 100644 index 0000000..78180f6 --- /dev/null +++ b/.config/nvim/lua/lazyvim/plugins/trouble.lua @@ -0,0 +1,11 @@ +return { + { + "folke/trouble.nvim", + cmd = { "TroubleToggle", "Trouble" }, + config = { use_diagnostic_signs = true }, + keys = { + { "lt", "TroubleToggle document_diagnostics", desc = "Document Diagnostics (Trouble)" }, + { "lT", "TroubleToggle workspace_diagnostics", desc = "Workspace Diagnostics (Trouble)" }, + }, + }, +} diff --git a/.config/nvim/lua/lazyvim/plugins/utility.lua b/.config/nvim/lua/lazyvim/plugins/utility.lua index 6be8cee..b6d46fe 100644 --- a/.config/nvim/lua/lazyvim/plugins/utility.lua +++ b/.config/nvim/lua/lazyvim/plugins/utility.lua @@ -8,11 +8,11 @@ return { config = function() require("illuminate").configure({ delay = 200 }) end, - -- stylua: ignore - keys = { - { "]]", function() require("illuminate").goto_next_reference(false) end, desc = "Next Reference", }, - { "[[", function() require("illuminate").goto_prev_reference(false) end, desc = "Prev Reference" }, - }, + -- stylua: ignore + keys = { + { "]]", function() require("illuminate").goto_next_reference(false) end, desc = "Next Reference", }, + { "[[", function() require("illuminate").goto_prev_reference(false) end, desc = "Prev Reference" }, + }, }, { "nvim-lua/popup.nvim", @@ -53,7 +53,12 @@ return { end, }, { - "moll/vim-bbye", + "echasnovski/mini.bufremove", + -- stylua: ignore + keys = { + { "bd", function() require("mini.bufremove").delete(0, false) end, desc = "Delete Buffer" }, + { "bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" }, + }, }, { "lewis6991/impatient.nvim", @@ -63,7 +68,10 @@ return { }, { "ghillb/cybu.nvim", - cmd = { "CybuNext", "CybuPrev" }, + keys = { + { "bl", "CybuNext", desc = "Next Buffer" }, + { "bh", "CybuPrev", desc = "Prev Buffer" }, + }, config = function() require("cybu").setup({ position = { @@ -93,6 +101,7 @@ return { }, { "mbbill/undotree", + cmd = { "UndotreeToggle" }, }, { "MunifTanjim/nui.nvim", @@ -128,19 +137,19 @@ return { end, }, { - "windwp/nvim-autopairs", - config = function() - require("nvim-autopairs").setup({ - disable_filetype = { "TelescopePrompt", "spectre_panel" }, - ignore_next_char = "[%w%.*]", -- don't place pair when cursor sits in front of any char - }) + "echasnovski/mini.pairs", + event = "VeryLazy", + config = function(_, opts) + require("mini.pairs").setup(opts) end, }, + { "preservim/vim-markdown", }, { "nacro90/numb.nvim", + event = "BufEnter", config = function() require("numb").setup({ show_numbers = true, -- enable 'number' for the window while peeking @@ -148,14 +157,12 @@ return { }) end, }, - { - "andymass/vim-matchup", - }, { "junegunn/vim-slash", }, { "folke/zen-mode.nvim", + cmd = { "ZenMode" }, config = function() require("zen-mode").setup({ window = { @@ -178,27 +185,36 @@ return { on_open = function() vim.g.cmp_active = false vim.cmd([[LspStop]]) - local status_ok, _ = pcall(vim.api.nvim_set_option_value, "winbar", nil, { scope = "local" }) - if not status_ok then - return - end - if vim.fn.exists("#" .. "_winbar") == 1 then - vim.cmd("au! " .. "_winbar") - end end, on_close = function() vim.g.cmp_active = true vim.cmd([[LspStart]]) - require("winbar").create_winbar() end, }) end, }, { - "tpope/vim-surround", + "echasnovski/mini.surround", + keys = { "gz" }, + opts = { + mappings = { + add = "gza", -- Add surrounding in Normal and Visual modes + delete = "gzd", -- Delete surrounding + find = "gzf", -- Find surrounding (to the right) + find_left = "gzF", -- Find surrounding (to the left) + highlight = "gzh", -- Highlight surrounding + replace = "gzr", -- Replace surrounding + update_n_lines = "gzn", -- Update `n_lines` + }, + }, + config = function(_, opts) + -- use gz mappings instead of s to prevent conflict with leap + require("mini.surround").setup(opts) + end, }, { "danymat/neogen", + event = "BufEnter", config = function() require("neogen").setup({ enabled = true, @@ -206,88 +222,4 @@ return { }) end, }, - { - "monaqa/dial.nvim", - config = function() - local dial_config = require("dial.config") - - local y = "2024/05/29" - - local augend = require("dial.augend") - dial_config.augends:register_group({ - default = { - augend.integer.alias.decimal, - augend.integer.alias.hex, - augend.date.alias["%Y/%m/%d"], - }, - typescript = { - augend.integer.alias.decimal, - augend.integer.alias.hex, - augend.constant.new({ elements = { "let", "const" } }), - }, - visual = { - augend.integer.alias.decimal, - augend.integer.alias.hex, - augend.date.alias["%Y/%m/%d"], - augend.constant.alias.alpha, - augend.constant.alias.Alpha, - }, - mygroup = { - augend.constant.new({ - elements = { "and", "or" }, - word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc. - cyclic = true, -- "or" is incremented into "and". - }), - augend.constant.new({ - elements = { "True", "False" }, - word = true, - cyclic = true, - }), - augend.constant.new({ - elements = { "public", "private" }, - word = true, - cyclic = true, - }), - augend.constant.new({ - elements = { "&&", "||" }, - word = false, - cyclic = true, - }), - augend.date.alias["%d/%m/%Y"], -- date (02/19/2022, etc.) - augend.constant.alias.bool, -- boolean value (true <-> false) - augend.integer.alias.decimal, - augend.integer.alias.hex, - augend.semver.alias.semver, - }, - }) - - local map = require("dial.map") - - -- change augends in VISUAL mode - vim.api.nvim_set_keymap("n", "", map.inc_normal("mygroup"), { noremap = true }) - vim.api.nvim_set_keymap("n", "", map.dec_normal("mygroup"), { noremap = true }) - vim.api.nvim_set_keymap("v", "", map.inc_normal("visual"), { noremap = true }) - vim.api.nvim_set_keymap("v", "", map.dec_normal("visual"), { noremap = true }) - - vim.cmd([[ - " enable only for specific FileType - autocmd FileType typescript,javascript lua vim.api.nvim_buf_set_keymap(0, "n", "", require("dial.map").inc_normal("typescript"), {noremap = true}) - ]]) - end, - }, - { - "ThePrimeagen/harpoon", - keys = { - { "mm", 'lua require("harpoon.mark").add_file()', desc = "Harpoon" }, - { "ml", 'lua require("harpoon.ui").nav_next()', desc = "Harpoon Next" }, - { "mh", 'lua require("harpoon.ui").nav_prev()', desc = "Harpoon Prev" }, - { "ms", "Telescope harpoon marks", desc = "Search Files" }, - { "mu", 'lua require("harpoon.ui").toggle_quick_menu()', desc = "Harpoon UI" }, - - { "m1", ' lua require("harpoon.ui").nav_file(1)', desc = "Goto 1" }, - { "m2", ' lua require("harpoon.ui").nav_file(2)', desc = "Goto 2" }, - { "m3", ' lua require("harpoon.ui").nav_file(3)', desc = "Goto 3" }, - { "m4", ' lua require("harpoon.ui").nav_file(4)', desc = "Goto 4" }, - }, - }, } diff --git a/.config/nvim/lua/lazyvim/plugins/whichkey.lua b/.config/nvim/lua/lazyvim/plugins/whichkey.lua index 538f140..f7bb5da 100644 --- a/.config/nvim/lua/lazyvim/plugins/whichkey.lua +++ b/.config/nvim/lua/lazyvim/plugins/whichkey.lua @@ -15,9 +15,9 @@ return { -- the presets plugin, adds help for a bunch of default keybindings in Neovim -- No actual key bindings are created presets = { - operators = false, -- adds help for operators like d, y, ... and registers them for motion / text object completion - motions = false, -- adds help for motions - text_objects = false, -- help for text objects triggered after entering an operator + operators = true, -- adds help for operators like d, y, ... and registers them for motion / text object completion + motions = true, -- adds help for motions + text_objects = true, -- help for text objects triggered after entering an operator windows = true, -- default bindings on nav = true, -- misc bindings to work with windows z = true, -- bindings for folds, spelling and others prefixed with z @@ -63,7 +63,7 @@ return { }) local leader_opts = { - mode = "n", -- NORMAL mode + mode = { "n", "v" }, -- NORMAL/VISUAL mode buffer = nil, -- Global mappings prefix = "", silent = true, -- use 'silent' @@ -78,20 +78,26 @@ return { }) local leader_mappings = { - a = { "Lspsaga code_action", "Action" }, - c = { "Bdelete", "Close Buffer" }, + l = { name = "+lsp" }, + b = { name = "+buffer" }, + r = { name = "+replace" }, + f = { name = "+file" }, + s = { name = "+search" }, + h = { name = "+help" }, + g = { name = "+git" }, + t = { name = "+todo" }, + N = { name = "+noice" }, + o = { name = "+option" }, + H = { "split", "split" }, - h = { "lua vim.lsp.buf.hover()", "Hover" }, + V = { "vsplit", "vsplit" }, n = { "NvimTreeToggle", "Explorer" }, - O = { "setlocal spell! spelllang=en_us", "Toggle Spelling" }, P = { "!opout %", "Preview Document" }, q = { 'lua require("lazyvim.functions").smart_quit()', "Quit" }, - V = { "vsplit", "vsplit" }, w = { "w", "Write" }, z = { "ZenMode", "Zen" }, - ["/"] = { 'lua require("Comment.api").toggle.linewise.current()', "Comment" }, ["'"] = { "close", "Close split" }, - u = { "UndoTreeToggle", "Undo Tree" }, + u = { "UndotreeToggle", "Undo Tree" }, C = { name = "Compiler", @@ -99,136 +105,31 @@ return { b = { "w! | !pandoc % -t beamer -o presentation.pdf", "Beamer Presentation" }, }, - b = { - name = "Buffer", - b = { "Telescope buffers", "Telescope" }, - c = { "Bdelete!", "Close Buffer" }, - h = { "BufferLineCyclePrev", "Cycle Previous" }, - l = { "BufferLineCycleNext", "Cycle Next" }, - p = { "BufferLinePickClose", "Pick Close" }, - }, + -- o = { + -- name = "Options", + -- c = { "lua vim.g.cmp_active=false", "Completion off" }, + -- C = { "lua vim.g.cmp_active=true", "Completion on" }, + -- w = { 'lua require("user.functions").toggle_option("wrap")', "Wrap" }, + -- r = { 'lua require("user.functions").toggle_option("relativenumber")', "Relative" }, + -- l = { 'lua require("user.functions").toggle_option("cursorline")', "Cursorline" }, + -- s = { 'lua require("user.functions").toggle_option("spell")', "Spell" }, + -- t = { 'lua require("user.functions").toggle_tabline()', "Tabline" }, + -- }, - p = { - name = "Packer", - c = { "PackerCompile", "Compile" }, - i = { "PackerInstall", "Install" }, - s = { "PackerSync", "Sync" }, - S = { "PackerStatus", "Status" }, - u = { "PackerUpdate", "Update" }, - }, - - o = { - name = "Options", - c = { "lua vim.g.cmp_active=false", "Completion off" }, - C = { "lua vim.g.cmp_active=true", "Completion on" }, - w = { 'lua require("user.functions").toggle_option("wrap")', "Wrap" }, - r = { 'lua require("user.functions").toggle_option("relativenumber")', "Relative" }, - l = { 'lua require("user.functions").toggle_option("cursorline")', "Cursorline" }, - s = { 'lua require("user.functions").toggle_option("spell")', "Spell" }, - t = { 'lua require("user.functions").toggle_tabline()', "Tabline" }, - }, - - r = { - name = "Replace", - r = { "lua require('spectre').open()", "Replace" }, - w = { "lua require('spectre').open_visual({select_word=true})", "Replace Word" }, - f = { "lua require('spectre').open_file_search()", "Replace Buffer" }, - }, - - d = { - name = "Debug", - b = { "lua require'dap'.toggle_breakpoint()", "Breakpoint" }, - c = { "lua require'dap'.continue()", "Continue" }, - i = { "lua require'dap'.step_into()", "Into" }, - o = { "lua require'dap'.step_over()", "Over" }, - O = { "lua require'dap'.step_out()", "Out" }, - r = { "lua require'dap'.repl.toggle()", "Repl" }, - l = { "lua require'dap'.run_last()", "Last" }, - u = { "lua require'dapui'.toggle()", "UI" }, - x = { "lua require'dap'.terminate()", "Exit" }, - }, - - f = { - name = "Find", - b = { "Telescope git_branches", "Checkout branch" }, - c = { "Telescope colorscheme", "Colorscheme" }, - f = { "Telescope find_files", "Find files" }, - t = { "Telescope live_grep", "Find Text" }, - s = { "Telescope grep_string", "Find String" }, - h = { "Telescope help_tags", "Help" }, - H = { "Telescope highlights", "Highlights" }, - l = { "Telescope resume", "Last Search" }, - M = { "Telescope man_pages", "Man Pages" }, - r = { "Telescope oldfiles", "Recent File" }, - R = { "Telescope registers", "Registers" }, - k = { "Telescope keymaps", "Keymaps" }, - C = { "Telescope commands", "Commands" }, - }, - - g = { - name = "Git", - g = { "Git", "Git" }, - j = { "lua require 'gitsigns'.next_hunk()", "Next Hunk" }, - k = { "lua require 'gitsigns'.prev_hunk()", "Prev Hunk" }, - l = { "GitBlameToggle", "Blame" }, - p = { "lua require 'gitsigns'.preview_hunk()", "Preview Hunk" }, - r = { "lua require 'gitsigns'.reset_hunk()", "Reset Hunk" }, - R = { "lua require 'gitsigns'.reset_buffer()", "Reset Buffer" }, - s = { "lua require 'gitsigns'.stage_hunk()", "Stage Hunk" }, - u = { - "lua require 'gitsigns'.undo_stage_hunk()", - "Undo Stage Hunk", - }, - o = { "Telescope git_status", "Open changed file" }, - b = { "Telescope git_branches", "Checkout branch" }, - c = { "Telescope git_commits", "Checkout commit" }, - d = { - "Gitsigns diffthis HEAD", - "Diff", - }, - }, - - l = { - name = "LSP", - a = { "Lspsaga code_action", "Code Action" }, - t = { "TroubleToggle document_diagnostics", "Diagnostics" }, - d = { "lua vim.lsp.buf.definition()", "Definition" }, - w = { - "TroubleToggle workspace_diagnostics", - "Workspace Diagnostics", - }, - f = { "lua vim.lsp.buf.format({ async = true })", "Format" }, - F = { "LspToggleAutoFormat", "Toggle Autoformat" }, - h = { "lua vim.lsp.buf.hover()", "Hover" }, - i = { "lua vim.lsp.buf.implementation()", "Implementation" }, - I = { "LspInfo", "Info" }, - j = { - "lua vim.diagnostic.goto_next({buffer=0})", - "Next Diagnostic", - }, - k = { - "lua vim.diagnostic.goto_prev({buffer=0})", - "Prev Diagnostic", - }, - v = { "lua require('lsp_lines').toggle()", "Virtual Text" }, - l = { "lua vim.lsp.codelens.run()", "CodeLens Action" }, - o = { "SymbolsOutline", "Outline" }, - r = { "lua vim.lsp.buf.rename()", "Rename" }, - R = { "TroubleToggle lsp_references", "References" }, - s = { "Telescope lsp_document_symbols", "Document Symbols" }, - S = { - "Telescope lsp_dynamic_workspace_symbols", - "Workspace Symbols", - }, - T = { 'lua require("user.functions").toggle_diagnostics()', "Toggle Diagnostics" }, - u = { "LuaSnipUnlinkCurrent", "Unlink Snippet" }, - M = { "Mason", "Open Mason UI" }, - }, + -- d = { + -- name = "Debug", + -- b = { "lua require'dap'.toggle_breakpoint()", "Breakpoint" }, + -- c = { "lua require'dap'.continue()", "Continue" }, + -- i = { "lua require'dap'.step_into()", "Into" }, + -- o = { "lua require'dap'.step_over()", "Over" }, + -- O = { "lua require'dap'.step_out()", "Out" }, + -- r = { "lua require'dap'.repl.toggle()", "Repl" }, + -- l = { "lua require'dap'.run_last()", "Last" }, + -- u = { "lua require'dapui'.toggle()", "UI" }, + -- x = { "lua require'dap'.terminate()", "Exit" }, + -- }, } - -- whichkey.register(m_mappings, m_opts) - - whichkey.register(mappings, opts) whichkey.register(leader_mappings, leader_opts) end, },