-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.zshrc
89 lines (66 loc) · 2.75 KB
/
.zshrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Path to your oh-my-zsh installation.
export ZSH=/Users/bob/.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.
# While going randomly through oh-my-zsh's theme's, I've created a file
# of those I like, located at /home/carl/liked_themes.txt
# get line count of liked_themes
LIKED_THEMES_FILE_LENGTH=$(wc -l < /Users/bob/liked_themes.txt)
random_index=$[ RANDOM % LIKED_THEMES_FILE_LENGTH ]
let random_index+=1
# get n'th line to be used for ZSH theme
sed_arg='p'
ZSH_THEME=$(sed -n "$random_index$sed_arg" < /Users/bob/liked_themes.txt)
alias reload='source ~/.zshrc'
alias notes="vim ~/Documents/work/notes.txt"
alias g='git'
alias ga='git add '
alias gb='git branch '
alias gc='git commit -v' # shows git diff in text editor when adding message
alias gd='git diff'
alias weather="curl -4 wttr.in/Christchurch"
# Jump to directory given its name $ 'cd <dir>' -> <dir>
setopt AUTO_CD
# Trigger IDE users
setopt NO_BEEP
setopt VI
export EDITOR="vi"
# Alt-S inserts "sudo " at the start of line:
insert_sudo () { zle beginning-of-line; zle -U "sudo " }
zle -N insert-sudo insert_sudo
bindkey "^[s" insert-sudo
DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
HIST_STAMPS="mm/dd/yyyy"
# 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)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
# User configuration
source $ZSH/oh-my-zsh.sh
# Share aliases with bash
source $HOME/.aliases
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
xclip="xclip -selection c"
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
export PATH="$PATH:/usr/home/bin"
# Setup shared history amongst terminal windows
export HISTCONTROL=ignoredups:erasedups # no duplicate entries
export HISTSIZE=100000 # big big history
export HISTFILESIZE=100000 # big big history
# Save and reload the history after each command finishes
export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
# generate AWS codes e.g. mfa aws-bob
# where mfa file is in ~/.aws/aws-bob.mfa
function mfa () {
oathtool --base32 --totp "$(cat ~/.aws/$1.mfa)" ;
}