From d3d7d566daee93876eda4380c0774e20a6c5330a Mon Sep 17 00:00:00 2001 From: asep komarudin Date: Mon, 19 Feb 2024 14:36:43 +0700 Subject: [PATCH] fix: remove auto pairs /^> --- lazy-lock.json | 1 + lua/user/autopairs.lua | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 9b91736..0c8d44b 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -32,6 +32,7 @@ "nvim-autopairs": { "branch": "master", "commit": "2e8a10c5fc0dcaf8296a5f1a7077efcd37065cc8" }, "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, + "nvim-jdtls": { "branch": "master", "commit": "a5c6f38f8151d7b4f5b32c005a95022fa66f4c9d" }, "nvim-lsp-installer": { "branch": "main", "commit": "17e0bfa5f2c8854d1636fcd036dc8284db136baa" }, "nvim-lspconfig": { "branch": "master", "commit": "cf3dd4a290084a868fac0e2e876039321d57111c" }, "nvim-material-icon": { "branch": "main", "commit": "602088c2682e61cbebd7191de7dc88bfa90c6890" }, diff --git a/lua/user/autopairs.lua b/lua/user/autopairs.lua index ea11b0a..64b83b0 100644 --- a/lua/user/autopairs.lua +++ b/lua/user/autopairs.lua @@ -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("/>") .. "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("/>") .. "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")