-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: replace plugins with mini.*
- Loading branch information
Showing
8 changed files
with
76 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
return { | ||
'echasnovski/mini.ai', | ||
event = 'VeryLazy', | ||
opts = function() | ||
local ai = require('mini.ai') | ||
return { | ||
n_lines = 500, | ||
custom_textobjects = { | ||
o = ai.gen_spec.treesitter({ | ||
a = { '@block.outer', '@conditional.outer', '@loop.outer' }, | ||
i = { '@block.inner', '@conditional.inner', '@loop.inner' }, | ||
}, {}), | ||
f = ai.gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' }, {}), | ||
c = ai.gen_spec.treesitter({ a = '@class.outer', i = '@class.inner' }, {}), | ||
t = { '<([%p%w]-)%f[^<%w][^<>]->.-</%1>', '^<.->().*()</[^/]->$' }, | ||
}, | ||
} | ||
end, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
return { | ||
'windwp/nvim-autopairs', | ||
event = 'InsertEnter', | ||
opts = function() | ||
return { | ||
disable_filetype = { 'TelescopePrompt', 'vim' }, | ||
} | ||
end, | ||
'echasnovski/mini.pairs', | ||
event = 'VeryLazy', | ||
opts = {}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,11 @@ | ||
return { | ||
'numToStr/Comment.nvim', | ||
'echasnovski/mini.comment', | ||
event = 'VeryLazy', | ||
opts = function() | ||
return { | ||
pre_hook = function(ctx) | ||
local U = require('Comment.utils') | ||
|
||
local location = nil | ||
if ctx.ctype == U.ctype.block then | ||
location = require('ts_context_commentstring.utils').get_cursor_location() | ||
elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then | ||
location = require('ts_context_commentstring.utils').get_visual_start_location() | ||
end | ||
|
||
return require('ts_context_commentstring.internal').calculate_commentstring({ | ||
key = ctx.ctype == U.ctype.line and '__default' or '__multiline', | ||
location = location, | ||
}) | ||
opts = { | ||
options = { | ||
custom_commentstring = function() | ||
return require('ts_context_commentstring.internal').calculate_commentstring() or vim.bo.commentstring | ||
end, | ||
} | ||
end, | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,32 @@ | ||
return { | ||
'kylechui/nvim-surround', | ||
version = '*', -- Use for stability; omit to use `main` branch for the latest features | ||
event = 'VeryLazy', | ||
config = function() | ||
require('nvim-surround').setup({ | ||
-- Configuration here, or leave empty to use defaults | ||
}) | ||
'echasnovski/mini.surround', | ||
keys = function(_, keys) | ||
-- Populate the keys based on the user's options | ||
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, desc = 'Add surrounding', mode = { 'n', 'v' } }, | ||
{ opts.mappings.delete, desc = 'Delete surrounding' }, | ||
{ opts.mappings.find, desc = 'Find right 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 = 'gsa', -- Add surrounding in Normal and Visual modes | ||
delete = 'gsd', -- Delete surrounding | ||
find = 'gsf', -- Find surrounding (to the right) | ||
find_left = 'gsF', -- Find surrounding (to the left) | ||
highlight = 'gsh', -- Highlight surrounding | ||
replace = 'gsr', -- Replace surrounding | ||
update_n_lines = 'gsn', -- Update `n_lines` | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters