Coder Social home page Coder Social logo

papercolor-theme-slim's Introduction

PaperColorSlim Colorscheme

This is a slimmed down re-implementation of papercolor-theme that:

  1. Supports nvim-treesitter
  2. Has no abstraction, making color mapping super simple
  3. 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. Run echo $COLORTERM from your terminal. If it responds truecolor, you have truecolor support. NOTE: I'd be happy to add cterm support, if this interests you please submit a PR.
  4. 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.
  5. Supports both background=light and background=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!

screenshot

Installation

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.

Configuration

Place the following in your ~/.vimrc or your ~/.config/nvim/init.vim:

Dark variant

colorscheme PaperColorSlim

Light variant

If you prefer the light background:

set background=light
colorscheme PaperColorSlim

Notes

  • 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 customizations requested 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:

  1. Use the PaperColorSlim-provided background colors (eg, don't put the above in your vimrc)
  2. Perform further customization, tweaking guifg and guibg colors where necessary
  3. 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

Notice how the light background is slightly different from the original while the dark background stays the same?

screenshot override

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.

Written by

Samuel Roeca [email protected]

Special thanks to Nikyle Nguyen and all their great work on papercolor-theme over the years!

papercolor-theme-slim's People

Contributors

pappasam avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.