Skip to content

Simple Neovim plugin to set a different colorscheme per filetype.

License

Notifications You must be signed in to change notification settings

arikheinss/styler.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎨 Styler

Simple Neovim plugin to set a different colorscheme per filetype.

image

⚡️ Requirements

  • Neovim >= 0.8.0
  • Styler only works with colorschemes that set highlights using vim.api.nvim_set_hl

📦 Installation

Install the plugin with your preferred package manager:

-- Packer
use({
  "folke/styler.nvim",
  config = function()
    require("styler").setup({
      themes = {
        markdown = { colorscheme = "gruvbox" },
        help = { colorscheme = "catppuccin-mocha", background = "dark" },
      },
    })
  end,
})

🚀 Usage

After setup, colorschemes will be automatically applied. To manually set a colorscheme for the current buffer, you can for example do:

:Styler tokyonight-storm

To programmatically set the colorscheme for a certain window, you can use:

require("styler").set_theme(0, {
  colorscheme = "elflord",
  background = "dark"
})

if you see flickering when a theme is loaded, that's because the colorscheme does :hi clear without checking if vim.g.colors_name is set. You should open an issue or a PR for the colorscheme to fix it.

About

Simple Neovim plugin to set a different colorscheme per filetype.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Lua 100.0%