Skip to content

offer buffer-local and global runtime config #77

@matu3ba

Description

@matu3ba

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions