-
Notifications
You must be signed in to change notification settings - Fork 0
/
.functions
34 lines (29 loc) · 957 Bytes
/
.functions
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
# Create a new directory and cd into it
function create() {
mkdir -p "$@" && cd "$_";
}
# clone a repo from url (https|git) and cd into it
function clone() {
local url=$1;
local repo=$(echo $url | awk -F/ '{print $NF}' | sed -e 's/.git$//');
git clone $url $repo && cd $repo;
}
# start new project with my 101 files
function start() {
local name=$1;
local [email protected]:armno/101.git
echo "$fg[yellow]Starting new project: $name $reset_color";
git clone $repo $name && cd $name && rm -rf .git;
echo "$fg[yellow]Initializing Git Repo$reset_color";
git init;
# empty the readme.md
echo "# $name" > readme.md;
echo "done"
}
function peg() {
filename=$(ls -1t $HOME/Desktop/Screen* | head -n 1)
sips --oneLine --setProperty format jpeg "$filename" --out "$HOME/Desktop/screenshot.jpg"
}
h() {
print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac --height "50%" | sed -E 's/ *[0-9]*\*? *//' | sed -E 's/\\/\\\\/g')
}