basic rofi and more macos cleanup

This commit is contained in:
Noah Masur
2022-05-07 09:24:17 -04:00
parent 43571c66dd
commit 4540327cb8
27 changed files with 155 additions and 23 deletions

25
macos/bin/quick-edit Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Credit: https://github.com/junegunn/fzf/blob/master/ADVANCED.md
# Requires bash.
# 1. Search for text in files using Ripgrep
# 2. Interactively narrow down the list using fzf
# 3. Open the file in Vim
IFS=: read -ra selected < <(
rg \
--color=always \
--line-number \
--no-heading \
--smart-case \
--iglob !/Library/** \
--iglob !/System/** \
--iglob "!Users/$HOME/Library/*" \
"${*:-}" |
fzf --ansi \
--color "hl:-1:underline,hl+:-1:underline:reverse" \
--delimiter : \
--preview 'bat --color=always {1} --highlight-line {2}' \
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3'
)
[ -n "${selected[0]}" ] && nvim "${selected[0]}" "+${selected[1]}"