Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

offer buffer-local and global runtime config #77

Open
matu3ba opened this issue May 17, 2023 · 5 comments
Open

offer buffer-local and global runtime config #77

matu3ba opened this issue May 17, 2023 · 5 comments

Comments

@matu3ba
Copy link

matu3ba commented May 17, 2023

Instead of having to use

  ensure_installed = { 'bash', 'c', 'cpp', 'julia', 'lua', 'python', 'rust', 'typescript', 'vim', 'vimdoc', 'zig' },
  auto_install = true,
  highlight = {
    enable = true,
    additional_vim_regex_highlighting = false,
    ..
    disable = { 'c', 'cpp', 'zig' },
  },
  incremental_selection = {
    enable = true,
    keymaps = {
      ..
      disable = { 'c', 'cpp', 'zig' }, -- slow, so opt-in
    },
  },
  indent = {
    enable = true,
    disable = { 'c', 'cpp', 'python', 'zig' }, -- broken
  },
}
require('iswap').setup {}

I would prefer

  ensure_installed = { 'bash', 'c', 'cpp', 'julia', 'lua', 'python', 'rust', 'typescript', 'vim', 'vimdoc', 'zig' },
  auto_install = true,
  highlight = {
    enable = true,
    additional_vim_regex_highlighting = false,
    ..
    disable = { 'c', 'cpp', 'zig' },
  },
  incremental_selection = {
    enable = true,
    keymaps = {
      ..
      disable = { 'c', 'cpp', 'zig' }, -- slow, so opt-in
    },
  },
  indent = {
    enable = true,
    disable = { 'c', 'cpp', 'python', 'zig' }, -- broken
  },
  iswap = {
    enable = true,
    disable = { 'c', 'cpp', 'zig' },
  },
}

Justification:
nvim gcc/c-family/c-common.cc from git://gcc.gnu.org/git/gcc.git freezes editor due to treesitter and generally one must be able to workaround not well written parsers via run-time opt-in until nvim-treesitter can handle those cases of treesitter misbehaving.
The user could hack around via checking file types, but that is a not good user experience.

@bew
Copy link

bew commented May 17, 2023

Note that the module system in nvim-treesitter will soon disappear, so it's not a good idea to try to integrate with it..

Ref: nvim-treesitter/nvim-treesitter#4767

@matu3ba matu3ba changed the title offer buffer-local runtime config xor nvim-treesitter.configs setup integration offer buffer-local and global runtime config ~~xor nvim-treesitter.configs setup integration~~ May 17, 2023
@matu3ba matu3ba changed the title offer buffer-local and global runtime config ~~xor nvim-treesitter.configs setup integration~~ offer buffer-local and global runtime config May 17, 2023
@matu3ba
Copy link
Author

matu3ba commented May 17, 2023

Thanks, I did adjust the issue.

@mizlan
Copy link
Owner

mizlan commented May 17, 2023 via email

@matu3ba
Copy link
Author

matu3ba commented May 17, 2023

I leave that to you as maintainer and code owner. ;-)

@mizlan
Copy link
Owner

mizlan commented May 17, 2023

what do you mean by buffer-local? You could have a filetype-specific autocommand, but I don't see how I could make my plugin buffer-local

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants