mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-24 09:48:51 +02:00
fix: remove auto pairs /^>
This commit is contained in:
parent
2af9f21559
commit
d3d7d566da
2 changed files with 10 additions and 9 deletions
|
@ -4,7 +4,7 @@ if not status_ok then
|
|||
return
|
||||
end
|
||||
|
||||
local Rule = require("nvim-autopairs.rule")
|
||||
-- local Rule = require("nvim-autopairs.rule")
|
||||
|
||||
npairs.setup({
|
||||
check_ts = true,
|
||||
|
@ -27,14 +27,14 @@ npairs.setup({
|
|||
},
|
||||
})
|
||||
|
||||
npairs.add_rules({
|
||||
Rule("/", ">"):with_pair(function(opts)
|
||||
local pair = opts.line:sub(opts.col, opts.col + 1)
|
||||
if (vim.bo.filetype == "jsx" or vim.bo.filetype == "tsx") and pair == "/" then
|
||||
return npairs.esc("/>") .. "<esc>i"
|
||||
end
|
||||
end),
|
||||
})
|
||||
-- npairs.add_rules({
|
||||
-- Rule("/", ">"):with_pair(function(opts)
|
||||
-- local pair = opts.line:sub(opts.col, opts.col + 1)
|
||||
-- if (vim.bo.filetype == "jsx" or vim.bo.filetype == "tsx") and pair == "/" then
|
||||
-- return npairs.esc("/>") .. "<esc>i"
|
||||
-- end
|
||||
-- end),
|
||||
-- })
|
||||
-- If you want insert `(` after select function or method item
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
local cmp_status_ok, cmp = pcall(require, "cmp")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue