fix slow terminal init

Moved all completion.sh and .zsh files into the zsh directory, so I
don't end up scanning all of my dotfiles plus nvm each time a new
terminal is initialized.
This commit is contained in:
Nick Nisi
2014-03-14 21:42:34 -05:00
parent c937dead7e
commit cf9ef8c569
4 changed files with 2 additions and 2 deletions

44
zsh/git.zsh Normal file
View File

@@ -0,0 +1,44 @@
# git aliases
alias ga='git add'
alias gb='git branch'
alias gl='git pull'
alias gp='git push'
alias gd='git diff'
alias gdc='git diff --cached'
alias gs='git s'
alias gss='git stash save'
alias gsp='git stash pop'
alias gmv='git mv'
alias grm='git rm'
alias grn='git-rename'
alias glog="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
# alias git-amend='git commit --amend -C HEAD'
alias git-undo='git reset --soft HEAD~1'
alias git-count='git shortlog -sn'
alias git-undopush="git push -f origin HEAD^:master"
# git root
alias gr='[ ! -z `git rev-parse --show-cdup` ] && cd `git rev-parse --show-cdup || pwd`'
alias sub-pull='git submodule foreach git pull origin master'
function give-credit() {
git commit --amend --author $1 <$2> -C HEAD
}
# a simple git rename file function
# git does not track case-sensitive changes to a filename.
function git-rename() {
git mv $1 "${2}-"
git mv "${2}-" $2
}
function g() {
if [[ $# > 0 ]]; then
# if there are arguments, send them to git
git $@
else
# otherwise, run git status
git s
fi
}

6
zsh/git_completion.sh Normal file
View File

@@ -0,0 +1,6 @@
# this is specific to the location of the current version of git, installed by homebrew
completion=/usr/local/Cellar/git/1.8.0.1/etc/bash_completion.d/git-completion.bash
if test -f $completion; then
source $completion
fi

4
zsh/tmux.zsh Normal file
View File

@@ -0,0 +1,4 @@
alias ta='tmux attach'
alias tls='tmux ls'
alias tat='tmux attach -t'
alias tns='tmux new-session -s'

View File

@@ -6,7 +6,7 @@ if [[ -d ~/code ]]; then
fi
# load all zsh config files
for config ($ZSH/**/*.zsh) source $config
for config ($ZSH/zsh/**/*.zsh) source $config
if [[ -a ~/.localrc ]]; then
source ~/.localrc
@@ -17,7 +17,7 @@ fi
autoload -U compinit
compinit
for config ($ZSH/**/completion.sh) source $config
for config ($ZSH/zsh/**/*completion.sh) source $config
export EDITOR='vim'