mini.pairs not working
Contributing guidelines
- [X] I have read CONTRIBUTING.md
- [X] I have read CODE_OF_CONDUCT.md
- [X] I have updated 'mini.nvim' to latest version
Module(s)
mini.pairs
Description
when trying to insert any paired symbols, an error message would pop up and a 0 will inserted instead.
Neovim version
v0.9.5
Steps to reproduce
- setup mini.pairs in config
- restart nvim
- try to input any paired symbols, like "(".
Expected behavior
No response
Actual behavior
an error message will show up, and a 0 will be inserted instead.
There is a not proper Lua pattern set up for ( character in the config. I can not help more without seeing how 'mini.pairs' is set up.
I used the default setup using
require(“mini.pairs”).setup()
I used the default setup using
require(“mini.pairs”).setup()
It doesn't look like it, because with basic require('mini.pairs').setup() everything works on all supported Neovim versions.
Would you mind executing the following command which will put some lines at the start of current buffer, copy those lines and paste here?
:lua vim.fn.append(0, vim.split(vim.inspect(MiniPairs.config), '\n'))
sure, here's the config I got through the command:
{
mappings = {
['"'] = {
action = "closeopen",
neigh_pattern = "[^\\].",
pair = '""',
register = {
cr = false
}
},
["'"] = {
action = "closeopen",
neigh_pattern = "[^%a\\].",
pair = "''",
register = {
cr = false
}
},
["("] = {
action = "open",
neigh_pattern = "[^\\].",
pair = "()"
},
[")"] = {
action = "close",
neigh_pattern = "[^\\].",
pair = "()"
},
["["] = {
action = "open",
neigh_pattern = "[^\\].",
pair = "[]"
},
["]"] = {
action = "close",
neigh_pattern = "[^\\].",
pair = "[]"
},
["`"] = {
action = "closeopen",
neigh_pattern = "[^\\].",
pair = "``",
register = {
cr = false
}
},
["{"] = {
action = "open",
neigh_pattern = "[^\\].",
pair = "{}"
},
["}"] = {
action = "close",
neigh_pattern = "[^\\].",
pair = "{}"
}
},
modes = {
command = false,
insert = true,
terminal = false
}
}
also, this is the setup i have in my config
sure, here's the config I got through the command:
Hmm, this look about right.
Would you mind trying to reproduce this with clean config in which only 'mini.pairs' installed and active? For this:
- Create a '~/.config/nvim-minipairs' directory and file 'init.lua' inside of it.
- Paste the following code in that 'init.lua' file:
local path_package = vim.fn.stdpath('data') .. '/site/' local mini_path = path_package .. 'pack/deps/start/mini.nvim' if not vim.loop.fs_stat(mini_path) then vim.cmd('echo "Installing `mini.nvim`" | redraw') local clone_cmd = { 'git', 'clone', '--filter=blob:none', 'https://github.com/echasnovski/mini.nvim', mini_path } vim.fn.system(clone_cmd) vim.cmd('packadd mini.nvim | helptags ALL') vim.cmd('echo "Installed `mini.nvim`" | redraw') end require('mini.pairs').setup() - From command line execute
NVIM_APPNAME=nvim-minipairs nvimand wait for 'mini.nvim' to be installed. - Enter Insert mode and try to reproduce the error.
Also it would be helpful to share a bit more info:
- Does this happen after every press of "(" or only in some situations? If not always, then what are the situations.
- The full Neovim version info. Like the whole output of
nvim --version. There might be a different source of Lua or something. - OS.
- Keyboard layout.
Thanks for the step-by-step guide. I'll give it a go and keep you updated when I got time. For now I'll just use nvim-autopairs as a replacement.