X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/12a2fe75d5dcc8df3f85fed9f23b248e65485996..fdd63454b51a35418ec23d3489cf20ae66a2299d:/nvim/lua/plugins/editor.lua?ds=sidebyside diff --git a/nvim/lua/plugins/editor.lua b/nvim/lua/plugins/editor.lua index cea1326..0407b47 100644 --- a/nvim/lua/plugins/editor.lua +++ b/nvim/lua/plugins/editor.lua @@ -3,12 +3,81 @@ return { { "nvim-telescope/telescope.nvim", keys = { + { "fF", LazyVim.pick("files", { cwd = false }), desc = "Find Files (cwd)" }, + -- from lazyvim + { ",", "Telescope buffers show_all_buffers=true", desc = "Switch Buffer" }, + { "/", LazyVim.pick("live_grep"), desc = "Grep (root dir)" }, + { ":", "Telescope command_history", desc = "Command History" }, + { "", LazyVim.pick("files"), desc = "Find Files (root dir)" }, { "", false }, + -- find + { "fb", "Telescope buffers sort_lastused=true", desc = "Buffers" }, + -- { "ff", LazyVim.pick("files"), desc = "Find Files (root dir)" }, + { "ff", false }, -- fswitch + { "fF", LazyVim.pick("files", { cwd = false }), desc = "Find Files (cwd)" }, + { "fr", "Telescope oldfiles", desc = "Recent" }, + { "fR", LazyVim.pick("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" }, + -- git + -- { "gc", "Telescope git_commits", desc = "commits" }, { "gc", false }, + -- { "gs", "Telescope git_status", desc = "status" }, { "gs", false }, - { "ff", false }, -- fswitch - -- use for snippets below - { "ss", false }, + -- search + { "sa", "Telescope autocommands", desc = "Auto Commands" }, + { "sb", "Telescope current_buffer_fuzzy_find", desc = "Buffer" }, + { "sc", "Telescope command_history", desc = "Command History" }, + { "sC", "Telescope commands", desc = "Commands" }, + { "sd", "Telescope diagnostics bufnr=0", desc = "Document diagnostics" }, + { "sD", "Telescope diagnostics", desc = "Workspace diagnostics" }, + { "sg", LazyVim.pick("live_grep"), desc = "Grep (root dir)" }, + { "sG", LazyVim.pick("live_grep", { cwd = false }), desc = "Grep (cwd)" }, + { "sh", "Telescope help_tags", desc = "Help Pages" }, + { "sH", "Telescope highlights", desc = "Search Highlight Groups" }, + { "sk", "Telescope keymaps", desc = "Key Maps" }, + { "sM", "Telescope man_pages", desc = "Man Pages" }, + { "sm", "Telescope marks", desc = "Jump to Mark" }, + { "so", "Telescope vim_options", desc = "Options" }, + { "sR", "Telescope resume", desc = "Resume" }, + { "sw", LazyVim.pick("grep_string"), desc = "Word (root dir)" }, + { "sW", LazyVim.pick("grep_string", { cwd = false }), desc = "Word (cwd)" }, + { "uC", LazyVim.pick("colorscheme", { enable_preview = true }), desc = "Colorscheme with preview" }, + -- { + -- "ss", + -- LazyVim.pick("lsp_document_symbols", { + -- symbols = { + -- "Class", + -- "Function", + -- "Method", + -- "Constructor", + -- "Interface", + -- "Module", + -- "Struct", + -- "Trait", + -- "Field", + -- "Property", + -- }, + -- }), + -- desc = "Goto Symbol", + -- }, + { "ss", false }, -- use for snippets below + { + "sS", + LazyVim.pick("lsp_dynamic_workspace_symbols", { + symbols = { + "Class", + "Function", + "Method", + "Constructor", + "Interface", + "Module", + "Struct", + "Trait", + "Field", + "Property", + }, + }), + desc = "Goto Symbol (Workspace)", + }, }, }, { @@ -21,8 +90,95 @@ return { end, keys = { { "ss", "Telescope luasnip", desc = "Snippets" } }, }, + { + "stevearc/oil.nvim", + opts = { + keymaps = { + ["g?"] = "actions.show_help", + [""] = "actions.select", + [""] = "actions.select_vsplit", + [""] = false, -- used to be actions.select_split + [""] = "actions.select_tab", + [""] = "actions.preview", + [""] = "actions.close", + [""] = false, -- used to be actions.refresh + ["-"] = "actions.parent", + ["_"] = "actions.open_cwd", + ["`"] = "actions.cd", + ["~"] = "actions.tcd", + ["gs"] = "actions.change_sort", + ["gx"] = "actions.open_external", + ["g."] = "actions.toggle_hidden", + ["g\\"] = "actions.toggle_trash", + }, + }, + dependencies = {"nvim-tree/nvim-web-devicons"}, + }, + { "folke/trouble.nvim", + cmd = { "Trouble" }, + opts = { + keys = { + [""] = "fold_toggle", + }, + modes = { + lsp = { + win = { position = "right" }, + }, + }, + }, + keys = { + { "xx", "Trouble diagnostics toggle", desc = "Diagnostics (Trouble)" }, + { "xX", "Trouble diagnostics toggle filter.buf=0", desc = "Buffer Diagnostics (Trouble)" }, + { "cs", "Trouble symbols toggle", desc = "Symbols (Trouble)" }, + { "cS", "Trouble lsp toggle", desc = "LSP references/definitions/... (Trouble)" }, + { "xL", "Trouble loclist toggle", desc = "Location List (Trouble)" }, + { "xQ", "Trouble qflist toggle", desc = "Quickfix List (Trouble)" }, + { + "[q", + function() + if require("trouble").is_open() then + require("trouble").prev({ skip_groups = true, jump = true }) + else + local ok, err = pcall(vim.cmd.cprev) + if not ok then + vim.notify(err, vim.log.levels.ERROR) + end + end + end, + desc = "Previous Trouble/Quickfix Item", + }, + { + "]q", + function() + if require("trouble").is_open() then + require("trouble").next({ skip_groups = true, jump = true }) + else + local ok, err = pcall(vim.cmd.cnext) + if not ok then + vim.notify(err, vim.log.levels.ERROR) + end + end + end, + desc = "Next Trouble/Quickfix Item", + }, + }, + }, + { "folke/todo-comments.nvim", + cmd = { "TodoTrouble", "TodoTelescope" }, + event = "LazyFile", + -- 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", "Trouble todo toggle", desc = "Todo (Trouble)" }, + { "xT", "Trouble todo toggle filter = {tag = {TODO,FIX,FIXME}}", desc = "Todo/Fix/Fixme (Trouble)" }, + { "st", "TodoTelescope", desc = "Todo" }, + { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, + }, + }, { "neo-tree.nvim", + enabled = false, lazy = false, opts = { filesystem = {