1
Fork 0
dots/zsh/zsh-functions

24 lines
738 B
Bash

function zsh_add_plugin() {
PLUGIN_NAME=$(echo $1 | cut -d "/" -f 2)
[ ! -d "$HOME/.local/share/zsh/plugins/$PLUGIN_NAME" ] &&
git clone "https://github.com/$1.git" "$HOME/.local/share/zsh/plugins/$PLUGIN_NAME"
safe_source "$HOME/.local/share/zsh/plugins/$PLUGIN_NAME/$PLUGIN_NAME.plugin.zsh"
safe_source "$HOME/.local/share/zsh/plugins/$PLUGIN_NAME/$PLUGIN_NAME.zsh"
}
function cc() python -c "from math import *; print($*)"
function mkcd() mkdir -p -- $1 && cd -- $1
function serve() {
gem list -i '^webrick$' > /dev/null || gem install webrick
ruby -run -e httpd . -p 3000
}
function save-ssh-key() {
mv "$1" "$HOME/.ssh/${1}_${2}"
mv "$1.pub" "$HOME/.ssh/${1}_${2}.pub"
}
# vim: filetype=zsh