Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/folke/styler.nvim
Simple Neovim plugin to set a different colorscheme per filetype.
https://github.com/folke/styler.nvim
neovim neovim-colorscheme neovim-plugin
Last synced: 4 days ago
JSON representation
Simple Neovim plugin to set a different colorscheme per filetype.
- Host: GitHub
- URL: https://github.com/folke/styler.nvim
- Owner: folke
- License: apache-2.0
- Created: 2022-11-14T11:21:05.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-22T13:07:54.000Z (4 months ago)
- Last Synced: 2024-10-31T19:37:39.722Z (13 days ago)
- Topics: neovim, neovim-colorscheme, neovim-plugin
- Language: Lua
- Homepage:
- Size: 63.5 KB
- Stars: 285
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 🎨 Styler
Simple Neovim plugin to set a different `colorscheme` per filetype.
![image](https://user-images.githubusercontent.com/292349/201969839-b6c2e18d-4313-4fed-b020-5c7ebbce667b.png)
## ⚡️ 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:
```lua
-- 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:```vim
:Styler tokyonight-storm
```To programmatically set the colorscheme for a certain window, you can use:
```lua
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.