From e051558fd5f0ca4a3c3ef1ff12aa8f85c459fa2a Mon Sep 17 00:00:00 2001 From: Joel Grunbaum <joelgrun@gmail.com> Date: Fri, 14 Jan 2022 04:51:54 +0000 Subject: [PATCH] Made theme switcher function. Need to figure out how to complete list of themes with helm and automatically install arbitrary themes --- config.org | 79 +++++++++++++++++++-------------------- 1 files changed, 39 insertions(+), 40 deletions(-) diff --git a/config.org b/config.org index 256d756..3aedeba 100644 --- a/config.org +++ b/config.org @@ -22,48 +22,36 @@ Theme switcher, using a cond allows loading of many preconfigured themes which can be switched between easily. Zenburn theme is my default. #+BEGIN_SRC emacs-lisp - (setq emacs-theme 'zenburn) - (defun disable-all-themes () (dolist (i custom-enabled-themes) (disable-theme i))) - (cond ((eq emacs-theme 'zenburn) - (use-package zenburn-theme - :init - (disable-all-themes) - :config - (load-theme 'zenburn t))) - ((eq emacs-theme 'doom-one) - (use-package doom-themes - :init - (disable-all-themes) - :config - (setq doom-themes-enable-bolt t - doom-themes-enable-italic t) - (load-theme 'doom-one t) - (doom-themes-visual-bell-config) - (doom-themes-org-config))) - ((eq emacs-theme 'nord) - (use-package nord-theme - :init - (disable-all-themes) - :config - (load-theme 'nord t))) - ((eq emacs-theme 'solarized) - (use-package solarized-theme - :init - (disable-all-themes) - :config - (load-theme 'solarized-dark t))) - ((eq emacs-theme 'jetbrains-darcula) - (use-package jetbrains-darcula-theme - :init - (disable-all-themes) - :config - (load-theme 'jetbrains-darcula t))) - ((eq emacs-theme 'none) - (disable-all-themes))) + (defun set-theme (theme) + "Set the theme with theme downloading" + (interactive "SWhat theme to load? ") + (cond ((eq theme 'zenburn) + (use-package zenburn-theme)) + ((string-match-p "^doom" "doom-one") + (use-package doom-themes + :config + (setq doom-themes-enable-bolt t + doom-themes-enable-italic t) + (doom-themes-visual-bell-config) + (doom-themes-org-config))) + ((eq theme 'nord) + (use-package nord-theme)) + ((eq theme 'solarized) + (use-package solarized-theme)) + ((eq theme 'jetbrains-darcula) + (use-package jetbrains-darcula-theme)) + ((eq theme 'none) + (disable-all-themes))) + (setq emacs-theme theme) + (when (not (eq theme 'none)) + (load-theme theme)) + (message (format "Theme set to: %s" theme))) + + (set-theme 'zenburn) #+END_SRC ** Default font @@ -168,8 +156,7 @@ ** Helm core Helm aids the user interface for emacs. Adds visual and auto-complete feedback for emacs commands. #+BEGIN_SRC emacs-lisp - (use-package helm-config - :ensure helm + (use-package helm :bind (("M-x" . helm-M-x) ("C-x C-f" . helm-find-files) ("M-y" . helm-show-kill-ring) @@ -962,6 +949,18 @@ ("M-RET" . 'srefactor-refactor-at-point))) #+END_SRC +** Tree sitter +Parser library. +Provides better syntax highlighting and some other neat features. +#+BEGIN_SRC emacs-lisp + (use-package tree-sitter + :diminish t) + (use-package tree-sitter-langs + :config + (global-tree-sitter-mode) + (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)) +#+END_SRC + ** Language specific configs *** C/C++ **** Flycheck -- Gitblit v1.9.3