Skip to content

Instantly share code, notes, and snippets.

@JonahMoses
Last active August 29, 2015 14:05
Show Gist options
  • Save JonahMoses/32a2addcc36796c350e4 to your computer and use it in GitHub Desktop.
Save JonahMoses/32a2addcc36796c350e4 to your computer and use it in GitHub Desktop.
# modify the prompt to contain git branch name if applicable
2 git_prompt_info() {
3 ref=$(git symbolic-ref HEAD 2> /dev/null)
4 if [[ -n $ref ]]; then
5 echo "on branch %{$fg[red]%}${ref#refs/heads/}%{$reset_color%}"
6 fi
7 }
8
9 setopt promptsubst
10 export PS1='${SSH_CONNECTION+"%{$fg_bold[green]%}%n@%m:"}% $reset_color$fg[green]%~ $reset_color$(git_prompt_info)
11 $fg_bold[red]ॐ $reset_color '
12
13 # load our own completion functions
14 fpath=(~/.zsh/completion $fpath)
15
16 # completion
17 autoload -U compinit
18 compinit
19
20 # load custom executable functions
21 for function in ~/.zsh/functions/*; do
22 source $function
23 done
24
25 # makes color constants available
26 autoload -U colors
27 colors
28
29 # enable colored output from ls, etc
30 export CLICOLOR=1
31
32 # history settings
33 setopt hist_ignore_all_dups inc_append_history
34 HISTFILE=~/.zhistory
35 HISTSIZE=4096
36 SAVEHIST=4096
37
38 # awesome cd movements from zshkit
39 setopt autocd autopushd pushdminus pushdsilent pushdtohome cdablevars
40 DIRSTACKSIZE=5
41
# Enable extended globbing
43 setopt extendedglob
44
45 # Allow [ or ] whereever you want
46 unsetopt nomatch
47
48 # vi mode
49 bindkey -v
50 bindkey "^F" vi-cmd-mode
51 bindkey jj vi-cmd-mode
52
53 # handy keybindings
54 bindkey "^A" beginning-of-line
55 bindkey "^E" end-of-line
56 bindkey "^R" history-incremental-search-backward
57 bindkey "^P" history-search-backward
58 bindkey "^Y" accept-and-hold
59 bindkey "^N" insert-last-word
60 bindkey -s "^T" "^[Isudo ^[A" # "t" for "toughguy"
61
62 # use vim as the visual editor
63 export VISUAL=vim
64 export EDITOR=$VISUAL
65
66 # ensure dotfiles bin directory is loaded first
67 export PATH="$HOME/.bin:/sbin:/usr/bin:usr/local/sbin:usr/local/sbin:$PATH"
68
69 # load rbenv if available
70 if which rbenv &>/dev/null ; then
71 eval "$(rbenv init - --no-rehash)"
72 fi
73
74 # mkdir .git/safe in the root of repositories you trust
75 export PATH=".git/safe/../../bin:$PATH"
76
77 # aliases
78 [[ -f ~/.aliases ]] && source ~/.aliases
79
80 # Local config
81 [
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment