papercolor-theme-slim
papercolor-theme-slim copied to clipboard
(Neo)Vim colorscheme that is pretty, slim, and performant
PaperColorSlim Colorscheme
This is a slimmed down, truecolor-focused re-implementation of papercolor-theme that:
- Supports nvim-treesitter and nvim lsp semantic highlights and for Neovim 0.8+.
- Has no abstraction, which simplifies user color mapping overrides.
- Targets
gui
options (guifg
,guibg
,gui
) with truecolor support. Runecho $COLORTERM
from your terminal. If it respondstruecolor
, you havetruecolor
support. - Limits highlight groups to: built-in groups, preferred groups, nvim-treesitter groups, and nvim lsp semantic highlights. This results in consistent highlighting across languages, but may sacrifice highlighting granularity in some cases.
- Supports both
background=light
andbackground=dark
.
NOTE: I'd be happy to add cterm
support. If this interests you, please submit a Pull Request.
It targets Neovim's syntax groups, but it should technically also work with Vim. The following screenshot shows the dark (default) and light variants operating on same Python file. If you write another language, don't worry: PaperColorSlim supports them all!
Installation
If using vim-plug:
Plug 'pappasam/papercolor-theme-slim'
Then run the Ex command:
:PlugInstall
I personally use vim-packager, so if you'd like to go down the "package" rabbit hole, I suggest giving that a try.
Dark and light
We use the dark variant by default:
colorscheme PaperColorSlim
The light variant can be used at start-up by setting background=light
before loading this colorscheme.
set background=light
colorscheme PaperColorSlim
You may change to the light/dark variant at any time by running :set background=light
or :set background=dark
Customization
You can configure virtually anything you want with Vim's native syntax highlighting tooling and autocmds
. What follows are some common configuration customization requests by users, along with their solution.
Transparent background
Some users want the background of their Vim to match their terminal's background color. To achieve this with PaperColorSlim, put the following code somewhere in your vimrc
:
augroup custom_papercolorslim_transparent_background
autocmd!
autocmd ColorScheme PaperColorSlim highlight Normal guibg=NONE
augroup end
Note: if your terminal background differs too much from #1c1c1c when using background=dark
, or #eeeeee when using background=light
, PaperColorSlim may not contrast well with your terminal's background. In this case, you will need to do one of the following:
- Use the PaperColorSlim-provided background colors (eg, don't put the above in your
vimrc
) - Perform further customization, tweaking
guifg
andguibg
colors where necessary - Use a different Vim
colorscheme
that better-supports your background preferences
Override color for only one &background type
Suppose, hypothetically, that you like the default guibg
color for &background == 'dark' but want to change the guibg
color for &background == 'light' to #fffff0. You can do this by adding the following snippet to your vimrc:
augroup custom_papercolorslim_light_background
autocmd!
autocmd ColorScheme PaperColorSlim
\ if &background == 'light' |
\ execute 'highlight Normal guibg=#fffff0' |
\ endif
augroup end
Modify highlight linking
Sometimes you want to change the group that a plugin's matched group is linked to. Although this colorscheme
doesn't handle that for you, it's trivial to do this linking yourself. Here are some examples from my vimrc for gitsigns and nvim-tree:
augroup custom_highlight_linking
autocmd!
autocmd ColorScheme PaperColorSlim
\ highlight link GitSignsAddNr DiffAdd |
\ highlight link GitSignsChangeNr DiffChange |
\ highlight link GitSignsDeleteNr DiffDelete |
\ highlight link GitSignsDeleteNr DiffDelete |
\ highlight link NvimTreeExecFile PreProc |
\ highlight link NvimTreeImageFile NONE |
\ highlight link NvimTreeSpecialFile NONE |
\ highlight link NvimTreeSymlink NONE
augroup end
Development
If you want to contribute and assuming you use Neovim, I suggest installing and using nvim-colorizer. It will let you see the colors associated with the hex codes, greatly simplifying development.
Credits
Special thanks to Nikyle Nguyen and all their great work on papercolor-theme over the years!