diff options
| author | Miquel Sabaté Solà <msabate@suse.com> | 2021-01-24 12:31:57 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <msabate@suse.com> | 2021-01-24 12:31:57 +0100 |
| commit | 62d1d61994b4889f8fff16978b7dfa1a047f6832 (patch) | |
| tree | 3281f1dde10aa4327239326fe0db8fad2b627e19 | |
| parent | 1484ac1fdf79dc86907cd7a9db09fc760329bfa4 (diff) | |
| download | soria-62d1d61994b4889f8fff16978b7dfa1a047f6832.tar.gz soria-62d1d61994b4889f8fff16978b7dfa1a047f6832.zip | |
Added treemacs support
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
| -rw-r--r-- | .gitignore | 4 | ||||
| -rw-r--r-- | CHANGELOG.org | 4 | ||||
| -rw-r--r-- | README.md | 14 | ||||
| -rw-r--r-- | soria-theme-tree.el | 173 | ||||
| -rw-r--r-- | soria-theme.el | 40 |
5 files changed, 231 insertions, 4 deletions
@@ -1,4 +1,4 @@ vendor/* soria-autoloads.el -soria-autoloads.el~ -soria-theme.elc
\ No newline at end of file +*.el~ +*.elc
\ No newline at end of file diff --git a/CHANGELOG.org b/CHANGELOG.org index acea92d..efb536f 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -2,6 +2,10 @@ * Changelog +** 0.4.0 (in development) + +- Added support for =treemacs=. + ** 0.3.3 - Do not highlight file extensions differently in =helm=. See [[https://github.com/mssola/soria/commit/7335adaa6e23d8aa10d2ca68e9ce2ac7fee8664c][7335adaa6e2]]. @@ -50,6 +50,10 @@ this, with a configuration like: :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 @@ -100,6 +104,16 @@ Then you can load this theme as usual: ## 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: + +```elisp +(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 diff --git a/soria-theme-tree.el b/soria-theme-tree.el new file mode 100644 index 0000000..29c1997 --- /dev/null +++ b/soria-theme-tree.el @@ -0,0 +1,173 @@ +;;; soria-theme-tree.el --- Files tree integration of the soria theme -*- lexical-binding: t; no-byte-compile: t -*- + +;; Copyright (C) 2021 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/>. + +;; Author: Miquel Sabaté Solà <mikisabate@gmail.com> +;; Version: 0.3.3 +;; Package-Requires: ((emacs "25.1") (treemacs "2.8") (all-the-icons "4.0.1")) +;; Keywords: faces +;; URL: https://github.com/mssola/soria + +;;; Commentary: +;; +;; This package provides treemacs integration to the soria theme. It uses all-the-icons +;; underneath, but it does not use all the available icons out there to keep things +;; simpler. + +;;; Credits: +;; +;; Adapted from the kaolin and the doom-emacs themes repositories. + +(defun soria-theme-tree--remove-fringes () + "Remove fringes from the special window." + + (when (display-graphic-p) + (setq left-fringe-width 0 + right-fringe-width 0))) + +(defun soria-theme-tree--hook () + "Basic definitions to be set on initialization." + + (setq line-spacing 1 + tab-width 1 + mode-line-format nil)) + +(defun soria-theme-tree--setup () + "Setup soria for treemacs." + + (require 'treemacs) + + (add-hook 'treemacs-mode-hook #'soria-theme-tree--hook) + (add-hook 'treemacs-mode-hook #'soria-theme-tree--remove-fringes) + (advice-add 'treemacs-select-window :after #'soria-theme-tree--remove-fringes) + + (setq treemacs-indentation 1 + treemacs-indentation-string " ") + + (treemacs-create-theme + "soria" + :config + (progn + ;; Set fallback icon + (treemacs-create-icon + :icon (format " %s\t" + (all-the-icons-octicon "file-text" + :height 1.0 :face 'font-lock-comment-face)) + :extensions (fallback)) + + (treemacs-create-icon + :icon (format " %s\t" + (all-the-icons-octicon "repo" :height 1.0 :v-adjust -0.1 + :face 'font-lock-preprocessor-face)) + :extensions (root)) + + (treemacs-create-icon + :icon (format "%s\t%s\t" + (all-the-icons-octicon "chevron-down" :height 0.75 :v-adjust 0.1 + :face 'font-lock-builtin-face) + (all-the-icons-octicon "file-directory" :v-adjust 0 + :face 'font-lock-builtin-face)) + :extensions (dir-open)) + + (treemacs-create-icon + :icon (format "%s\t%s\t" + (all-the-icons-octicon "chevron-right" :height 0.75 + :v-adjust 0.1 :face 'font-lock-builtin-face) + (all-the-icons-octicon "file-directory" :v-adjust 0 + :face 'font-lock-builtin-face)) + :extensions (dir-closed)) + + (treemacs-create-icon + :icon (format "%s\t%s\t" + (all-the-icons-octicon "chevron-down" :height 0.75 :v-adjust 0.1 + :face 'font-lock-comment-face) + (all-the-icons-octicon "package" :v-adjust 0 :face + 'font-lock-comment-face)) + :extensions (tag-open)) + (treemacs-create-icon + :icon (format "%s\t%s\t" + (all-the-icons-octicon "chevron-right" :height 0.75 :v-adjust 0.1 + :face 'font-lock-comment-face) + (all-the-icons-octicon "package" :v-adjust 0 + :face 'font-lock-comment-face)) + :extensions (tag-closed)) + + (treemacs-create-icon + :icon (format "%s\t" (all-the-icons-octicon "tag" :height 0.9 :v-adjust 0 + :face 'font-lock-comment-face)) + :extensions (tag-leaf)) + + (treemacs-create-icon + :icon (format "%s\t" (all-the-icons-octicon "flame" :v-adjust 0 + :face 'all-the-icons-red)) + :extensions (error)) + + (treemacs-create-icon + :icon (format "%s\t" (all-the-icons-octicon "stop" :v-adjust 0 + :face 'all-the-icons-orange)) + :extensions (warning)) + + (treemacs-create-icon + :icon (format "%s\t" (all-the-icons-octicon "info" :height 0.75 :v-adjust 0.1 + :face 'all-the-icons-green)) + :extensions (info)) + + ;; Icons for filetypes + + (treemacs-create-icon + :icon (format " %s\t" (all-the-icons-octicon "file-code" :v-adjust 0 + :face 'font-lock-comment-face)) + :extensions ("a.out" "adoc" "asciidoc" "bashrc" "c" "cabal" "cabal" "cask" + "cc" "clj" "cljc" "cljs" "conf" "cpp" "css" "csv" "cxx" "dart" + "dockerfile" "dockerfile" "editorconfig" "eex" "el" "elm" "erb" + "ex" "exs" "fish" "gemfile" "gitignore" "git" "gitconfig" + "gitmodules" "go" "h" "hh" "hpp" "hs" "htm" "html" "hy" + "ideavimrc" "ini" "inputrc" "j2" "java" "jinja2" "jinja2" "jl" + "js" "json" "jsx" "kt" "kt" "kts" "lhs" "lisp" "lua" "lua" + "makefile" "markdown" "md" "ml" "mli" "nim" "nim" "nims" "nix" + "org" "perl" "php" "pl" "plt" "pm" "pm6" "pp" "pp" "py" "pyc" + "r" "racket" "rake" "rb" "re" "rei" "rkt" "rktd" "rktl" "rs" + "ru" "sbt" "scala" "scm" "scrbl" "scribble" "scss" "sh" + "sql" "sql" "styles" "sv" "tex" "toml" "tpp" "tridactylrc" + "ts" "tsx" "txt" "v" "vagrantfile" "vh" "vimperatorrc" + "vimrc" "vrapperrc" "vue" "xml" "xsl" "yaml" "yml" "zsh" + "zshrc")) + + (treemacs-create-icon + :icon (format " %s\t" (all-the-icons-octicon "file-media") :v-adjust 0 + :face 'font-lock-constant-face) + :extensions ("jpg" "jpeg" "png" "gif" "ico" "tif" "tiff" "svg" "bmp" "psd" "ai" + "eps" "indd" "mov" "avi" "mp4" "webm" "webp" "mkv" "wav" "mp3" + "ogg" "midi")) + + (treemacs-create-icon + :icon (format " %s\t" (all-the-icons-octicon "file-zip") :v-adjust 0 + :face 'font-lock-number-face) + :extensions ("zip" "xz" "tar" "gz" "7z" "rar")))) + + (treemacs-load-theme "soria")) + +;;;###autoload +(defun soria-theme-tree-config () + "Setup the configuration for treemacs support." + + (soria-theme-tree--setup)) + +;;; Code: + +(provide 'soria-theme-tree) + +;;; soria-theme-tree.el ends here diff --git a/soria-theme.el b/soria-theme.el index 06b0ef5..1eaa78c 100644 --- a/soria-theme.el +++ b/soria-theme.el @@ -1484,7 +1484,44 @@ The theme has to be reloaded after changing anything in this group." ((,class (:foreground ,soria-green :weight normal)))) `(doom-modeline-warning - ((,class (:foreground ,soria-orange :weight normal)))))) + ((,class (:foreground ,soria-orange :weight normal)))) + + ;; treemacs + + `(treemacs-root-face + ((,class (:foreground ,soria-white :weight bold)))) + + `(treemacs-file-face + ((,class (:foreground ,soria-white)))) + + `(treemacs-directory-face + ((,class (:foreground ,soria-blue)))) + + `(treemacs-tags-face + ((,class (:foreground ,soria-yellow)))) + + `(treemacs-git-modified-face + ((,class (:foreground ,soria-orange)))) + + `(treemacs-git-added-face + ((,class (:foreground ,soria-green)))) + + `(treemacs-git-conflict-face + ((,class (:foreground ,soria-redpastel)))) + + `(treemacs-git-untracked-face + ((,class (:inherit flycheck-warning)))) + + ;; all-the-icons + + `(all-the-icons-red + ((,class (:foreground ,soria-redpastel)))) + + `(all-the-icons-orange + ((,class (:foreground ,soria-orange)))) + + `(all-the-icons-green + ((,class (:foreground ,soria-green)))))) (defun soria-theme-purple-identifiers () "Make function identifiers purple. @@ -1501,7 +1538,6 @@ identifiers" (provide-theme 'soria) -;; Make package-lint happy. This file is not meant to be used as a library. (provide 'soria-theme) ;;; soria-theme.el ends here |
