Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share your custom highlights #31

Closed
olimorris opened this issue Mar 6, 2022 · 7 comments
Closed

Share your custom highlights #31

olimorris opened this issue Mar 6, 2022 · 7 comments
Labels
tips Useful tip for other users

Comments

@olimorris
Copy link
Owner

olimorris commented Mar 6, 2022

Telescope

I thought I'd begin by sharing how I have Telescope formatted:

Screenshots

Screen Shot 2023-01-17 at 18 15 15@2x

Screen Shot 2023-01-17 at 18 15 39@2x

Highlights

colors = {
  dark = {
    telescope_prompt = "require('onedarkpro.helpers').darken('bg', 1, 'onedark')",
    telescope_results = "require('onedarkpro.helpers').darken('bg', 4, 'onedark')",
    telescope_preview = "require('onedarkpro.helpers').darken('bg', 6, 'onedark')",
    telescope_selection = "require('onedarkpro.helpers').darken('bg', 8, 'onedark')",
  },
  light = {
    telescope_prompt = "require('onedarkpro.helpers').darken('bg', 2, 'onelight')",
    telescope_results = "require('onedarkpro.helpers').darken('bg', 5, 'onelight')",
    telescope_preview = "require('onedarkpro.helpers').darken('bg', 7, 'onelight')",
    telescope_selection = "require('onedarkpro.helpers').darken('bg', 9, 'onelight')",
  },
},
highlights = {
  TelescopeBorder = {
    fg = "${telescope_results}",
    bg = "${telescope_results}",
  },
  TelescopePromptBorder = {
    fg = "${telescope_prompt}",
    bg = "${telescope_prompt}",
  },
  TelescopePromptCounter = { fg = "${fg}" },
  TelescopePromptNormal = { fg = "${fg}", bg = "${telescope_prompt}" },
  TelescopePromptPrefix = {
    fg = "${purple}",
    bg = "${telescope_prompt}",
  },
  TelescopePromptTitle = {
    fg = "${telescope_prompt}",
    bg = "${purple}",
  },
  TelescopePreviewTitle = {
    fg = "${telescope_results}",
    bg = "${green}",
  },
  TelescopeResultsTitle = {
    fg = "${telescope_results}",
    bg = "${telescope_results}",
  },
  TelescopeMatching = { fg = "${blue}" },
  TelescopeNormal = { bg = "${telescope_results}" },
  TelescopeSelection = { bg = "${telescope_selection}" },
  TelescopePreviewNormal = { bg = "${telescope_preview}" },
  TelescopePreviewBorder = { fg = "${telescope_preview}", bg = "${telescope_preview}" },
}

Note: The config for Telescope itself was taken from the awesome NvChad!

@olimorris olimorris added the tips Useful tip for other users label Mar 6, 2022
@olimorris olimorris pinned this issue Mar 6, 2022
@mrjones2014
Copy link
Contributor

mrjones2014 commented Aug 15, 2022

Similar setup with some tweaked colors

image

local onedarkpro = require('onedarkpro')
local utils = require('onedarkpro.utils')
local gray = utils.lighten('#000000', 0.1, '#1b1b1b')
onedarkpro.setup({
  dark_theme = 'onedark_vivid',
  colors = {
    bg = '#000000',
    color_column = gray,
    telescope_prompt = utils.lighten('#000000', 0.01, '#101010'),
    telescope_results = '#000000',
  },
  hlgroups = {
    LineNr = gray,
    SignColumn = gray,
    Search = {
      fg = '${black}',
      bg = '${highlight}',
    },
    TelescopeBorder = {
      fg = '${telescope_results}',
      bg = '${telescope_results}',
    },
    TelescopePromptBorder = {
      fg = '${telescope_prompt}',
      bg = '${telescope_prompt}',
    },
    TelescopePromptCounter = { fg = '${fg}' },
    TelescopePromptNormal = { fg = '${fg}', bg = '${telescope_prompt}' },
    TelescopePromptPrefix = {
      fg = '${green}',
      bg = '${telescope_prompt}',
    },
    TelescopePromptTitle = {
      fg = '${telescope_prompt}',
      bg = '${green}',
    },

    TelescopePreviewTitle = {
      fg = '${telescope_results}',
      bg = '${green}',
    },
    TelescopeResultsTitle = {
      fg = '${telescope_results}',
      bg = '${telescope_results}',
    },

    TelescopeMatching = { fg = '${green}' },
    TelescopeNormal = { bg = '${telescope_results}' },
    TelescopeSelection = { bg = '${telescope_prompt}' },
  },
  plugins = {
    all = true,
  },
  options = {
    bold = true,
    italic = true,
    undercurl = true,
    window_unfocussed_color = true,
  },
  styles = {
    comments = 'italic',
    keywords = 'italic',
  },
})
vim.cmd('colorscheme onedarkpro')

@mmirus
Copy link
Contributor

mmirus commented Oct 14, 2022

Had occasion to pop open some PHP code for the first time in a while, and thought I'd see how the theme compares to vscode. As it turns out, it's really close!

Here are a handful of changes I've made so far to match vscode more closely:

    -- PHP
    ["@method.php"] = { fg = "${blue}", style = "bold" },
    ["@method.call.php"] = { link = "@method.php" },
    ["@function.builtin.php"] = { fg = "${cyan}" },
    ["@keyword.php"] = { fg = "${purple}", style = "NONE" },
    ["@keyword.return.php"] = { link = "@keyword.php" },
    ["@namespace.php"] = { fg = "${yellow}", style = "bold" },

@olimorris
Copy link
Owner Author

Had occasion to pop open some PHP code for the first time in a while, and thought I'd see how the theme compares to vscode. As it turns out, it's really close!

Here are a handful of changes I've made so far to match vscode more closely:

    -- PHP

    ["@method.php"] = { fg = "${blue}", style = "bold" },

    ["@method.call.php"] = { link = "@method.php" },

    ["@function.builtin.php"] = { fg = "${cyan}" },

    ["@keyword.php"] = { fg = "${purple}", style = "NONE" },

    ["@keyword.return.php"] = { link = "@keyword.php" },

    ["@namespace.php"] = { fg = "${yellow}", style = "bold" },


Amazing! Would you consider a pr to add PHP support?

@mmirus
Copy link
Contributor

mmirus commented Oct 15, 2022

Sure thing! See #118.

@tristan957
Copy link
Contributor

tristan957 commented Oct 21, 2022

I will probably come with some Meson fixes at some point, and I have it on my list to look at C. I know you got the structure of the code from nightfox or whatever, but this is really easy to do custom highlighting!

@nickp-real
Copy link
Contributor

since you change the highlight configuration, can you update the highlight value?

@olimorris
Copy link
Owner Author

@nickp-real - I've updated my Telescope post for the new theme API

asyncedd added a commit to asyncedd/dots.nvim that referenced this issue May 31, 2023
Repository owner deleted a comment from smit2909 Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tips Useful tip for other users
Projects
None yet
Development

No branches or pull requests

5 participants