-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.aliases
155 lines (134 loc) · 4.62 KB
/
.aliases
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
## File shortcuts
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
## GPG
alias keys="gpg --list-secret-keys --keyid-format=long"
alias keygrip="gpg -K --with-keygrip"
## Web Stuff
alias stack="stackoverflow"
alias duck="ddg"
alias wolf="wolframalpha"
## Environments
alias compose="docker-compose"
alias gcp=gcloud
alias k=kubectl
alias t=terraform
alias v=vagrant
alias vb="VBoxManage"
alias g=git
alias f=flutter
alias fd="flutter doctor -v"
## IDE
alias studio="open -a /Applications/Android\ Studio.app"
alias xcode="open -a /Applications/XCode.app"
alias iphone="open -a Simulator"
## npm aliases
alias ni="npm install"
alias nrs="npm run start -s --"
alias nrb="npm run build -s --"
alias nrd="npm run dev -s --"
alias nrt="npm run test -s --"
alias nrtw="npm run test:watch -s --"
alias nrv="npm run validate -s --"
alias rnm="rm -rf node_modules"
alias flush-npm="rm -rf node_modules && npm i && echo NPM is done"
## Utilities
alias c="tr -d '\n' | pbcopy"
alias df="df -h"
alias du="du -hd1 | sort -h"
alias usage="du -h -d1"
alias runp="lsof -i"
alias catn="nl -b a"
## Shell
alias update="source ~/.zshrc" # Reload terminal profile.
alias bootstrap="source /Users/$USER/dotfiles/bootstrap.sh" # Regenerate dotfiles
alias reload="exec ${SHELL} -l"
## Software
alias upgrade='sudo softwareupdate -i -a; brew update; brew upgrade; brew cleanup; sudo gem update --system; sudo gem update --user-install; sudo gem cleanup'
alias pip=pip3
alias path='echo -e ${PATH//:/\\n}'
alias mergepdf='gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=_merged.pdf' # TODO - Research and test.
## Network
alias ip="ipconfig getifaddr en0"
alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)'"
alias ifactive="ifconfig | pcregrep -M -o '^[^\t:]+:([^\n]|\n\t)*status: active'"
# Show/hide hidden files in Finder
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# Hide/show all desktop icons (useful when presenting)
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
# URL-encode strings
alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1]);"'
# Always enable colored `grep` output
# Note: `GREP_OPTIONS="--color=auto"` is deprecated, hence the alias usage.
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# Enable aliases to be sudo’ed
alias sudo='sudo '
# Get week number
alias week='date +%V'
# Cursor.AI specific aliases
alias ai-commit="git smart-commit"
alias ai-review="git review"
alias ai-branch="git smart-branch"
# Enhanced development workflow
alias analyze="cursor-ai analyze-code"
alias suggest="cursor-ai suggest-improvement"
alias doc="cursor-ai generate-docs"
# Context-aware git operations
alias gc='f() { \
if [ -n "$CURSOR_AI_ACTIVE" ]; then \
git diff --cached | cursor-ai suggest-commit-message | git commit -F -; \
else \
git commit -m "$*"; \
fi \
}; f'
# File change analysis
alias changes='f() { \
if [ -n "$CURSOR_AI_ACTIVE" ]; then \
git status --porcelain | cursor-ai analyze-changes; \
else \
git status --porcelain; \
fi \
}; f'
# CURSOR AI INTEGRATION INSTRUCTIONS
# -----------------------------------
# Environment Detection:
# - $CURSOR_AI_ACTIVE indicates Cursor.AI IDE presence
# - Smart commands adapt based on environment
#
# Enhanced Git Operations:
# 1. Commit Messages:
# - ai-commit: Generate context-aware commit messages
# - gc: Smart commit with LLM suggestions
#
# 2. Code Review:
# - ai-review: Get AI-powered code review
# - analyze: Deep code analysis
#
# 3. Branch Management:
# - ai-branch: Generate meaningful branch names
#
# 4. Documentation:
# - doc: Generate documentation based on code
# - suggest: Get code improvement suggestions
#
# Usage Examples:
# - ai-commit # Generate smart commit message
# - ai-review HEAD~1 # Review changes since last commit
# - changes # Analyze current changes
# - doc ./src/feature.js # Generate documentation
#
# Note: Commands adapt to environment:
# - In Cursor.AI: Full LLM capabilities
# - Outside: Fallback to standard git operations
# -----------------------------------