Kaynağa Gözat

using_oh_my_zsh: setup new zshrc and prompt

Weiyi Lou 13 yıl önce
ebeveyn
işleme
4c9d62a67e
4 değiştirilmiş dosya ile 89 ekleme ve 31 silme
  1. 43 28
      RUNME
  2. 10 0
      zsh/oh-my-zsh-customs/cinaeco.zsh-theme
  3. 0 3
      zsh/zshrc
  4. 36 0
      zsh/zshrc.ohmyzsh

+ 43 - 28
RUNME

@@ -1,51 +1,45 @@
 #!/bin/sh
 
-# Running this script creates the appropriate symlinks in home
-# Use from within dotfiles directory
+# This script pulls extra software and creates appropriate symlinks in the home
+# directory
+# Run from where it's located (within dotfiles directory)
 # A lot of this extra knowledge courtesy of vimcasts.org!
 
-# Vim
-ln -s dotfiles/vim/ ~/.vim
-ln -s dotfiles/vim/vimrc ~/.vimrc
-# Vim persistent undo directory
-mkdir ~/.vimundo
-
-# Zsh
-ln -s dotfiles/zsh/zshrc ~/.zshrc
-ln -s dotfiles/zsh/zshenv ~/.zshenv
-ln -s dotfiles/zsh/zshlocal ~/.zshlocal
-
-# Pentadactyl
-ln -s dotfiles/pentadactyl/pentadactylrc ~/.pentadactylrc
-
-# Screen
-ln -s dotfiles/screen/screenrc ~/.screenrc
-
 # Make a known_hosts file if none, otherwise zsh throws an error for our .zshrc
-echo "Checking for known_hosts in ~/.ssh/..."
+echo "Checking for known_hosts:"
 if test -f ~/.ssh/known_hosts; then
-  echo "known_hosts found..."
+  echo " -> Found"
 else
-  echo "Does not exist. Creating..."
+  echo " -> Not Found"
   mkdir -p ~/.ssh
   touch ~/.ssh/known_hosts
+  echo " -> Created ~/.ssh/known_hosts"
 fi
 
 # Ack for this user (perl 5.8.8 or higher on system)
 # Curl may need to have proxy settings
-echo "Checking for ack in ~/bin/..."
+echo "Checking for ack in ~/bin:"
 if test -f ~/bin/ack; then
-  echo "ack found..."
+  echo " -> Found"
 else
-  echo "Downloading ack from betterthangrep.com..."
+  echo " -> Not Found"
   mkdir -p ~/bin
   curl http://betterthangrep.com/ack-standalone > ~/bin/ack
   chmod 0755 ~/bin/ack
+  echo " -> Installed ~/bin/ack from betterthangrep.com"
 fi
 
+# color for git! Some machines don't have it.
+echo "Setting up git colour and editor:"
+git config --global color.ui true
+git config --global core.editor "vim"
+echo " -> Done"
+
 # This repository has vim plugins as submodules, so initialise and clone them
+echo "Getting dotfiles submodules:"
 git submodule init
 git submodule update
+echo " -> Done"
 
 # Add more vim plugins from this dotfiles directory, like so:
 #     git submodule add git://github.com/tpope/module.git vim/bundle/module
@@ -53,6 +47,27 @@ git submodule update
 # Apart from updating plugins individually, you can update all submodules
 #     git submodule foreach git pull origin master
 
-# color for git! Some machines don't have it.
-git config --global color.ui true
-git config --global core.editor "vim"
+# Vim
+echo "Symlinking for vim:"
+ln -s dotfiles/vim/ ~/.vim
+ln -s dotfiles/vim/vimrc ~/.vimrc
+mkdir ~/.vimundo # persistent undo directory
+echo " -> Done"
+
+# Zsh
+echo "Symlinking for zsh:"
+ln -s dotfiles/zsh/zshrc ~/.zshrc
+ln -s dotfiles/zsh/zshenv ~/.zshenv
+ln -s dotfiles/zsh/zshlocal ~/.zshlocal
+ln -s ../../oh-my-zsh-customs/cinaeco.zsh-theme zsh/oh-my-zsh/custom
+echo " -> Done"
+
+# Pentadactyl
+echo "Symlinking for pentadactyl:"
+ln -s dotfiles/pentadactyl/pentadactylrc ~/.pentadactylrc
+echo " -> Done"
+
+# Screen
+echo "Symlinking for gnu screen:"
+ln -s dotfiles/screen/screenrc ~/.screenrc
+echo " -> Done"

+ 10 - 0
zsh/oh-my-zsh-customs/cinaeco.zsh-theme

@@ -0,0 +1,10 @@
+PROMPT='
+$fg[yellow][%n@%m] $fg_bold[green]%T $fg[cyan]%3~ $fg[blue]$(git_prompt_info)$reset_color
+→ $reset_color'
+
+ZSH_THEME_GIT_PROMPT_PREFIX="is a git repo [branch: "
+ZSH_THEME_GIT_PROMPT_SUFFIX="]"
+ZSH_THEME_GIT_PROMPT_CLEAN=" ✔ is clean"
+ZSH_THEME_GIT_PROMPT_DIRTY=" ✗ has changes"
+
+MODE_INDICATOR="-- Command --"

+ 0 - 3
zsh/zshrc

@@ -24,9 +24,6 @@ alias mmv='noglob zmv -W'
 # SET OPTIONS #
 ###############
 
-# vi keybindings
-bindkey -v
-
 #allow tab completion in the middle of a word
 setopt COMPLETE_IN_WORD
 

+ 36 - 0
zsh/zshrc.ohmyzsh

@@ -0,0 +1,36 @@
+# Path to your oh-my-zsh configuration.
+ZSH=$HOME/.oh-my-zsh
+
+# Set name of the theme to load.
+# Look in ~/.oh-my-zsh/themes/
+# Optionally, if you set this to "random", it'll load a random theme each
+# time that oh-my-zsh is loaded.
+ZSH_THEME="cinaeco"
+
+# Example aliases
+# alias zshconfig="mate ~/.zshrc"
+# alias ohmyzsh="mate ~/.oh-my-zsh"
+
+# Set to this to use case-sensitive completion
+# CASE_SENSITIVE="true"
+
+# Comment this out to disable weekly auto-update checks
+# DISABLE_AUTO_UPDATE="true"
+
+# Uncomment following line if you want to disable colors in ls
+# DISABLE_LS_COLORS="true"
+
+# Uncomment following line if you want to disable autosetting terminal title.
+# DISABLE_AUTO_TITLE="true"
+
+# Uncomment following line if you want red dots to be displayed while waiting for completion
+# COMPLETION_WAITING_DOTS="true"
+
+# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
+# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
+# Example format: plugins=(rails git textmate ruby lighthouse)
+plugins=(git vi-mode)
+
+source $ZSH/oh-my-zsh.sh
+
+# Customize to your needs...