如何在Spacemacs shell中自定义Oh My ZSH?

Jon*_*fer 6 emacs zsh ansi oh-my-zsh spacemacs

上下文

我在iTerm2(我使用的是Mac)上有一个漂亮而漂亮的设置,默认的外壳是ZSH,可以使用Oh-my-zshAgnoster-fcamblor主题进行正确定制.

在此输入图像描述


问题

作为Spacemacs用户,我想在不离开Emacs的情况下尽可能多地做.所以我决定从里面调用一个终端窗口,因为我习惯使用Vim/tmux.

这是我得到的外观(在同一目录中):

在此输入图像描述


我检查过的事情

显然主题没有被应用.

这是我的相关部分~/.spacemacs:

(shell :variables
        shell-default-shell 'ansi-term
        shell-default-height 30
        shell-default-term-shell "/bin/zsh"
        shell-default-position 'bottom)
Run Code Online (Sandbox Code Playgroud)

一些重要的事情:

  • $> echo $0向我展示ZSH是在Spacemacs中使用的shell.
  • $> echo $PS1告诉我它设置正确,它与iTerm2相匹配.
  • 我尝试使用我使用的配置文件但是,正如上面的事实所示,它已经被加载了.

如何在Spacemacs Shell窗口中应用Oh-my-zsh主题?

Jon*_*fer 3

我没有尝试让Spacemacs选项覆盖终端选项(无法做到),而是决定将 Spacemacs 主题与我一直在使用的Agnoster-Fcamblor主题相匹配,这样两者都具有相同的颜色和背景(又名皮肤/主题)。

1. dotspacemacs-additional-packages内部:

color-theme-solarized
Run Code Online (Sandbox Code Playgroud)

2. 在dotspacemacs/user-config中:

(defun dotspacemacs/用户配置()

;; 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")
     )))
Run Code Online (Sandbox Code Playgroud)