Skip to content
/ soria Public

A xoria256 theme with some colors from openSUSE

License

Notifications You must be signed in to change notification settings

mssola/soria

Repository files navigation

GNU Emacs supported versions MELPA MELPA Stable Build Status for main branch License GPL 3


Soria is a color theme which mixes:

  • xoria256: a color theme by Dmitry Zotikov, originally for Vim. I did not do the initial porting from Vim to GNU Emacs, I took it from suxue.
  • openSUSE: I took some colors from openSUSE's Brand Guidelines.

You can get a glimpse of this color theme on this screenshot (and you can check more screenshots on this project's wiki):

Overview screenshot

Installation

MELPA (recommended)

This theme is available from MELPA and MELPA stable. Thus, you can install this theme like so:

M-x package-install RET soria-theme

To load it automatically on GNU Emacs startup add this to your init file:

(load-theme 'soria t)

You can also use use-package for this, with a configuration like:

(use-package soria-theme
  :ensure t
  :config
  (load-theme 'soria t)

  (with-eval-after-load 'treemacs
    (require 'soria-theme-tree)
    (soria-theme-tree-config))

  (dolist (lang-hook '(ruby-mode-hook
                       php-mode-hook
                       perl-mode-hook
                       emacs-lisp-mode-hook))
    (add-hook lang-hook 'soria-theme-purple-identifiers)))

Manual

Simply download the soria-theme.el file into your ~/.emacs.d/ and then load it like so:

M-x load-theme RET soria

If you want to move this file into another directory, make sure that this directory is inside of the custom-theme-load-path list. You can do this by running the following lisp code:

(add-to-list 'custom-theme-load-path "/home/user/my/themes/directory")

openSUSE

I have also created a package inside of my personal OBS project. You can add the repository for your openSUSE distribution and install it like so:

# This is the openSUSE Leap 15.3 repository. Check my home project for more openSUSE distributions.
$ sudo zypper ar https://download.opensuse.org/repositories/home:/mssola/openSUSE_Leap_15.3/ home:mssola
$ sudo zypper ref home:mssola
$ sudo zypper install soria-theme

Note that this RPM installs the relevant file in /usr/share/emacs/site-lisp/themes. You have to make sure that this directory is inside of the custom-theme-load-path list. You can do this by running the following lisp code:

(add-to-list 'custom-theme-load-path "/usr/share/emacs/site-lisp/themes")

Then you can load this theme as usual:

M-x load-theme RET soria

Customization

treemacs support

This color theme has support for the treemacs package, but in order to enable it you have to call the soria-theme-tree-config function. You can do this like so:

(with-eval-after-load 'treemacs
  (require 'soria-theme-tree)
  (soria-theme-tree-config))

soria-theme-hide-helm-header

This color theme defines the soria group, which in turn has only one configuration option: soria-theme-hide-helm-header.

The Helm package in combination with Projectile shows a header that in my humble opinion is quite useless and it's distracting. For this reason, this header is hidden by default. If you set it to false, then you'll see the header with the same colors as the status line.

soria-theme-purple-identifiers

This theme also provides one interactive function that can be used as a hook: soria-theme-purple-identifiers.

As a reminder, this color theme is a port from Vim, and Vim and GNU Emacs have some different takes on function identifiers. As such, the original Vim theme defines identifiers as purple, but only method definitions in Ruby, Perl and PHP (languages that I've used with this theme, there might be more) were highlighted this way, but that wasn't the case for C, C++ or Go. This is certainly a bug in Vim, but I got used to it, and when doing this port I could notice this a lot. For this reason, by default this color theme for GNU Emacs defines function identifiers as white, but it provides this function so in other languages can be drawn in purple.

You may turn identifiers into purple with a code like this:

(dolist (lang-hook '(ruby-mode-hook
                     php-mode-hook
                     perl-mode-hook
                     emacs-lisp-mode-hook))
  (add-hook lang-hook 'soria-theme-purple-identifiers))

Contributing

Do you want to contribute with code, or to report an issue you are facing? Read the CONTRIBUTING.org file.

Read the CHANGELOG.org file.

License

Copyright (C) 2016-Ω Miquel Sabaté Solà <mikisabate@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

You can check the soria-theme.el and the soria-theme-tree.el files for further acknowledgements.