2024-05-21 17:26:29 +02:00
2024-05-20 23:29:17 +02:00
2024-05-20 22:28:49 +00:00
2024-05-21 17:26:29 +02:00
2024-05-20 23:41:02 +02:00
2024-05-20 23:24:59 +02:00
2024-05-21 17:26:29 +02:00
2024-05-20 23:02:42 +02:00
2024-05-20 23:02:42 +02:00
2024-05-20 23:02:42 +02:00

🚀 ts-comments.nvim

Tiny plugin to enhance Neovim's native comments:

  • Easily override the comment string for a given treesitter language
  • Supports different comment strings for different treesitter node types

Requirements

  • Neovim >= 0.10.0

📦 Installation

Using lazy.nvim:

{
  "folke/ts-comments.nvim",
  opts = {},
  event = "VeryLazy",
  enabled = vim.fn.has("nvim-0.10.0") == 1,
}

⚙️ Configuration

Default configuration:

{
  lang = {
    astro = "<!-- %s -->",
    c = "// %s",
    cpp = "// %s",
    css = "/* %s */",
    c_sharp = "// %s",
    gleam = "// %s",
    glimmer = "{{! %s }}",
    graphql = "# %s",
    handlebars = "{{! %s }}",
    hcl = "# %s",
    html = "<!-- %s -->",
    ini = "; %s",
    php = "// %s",
    rego = "# %s",
    rescript = "// %s",
    sql = "-- %s",
    svelte = "<!-- %s -->",
    terraform = "# %s",
    tsx = {
      _ = "// %s",
      call_expression = "// %s",
      comment = "// %s",
      jsx_attribute = "// %s",
      jsx_element = "{/* %s */}",
      jsx_fragment = "{/* %s */}",
      spread_element = "// %s",
      statement_block = "// %s",
    },
    javascript = {
      _ = "// %s",
      call_expression = "// %s",
      comment = "// %s",
      jsx_attribute = "// %s",
      jsx_element = "{/* %s */}",
      jsx_fragment = "{/* %s */}",
      spread_element = "// %s",
      statement_block = "// %s",
    },
    twig = "{# %s #}",
    typescript = "// %s",
    vim = '" %s',
    vue = "<!-- %s -->",
  },
}

Description
Tiny plugin to enhance Neovim's native comments
Readme Apache-2.0 89 KiB
Languages
Lua 100%