mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
nvim: use blink-pairs
This commit is contained in:
parent
5c189f5c0f
commit
bddc75a08b
6 changed files with 112 additions and 49 deletions
|
|
@ -15,7 +15,7 @@ return {
|
|||
},
|
||||
{ import = "plugins.mod.img-clip" },
|
||||
{ import = "plugins.mod.mc" }, -- Multiple-cursors
|
||||
{ import = "plugins.mod.autopairs" },
|
||||
{ import = "plugins.mod.blink-pairs" },
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
local npairs = require("nvim-autopairs")
|
||||
local Rule = require("nvim-autopairs.rule")
|
||||
|
||||
npairs.setup()
|
||||
npairs.add_rule(Rule("$", "$", "markdown"))
|
||||
npairs.add_rule(Rule("\\(", "\\)", "tex"))
|
||||
npairs.add_rule(Rule("\\[", "\\]", "tex"))
|
||||
|
||||
npairs.add_rules({
|
||||
Rule("%(", "%)", "cmd"):with_pair(function(opts)
|
||||
if vim.fn.getcmdtype() == ":" then
|
||||
return true
|
||||
end
|
||||
end),
|
||||
})
|
||||
end,
|
||||
}
|
||||
39
home/dot_config/nvim/lua/plugins/mod/blink-pairs.lua
Normal file
39
home/dot_config/nvim/lua/plugins/mod/blink-pairs.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
"saghen/blink.pairs",
|
||||
version = "*", -- use prebuilt version
|
||||
event = "BufEnter",
|
||||
|
||||
-- download binary
|
||||
dependencies = "saghen/blink.download",
|
||||
|
||||
--- @module 'blink.pairs'
|
||||
--- @type blink.pairs.Config
|
||||
opts = {
|
||||
mappings = {
|
||||
enabled = true,
|
||||
cmdline = true,
|
||||
disabled_filetypes = {},
|
||||
-- https://github.com/Saghen/blink.pairs/blob/main/lua/blink/pairs/config/mappings.lua#24
|
||||
-- Battery included!
|
||||
pairs = {},
|
||||
},
|
||||
highlights = {
|
||||
enabled = true,
|
||||
cmdline = true,
|
||||
groups = {
|
||||
"BlinkPairsOrange",
|
||||
"BlinkPairsPurple",
|
||||
"BlinkPairsBlue",
|
||||
},
|
||||
unmatched_group = "BlinkPairsUnmatched",
|
||||
|
||||
matchparen = {
|
||||
enabled = true,
|
||||
cmdline = false,
|
||||
include_surrounding = false,
|
||||
group = "BlinkPairsMatchParen",
|
||||
priority = 250,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue