SCNVim - A NeoVim frontend for SuperCollider

Is this wanted behaviour?

The negative numbers have a different color compared to positive numbers:

image

Can someone reproduce this?

not seeing it here:
image

maybe update TreeSitter grammar?

1 Like

You mean the SC treesitter from here? GitHub - madskjeldgaard/tree-sitter-supercollider: SuperCollider grammar for the tree-sitter code parser

I’m not using it currently.

Edit: I had the treesitter installed, but Supercollider was commented out.

Now it looks like this

image

Thanks!

1 Like

I am struggling to get nvim-treesitter syntax highlighting to work. Don’t quite know where to go identify the issue.

I’ve been using SCNvim successfully using LazyVim package manager for a while. I recently updated NVim to 0.11.5 to keep up with lazy, and however I handled these updates seemed to have broken treesitter syntax highlighting. Everything else in my setup is working fine, (I think). SCNvim does, at least.

Unless I misunderstand (entirely a possibility-- lua and nvim plugins aren’t clicking for me on a systematic level at all), nvim-treesitter is packaged up with lazyvim, and all one has to do to implement syntax highlighting is :TSInstall supercollider. Well, I’ve done this, and no dice. :checkhealth reveals no clues-- supercollider is listed as an install language.

image

Do I need to include anything in my lua/plugins/ directory?

highlighting needs to be enabled - you can do this inside your lazy setup or in an external file (and have your lazy treesitter require it) eg.

require("nvim-treesitter.configs").setup {
  -- ensure_installed = {"supercollider", "rust", "html", "javascript"},
  highlight = {
    enable = true,
  },
.--other settings here --
}

head on over to GitHub - nvim-treesitter/nvim-treesitter: Nvim Treesitter configurations and abstraction layer

and scroll down to Modules in the Quickstart section for a complete explanation

I have this treesitter.lua in my plugin folder:

return {
  'nvim-treesitter/nvim-treesitter',
  config = function()
    require('nvim-treesitter.configs').setup {
      ensure_installed = {
        'c',
        'cpp',
        'c_sharp',
        'zig',
        'lua',
        'html',
        'javascript',
        'css',
        'scss',
        'tsx',
        'typescript',
        'json',
        'yaml',
        'fennel',
        'dockerfile',
        'query',
        'cmake',
        'gdscript',
        'markdown',
        'vimdoc',
        'supercollider',
      },
      -- indent = {
      --   enable = true,
      -- },
      highlight = {
        enable = true,
        disable = {},
      },
      incremental_selection = {
        enable = true,
        keymaps = {
          init_selection = '<Enter>',
          node_incremental = '<Enter>',
          node_decremental = '<BS>',
        },
      },
      textobjects = {
        select = {
          enable = true,
          keymaps = {
            -- You can use the capture groups defined in textobjects.scm
            ['af'] = '@function.outer',
            ['if'] = '@function.inner',
            ['ac'] = '@class.outer',
            ['ic'] = '@class.inner',
          },
        },
        move = {
          enable = true,
          set_jumps = true, -- whether to set jumps in the jumplist
          goto_next_start = {
            [']m'] = '@function.outer',
            [']]'] = '@class.outer',
          },
          goto_next_end = {
            [']M'] = '@function.outer',
            [']['] = '@class.outer',
          },
          goto_previous_start = {
            ['[m'] = '@function.outer',
            ['[['] = '@class.outer',
          },
          goto_previous_end = {
            ['[M'] = '@function.outer',
            ['[]'] = '@class.outer',
          },
        },
        swap = {
          enable = true,
          swap_next = {
            ['<leader>sw'] = '@parameter.inner',
          },
          swap_previous = {
            ['<leader>sW'] = '@parameter.inner',
          },
        },
      },
    }
  end,
}

β”œβ”€β”€ init.lua
β”œβ”€β”€ lazy-lock.json
└── lua
β”œβ”€β”€ config
β”‚ β”œβ”€β”€ autocmds.lua
β”‚ β”œβ”€β”€ globals.lua
β”‚ β”œβ”€β”€ keymaps.lua
β”‚ β”œβ”€β”€ lazy.lua
β”‚ └── options.lua
β”œβ”€β”€ plugins
β”‚ β”œβ”€β”€ blink-cmp.lua
β”‚ β”œβ”€β”€ blink-compat.lua
β”‚ β”œβ”€β”€ catppuccin.lua
β”‚ β”œβ”€β”€ fzf.lua
β”‚ β”œβ”€β”€ gruvbox.lua
β”‚ β”œβ”€β”€ lualine.lua
β”‚ β”œβ”€β”€ luasnip.lua
β”‚ β”œβ”€β”€ scnvim.lua
β”‚ └── treesitter.lua
β”œβ”€β”€ servers
└── utils

@Lilith93 @semiquaver. Thank you both. This treesitter.lua configuration works, for whatever reason, only when I require nvim-treesitter.config instead of nvim-treesitter.configs. The code warning suggests where I might go to investigate. but I’m satisfied for now.
image

Back in business :smiling_imp:
image
Now to try and implement lua snippets…

I returned to Dusty Phillips book on Nvim / LazyVim for reference. What a gem.