Elixir support #221

Open
opened 2026-04-28 19:54:10 +00:00 by srcrip · 8 comments
srcrip commented 2026-04-28 19:54:10 +00:00

Prerequisites

Neovim version

NVIM v0.12.0-dev-934+ga9a4c271b1-Homebrew
Build type: Release
LuaJIT 2.1.1753364724
Run "nvim -V1 -v" for more info

Operating system

MacOS

Description

I seem to be unable to get fugitive highlighting to work with Elixir files, even though I do have the elixir TS files installed (I use it for highlighting generally).

Also note, in your repro script, you need to change the module name to just "lazy" not "lazy.nvim"

When I test the minimal repro script, and test out fugitive, I end up seeing TS highlighting in non-elixir files, but no TS highlighting in elixir files.

Steps to reproduce

  1. install fugitive
  2. install this plugin
  3. go to an elixir project
  4. open the fugitive status buffer and see if there is TS highlighting

Health check

==============================================================================
diffs:                                                                      ✅

diffs.nvim ~
- ✅ OK Neovim 0.9.0+ detected
- ✅ OK vim-fugitive detected
- libvscode_diff not found (optional, using native vim.diff fallback)

Minimal reproduction

vim.env.LAZY_STDPATH = '.repro'
load(vim.fn.system('curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua'))()
require('lazy').setup({
  spec = {
    { 'barrettruth/midnight.nvim', lazy = false, config = function() vim.cmd.colorscheme('midnight') end },
    { 'tpope/vim-fugitive' },
    { 'NeogitOrg/neogit', dependencies = { 'nvim-lua/plenary.nvim' } },
    { 'lewis6991/gitsigns.nvim', config = true },
    { 'rhysd/committia.vim' },
    { 'nvim-telescope/telescope.nvim', dependencies = { 'nvim-lua/plenary.nvim' } },
    {
      'barrettruth/diffs.nvim',
      init = function()
        vim.g.diffs = {
          debug = '/tmp/diffs.log',
          integrations = {
            fugitive = true,
            neogit = true,
            gitsigns = true,
            committia = true,
            telescope = true,
          },
        }
      end,
    },
  },
})
### Prerequisites - [x] I have searched [existing issues](https://github.com/barrettruth/diffs.nvim/issues) - [x] I have updated to the latest version ### Neovim version ```text NVIM v0.12.0-dev-934+ga9a4c271b1-Homebrew Build type: Release LuaJIT 2.1.1753364724 Run "nvim -V1 -v" for more info ``` ### Operating system MacOS ### Description I seem to be unable to get fugitive highlighting to work with Elixir files, even though I do have the elixir TS files installed (I use it for highlighting generally). Also note, in your repro script, you need to change the module name to just `"lazy"` not `"lazy.nvim"` When I test the minimal repro script, and test out fugitive, I end up seeing TS highlighting in non-elixir files, but no TS highlighting in elixir files. ### Steps to reproduce 1. install fugitive 2. install this plugin 3. go to an elixir project 4. open the fugitive status buffer and see if there is TS highlighting ### Health check ```text ============================================================================== diffs: ✅ diffs.nvim ~ - ✅ OK Neovim 0.9.0+ detected - ✅ OK vim-fugitive detected - libvscode_diff not found (optional, using native vim.diff fallback) ``` ### Minimal reproduction ```lua vim.env.LAZY_STDPATH = '.repro' load(vim.fn.system('curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua'))() require('lazy').setup({ spec = { { 'barrettruth/midnight.nvim', lazy = false, config = function() vim.cmd.colorscheme('midnight') end }, { 'tpope/vim-fugitive' }, { 'NeogitOrg/neogit', dependencies = { 'nvim-lua/plenary.nvim' } }, { 'lewis6991/gitsigns.nvim', config = true }, { 'rhysd/committia.vim' }, { 'nvim-telescope/telescope.nvim', dependencies = { 'nvim-lua/plenary.nvim' } }, { 'barrettruth/diffs.nvim', init = function() vim.g.diffs = { debug = '/tmp/diffs.log', integrations = { fugitive = true, neogit = true, gitsigns = true, committia = true, telescope = true, }, } end, }, }, }) ```
barrettruth commented 2026-04-28 20:11:40 +00:00

bruh, another problem with the repro script LMAO. sorry. looking into this now (repro + issue)

EDIT: repro script no longer uses lazy and works. gosh... i hate lazy. looking into the highlighting issue now.

bruh, another problem with the repro script LMAO. sorry. looking into this now (repro + issue) EDIT: repro script no longer uses lazy and works. gosh... i hate lazy. looking into the highlighting issue now.
barrettruth commented 2026-04-28 20:42:36 +00:00
Image

UPD: unable to reproduce with some sample code.

Please try with the up-to-date reproduction script. Apologies for the inconvenience.

Obligatory mention: please check your plugins, try with nvim --noplugin, etc.

<img width="501" height="512" alt="Image" src="https://github.com/user-attachments/assets/6ce64202-2da7-49f1-9a58-c81d94d80e52" /> UPD: unable to reproduce with some sample code. Please try with the up-to-date reproduction script. Apologies for the inconvenience. Obligatory mention: please check your plugins, try with `nvim --noplugin`, etc.
srcrip commented 2026-04-28 23:07:03 +00:00

Hmm that’s weird, yeah it didn’t look like that at all for me… but let me try the new version of the script and see if that’s the difference.

Hmm that’s weird, yeah it didn’t look like that at all for me… but let me try the new version of the script and see if that’s the difference.
srcrip commented 2026-04-28 23:07:47 +00:00

I will try that no plugin flag, I thought passing it the script disabled all my other startup files plugins but maybe it didn’t.

I will try that no plugin flag, I thought passing it the script disabled all my other startup files plugins but maybe it didn’t.
barrettruth commented 2026-04-28 23:26:35 +00:00

(it probably did - i was just being cautious)

BTW, if you want - link me your dotfiles. I can debug for you xd (or, do my best to)

(it probably did - i was just being cautious) BTW, if you want - link me your dotfiles. I can debug for you xd (or, do my best to)
srcrip commented 2026-04-30 15:15:01 +00:00

ok @barrettruth I tested with the new version of that script, and using --clean, which should disable all my plugins, and I can confirm that I don't seem to be getting any elixir highlighting in fugitive status buffer diffs. Just looks exactly identical to regular diff highlights.

I think you should be able to repro this the same way... just try cloneing an elixir library on github, change some files, then put your script in the repo and run it the same way, open fugitive, and you should be able to confirm that the highlighting isn't there

Just to be sure I also backed up and deleted my init.lua, and tested again, just in case --clean wasn't actually removing my startup stuff, and I can confirm it looked the same.

I am not really sure why it would work differently with elixir... maybe something to do with how the TS stuff is implemented for it? I have no idea.

ok @barrettruth I tested with the new version of that script, and using `--clean`, which should disable all my plugins, and I can confirm that I don't seem to be getting any elixir highlighting in fugitive status buffer diffs. Just looks exactly identical to regular diff highlights. I think you should be able to repro this the same way... just try cloneing an elixir library on github, change some files, then put your script in the repo and run it the same way, open fugitive, and you should be able to confirm that the highlighting isn't there Just to be sure I also backed up and deleted my init.lua, and tested again, just in case `--clean` wasn't actually removing my startup stuff, and I can confirm it looked the same. I am not really sure why it would work differently with elixir... maybe something to do with how the TS stuff is implemented for it? I have no idea.
srcrip commented 2026-04-30 15:17:38 +00:00

Is it possible that the startup script isn't using a colorscheme that has the proper highlights for me to see it properly when testing with it or something?

I could also try just going into my startup script and removing everything except for this plugin, fugitive, and treesitter stuff, but I'd think the repro script should be identical to that...

Only other thing I can think of if you can't repro it is some difference with my treesitter versions of vim versions or something?

Is it possible that the startup script isn't using a colorscheme that has the proper highlights for me to see it properly when testing with it or something? I could also try just going into my startup script and removing everything except for this plugin, fugitive, and treesitter stuff, but I'd think the repro script should be identical to that... Only other thing I can think of if you can't repro it is some difference with my treesitter versions of vim versions or something?
barrettruth commented 2026-04-30 20:02:24 +00:00

Super sorry that you ended up being the guinea-pig for this. I've updated the repro script to use the user's treesitter scripts in the environment in the repo for simplicity. Please try again.

Super sorry that you ended up being the guinea-pig for this. I've updated the repro script to use the user's treesitter scripts in the environment in the repo for simplicity. Please try again.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/diffs.nvim#221
No description provided.