diff options
| author | Alec Goncharow <alec@goncharow.dev> | 2023-12-14 18:37:15 -0500 |
|---|---|---|
| committer | Alec Goncharow <alec@goncharow.dev> | 2023-12-14 18:37:15 -0500 |
| commit | c3575e1f0448faf27d9d00042ed124028b82f26b (patch) | |
| tree | e6f176b03a83536bf1bbd9f0ca378058c5c6f25a /functions | |
| parent | 16234cf74ac878d07cde2a88baf79d1c17f18fec (diff) | |
sync
Diffstat (limited to 'functions')
| -rwxr-xr-x | functions/fzf.sh | 17 | ||||
| -rwxr-xr-x | functions/zig.sh | 24 |
2 files changed, 41 insertions, 0 deletions
diff --git a/functions/fzf.sh b/functions/fzf.sh new file mode 100755 index 0000000..8761247 --- /dev/null +++ b/functions/fzf.sh @@ -0,0 +1,17 @@ +#!/bin/zsh + +function frg { + result=$(rg --ignore-case --color=always --line-number --no-heading "$@" | + fzf --ansi \ + --color 'hl:-1:underline,hl+:-1:underline:reverse' \ + --delimiter ':' \ + --preview "bat --color=always {1} --theme='gruvbox-dark' --highlight-line {2}" \ + --preview-window 'up,60%,border-bottom,+{2}+3/3,~3') + file=${result%%:*} + linenumber=$(echo "${result}" | cut -d: -f2) + if [[ -n "$file" ]]; then + nvim +"${linenumber}" "$file" + fi +} + +alias rgf=frg diff --git a/functions/zig.sh b/functions/zig.sh new file mode 100755 index 0000000..49b437a --- /dev/null +++ b/functions/zig.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +zb () { + zig build "$@" +} + +zbs() { + zig build "$@" --summary all +} + +zt () { + zig build test "$@" +} + +zts() { + zig build test "$@" --summary all +} + +zr () { + zig build run "$@" +} + +zrs() { + zig build run "$@" --summary all +} |
