rougier / nano-emacs

GNU Emacs / N Λ N O - Emacs made simple
GNU General Public License v3.0
2.52k stars 195 forks source link

Could u make the theme as a separate repo? #37

Open jesse23 opened 3 years ago

jesse23 commented 3 years ago

The theme looks nice...it will be great if it could be a separate repo...thx

rougier commented 3 years ago

We tried to make the repo modular such that you can use only the theme. But you mean you would prefer a separate repository just for the theme?

jesse23 commented 3 years ago

Yeah beside of the nano keybinding the theme and color it looks very nice and minimalistic.

Or just a simple wiki for how to use the theme/color part in normal emacs or spacemas. THx!

rougier commented 3 years ago

I'll add a section in the README. Did you manage to use only the theme? Do you want to make a PR for this section?

jesse23 commented 3 years ago

Yes definitely love the top bar and the command hint layout but still want to stay in doom-emacs key-binding setup or for other user spacemacs setup.

mclearc commented 3 years ago

Here's my use-package setup via straight. I use evil, my own custom bindings, etc. Seems like it would work for doom too. Just require the parts that you want to use in the :init section.

(use-package nano-emacs
  :straight (:host github :repo "rougier/nano-emacs")
  :init
  (require 'nano-base-colors)
  (require 'nano-colors)
  (require 'nano-faces)
  (require 'nano-theme)
  (require 'nano-theme-dark)
  (require 'nano-theme-light)
  (require 'nano-splash)
  (require 'nano-modeline)
  (nano-faces)
  (nano-theme))
bakirtzisg commented 3 years ago

Here's my use-package setup via straight. I use evil, my own custom bindings, etc. Seems like it would work for doom too. Just require the parts that you want to use in the :init section.

(use-package nano-emacs
  :straight (:host github :repo "rougier/nano-emacs")
  :init
  (require 'nano-base-colors)
  (require 'nano-colors)
  (require 'nano-faces)
  (require 'nano-theme)
  (require 'nano-theme-dark)
  (require 'nano-theme-light)
  (require 'nano-splash)
  (require 'nano-modeline)
  (nano-faces)
  (nano-theme))

This works somewhat for me, I am getting "could not load nano-emacs" and no splash screen (because of the error) even though visually emacs changes... Any ideas why that would be? I am setting up emacs from scratch so the only thing is straight and nano-emacs in my config at the moment.

mclearc commented 3 years ago

Hmm. perhaps try adding :demand t as well? I assume you've got your load-path set to find it?

bakirtzisg commented 3 years ago

I tried both before and after the use-package instantiation above (add-to-list 'load-path /home/user/.emacs.d/straight/build/nano-emacs"). Is that what you mean? Adding :demand t does not solve it either unfortunately.

mclearc commented 3 years ago

@bakirtzisg that's strange. Have you tried just manually requiring the parts of the emacs-nano conifg you want and calling the theme to see that it works? So, something like the following in your init.el:

(add-to-list 'load-path /home/user/.emacs.d/straight/build/nano-emacs")
  (require 'nano-base-colors)
  (require 'nano-colors)
  (require 'nano-faces)
  (require 'nano-theme)
  (require 'nano-theme-dark)
  (require 'nano-theme-light)
  (require 'nano-splash)
  (require 'nano-modeline)
  (nano-faces)
  (nano-theme))

If that doesn't work then it is probably not use-package that is causing the problem. You might also want to check if there are any messages in the Messages buffer that might indicate where the problem lies.

rougier commented 3 years ago

@mclearc Thanks for the explanation. Could you contribute it to the README ?

bakirtzisg commented 3 years ago

@rougier This solution hasn't worked for me just FYI.

rougier commented 3 years ago

@bakirtzisg What did not work exactly ?

mclearc commented 3 years ago

Just to follow up: below is a configuration for using nano as a "module" in an independent config using straight, much like one might use any other theme. I don't see why this wouldn't work for anyone else but am happy to try to troubleshoot further. Note that I have straight pulling from my fork, and a particular branch thereof, which makes it trivially easy to make changes to the theme, etc, as I like. But you don't need to do that part if you don't want; in that case just delete the :fork, etc. portion of the straight call. In any case, put this in a file in your load-path called setup-theme.el and call it from your init.el file.

;;; Setup nano using use-package & straight
(use-package nano
  :straight (:type git :host github :repo "rougier/nano-emacs"
             :fork (:host github :repo "mclear-tools/nano-emacs" :branch "test-new-stuff"))
  :config
  (require 'nano-base-colors)
  (require 'nano-colors)
  (require 'nano-faces)
  (require 'nano-theme)
  (require 'nano-theme-dark)
  (require 'nano-theme-light)
  (require 'nano-splash)
  (require 'nano-modeline))

;;; Define Nano dark & light theme functions

(defun nano-theme-dark ()
  "Enable dark Nano theme and customizations."
  (interactive)
  (nano-theme-set-dark)
  (nano-faces)
  (nano-theme)
  ;; Fall back font for glyph missing in Roboto
  (defface fallback '((t :family "Fira Code"
                         :inherit 'nano-face-faded)) "Fallback")
  (set-display-table-slot standard-display-table 'truncation
                          (make-glyph-code ?… 'fallback))
  (set-display-table-slot standard-display-table 'wrap
                          (make-glyph-code ?↩ 'fallback)))

(defun nano-theme-light ()
  "Enable light Nano theme and customizations."
  (interactive)
  (nano-theme-set-light)
  (nano-faces)
  (nano-theme)
  ;; Fall back font for glyph missing in Roboto
  (defface fallback '((t :family "Fira Code"
                         :inherit 'nano-face-faded)) "Fallback")
  (set-display-table-slot standard-display-table 'truncation
                          (make-glyph-code ?… 'fallback))
  (set-display-table-slot standard-display-table 'wrap
                          (make-glyph-code ?↩ 'fallback)))

;;; Set Theme
;; call theme of choice
(nano-theme-dark)

;;; Provide theme for init.el
(provide 'setup-theme)
WillPower3309 commented 3 years ago

should be resolved with the code snippet I placed into #43 . The one caveat is discussed in #74

mclearc commented 3 years ago

There is also https://github.com/mclear-tools/bespoke-themes if you want something like nano-emacs but behaving more like a standard theme.

WillPower3309 commented 3 years ago

Striaght.el installation addressed in #82

mrunhap commented 3 years ago

https://github.com/404cn/nano-theme.el