Git Product home page Git Product logo

Comments (6)

rmehri01 avatar rmehri01 commented on July 21, 2024

No problem, I'm glad you like it! I believe that is intentional due to them being different in tree sitter. In Lua they are constructors while in JavaScript they are delimiters:

-- Constructor calls and definitions: `{}` in Lua, and Java constructors.
TSConstructor = { fg = onenord.yellow },

-- Punctuation delimiters: Periods, commas, semicolons, etc.
TSPunctDelimiter = { fg = onenord.dark_blue },
-- Brackets, braces, parentheses, etc.
TSPunctBracket = { fg = onenord.dark_blue },
-- Special punctuation that doesn't fit into the previous categories.
TSPunctSpecial = { fg = onenord.dark_blue },

I think that you can override TSConstructor using vim's highlight but I could provide a more convenient way to do it in Lua as a part of the config options if you think that would be helpful!

from onenord.nvim.

rmehri01 avatar rmehri01 commented on July 21, 2024

I went ahead and added a way to overwrite any of the highlight groups so you can give it a try if you'd like:

local colors = require("onenord.colors")

require("onenord").setup({
  custom_highlights = {
    TSConstructor = { fg = colors.dark_blue },
  },
})

from onenord.nvim.

zeitchef avatar zeitchef commented on July 21, 2024

Thanks for the quick response @rmehri01 - unfortunately, this is still not overwriting TSConstructor for me.

  use {
    'rmehri01/onenord.nvim',
    setup = function()
      local colors = require 'onenord.colors'

      require('onenord').setup {
        custom_highlights = {
          TSConstructor = { fg = colors.dark_blue },
        },
      }
    end,
  }

Have I just overlooked something?

EDIT: Sorry, I think this is a problem on my end with Packer.

from onenord.nvim.

rmehri01 avatar rmehri01 commented on July 21, 2024

Hey @zeitchef, I think you need to use config = rather than setup =. When I try it, setup = doesn't work since it runs before the plugin is loaded. I'm not sure if setup = is supposed to work or not but from what I've seen from other plugins, they seem to use config = but correct me if I'm wrong! This works for me:

use {
  "rmehri01/onenord.nvim",
  config = function()
    local colors = require("onenord.colors")

    require("onenord").setup({
      custom_highlights = {
        TSConstructor = { fg = colors.dark_blue },
      },
    })
  end,
}

from onenord.nvim.

zeitchef avatar zeitchef commented on July 21, 2024

Thanks @rmehri01 - you're right, of course. Unfortunately, this somehow doesn't work for my setup. The only way I got it to work was to manually override the highlight:

vim.highlight.create('TSConstructor', { guifg = onenord.dark_blue }, false)

from onenord.nvim.

rmehri01 avatar rmehri01 commented on July 21, 2024

Hmm, I see. If you're okay with that then great but otherwise let me know if I can do anything else and I could give it a shot!

from onenord.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.