summaryrefslogtreecommitdiff
path: root/commands.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'commands.zsh')
-rw-r--r--commands.zsh97
1 files changed, 97 insertions, 0 deletions
diff --git a/commands.zsh b/commands.zsh
new file mode 100644
index 0000000..2e1ec76
--- /dev/null
+++ b/commands.zsh
@@ -0,0 +1,97 @@
+alias vim=nvim
+alias vi=nvim
+alias v=nvim
+alias vl="VIM_THEME=PaperColor VIM_AIRLINE_THEME=papercolor VIM_BACKGROUND=light v"
+alias g=git
+alias cat=bat
+alias b=bat
+alias man=batman
+alias c=clear
+alias e=exit
+alias rm=trash
+alias bx='bundle exec'
+alias bxr='bx rake'
+alias s='bx rspec'
+alias ls='lsd -1'
+alias r='bin/rails'
+alias leaky="pkill -9 -f 'rb-fsevent|rails|puma|node'"
+alias awake="sudo pmset -a sleep 0; sudo pmset -a hibernatemode 0; sudo pmset -a disablesleep 1;"
+alias sleepy="sudo pmset -a sleep 1; sudo pmset -a hibernatemode 25; sudo pmset -a disablesleep 0;"
+
+function peek() {
+ cat $(need)
+}
+
+function thisruby() {
+ chruby $(cat .ruby-version)
+}
+
+function vls() {
+ vl $(need)
+}
+
+function vg() {
+ vim -c "G"
+}
+
+function vs() {
+ vim $(need)
+}
+
+function vr() {
+ vim -c Ranger
+}
+
+function ss() {
+ bundle exec rspec $(need | tee .spec-history)
+}
+
+function ssr() {
+ bundle exec rspec $(cat .spec-history)
+}
+
+function need() {
+ rg . -l | fzy
+}
+
+function dig() {
+ rg . | fzy -l 20 | gawk '{split($0, a, ":"); print a[1]}'
+}
+
+function vd() {
+ v $(dig)
+}
+
+function dbup() {
+ pg_ctl -D /usr/local/var/postgres start
+ redis-server /usr/local/etc/redis.conf --daemonize yes
+}
+
+# TODO stop redis
+function dbdown() {
+ pg_ctl -D /usr/local/var/postgres stop
+}
+
+function smol() {
+ ffmpeg -i $1 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 $2
+}
+
+function spacify() {
+ tr '\n' ' ' < $1
+}
+
+function get_rake_task() {
+ strip $(bundle exec rake -T | fzy)
+}
+
+function rakey() {
+ bundle exec $(get_rake_task | tee .rake-history)
+}
+
+function rake_replay() {
+ bundle exec $(cat .rake-history)
+}
+
+function again() {
+ $(history -n 1000 | uniq | fzy)
+}