How to customise Oh My ZSH within a Spacemacs shell?
Asked Answered
L

1

8

Context

I have a nice and beautiful setup on iTerm2 (I'm using a Mac) where the default shell is ZSH and it is properly customized using Oh-my-zsh and the Agnoster-fcamblor Theme.

enter image description here


Issue

As a Spacemacs user, I would like to do as much as possible without leaving Emacs. So I decided to invoke a terminal window from inside of it, as I'm used to doing with Vim/tmux.

This is the look that I get (in the same directory):

enter image description here


Things I've checked

Apparently the Theme is not being applied.

This is the relevant part of my ~/.spacemacs:

(shell :variables
        shell-default-shell 'ansi-term
        shell-default-height 30
        shell-default-term-shell "/bin/zsh"
        shell-default-position 'bottom)

A few important things:

  • $> echo $0 shows me ZSH is the shell being used inside Spacemacs.
  • $> echo $PS1 shows me it is properly set and it matches iTerm2.
  • I tried sourcing the configuration file I use but, as the above fact suggests, it is already being loaded.

Question

How can I apply the Oh-my-zsh Theme inside a Spacemacs Shell Window?

Leclair answered 20/8, 2017 at 9:11 Comment(1)
@jaysoifer actually, my problems comes from the M-x shell command. I didn't try since a while so maybe I changed something relevant in my config but now, it is working well just with M-x ansi-termPersonification
L
3

Instead of trying to make Spacemacs options override the terminal options (wasn't able to do it), I decided to match the Spacemacs Theme with the Agnoster-Fcamblor theme I've been using, this way both have the same colors and backgrounds (a.k.a. skin/theme).

1. Inside dotspacemacs-additional-packages:

color-theme-solarized

2. Inside dotspacemacs/user-config:

(defun dotspacemacs/user-config ()

;; Fix separators
(setq ns-use-srgb-colorspace nil)
;; (setq powerline-default-separator 'utf-8)
;; Theme Customizations
(setq theming-modifications
    '((solarized
       ;; Provide a sort of "on-off" modeline whereby the current buffer has a nice
       ;; bright blue background, and all the others are in cream.
       ;; TODO: Change to use variables here. However, got error:
       ;; (Spacemacs) Error in dotspacemacs/user-config: Wrong type argument: stringp, pd-blue
       (mode-line :foreground "#e9e2cb" :background "#2075c7" :inverse-video nil)
       (powerline-active1 :foreground "#e9e2cb" :background "#2075c7" :inverse-video nil)
       (powerline-active2 :foreground "#e9e2cb" :background "#2075c7" :inverse-video nil)
       (mode-line-inactive :foreground "#2075c7" :background "#e9e2cb" :inverse-video nil)
       (powerline-inactive1 :foreground "#2075c7" :background "#e9e2cb" :inverse-video nil)
       (powerline-inactive2 :foreground "#2075c7" :background "#e9e2cb" :inverse-video nil)
       ;; Make a really prominent helm selection line.
       (helm-selection :foreground "white" :background "#2075c7" :inverse-video nil)
       ;; See comment above about dotspacemacs-colorize-cursor-according-to-state.
       (cursor :background "#b58900")
     )))
Leclair answered 15/12, 2017 at 12:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.