return { { 'nvim-tree/nvim-tree.lua', cmd = { 'NvimTreeToggle', 'NvimTreeFocus' }, config = function(_, opts) require('nvim-tree').setup(opts) end, keys = { { '', ' NvimTreeToggle ', desc = '[T]oggle [F]ile explorer' }, { 'tf', ' NvimTreeToggle ', desc = '[T]oggle [F]ile explorer' }, }, }, { 'ggandor/leap.nvim', lazy = false, }, { 'ggandor/flit.nvim', lazy = false, config = function() require('flit').setup { keys = { f = 'f', F = 'F', t = 't', T = 'T' }, -- A string like "nv", "nvo", "o", etc. labeled_modes = 'v', multiline = true, -- Like `leap`s similar argument (call-specific overrides). -- E.g.: opts = { equivalence_classes = {} } opts = {}, } end, }, { 'kdheepak/lazygit.nvim', keys = { 'gg', ' LazyGit ', 'Open LazyGit' }, cmd = 'LazyGit', -- optional for floating window border decoration dependencies = { 'nvim-lua/plenary.nvim', }, }, { 'folke/which-key.nvim', keys = { '', '', '', '', '"', "'", '`', 'c', 'v', 'g' }, defaults = { mode = { 'n', 'v' }, [';'] = { name = '+telescope' }, [';f'] = { name = '+find' }, ['g'] = { name = '+goto' }, [']'] = { name = '+next' }, ['['] = { name = '+prev' }, ['d'] = { name = '+lsp/debug' }, ['r'] = { name = '+diagnostics/quickfix' }, ['c'] = { name = '+code' }, ['g'] = { name = '+git' }, ['t'] = { name = '+toggle/tools' }, ['w'] = { name = '+window/which' }, ['f'] = { name = '+formatting' }, }, opts = { triggers_nowait = { -- marks '`', "'", 'g`', "g'", -- registers '"', '', -- spelling 'z=', }, triggers_blacklist = { -- list of mode / prefixes that should never be hooked by WhichKey -- this is mostly relevant for keymaps that start with a native binding i = { 'j', 'k' }, v = { 'j', 'k' }, n = { 'o', 'O' }, }, }, }, { 'echasnovski/mini.trailspace', lazy = false, event = { 'BufReadPost', 'BufNewFile' }, opts = {}, }, { 'itchyny/vim-cursorword', event = 'FileType', init = function() vim.g.cursorword = 0 end, config = function() local augroup = vim.api.nvim_create_augroup('plex_cursorword', {}) vim.api.nvim_create_autocmd('FileType', { group = augroup, pattern = { 'conf', 'dosini', 'json', 'markdown', 'nginx', 'text', 'yaml', }, callback = function() if vim.wo.diff or vim.wo.previewwindow then vim.b.cursorword = 0 else vim.b.cursorword = 1 end end, }) vim.api.nvim_create_autocmd('InsertEnter', { group = augroup, callback = function() if vim.b['cursorword'] == 1 then vim.b['cursorword'] = 0 end end, }) vim.api.nvim_create_autocmd('InsertLeave', { group = augroup, callback = function() if vim.b['cursorword'] == 0 then vim.b['cursorword'] = 1 end end, }) end, }, { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' config = function() -- This is the function that runs, AFTER loading require('which-key').setup() -- Document existing key chains require('which-key').register { ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, ['f'] = { name = '[F]ind', _ = 'which_key_ignore' }, ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, ['h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, } -- visual mode require('which-key').register({ ['h'] = { 'Git [H]unk' }, }, { mode = 'v' }) end, }, { 'RRethy/vim-illuminate', lazy = false, event = { 'BufReadPost', 'BufNewFile' }, opts = { delay = 200, under_cursor = false, modes_allowlist = { 'n', 'no', 'nt' }, filetypes_denylist = { 'DiffviewFileHistory', 'DiffviewFiles', 'SidebarNvim', 'fugitive', 'git', 'minifiles', 'neo-tree', }, }, keys = { { ']]', desc = 'Next Reference' }, { '[[', desc = 'Prev Reference' }, }, config = function(_, opts) require('illuminate').configure(opts) local function map(key, dir, buffer) vim.keymap.set('n', key, function() require('illuminate')['goto_' .. dir .. '_reference'](false) end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. ' Reference', buffer = buffer, }) end map(']]', 'next') map('[[', 'prev') -- also set it after loading ftplugins, since a lot overwrite [[ and ]] vim.api.nvim_create_autocmd('FileType', { group = vim.api.nvim_create_augroup('plex_illuminate', {}), callback = function() local buffer = vim.api.nvim_get_current_buf() map(']]', 'next', buffer) map('[[', 'prev', buffer) end, }) end, }, { 'folke/todo-comments.nvim', lazy = false, dependencies = 'nvim-telescope/telescope.nvim', -- 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' }, { 'dt', 'TodoTelescope', desc = 'todo' }, { 'xt', 'TodoTrouble', desc = 'Todo (Trouble)' }, { 'xT', 'TodoTrouble keywords=TODO,FIX,FIXME', desc = 'Todo/Fix/Fixme (Trouble)' }, }, opts = { signs = true, keywords = { FIX = { icon = ' ', -- icon used for the sign, and in search results color = 'error', -- can be a hex color, or a named color (see below) alt = { 'FIXME', 'BUG', 'FIXIT', 'ISSUE' }, -- a set of other keywords that all map to this FIX keywords }, TODO = { icon = ' ', color = 'todo' }, HACK = { icon = ' ', color = 'hack' }, SECURITY = { icon = '󰒃 ', color = 'security' }, WARN = { icon = ' ', color = 'warning', alt = { 'WARNING', 'XXX' } }, PERF = { icon = ' ', color = 'perf', alt = { 'OPTIM', 'PERFORMANCE', 'OPTIMIZE' } }, NOTE = { icon = ' ', color = 'hint', alt = { 'INFO' } }, TEST = { icon = '⏲ ', color = 'test', alt = { 'TESTING', 'PASSED', 'FAILED' } }, }, colors = { error = { 'DiagnosticError', 'ErrorMsg', '#DC2626' }, warning = { 'DiagnosticWarn', 'WarningMsg', '#FBBF24' }, todo = { 'DiagnosticTodo', '#80e64d' }, hint = { 'DiagnosticHint', '#10B981' }, hack = { 'DiagnosticHack', '#FF33FF' }, security = { 'DiagnosticSecurity', '#FF6600' }, default = { 'Identifier', '#7C3AED' }, test = { 'DiagnosticTest', '#E6E600' }, perf = { 'DiagnosticPerf', '#9999ff' }, }, }, }, { 'folke/trouble.nvim', cmd = 'Trouble', opts = { use_diagnostic_signs = true }, -- stylua: ignore keys = { { 'rb', "Trouble diagnostics toggle filter.buf=0", desc = 'Document Diagnostics (Trouble)' }, { 'rr', 'Trouble diagnostics toggle', desc = 'Workspace Diagnostics (Trouble)' }, { 'rq', "Trouble qflist toggle", desc = 'Quickfix List (Trouble)' }, { 'rl', "Trouble loclist toggle", desc = 'Location List (Trouble)' }, { 'rd', "Trouble symbols", desc = 'LSP symbols (Trouble)' }, { 'rt', "Trouble todo", desc = 'Todos (Trouble)' }, { '[q', function() if require('trouble').is_open() then require('trouble').previous({ skip_groups = true, jump = true }) else vim.cmd.cprev() end end, desc = 'Previous trouble/quickfix item', }, { ']q', function() if require('trouble').is_open() then require('trouble').next({ skip_groups = true, jump = true }) else vim.cmd.cnext() end end, desc = 'Next trouble/quickfix item', }, }, }, { 'akinsho/toggleterm.nvim', keys = { { '', 'exe v:count1 "ToggleTerm direction=float"', desc = 'Toggle a big floating terminal' }, { '', 'exe v:count1 "ToggleTerm direction=float"', desc = 'Toggle a big floating terminal' }, { '', 'exe v:count1 "ToggleTerm direction=tab"', desc = 'Toggle a terminal in a new tab' }, { '', 'exe v:count1 "ToggleTerm direction=horizontal"', desc = 'Toggle a horizontal terminal' }, { '', 'exe v:count1 "ToggleTerm direction=vertical"', desc = 'Toggle a vertical terminal' }, }, cmd = 'ToggleTerm', opts = { size = function(term) if term.direction == 'horizontal' then return vim.o.lines * 0.35 elseif term.direction == 'vertical' then return vim.o.columns * 0.35 else return 20 end end, open_mapping = false, float_opts = { border = 'curved', }, }, }, }