neovim-confs/lua/plex/plugins/editor.lua

82 lines
2.9 KiB
Lua

-- Plugins: Editor
-- https://github.com/rafi/vim-config
local is_windows = vim.loop.os_uname().sysname == 'Windows_NT'
return {
-----------------------------------------------------------------------------
{
'ggandor/leap.nvim',
-- stylua: ignore
keys = {
{ 'gl', '<Plug>(leap-forward-to)', mode = { 'n', 'x', 'o' }, desc = 'Leap forward to' },
{ 'gL', '<Plug>(leap-backward-to)', mode = { 'n', 'x', 'o' }, desc = 'Leap backward to' },
{ '<leader>wl', '<Plug>(leap-from-window)', mode = { 'n', 'x', 'o' }, desc = 'Leap to windows' },
},
config = function ()
local leap = require('leap')
leap.opts.case_sensitive = false
leap.opts.safe_labels = { 'f', 'n', 'u', 't', 'g', 'ö', 'w', 'b', 'm' }
leap.opts.labels = { 'a', 's', 'f', 'n', 'j', 'k', 'r', 'e', 'r', 'm',
'ö', 'b', 'v', 'u', 'z', 'w', '2', '3', '4', '5', '6',
'7', '8', '9' }
end,
},
-----------------------------------------------------------------------------
-- NOTE: THIS SECTION CONTAINS THE PREFIXES!
{
'folke/which-key.nvim',
event = 'VeryLazy',
opts = {
icons = { separator = ' 󰁔 ' },
window = { winblend = 0 },
defaults = {
mode = { 'n', 'v' },
[';'] = { name = '+telescope' },
[';d'] = { name = '+lsp/todo' },
['g'] = { name = '+goto' },
['gz'] = { name = '+surround' },
[']'] = { name = '+next' },
['['] = { name = '+prev' },
['<leader>b'] = { name = '+buffer' },
['<leader>c'] = { name = '+code' },
['<leader>g'] = { name = '+git' },
['<leader>h'] = { name = '+hunks' },
['<leader>S'] = { name = '+search' },
['<leader>t'] = { name = '+toggle/tools' },
['<leader>u'] = { name = '+ui' },
['<leader>x'] = { name = '+diagnostics/quickfix' },
['<leader>z'] = { name = '+notes' },
['<leader>w'] = { name = '+window' },
['<leader>f'] = { name = '+formatting' },
['<leader>m'] = { name = '+marks/misc' },
['<leader>md'] = { name = '+line-diffs' },
},
},
config = function(_, opts)
local wk = require('which-key')
wk.setup(opts)
wk.register(opts.defaults)
end,
},
-----------------------------------------------------------------------------
{
'folke/todo-comments.nvim',
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' },
{ '<LocalLeader>dt', '<cmd>TodoTelescope<CR>', desc = 'todo' },
{ '<leader>xt', '<cmd>TodoTrouble<CR>', desc = 'Todo (Trouble)' },
{ '<leader>xT', '<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>', desc = 'Todo/Fix/Fixme (Trouble)' },
{ '<leader>St', '<cmd>TodoTelescope<cr>', desc = 'Todo' },
{ '<leader>ST', '<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>', desc = 'Todo/Fix/Fixme' },
},
opts = { signs = false },
},
}