Skip to content

rose-pine/pygments

Repository files navigation

Rose Piné for Pygments

All natural pine, faux fur and a bit of soho vibes for the classy minimalist

Python versions GitHub Workflow Status (with event) Codecov License Latest release Any color you like

Requirements

This package has been tested on Python versions 3.9, 3.10, 3.11 with Python 3.9 being the minimum required.

Installation

The pygments-rose-pine package is not currently published to PyPI. If, however, you still wish to install this package, the following steps should work to install the latest release.

repo="https://github.com/rose-pine/pygments"

# Find the latest release.
latest=$(git ls-remote --tags --refs $repo | # Fetch remote tags.
                 sort -t '/' -k 3 -V |       # Sort them by version.
                 tail -n 1 |                 # Take the latest one.
                 awk -F / '{print $3}')      # Return only the tag.

# Craft the URL for the release asset.
version=$(echo $latest | tr -d 'v')  # Remove the leading v.
wheel="pygments_rose_pine-${version}-py3-none-any.whl"
release="${repo}/releases/download/${latest}/${wheel}"

# Install the release.
pip install $release

You can also use Pipx to install it, but bear in mind that you need to inject the package in the venv of the tool you want to use it with. So the script will be:

repo="https://github.com/rose-pine/pygments"

# Find the latest release.
latest=$(git ls-remote --tags --refs $repo | # Fetch remote tags.
                 sort -t '/' -k 3 -V |       # Sort them by version.
                 tail -n 1 |                 # Take the latest one.
                 awk -F / '{print $3}')      # Return only the tag.

# Craft the URL for the release asset.
version=$(echo $latest | tr -d 'v')  # Remove the leading v.
wheel="pygments_rose_pine-${version}-py3-none-any.whl"
release="${repo}/releases/download/${latest}/${wheel}"

# Install the release.
pipx inject {name of the tool} $release

Usage

The style installs itself as a Pygments plugin, so after installation you should only need to launch your console with one of the rose-pine styles available (rose-pine, rose-pine-moon, rose-pine-dawn). Below there are some examples for common consoles.

IPython

In the case of IPython, you can launch the console with the following command.

ipython --TerminalInteractiveShell.highlighting_style=rose-pine

or add it to your IPython config.

config = get_config()
config.TerminalInteractiveShell.highlighting_style = "rose-pine"

Note: This will only affect your syntax highlighting. If you're looking to modify your prompt, Reilly Siemmens from the IPython Gruvbox theme has an excellent example prompt that shows how to customize it.

Radian

In the case of Radian, you can add the theme to your Radian configuration on your .radian_profile

options(radian.color_scheme = "rose-pine")

Note: For radian, the prompt modification options can be found on their documentation.

Gallery

Rose Piné

Rosé Pine

Rose Piné Moon

Rosé Pine Moon

Rose Piné Dawn

Rosé Pine Dawn