This is a slimmed down re-implementation of papercolor-theme that:
- Supports nvim-treesitter
- Has no abstraction, making color mapping super simple
- Targets gui options (
guifg
,guibg
,gui
) with truecolor support. If you're using a modern terminal (alacritty, iterm2, gnome terminal, etc), you probably have truecolor support. Runecho $COLORTERM
from your terminal. If it respondstruecolor
, you have truecolor support. NOTE: I'd be happy to add cterm support, if this interests you please submit a PR. - Limits highlight groups to: built-in, preferred, nvim-treesitter, and a couple non-standard overrides at the author's discretion. This results in consistent highlighting across languages, but may sacrifice highlighting granularity in some cases.
- Supports both
background=light
andbackground=dark
It targets Neovim's syntax groups, but it should technically work with regular Vim. The following screenshot shows the dark (default) and light variants operating on same Python file (from jedi-language-server). If you write another language, don't worry: PaperColorSlim supports them all!
If using vim-plug, place the following line in the Plugin section of your inti.vim / vimrc:
" ~/.vimrc
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.
Place the following in your ~/.vimrc
or your ~/.config/nvim/init.vim
:
colorscheme PaperColorSlim
If you prefer the light background:
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
You can configure virtually anything you want with Vim's native syntax highlighting tooling and autocmds. What follows are some common configuration customizations requested by users, along with their solution.
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
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
Notice how the light background is slightly different from the original while the dark background stays the same?
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.
Samuel Roeca [email protected]
Special thanks to Nikyle Nguyen and all their great work on papercolor-theme over the years!