360 lines
13 KiB
Lua
360 lines
13 KiB
Lua
return {
|
|
{ 'nfnty/vim-nftables', ft = 'nftables' },
|
|
{ 'MTDL9/vim-log-highlighting', ft = 'log' },
|
|
{
|
|
'nvim-orgmode/orgmode',
|
|
ft = 'org',
|
|
config = function()
|
|
require('user.plugins.editor.orgmode')
|
|
end,
|
|
},
|
|
{
|
|
'lukas-reineke/headlines.nvim',
|
|
ft = { 'org', 'markdown' },
|
|
opts = require('user.plugins.editor.headlines'),
|
|
},
|
|
{
|
|
'folke/todo-comments.nvim',
|
|
cmd = { 'TodoTrouble', 'TodoTelescope' },
|
|
event = { 'BufReadPost', 'BufNewFile' },
|
|
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' },
|
|
{ 'gt', '<cmd>TodoTrouble<CR>', desc = 'Todo items' },
|
|
{ '<leader>ft', '<cmd>TodoTelescope<CR>', desc = 'Todo items' },
|
|
},
|
|
opts = require('user.plugins.editor.todo-comments'),
|
|
},
|
|
{
|
|
'nvim-treesitter/nvim-treesitter',
|
|
build = { '/bin/mkdir -p ' .. vim.fn.stdpath('data') .. '/parsers', ':TSUpdate' },
|
|
event = { 'BufReadPost', 'BufNewFile' },
|
|
keys = {
|
|
{ '<C-Space>', desc = 'Increment selection' },
|
|
{ '<BS>', desc = 'Decrement selection', mode = 'x' },
|
|
},
|
|
dependencies = {
|
|
'HiPhish/nvim-ts-rainbow2',
|
|
'nvim-treesitter/nvim-treesitter-context',
|
|
'nvim-treesitter/nvim-treesitter-refactor',
|
|
{
|
|
'andymass/vim-matchup',
|
|
init = function()
|
|
vim.g.matchup_matchparen_offscreen = { method = 'popup' }
|
|
end,
|
|
},
|
|
},
|
|
opts = require('user.plugins.editor.treesitter'),
|
|
config = function(_, opts)
|
|
require('nvim-treesitter.configs').setup(opts)
|
|
-- tree-sitter based folding
|
|
vim.opt.foldmethod = 'expr'
|
|
vim.opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
|
end,
|
|
},
|
|
{
|
|
'windwp/nvim-ts-autotag',
|
|
ft = {
|
|
'html',
|
|
'javascript',
|
|
'typescript',
|
|
'javascriptreact',
|
|
'typescriptreact',
|
|
'vue',
|
|
'xml',
|
|
'php',
|
|
'markdown',
|
|
},
|
|
},
|
|
{
|
|
'lukas-reineke/indent-blankline.nvim',
|
|
event = { 'BufReadPost', 'BufNewFile' },
|
|
opts = require('user.plugins.editor.indent-blankline'),
|
|
},
|
|
{
|
|
'mizlan/iswap.nvim',
|
|
cmd = { 'ISwapWith', 'ISwap' },
|
|
keys = {
|
|
{ '<leader>es', '<cmd>ISwapWith<CR>', desc = 'Swap arguments' },
|
|
},
|
|
opts = { hl_grey = 'LineNr', autoswap = true },
|
|
},
|
|
{
|
|
'danymat/neogen',
|
|
cmd = 'Neogen',
|
|
keys = {
|
|
{ '<leader>eg', '<cmd>Neogen<CR>', desc = 'Generate annotation' },
|
|
},
|
|
opts = {
|
|
enabled = true,
|
|
input_after_comment = true,
|
|
snippet_engine = 'luasnip',
|
|
},
|
|
},
|
|
{
|
|
'folke/zen-mode.nvim',
|
|
cmd = 'ZenMode',
|
|
keys = {
|
|
{ '<leader>ez', '<cmd>ZenMode', desc = 'Zen mode' },
|
|
},
|
|
dependencies = {
|
|
{
|
|
'folke/twilight.nvim',
|
|
cmd = { 'Twilight', 'TwilightEnable' },
|
|
opts = require('user.plugins.editor.twilight'),
|
|
},
|
|
},
|
|
opts = { window = { width = 150 } },
|
|
},
|
|
{
|
|
'monaqa/dial.nvim',
|
|
keys = {
|
|
{ '<C-a>', function() require('dial.map').inc_normal() end, expr = true, desc = 'Increment' },
|
|
{ '<C-x>', function() require('dial.map').dec_normal() end, expr = true, desc = 'Decrement' },
|
|
{ '<C-a>', function() require('dial.map').inc_visual() end, expr = true, desc = 'Increment', mode = 'x' },
|
|
{ '<C-x>', function() require('dial.map').dec_visual() end, expr = true, desc = 'Decrement', mode = 'x' },
|
|
{ 'g<C-a>', function() require('dial.map').inc_gvisual() end, expr = true, desc = 'Increment (multiline)', mode = 'x' },
|
|
{ 'g<C-x>', function() require('dial.map').dec_gvisual() end, expr = true, desc = 'Decrement (multiline)', mode = 'x' },
|
|
},
|
|
config = function()
|
|
local augend = require('dial.augend')
|
|
require('dial.config').augends:register_group {
|
|
default = {
|
|
augend.integer.alias.decimal_int,
|
|
augend.integer.alias.hex,
|
|
augend.constant.alias.bool,
|
|
augend.constant.new { elements = { 'True', 'False' }, word = true, cyclic = true },
|
|
augend.hexcolor.new { case = 'lower' },
|
|
augend.semver.alias.semver,
|
|
augend.date.alias['%Y/%m/%d'],
|
|
},
|
|
}
|
|
end,
|
|
},
|
|
{
|
|
'max397574/better-escape.nvim',
|
|
event = 'InsertCharPre',
|
|
opts = {
|
|
mapping = { 'jk', 'kj' },
|
|
timeout = vim.opt.timeoutlen:get(),
|
|
clear_empty_lines = false,
|
|
keys = '<Esc>',
|
|
},
|
|
},
|
|
{
|
|
'eraserhd/parinfer-rust',
|
|
build = 'cargo build --locked --release',
|
|
ft = {
|
|
'clojure',
|
|
'lisp',
|
|
'scheme',
|
|
'fennel',
|
|
'racket',
|
|
'hy',
|
|
'janet',
|
|
'carp',
|
|
'wast',
|
|
},
|
|
},
|
|
{
|
|
'jbyuki/venn.nvim',
|
|
cmd = 'VBox',
|
|
keys = {
|
|
{
|
|
'<leader>ev', function()
|
|
local venn_enabled = vim.inspect(vim.b.venn_enabled)
|
|
local key_opts = { noremap = true, silent = true, buffer = true }
|
|
local lazy_util = require('lazy.core.util')
|
|
|
|
if venn_enabled == 'nil' then
|
|
vim.b.venn_enabled = true
|
|
vim.opt_local.virtualedit = 'all'
|
|
|
|
-- Draw lines with WASD keystroke
|
|
vim.keymap.set('n', 'A', '<C-v>h:VBox<CR>', key_opts)
|
|
vim.keymap.set('n', 'A', '<C-v>h:VBox<CR>', key_opts)
|
|
vim.keymap.set('n', 'S', '<C-v>j:VBox<CR>', key_opts)
|
|
vim.keymap.set('n', 'W', '<C-v>k:VBox<CR>', key_opts)
|
|
vim.keymap.set('n', 'D', '<C-v>l:VBox<CR>', key_opts)
|
|
-- Draw boxes by pressing 'f' with visual selection
|
|
vim.keymap.set('x', 'f', ':VBox<CR>', key_opts)
|
|
|
|
lazy_util.info('Virtual box editing mode enabled.', { title = 'Venv mode', icon = ' ' })
|
|
else
|
|
vim.b.venn_enabled = nil
|
|
vim.opt_local.virtualedit = vim.opt.virtualedit:get()
|
|
|
|
vim.keymap.del('n', 'A', { buffer = true })
|
|
vim.keymap.del('n', 'S', { buffer = true })
|
|
vim.keymap.del('n', 'W', { buffer = true })
|
|
vim.keymap.del('n', 'D', { buffer = true })
|
|
vim.keymap.del('x', 'f', { buffer = true })
|
|
|
|
lazy_util.info('Virtual box editing mode disabled.', { title = 'Venv mode', icon = ' ' })
|
|
end
|
|
end,
|
|
desc = 'Virtual box edit',
|
|
},
|
|
},
|
|
},
|
|
{
|
|
'ggandor/flit.nvim',
|
|
keys = function()
|
|
local ret = {}
|
|
for _, key in ipairs { 'f', 'F', 't', 'T' } do
|
|
ret[#ret + 1] = { key, mode = { 'n', 'x', 'o' }, desc = key }
|
|
end
|
|
return ret
|
|
end,
|
|
dependencies = {
|
|
{
|
|
'ggandor/leap.nvim',
|
|
dependencies = { 'vim-repeat' },
|
|
keys = {
|
|
{ '-', '<Plug>(leap-forward-to)', mode = { 'n', 'x', 'o' }, desc = 'Leap forward to' },
|
|
{ '_', '<Plug>(leap-backward-to)', mode = { 'n', 'x', 'o' }, desc = 'Leap backward to' },
|
|
{ 'gs', '<Plug>(leap-from-window)', mode = { 'n', 'x', 'o' }, desc = 'Leap from window' },
|
|
},
|
|
opts = {
|
|
case_sensitive = true,
|
|
safe_labels = {}, -- No auto jump to first match
|
|
},
|
|
config = function(_, opts)
|
|
local leap = require('leap')
|
|
for k, v in pairs(opts) do
|
|
leap.opts[k] = v
|
|
end
|
|
end,
|
|
},
|
|
},
|
|
opts = { multiline = false },
|
|
},
|
|
{
|
|
'Wansmer/treesj',
|
|
keys = {
|
|
{ 'gJ', '<cmd>TSJToggle<CR>', desc = 'Join toggle' },
|
|
},
|
|
opts = { use_default_keymaps = false, max_join_length = 150 },
|
|
},
|
|
{
|
|
'echasnovski/mini.move',
|
|
keys = {
|
|
{ '<A-h>', mode = { 'n', 'x' }, desc = 'Move left' },
|
|
{ '<A-j>', mode = { 'n', 'x' }, desc = 'Move down' },
|
|
{ '<A-k>', mode = { 'n', 'x' }, desc = 'Move up' },
|
|
{ '<A-l>', mode = { 'n', 'x' }, desc = 'Move right' },
|
|
},
|
|
opts = {
|
|
options = {
|
|
reindent_linewise = true,
|
|
},
|
|
},
|
|
config = function(_, opts)
|
|
require('mini.move').setup(opts)
|
|
end,
|
|
},
|
|
{
|
|
'echasnovski/mini.ai',
|
|
event = 'VeryLazy',
|
|
dependencies = {
|
|
{
|
|
'nvim-treesitter/nvim-treesitter-textobjects',
|
|
-- we only need the queries, other functions aren't used
|
|
init = function()
|
|
require('lazy.core.loader').disable_rtp_plugin('nvim-treesitter-textobjects')
|
|
end,
|
|
},
|
|
},
|
|
config = function()
|
|
require('user.plugins.editor.mini-ai')
|
|
end,
|
|
},
|
|
{
|
|
'echasnovski/mini.pairs',
|
|
event = 'InsertEnter',
|
|
config = function()
|
|
require('mini.pairs').setup()
|
|
end,
|
|
},
|
|
{
|
|
'echasnovski/mini.align',
|
|
keys = function(_, keys)
|
|
local plugin = require('lazy.core.config').spec.plugins['mini.align']
|
|
local opts = require('lazy.core.plugin').values(plugin, 'opts', false)
|
|
local mappings = {
|
|
{ opts.mappings.start, mode = { 'n', 'v' }, desc = 'Align text' },
|
|
{ opts.mappings.start_with_preview, mode = { 'n', 'v' }, desc = 'Align text (with preview)' },
|
|
}
|
|
mappings = vim.tbl_filter(function(m)
|
|
return m[1] and #m[1] > 0
|
|
end, mappings)
|
|
return vim.list_extend(mappings, keys)
|
|
end,
|
|
opts = { mappings = { start = 'ga', start_with_preview = 'gA' } },
|
|
config = function(_, opts)
|
|
require('mini.align').setup(opts)
|
|
end,
|
|
},
|
|
{
|
|
'echasnovski/mini.comment',
|
|
keys = {
|
|
{ 'gc', mode = 'o' },
|
|
{ 'gc', mode = { 'n', 'x' }, desc = 'Toggle comment' },
|
|
{ 'gcc', mode = 'n', desc = 'Toggle comment on current line' },
|
|
},
|
|
opts = {
|
|
options = { ignore_blank_line = true },
|
|
},
|
|
config = function(_, opts)
|
|
require('mini.comment').setup(opts)
|
|
end,
|
|
},
|
|
{
|
|
'echasnovski/mini.surround',
|
|
keys = function(_, keys)
|
|
local plugin = require('lazy.core.config').spec.plugins['mini.surround']
|
|
local opts = require('lazy.core.plugin').values(plugin, 'opts', false)
|
|
local mappings = {
|
|
{ opts.mappings.add, mode = { 'n', 'x' }, desc = 'Add surrounding' },
|
|
{ opts.mappings.delete, desc = 'Delete surrounding' },
|
|
{ opts.mappings.find, desc = 'Find surrounding' },
|
|
{ opts.mappings.find_left, desc = 'Find left surrounding' },
|
|
{ opts.mappings.highlight, desc = 'Highlight surrounding' },
|
|
{ opts.mappings.replace, desc = 'Replace surrounding' },
|
|
{ opts.mappings.update_n_lines, desc = 'Update `MiniSurround.config.n_lines`' },
|
|
}
|
|
mappings = vim.tbl_filter(function(m)
|
|
return m[1] and #m[1] > 0
|
|
end, mappings)
|
|
return vim.list_extend(mappings, keys)
|
|
end,
|
|
opts = {
|
|
mappings = {
|
|
add = 'sa',
|
|
delete = 'sd',
|
|
find = 'sf',
|
|
find_left = 'sF',
|
|
highlight = 'sh',
|
|
replace = 'sr',
|
|
update_n_lines = 'sn',
|
|
},
|
|
silent = true,
|
|
search_method = 'cover_or_next',
|
|
highlight_duration = vim.opt.timeoutlen:get(),
|
|
},
|
|
config = function(_, opts)
|
|
require('mini.surround').setup(opts)
|
|
end,
|
|
},
|
|
{
|
|
'echasnovski/mini.animate',
|
|
event = 'VeryLazy',
|
|
opts = function()
|
|
return require('user.plugins.editor.mini-animate')
|
|
end,
|
|
config = function(_, opts)
|
|
require('mini.animate').setup(opts)
|
|
end,
|
|
},
|
|
}
|