hammerspoon and reorganize old files to legacy

This commit is contained in:
Noah Masur
2022-06-14 07:32:27 -04:00
parent c048b7244f
commit df59e376f2
52 changed files with 2 additions and 0 deletions

25
legacy/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]}"