forked from searls/icloud-dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.aliases.nu
More file actions
87 lines (73 loc) · 2.43 KB
/
Copy path.aliases.nu
File metadata and controls
87 lines (73 loc) · 2.43 KB
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
# .aliases.nu - Nushell aliases
# Reload config (nushell can't alias `source`, use exec)
def resource [] { exec nu }
# Git shortcuts
alias gst = git status
alias gb = git branch
alias gba = git branch -a
alias gc = git commit -v
alias gca = git commit -v -a
alias gd = git diff
alias gl = git pull
alias gp = git push
alias glog = git log --abbrev-commit --pretty=oneline
alias gco = git checkout
alias gg = git grep -n
alias grh = git reset --HARD
alias hub = git
# Open GitUp at repo root
def gitup [] { ^open -a GitUp (git rev-parse --show-toplevel) }
# macOS system
alias lock = /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend
alias saferestart = osascript -e 'tell app "System Events" to restart'
alias safeshutdown = osascript -e 'tell app "System Events" to shut down'
alias sleepnow = pmset sleepnow
alias displaysleepnow = pmset displaysleepnow
alias fix_dns = sudo killall -HUP mDNSResponder
alias restartdns = fix_dns
alias chrome = ^open -a "Google Chrome"
alias lsregister = /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister
# iOS Simulator
alias simshot = xcrun simctl io booted screenshot
alias simaddmedia = xcrun simctl addmedia booted
alias simopenurl = xcrun simctl openurl booted
alias simappcontainer = xcrun simctl get_app_container booted
# Time Machine
alias timemachine_info = sudo tmutil listbackups
alias timemachine_start = sudo tmutil startbackup
alias timemachine_stop = sudo tmutil stopbackup
alias timemachine_boost = sudo sysctl debug.lowpri_throttle_enabled=0
alias timemachine_regular = sudo sysctl debug.lowpri_throttle_enabled=1
# System info
def versions [] {
print (sw_vers)
print "---"
print (xcodebuild -version)
}
# Node modules helpers
def find_node_modules [] {
glob **/node_modules --depth 10 | where ($it | path type) == "dir"
}
def nuke_node_modules [] {
find_node_modules | each {|dir| rm -rf $dir }
}
# Open Xcode workspace/project
def openx [] {
let workspace = (glob "*.xcworkspace" | first)
if ($workspace | is-not-empty) {
xed $workspace
return
}
let project = (glob "*.xcodeproj" | first)
if ($project | is-not-empty) {
xed $project
return
}
if ("Package.swift" | path exists) {
xed "Package.swift"
return
}
print "No Xcode files to open."
}
alias xcp = openx
def podxcp [] { pod install; openx }