nvim/lua/plugs/edit-plugs.lua

114 lines
2.8 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

return {
'vijaymarupudi/nvim-fzf', -- fzf
{
-- surround 和 wildfire 配合有神奇的效果
'tpope/vim-surround',
'gcmt/wildfire.vim',
-- 括号箭头
'yaocccc/nvim-hlchunk',
},
-- 多光标
{
'terryma/vim-multiple-cursors',
},
--格式整理
{
'junegunn/vim-easy-align',
config = function()
G.map({
{ "v", "ga", ":EasyAlign<CR>", { noremap = true } },
{ "v", "=", ":EasyAlign<CR>", { noremap = true } },
})
end
},
-- 注释插件Neovim 0.12 内置 treesitter gc/gcc 注释切换,暂注释掉此插件测试
-- {
-- 'tpope/vim-commentary',
-- },
{
-- Copilot 懒加载:只在插入模式需要(和 nvim-cmp 共用 Tab 键cmp 改用 C-n/C-p 避让)
'github/copilot.vim', -- github copilot
event = "InsertEnter",
},
{
'windwp/nvim-autopairs',
event = "InsertEnter",
config = function()
require('nvim-autopairs').setup({
disable_filetype = { "vim" },
})
end
},
{
'kevinhwang91/nvim-ufo',
dependencies = {
'kevinhwang91/promise-async'
},
config = function()
vim.opt.foldcolumn = '0'
vim.opt.foldlevel = 99
vim.opt.foldlevelstart = 99
vim.opt.foldenable = true
require("ufo").setup({
provider_selector = function(bufnr, filetype, buftype)
return { 'treesitter', 'indent' }
end
})
end
},
{
-- hop 快速跳转:用 f/F/t/T 做行内单字符跳转,<c-f> 做双字符跳转
-- 注意:这会覆盖 Vim 原生的 f/F/t/T
"phaazon/hop.nvim",
branch = "v2",
keys = {
"f", "F", "t", "T",
"<c-f>"
},
config = function()
require("hop").setup { keys = 'asdfghjkl;' }
local hop = require('hop')
local directions = require('hop.hint').HintDirection
G.map({
{ "n", "<c-f>", ":HopChar2MW<CR>", { noremap = true } },
{ "n", "f",
function()
hop.hint_char1({
direction = directions.AFTER_CURSOR,
current_line_only = true
})
end, { noremap = true }
},
{ "n", "F",
function()
hop.hint_char1({
direction = directions.BEFORE_CURSOR,
current_line_only = true
})
end, { noremap = true }
},
{ "n", "t",
function()
hop.hint_char1({
direction = directions.AFTER_CURSOR,
current_line_only = true,
hint_offset = -1
})
end, { noremap = true }
},
{ "n", "T",
function()
hop.hint_char1({
direction = directions.BEFORE_CURSOR,
current_line_only = true,
hint_offset = -1
})
end, { noremap = true }
},
})
end
}
}