give helix a proper whirl as a daily driver
This commit is contained in:
parent
fba5c2942d
commit
2682af3b05
7 changed files with 316 additions and 45 deletions
21
bin/tmux-hx-helper
Executable file
21
bin/tmux-hx-helper
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
set -exo pipefail
|
||||
|
||||
eval "$(direnv export bash 2>/dev/null)"
|
||||
|
||||
PATH="$HOME/bin:$PATH"
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
_file=$(readlink -f "$@")
|
||||
else
|
||||
FZF=${FZF:-"fzf-tmux -p 90%,50% -y 0"}
|
||||
_root=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
|
||||
_store=$(echo "$_root" | sha1sum | cut -d ' ' -f 1)
|
||||
_file=$( ( (fre --store_name "$_store" --sorted | xargs -n 100 ls -d 2>/dev/null || true) && fd --type f --hidden --follow --exclude .git --ignore-file "${_root}/.gitignore" . "$_root") | cat -n | sort -k2 -k1n | uniq -f1 | sort -nk1,1 | cut -f2- | sed -e "s#^${_root}/##" | $FZF --no-sort)
|
||||
_file="${_root}/${_file}"
|
||||
fre --store_name "$_store" --add "$_file"
|
||||
fi
|
||||
|
||||
(tmux select-window -t helix &&
|
||||
tmux send-keys -t helix Escape &&
|
||||
tmux send-keys -t helix ":open ${_file}" Enter) || tmux new-window -t 42 -n helix helix "${_file}"
|
Loading…
Add table
Add a link
Reference in a new issue