rainbow_csv.nvim icon indicating copy to clipboard operation
rainbow_csv.nvim copied to clipboard

Doesn't color a csv file.

Open vinoff opened this issue 2 years ago • 7 comments

I am using this plugin for the "rainbow" part of it. I want each CSV entry to be a different color. This is not happening.

I am using this test file:


Name,Age,Occupation
John Doe,28,Data Scientist
Jane Doe,34,Software Engineer
Max Mustermann,45,Project Manager
Erika Mustermann,32,UI/UX Designer

I am using latest version of NVim. It installed properly and I am able to use RainbowDelim and such. However, no rainbow. Is there anything I need to do to CSVs colored?

vinoff avatar Mar 05 '24 09:03 vinoff

I'm not having highlighting issues opening that file using a minimal init.lua.

Any chance you're using nvim-treesitter's highlight module? If so, you'll want to turn it off for CSV filetypes using one of the methods described in #13.

cameron-wags avatar Mar 06 '24 00:03 cameron-wags

I am having the same issue, i was indeed using treesitter highlight but i have disabled it for csv files and now i get no colouration at all.

It appears as if the plugin isn't starting at all as i don't get access to the plugins :commands

indeedhat avatar Mar 11 '24 09:03 indeedhat

@indeedhat Could I see the parts of your config related to this plugin? Sounds like the plugin truly isn't loading for you.

I'm not having issues using this init.lua on nvim nightly:

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({
        {
            'cameron-wags/rainbow_csv.nvim',
            config = true,
            ft = {
                'csv',
                'tsv',
                'csv_semicolon',
                'csv_whitespace',
                'csv_pipe',
                'rfc_csv',
                'rfc_semicolon'
            },
            cmd = {
                'RainbowDelim',
                'RainbowDelimSimple',
                'RainbowDelimQuoted',
                'RainbowMultiDelim'
            },
        },
}, {})

@vinoff Still having the issue? If so, I'd like to see the config that's causing this.

cameron-wags avatar Mar 11 '24 13:03 cameron-wags

Yeah that is what i was thinking too.

Im using packer and this is the relevent part of the config. I have tried with the lazy stuff commented out and enabled.

    use {
        'cameron-wags/rainbow_csv.nvim',
        config = function()
            require 'rainbow_csv'.setup()
        end,
        -- -- optional lazy-loading below
        -- module = {
        --     'rainbow_csv',
        --     'rainbow_csv.fns'
        -- },
        -- ft = {
        --     'csv',
        --     'tsv',
        --     'csv_semicolon',
        --     'csv_whitespace',
        --     'csv_pipe',
        --     'rfc_csv',
        --     'rfc_semicolon'
        -- }
    }

Ill try running it with a bare minimum config using packer and see what happens.

indeedhat avatar Mar 11 '24 14:03 indeedhat

it works with your lazy config but not a bare bones packer one.

TBH now that its no longer maintained ive been meaning to swap to something else, maybe this should be my push.

indeedhat avatar Mar 11 '24 14:03 indeedhat

I ended switching to lazy.nvim last night and it works fine with the rest of my config so the issue (at least for me) seems to be related to packer

indeedhat avatar Mar 12 '24 11:03 indeedhat

In my case, the problem was that nvim-treesitter had the auto_install = true parameter, which automatically installed the csv language. This created a conflict with the rainbow plugin.

To check if the csv language is installed, use the :TSModuleInfo command.

To fix this:

  • Remove the csv language with the :TSUninstall csv command.
  • Choose one of the following options:
    • Disable automatic language installation: Set auto_install = false in your treesitter configuration.
    • Exclude the csv language from automatic installation: Add ignore_install = { 'csv' } to your treesitter configuration.

makirill avatar Jan 26 '25 04:01 makirill