I'm in the process of yoinking some of your configuration (thank you for providing that, the plugins and blog posts) and noticed some small issues in the autopairs setup.
It looks like you forgot to finish writing disable-rule-for-filetypes so that it accepts and makes use of the arguments you provide when calling it. It instead always uses autopairs.get_rule for "'" and the lisps table (the latter doesn't really matter).
Making that change myself I noticed that it doesn't work for "`". Running :lua require(vim.inspect(require('nvim-autopairs').get_rule("`"))) reveals that because only a single rule exists, it can't be indexed.
When debugging this, I noticed that there are two rules for "'", the second one being exclusive to Rust and more importantly, the first one excluding Rust using not_filetypes = { "rust" } (these rules disable autopairs for "'" when used in lifetime annotation position).
Since your current code uses assoc-in, it overrides the existing table of excluded filetypes essentially disabling the rather useful rules for Rust.
Here is my (likely unidiomatic, this is my first LISP) code to address these issues:
I'm in the process of yoinking some of your configuration (thank you for providing that, the plugins and blog posts) and noticed some small issues in the autopairs setup.
disable-rule-for-filetypes
so that it accepts and makes use of the arguments you provide when calling it. It instead always usesautopairs.get_rule
for"'"
and thelisps
table (the latter doesn't really matter)."`"
. Running:lua require(vim.inspect(require('nvim-autopairs').get_rule("`")))
reveals that because only a single rule exists, it can't be indexed."'"
, the second one being exclusive to Rust and more importantly, the first one excluding Rust usingnot_filetypes = { "rust" }
(these rules disable autopairs for"'"
when used in lifetime annotation position). Since your current code usesassoc-in
, it overrides the existing table of excluded filetypes essentially disabling the rather useful rules for Rust.Here is my (likely unidiomatic, this is my first LISP) code to address these issues:
I hope this is useful to you :slightly_smiling_face: