-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.fish
142 lines (125 loc) · 3.82 KB
/
config.fish
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
# alias
alias l='ls'
alias lla='ll -a'
alias op='open'
alias rm='trash-put'
alias pecob='peco --layout bottom-up'
alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
alias load='exec $SHELL -l'
alias c='clear'
alias m='code ~/ghq/github.com/nkmr-jp/setup/.messages'
alias setup='code ~/ghq/github.com/nkmr-jp/setup'
alias sleepon='sudo pmset -a disablesleep 0'
alias sleepoff='sudo pmset -a disablesleep 1'
alias opg='gh repo view --web'
alias oura='open https://cloud.ouraring.com/dashboard'
alias e='open /Applications/Effortless.app'
alias get='ghu get'
alias init='ghu init'
alias profile='code ~/.zprofile'
alias run='go run main.go'
alias xbar='code ~/ghq/github.com/nkmr-jp/xbar/plugins'
alias ops='open https://console.cloud.google.com/storage/browser'
alias opf='open https://console.cloud.google.com/functions/list'
alias opb='open https://console.cloud.google.com/bigquery'
alias opr='open https://console.cloud.google.com/run'
alias ope='open https://console.cloud.google.com/eventarc/triggers'
alias wind='windsurf'
# util
function todo
if count $argv > /dev/null
if test $argv[1] = "all"
echo
echo
for x in (string split "\n" (echo $ACTIVE_REPO))
if test -f ~/ghq/github.com/nkmr-jp/$x/.todo.txt
set_color blue; echo "▶ /~https://github.com/nkmr-jp/$x"; set_color reset;
echo
set_color yellow;
sed 's/^/ • /' ~/ghq/github.com/nkmr-jp/$x/.todo.txt
set_color reset;
echo
end
end
else
echo "$argv[1]" >> .todo.txt
end
else if test -f .todo.txt
echo
set_color yellow;
sed 's/^/ • /' .todo.txt
set_color reset;
echo
end
end
function ql
qlmanage -p $argv[1] > /dev/null ^&1
end
function bash_colors
# See: https://gist.github.com/rsperl/d2dfe88a520968fbc1f49db0a29345b9
bash -c 'for c in {0..255}; do tput setaf $c; tput setaf $c | cat -v; echo =$c; done'
end
function colors
for x in (string split "\n" (set_color --print-colors))
set_color $x; echo $x; set_color reset;
end
end
function stats
echo ""
echo "[ Programing Languages ]"
go version
node -v
python -V
ruby -v
echo ""
echo ""
echo "[ macOS ]"
system_profiler SPSoftwareDataType
# system_profiler SPHardwareDataType
echo ""
echo ""
echo "[ iStats ]"
istats
end
# query
function query
open "https://www.google.com/search?q=$argv"
end
function query-go
open "https://pkg.go.dev/search?q=$argv"
end
function query-repo
open "/~https://github.com/nkmr-jp?tab=repositories&q=$argv"
end
function query-github
open "/~https://github.com/search?q=$argv"
end
# help
alias help-fish='open https://fishshell.com/docs/current/commands.html'
alias help-go-mod='open /~https://github.com/golang/go/wiki/Modules'
alias help-gh='open https://cli.github.com/manual/'
alias help-gcloud='open https://cloud.google.com/sdk/docs/cheatsheet'
alias help-docker='open https://docs.docker.com/engine/reference/commandline/docker/'
function help-jq
open https://dev.classmethod.jp/articles/jq-manual-japanese-translation-roughly/;
open https://stedolan.github.io/jq/manual/;
end
function help-go-zap
open https://pkg.go.dev/go.uber.org/zap?tab=doc
open https://qiita.com/emonuh/items/28dbee9bf2fe51d28153
end
# fish settings
## plugin settings
### /~https://github.com/franciscolourenco/done
set -U __done_min_cmd_duration 5000
## keybind
# bind \c] enhancd
## restore path order from zsh
set PATH $ZSH_PATH
## messages
function fish_greeting
gshuf -n 1 $HOME/ghq/github.com/nkmr-jp/setup/.messages
end
## pack
## See: https://buildpacks.io/docs/tools/pack/
# source (pack completion --shell fish)