Giter Club home page Giter Club logo

ultimate-autopair.nvim's Introduction

Last updated: 2024-04-15

Currently working on

Ultimate autopair v0.7

I'm around 30% done, with the major missing things being: almost all the mappings. Current progress is slow as there are many hard problems to solve and I got many other project going on simultaneously. Don't expect release any time soon.

My neovim plugins

Here is a list of all my plugins and a short description of what they do.

ultimate-autopair.nvim's People

Contributors

altermo avatar tzachar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

tzachar

ultimate-autopair.nvim's Issues

Newline <BS> doesn't work?

Hey, thanks for this awesome plugin!

FYI, Newline doesn't work from this commit: 036b8c1

Minimal repro:

local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  -- do not remove the colorscheme!
  "folke/tokyonight",
  -- add any other pugins here
  {
    "altermo/ultimate-autopair.nvim",
    opts = {
      bs = {
	enable = true,
      },
    },
    commit = "f92801d",
  },
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

-- add anything else here
vim.opt.termguicolors = true
-- do not remove the colorscheme!
vim.cmd([[colorscheme tokyonight]])

Run with:

nvim -u repro.lua repro.lua

Bug: Crashes nvim when a bracket is typed

When I pass anything in the setup call, it completely crashes nvim as soon as I type a bracket the first or second time.

Reproducible with minimal config:

local plugins = {
	{
		"altermo/ultimate-autopair.nvim",
		event = { "InsertEnter", "CmdlineEnter" },
		dependencies = "nvim-treesitter/nvim-treesitter",
		opts = {},
	},
}
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system {
		"git",
		"clone",
		"--filter=blob:none",
		"https://github.com/folke/lazy.nvim.git",
		"--branch=stable",
		lazypath,
	}
end
vim.opt.runtimepath:prepend(lazypath)
require("lazy").setup(plugins)
NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3
macOS 13.4.1

Custom characters for backspace mapping

Hi, only issue I'm having is that I can't use ^H instead of backspace (which is very handy sometimes). However ^M instead of an actual return key works, but not ^J. I believe one way to fix that is to provide a config field for both BS and CR mappings, that will accept keys to interpret as CR or BS

{
  bs={
    lhs={'<BS>', '<C-h>'}
  },
  cr={
    lhs={'<BS>', '<C-j>'}
  }
}

Still a great plugin, thank you

Error on updating plugin

Hi,

I stumbled upon the following error on installing the latest version via Lazy on the nightly build of neovim:

 error: Your local changes to the following files would be overwritten by checkout:
 doc/tags
 Please commit your changes or stash them before you switch branches.

== Feek

[bug] crash nvim

I works only when plugin is enabled.
Steps in lua file:

  1. type M.get
  2. type (
  3. try to remove (tap backspace). Sometimes crash was right here.
  4. try to type later _langu -> CRASH

Can't tab twice?

Make a new file

:setf ruby

and type:

hello['|']

and hit tab twice, and it stops after ' but doesnt go to ]

I notice SOME times it works on lua, but not always, and it seems to sometimes work elsewhere, but I can't figure out what exactly causes it.

Issue in Markdown files and VimWiki

When using a markdown file and VimWiki some errors occurs.

How to reproduce:

  • Create a new Markdown file `nvim test.md'
  • add header + space #
  • stay in insert mode
  • press backspace
E5108: Error executing lua: ...-autopair.nvim/lua/ultimate-autopair/utils/info_line.lua:140: attempt to index local 'node' (a nil value)
stack traceback:
        ...-autopair.nvim/lua/ultimate-autopair/utils/info_line.lua:140: in function 'filter_string'
        ...ultimate-autopair.nvim/lua/ultimate-autopair/maps/bs.lua:121: in function <...ultimate-autopair.nvim/lua/ultimate-autopair/maps/bs.lua:115>

Start balancing spaces only when non space characters are present

Hi,

I have a suggestion for starting the balancing spaces. Reason for the request are the Markdown ToDo items:

- [ ] ToDo item
- [ ] 

When creating a ToDo item Ultimate Autopairs does the following (_ is a space and | is the cursor):

- [|]
pressing space in order to generate empty task:
-[_|_]

wanted behaviour:
- [_|]

It would be nice you start the balancing spaces only when 'non space' characters are present inside the autopair:

(|)
pressing space:
(_|)
pressing an other space:
(__|)
typing non space character (means fire up the auto balance module) :
(__A|__)

== Feek

Feature Request: Command to Enable/Disable

Hello,

Really enjoying this plugin and wonder if there are plans to offer something along the lines of a :UAEnable and :UADisable which could then be mapped as needed?

Feature request

Hi.

Cool plugin here ;)

Wonder how hard it would be to support the following features:

  1. fast backwards -- the opposite of fast forward, as sometime I overshoot...
  2. multi line support for fast forward -- when used at the end of line, skip to the next line.

wdyt?

Disabling in cmd mode

Why disable it? In Termux, there is no Del key, so you cannot do, like "<Del> to remove the closing quote.

There is a workaround, and it's to use <C-v>" in order to insert a literal character, it gets tiring to do it sometimes, though.

Backspace broken with certain pairs

...tly/nvim-macos/share/nvim/runtime/lua/vim/treesitter.lua:382: Invalid position: row and col must be non-negative
stack traceback:
	...y/ultimate-autopair.nvim/lua/ultimate-autopair/debug.lua:77: in function <...y/ultimate-autopair.nvim/lua/ultimate-autopair/debug.lua:74>
	[C]: in function 'assert'
	...tly/nvim-macos/share/nvim/runtime/lua/vim/treesitter.lua:382: in function 'getnode'
	...y/ultimate-autopair.nvim/lua/ultimate-autopair/utils.lua:154: in function 'gettsnode'
	...autopair.nvim/lua/ultimate-autopair/extension/tsnode.lua:30: in function '_in_tsnode'
	...autopair.nvim/lua/ultimate-autopair/extension/tsnode.lua:91: in function 'filter'
	...autopair.nvim/lua/ultimate-autopair/extension/tsnode.lua:132: in function 'efilter'
	...ua/ultimate-autopair/profile/default/utils/open_pair.lua:48: in function 'count_start_pair'
	...ua/ultimate-autopair/profile/default/utils/open_pair.lua:193: in function 'open_start_pair_before'
	...air.nvim/lua/ultimate-autopair/profile/default/pairs.lua:39: in function 'backspace'
	...r.nvim/lua/ultimate-autopair/profile/default/maps/bs.lua:18: in function <...r.nvim/lua/ultimate-autopair/profile/default/maps/bs.lua:15>
	[C]: in function 'xpcall'
	...y/ultimate-autopair.nvim/lua/ultimate-autopair/debug.lua:97: in function 'run'
	...zy/ultimate-autopair.nvim/lua/ultimate-autopair/core.lua:95: in function <...zy/ultimate-autopair.nvim/lua/ultimate-autopair/core.lua:87>

When I start to press backspace in the middle of some pairs, like from {{{{{|}}}}}, I get this error message. And backspace no longer works correctly; it only deletes the ones on the left.

Why did neovim crashes?

Neovim crashed because of a neovim bug #24783 which has been fixed, but requires neovim to be updated to the latest dev version.
If you're not planning to update neovim, then install the plugin with the commit 667d230.

Update

I have refactored the code so that the crash won't happen, at the cost of speed.
You can now use the latest release of the plugin without worry.

Command `cabbrev` stop working

Lazy setup:

  {
    'altermo/ultimate-autopair.nvim',
    event = { 'InsertEnter', 'CmdlineEnter' },
    config = function()
      require('ultimate-autopair').setup {}
    end,
  },

Abbreviations:

  cabbrev <expr> lpi getcmdpos() == 4 && getcmdtype() == ':' ? 'lua print(vim.inspect' : 'lpi'
" or
  cabbrev <expr> bdn getcmdtype() == ':' ? 'bn<bar>bd#' : 'bdn'

stop working in command line. Press :lpi( nothing happens. I erase ultimate-autopair.nvim restart, press :lpi( then :lua print(vim.inspect(.

Thank you a lot for the plugin.

health error

Below is the output of checkhealth:

ultimate-autopair

  • tests starting
  • ERROR error while checking health: Vim:E903: Process failed to start: too many open files: "/usr/local/bin/nvim"

Fly mode in newer version of ultimate-autopair

I wrote in a closed issue #17 but thought I'd write a new one since the message might be missed when it's in a closed issue. In #17 you helped me setting up fly mode however in the new version it stopped working and I'm getting

|| ultimate-autopair:
|| Old configuration detected
|| The problem:
|| extensions option needs updating (aborting)
|| packer.nvim: Error running config for ultimate-autopair.nvim: ...vim/lua/ultimate-autopair/configs/default/utils/init.lua:44: attempt to compare two nil values

Here's my current config again which you helped me with above:

require('ultimate-autopair').setup({
	extensions = {
		{ 'cmdtype',  { '/', '?', '@' } },
		'multichar',
		'string',
		{ 'treenode', { inside = { 'comment' } } },
		{ 'escape',   { filter = true } },
		'rules',
		'filetype',
		{ 'alpha',   { before = { "'" } } },
		{ 'suround', { '"', "'" } },
		{ 'fly',     { ')', '}', ']', ' ', "'", '"', nofilter = true } },
	},
})

This worked great before and would really appreciate getting it working with the new version. There's no hurry though.

Typo: warp vs wrap?

Hi, I see you use fastwarp to describe the feature where a user can move the closing parenthesis to the end of a word. This feature is usually referred to as fastwrap, as you can see here and here. Is that a typo in your repo?

Unexpected behavior in S-expression langs like lisp, fenell, racket, scheme and etc

I realized that in these programming languages, something happens that is not supposed to happen.

What happens:

Before                    Input                After
-----------------------------------------------------------
(defun foo (x y z)|)      <CR>          (defun foo (x y z)
                                           |
                                           )

what should happen:

Before                    Input                After
-----------------------------------------------------------
(defun foo (x y z)|)      <CR>          (defun foo (x y z)
                                           |)

Triggers with backslashes

I would like to add a pair \( \) for tex. However, { "\\(", "\\)", ft = { "tex" } }, does not work. Inputting \( does nothing; but inputting \\( produces \\(\). Why is this happening?

enter key doesn't work in insert mode

This is my config:

	{
		'altermo/ultimate-autopair.nvim',
		event={'InsertEnter','CmdlineEnter'},
		branch='v0.6',
		opts={
			--Config goes here
		},
	},

In insert mode, press Enter key, nothing happens.

Conflict with nvim-treesitter-endwise

Reproduce:

for name, url in pairs{
  treesitter = 'nvim-treesitter/nvim-treesitter',
  endwise = 'RRethy/nvim-treesitter-endwise',
  autopair = 'altermo/ultimate-autopair.nvim',
} do
  local install_path = vim.fn.fnamemodify('nvim_issue/'..name, ':p')
  if vim.fn.isdirectory(install_path) == 0 then
    print(vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/' .. url, install_path })
  end
  vim.opt.runtimepath:append(install_path)
end

require "ultimate-autopair".setup {}

require "nvim-treesitter.configs".setup {
  endwise = { enable = true }
}
$ nvim -u minimal.lua foo.lua

and type (function() followed by <CR>.

Actual Result: two ends are inserted.

(function()
   |
end
end
  )

Expected:

(function()
   |
end)

Fly mode from inside a string

I often use the fly mode and it works great. It doesn't work inside strings and I understand why but wonder if it would be possible to configure so that it does? In other plugins it worked and I had to do ctrl-v) to add a ')' inside a string because otherwise I would jump to the wrapping ).

If possible I would appreciate a config example. I'm guessing you could use "list_of_characters" but I'm not sure how.

Lot of errors in CheckHealth related to lua

Hi,

Updated to the latest version (v0.6) and I noticed a lot of errors in the CheckHealth related to lua.

Using neovim nightly (NVIM v0.10.0-dev-1049+g6a8b48e24-Homebrew) on macOS.

How to reproduce

install Neovim kickstart project

git clone https://github.com/nvim-lua/kickstart.nvim.git ~/.config/kick

install ultimate-autopair.nvim via Lazy in init.lua:

{
    'altermo/ultimate-autopair.nvim',
    event={'InsertEnter','CmdlineEnter'},
    branch='v0.6',
    opts={
        --Config goes here
    },
}

run kickstarter neovim version via: NVIM_APPNAME=kick nvim

run checkhealth

Result

img

Wrong behaviour deleting spaces

Hi,

consider the following function:

function(÷÷÷|'argument1', 'argument2'÷÷);

where ÷ is a space and | is the cursor position. So three spaces at start bracket and two spaces at the end bracket.

When pressing on time one the <bs> also the ending ' quote of the second argument is deleted.

Related to this, maybe you could also check if the spaces remain "balanced".

== Feek

ERROR 's

npair started giving error on lates update may 12+

ERROR

Failed to run `config` for npairs-integrate-upair
vim/keymap.lua:107: E31: No such mapping
# stacktrace:
  - vim\keymap.lua:107 _in_ **del**
  - ultimate-autopair.nvim\lua\ultimate-autopair\core.lua:54 _in_ **clear**
  - ultimate-autopair.nvim\lua\ultimate-autopair\config.lua:34 _in_ **init**
  - ultimate-autopair.nvim\lua\ultimate-autopair\init.lua:67 _in_ **init**
  - ultimate-autopair.nvim\lua\ultimate-autopair\init.lua:64 _in_ **setup**
  - npairs-integrate-upair\lua\npairs-int-upair.lua:43 _in_ **init_upari**
  - npairs-integrate-upair\lua\npairs-int-upair.lua:21 _in_ **init_plugins**
  - npairs-integrate-upair\lua\npairs-int-upair.lua:18 _in_ **setup**
  - Lazy.lua:362 _in_ **config**

minimal config using lazy.nvim

vim.g.mapleader = " "
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system {
	'git',
	'clone',
	'--filter=blob:none',
	'https://github.com/folke/lazy.nvim.git',
	'--branch=stable', -- latest stable release
	lazypath, } end
vim.opt.rtp:prepend(lazypath)

require('lazy').setup({
    { -- Brackts, Parent, quotes, Completion
    'altermo/npairs-integrate-upair', -- integrate both nvim-autopairs + ultimate-autopair
    event = "InsertEnter",
    dependencies = {
    'windwp/nvim-autopairs',
    {'altermo/ultimate-autopair.nvim',
    event={'InsertEnter','CmdlineEnter'},
      config = function()
      require('ultimate-autopair').setup({})
      end },
      },
    config=function() require('npairs-int-upair').setup() end },

}, {})

bug: Unknown command regex

I am using the out-of-box builtin config, and it happened when I type " in vimscripts.

Stacktrace:

stack traceback:
        ...d/ultimate-autopair.nvim/lua/ultimate-autopair/debug.lua:102: in function <...d/ultimate-autopair.nvim/lua/ultimate-autopair/debug.lua:100>
        [C]: in function 'error'
        ...autopair.nvim/lua/ultimate-autopair/extensions/rules.lua:50: in function 'check_rule'
        ...autopair.nvim/lua/ultimate-autopair/extensions/rules.lua:7: in function 'check_rule'
        ...autopair.nvim/lua/ultimate-autopair/extensions/rules.lua:55: in function 'check_rules'
        ...autopair.nvim/lua/ultimate-autopair/extensions/rules.lua:70: in function 'f'
        ...vim/lua/ultimate-autopair/configs/default/utils/init.lua:77: in function 'check'
        ...air.nvim/lua/ultimate-autopair/configs/default/paira.lua:97: in function <...air.nvim/lua/ultimate-autopair/configs/default/paira.lua:92>
        [C]: in function 'xpcall'
        ...d/ultimate-autopair.nvim/lua/ultimate-autopair/debug.lua:121: in function <...d/ultimate-autopair.nvim/lua/ultimate-autopair/debug.lua:120>
        ...ed/ultimate-autopair.nvim/lua/ultimate-autopair/core.lua:39: in function <...ed/ultimate-autopair.nvim/lua/ultimate-autopair/core.lua:33>

Debugging info:

{
  args = { {
      col = 1,
      incmd = false,
      key = '"',
      line = "",
      linenr = 3068,
      wcol = 1,
      wline = ""
    } },
  info = {
    _type = {
      [{}] = { "pair", "ambigous" }
    },
    backspace = <function 1>,
    check = <function 2>,
    conf = { '"', '"',
      rules = { { "when", { "filetype", "vim" }, { "not", { "regex", "^%s*$" } } } },
      string = true,
      suround = true
    },
    doc = 'autopairs ambigous pair: "',
    end_pair = '"',
    ext_checks = {},
    extensions = { {
        conf = {
          nofilter = false,
          other_char = { " " },
          p = 10
        },
        m = {
          call = <function 3>,
          check = <function 4>
        },
        name = "fly"
      }, {
        conf = {
          p = 20
        },
        m = {
          call = <function 5>
        },
        name = "suround"
      }, {
        conf = {
          p = 30
        },
        m = {
          call = <function 6>
        },
        name = "alpha"
      }, {
        conf = {
          p = 40
        },
        m = {
          call = <function 7>,
          check_rule = <function 8>,
          check_rules = <function 9>,
          init = <function 10>
        },
        name = "rules"
      }, {
        conf = {
          p = 60
        },
        m = {
          call = <function 11>,
          filter_out_string = <function 12>,
          filter_string = <function 13>,
          instring = <function 14>
        },
        name = "string"
      }, {
        conf = {
          filter = true,
          p = 70
        },
        m = {
          call = <function 15>
        },
        name = "escape"
      }, {
        conf = {
          nft = { "TelescopePrompt" },
          p = 80
        },
        m = {
          call = <function 16>
        },
        name = "filetype"
      }, {
        conf = {
          p = 90,
          types = { "/", "?", "@" }
        },
        m = {
          call = <function 17>
        },
        name = "cmdtype"
      } },
    fn = {
      check_end_pair = <function 18>,
      check_start_pair = <function 19>,
      find_end_pair = <function 20>,
      find_start_pair = <function 21>,
      in_pair = <function 22>,
      is_end = <function 23>,
      is_start = <function 24>
    },
    get_map = <function 25>,
    newline = <function 26>,
    p = 10,
    pair = '"',
    rule = <function 27>,
    sort = <function 28>,
    start_pair = '"'
  },
  mes = "...autopair.nvim/lua/ultimate-autopair/extensions/rules.lua:50: Unknown command regex"
}

[help] how to config ultimate-autopair.nvim for my special use case in lisp file

First of all, thank you for this great plugin for neovim, It't the best autopair plugin that I have used. This issue is more about help than issue.

what I meet

As a fennel man, I use parinfer-rust as my auto-pairs plugin in all lisp buffer, it solves all things related to bracket balancing but quotation marks. So, the problem is there is little confilicts between ulitmate-autopair.nvim and parinfer-rust. For example:

  1. this is a fennel buffer
    image
  2. than I input enter
    image
    that because parinfer-rust auto balance bracket and break autopairs' cr function

several solutions

  1. Disable all bracket related function only in lisp buffer(and I would like to keep the quoted functions), but I don't know how to do it. Maybe let cr enable can be a function and I can add some logic in it
  2. Or provider a buffer level configuration and I can call it in filetype autocmd.

Curious about commit messages

Hi,

I've been using ultimate-autopair and it's working great for me. I like to follow the work by reading commit messages but it's very hard the way It's done in this project. The commit message is just the files which were changed I believe? Is it not hard even for you to go back and see what's been done?

Insert comma after pair

I just discovered this plugin and it's been working great so far! One thing that I have always wanted, which I didn't have in nvim-autopairs either, is the ability to insert a character after an autocompleted pair. One example is when adding a new nested item to a lua table:

{
   {*} -- <-- After typing { I would like to be able to add a comma after the automatically added }
   { "altermo/ultimate-autopair.nvim", opts = {} },
},

In the example above I could use fastwarp and type {,<A-e> which would move the } to the left of the comma, but it would be nice if I could just type {, and it would result in {}, with the cursor inside the braces.

deprecation warning in nightly

image

In nightly there is a deprecation warning about get_node() func. so please add a line where it checks for neovim version 0.8 or 0.9.
Thank you

Error with latest update

I know this is alpha and somewhat of a moving target so figured I'd post this new error:

Screenshot_2023-05-20_11-56-49

Here's my config

return {
  {
    'altermo/ultimate-autopair.nvim',
    enabled = true,
    event = { 'InsertEnter', 'CmdlineEnter' },
    config = function()
      require('ultimate-autopair').setup({
        -- Disable autopair in the command line: https://github.com/altermo/ultimate-autopair.nvim/issues/8
        cmap = false,
        -- Get Fly Mode working on strings: https://github.com/altermo/ultimate-autopair.nvim/issues/17
        extensions = {
          { 'cmdtype',  { '/', '?', '@' } },
          'multichar',
          'string',
          { 'treenode', { inside = { 'comment' } } },
          { 'escape',   { filter = true } },
          'rules',
          'filetype',
          { 'alpha',   { before = { "'" } } },
          { 'suround', { '"', "'" } },
          { 'fly',     { ')', '}', ']', ' ', "'", '"', nofilter = true } },
        },
      })
    end
  },
}

Cancel Fly mode

Hello
Is there a way to undo/cancel a fly in fly mode?
auto-pairs's fly mode has an <M-b> mapping to back-insert the character skipped by fly mode where it was typed, effectively undoing the fly like if it wasn't enabled.
Can this be done with this plugin?
Thanks

Rule from #31 not working with markdown files

I suspect this is related to the enhancement provided in #31 where the plugin is configured to avoid autopairing in comments.

How to reproduce:

  1. Add rule mentioned above.
  2. Open a new .md file
  3. Attempt to add a valid Markdown header like ##Something
...e/windowsrefund/.config/nvim/lua/plugins/ultimate-autopair.lua:27: attempt to index a nil value
stack traceback:
	...y/ultimate-autopair.nvim/lua/ultimate-autopair/debug.lua:104: in function '__index'
	...e/windowsrefund/.config/nvim/lua/plugins/ultimate-autopair.lua:27: in function 'check_rule'
	...autopair.nvim/lua/ultimate-autopair/extensions/rules.lua:54: in function 'check_rules'
	...autopair.nvim/lua/ultimate-autopair/extensions/rules.lua:73: in function <...autopair.nvim/lua/ultimate-autopair/extensions/rules.lua:69>
	[C]: in function 'xpcall'
	...y/ultimate-autopair.nvim/lua/ultimate-autopair/debug.lua:121: in function <...y/ultimate-autopair.nvim/lua/ultimate-autopair/debug.lua:120>
	...zy/ultimate-autopair.nvim/lua/ultimate-autopair/core.lua:40: in function <...zy/ultimate-autopair.nvim/lua/ultimate-autopair/core.lua:32>

Curious to hear your thoughts and/or answer any questions.

How to disable plugin for a particular filetype?

I looked through the docs but couldn't find this. I want to disable all pairs for some filetypes, for example TelescopePrompt.

Looking at the code it seems this should work, but it doesn't for me:

require("ultimate-autopair").setup {
  default_pairs = {
    ft = {
      TelescopePrompt = { disable = true },
    },
  },
}

It might also be handy to be able to supply a function that returns a bool which enables or disables the plugin. That would make it easier to do more complex logic with buftypes/filetypes and other factors.

Example configuration throws errors

The default configuration doesn't declare M so these don't work:

_default_beg_filter=M.default_beg_filter,
_default_end_filter=M.default_end_filter,

Revisit the request for a toggle

Hello,

Can I ask for #30 to be revisited as an actual toggle would be far more practical. As it stands now, it feels like some amount of code would need to be written in order to determine what to set (true or false). So the real utility of this functionality would come in the form of :UAToggle or require('ultimate-autopair.core').toggle(). If a toggle were made available, one would be able to assign it to a single keymap in order to easily change state.

Deprecated: `vim.treesitter.get_node_at_pos()` and `vim.treesitter.get_node_at_cursor()`

Last neovim commit at master. First time runs this plugin raises this message:

vim.treesitter.get_node_at_pos() is deprecated, use vim.treesitter.get_node() instead. See :h deprecated
This function will be removed in Nvim version 0.10
stack traceback:
        /usr/local/share/nvim/runtime/lua/vim/treesitter.lua:355: in function </usr/local/share/nvim/runtime/lua/vim/treesitter.lua:354>
        [C]: in function 'pcall'
        ...-autopair.nvim/lua/ultimate-autopair/utils/info_line.lua:53: in function 'check_rule'
        ...autopair.nvim/lua/ultimate_autopair_extensions/rules.lua:20: in function 'check_rule'
        ...autopair.nvim/lua/ultimate_autopair_extensions/rules.lua:54: in function 'check_rules'
        ...pair.nvim/lua/ultimate_autopair_extensions/multichar.lua:11: in function 'call'
        ...ultimate-autopair.nvim/lua/ultimate-autopair/creater.lua:8: in function <...ultimate-autopair.nvim/lua/ultimate-autopair/creater.lua:4>

[Feature Request] Don't add backtick in Lisps

In some Lisp languages, ` is used for quasiquoting a list, kind of like '. Having ` not auto-close in Lisp languages makes sense IMO.

{ -- internal_pairs
    "`", "`",
    multiline = false,
    cond = function(_fn)
        return not (vim.o.lisp or vim.o.ft ~= "tex")
    end,
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.