Coder Social home page Coder Social logo

Comments (14)

sorachii avatar sorachii commented on June 16, 2024 2

I appreciate your answer.

I see it handles tones but I was thinking it could be nice to use love, rose,
gold, iris mainly for the Dawn theme and colder tones like pine, foam, iris for
Regular and Moon themes.

I am continuing with the tone shifting approach for now, just wanted to share
this idea.

from neovim.

mvllow avatar mvllow commented on June 16, 2024 1

Sure thing, you should only need to modify ./lua/rose-pine/theme.lua. If you look at lines 125-130 (at the time of writing) there are some html groups, eg. htmlTag = { fg = p.subtle },. You could add your markdown highlight groups under those with a similar format.

To find highlight groups to add, open a markdown file in neovim and do :highlight markdown<Tab> (tab completing through all available options). You could then do :highlight markdownBold guifg=#fa8072 to see bold text in a markdown file turn salmon coloured.

Next, add the group to that theme.lua file mentioned above, using whatever colours you want in the Rosé Pine palette. For example:

  ...
  htmlTagName = { fg = p.foam },

  -- This would be your new line
  markdownBold = { fg = p.iris },

  DiagnosticHint = { fg = groups.hint },
  ...

Finally, if you want to test locally, update your plugin config to point to your local version of the theme. Using packer:

-- use('rose-pine/neovim')
use('~/dev/local-theme')

A bit much, so please feel free to reach out with any questions. Hope this helps 😌

from neovim.

mvllow avatar mvllow commented on June 16, 2024 1

I would take a look at some other themes. For example, tokyonight.nvim has the following:

    htmlH1 = { fg = c.magenta, style = "bold" },
    htmlH2 = { fg = c.blue, style = "bold" },

    -- mkdHeading = { fg = c.orange, style = "bold" },
    -- mkdCode = { bg = c.terminal_black, fg = c.fg },
    mkdCodeDelimiter = { bg = c.terminal_black, fg = c.fg },
    mkdCodeStart = { fg = c.teal, style = "bold" },
    mkdCodeEnd = { fg = c.teal, style = "bold" },
    -- mkdLink = { fg = c.blue, style = "underline" },

    markdownHeadingDelimiter = { fg = c.orange, style = "bold" },
    markdownCode = { fg = c.teal },
    markdownCodeBlock = { fg = c.teal },
    markdownH1 = { fg = c.magenta, style = "bold" },
    markdownH2 = { fg = c.blue, style = "bold" },
    markdownLinkText = { fg = c.blue, style = "underline" },

I think it should be enough to try :hi markdown<Tab>, :hi mkd<Tab> and :hi html<Tab> to see available groups. I wish there was a guide with more exact information, every theme seems to be different.

from neovim.

mvllow avatar mvllow commented on June 16, 2024 1

That should be handled for you by using p.foam for example in your theme. So testing locally mkdListItemLine = { fg = p.foam } would be similar to :hi mkdListItemLine guifg=#9ccfd8 for Rosé Pine and :hi mkdListItemLine guifg=#56949f for Rosé Pine Dawn. Hope that makes sense 😌

Edit: this would be a good time to add your local fork to your plugins:

require('packer').startup(function(use)
	use({
		'~/path/to-your-fork',
		config = function()
			vim.cmd('colorscheme rose-pine')
		end,
	})
end

If using packer, this may require a :PackerCompile every time you update a colour in theme.lua.

from neovim.

sorachii avatar sorachii commented on June 16, 2024

Hi!

I came across that markdown files are not exactly covered for some reason. I'll attach screenshot tomorrow. What can I do if I'd like to help improve on this?

Best regards

from neovim.

mvllow avatar mvllow commented on June 16, 2024

Any additions are welcome and appreciated. If you have questions on how to add something let us know; as far as what to add, that’s up to you and your judgement 😌

We generally want to avoid non-neutral colours for large blocks of text (eg. markdown paragraphs) but headings, links etc. are all open to be added/changed.

from neovim.

sorachii avatar sorachii commented on June 16, 2024

It would be my first neovim theme contribution. I am interested in working on it. Is there any good resource you'd suggest before starting? I am quite busy so it might take me some time to implement it.

from neovim.

sorachii avatar sorachii commented on June 16, 2024

Wow. I was not expecting this detailed instructions. I really appreciate it! I am sure this puts me on the right track. 😊

from neovim.

sorachii avatar sorachii commented on June 16, 2024

Hi @mvllow!

Tried fidgeting with the markdown highlight groups but for some reason it wont use what I set either on the :nvim command line nor what I set in ~/git/rose-pine-markdown-fork/lua/rose-pine/theme.lua.

On the following theme, gruvbox-material, I can see that nvim uses the highlightgroups I would like to set but when I set it, it won't work.

2021-11-07 14_24_22-gruvbox-material-markdown

Here you can see nvim with rose-pine on the left, just installed vim without config on the right. When I set highlight colors on regular vim like you showed, it works but not on nvim.
2021-11-07 14_42_37-markdown-highlights-nvim-vim

I am on v0.6.0-dev+518-g1dbbaf89b build.
Here are the highlight changes I tested and would be cool if I can see them work so I can conftinue with more highlights.
Do you have any tips on why it is not working?

from neovim.

sorachii avatar sorachii commented on June 16, 2024

Found the issue. For some reason the highlight group in nvim for markdown headers is not markdownH1, instead htmlH1. I'll continue the work. :)

from neovim.

sorachii avatar sorachii commented on June 16, 2024

What is a good way to figure out what highlight groups are I am looking for apart from trying out a bunch, then stumbling upon the ones I am looking for?

from neovim.

sorachii avatar sorachii commented on June 16, 2024

I think I found a cool solution to get highlight group from under the cursor.
nvim-treesitter/playground

from neovim.

sorachii avatar sorachii commented on June 16, 2024

What should I do in order to separate the syntax group of dark/light bg or Regular/Dawn/Night themes?
The same highlight group colors doesn't play well with dark and light themes:

2021-11-07 21_06_19-light-bad
2021-11-07 21_09_26-dark-good

We could separate the highlight groups by rose-pine variant or background light/dark just like the palette in lua/rose-pine/palette.lua. There might be better solution, that is why I am asking you. :)

from neovim.

mvllow avatar mvllow commented on June 16, 2024

I would say let's stick to same colours for each variant now but I like your idea of having a tailored experience per variant. May revisit in the future – will need to refactor our other syntax themes to match.

from neovim.

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.