Skip to content

Instantly share code, notes, and snippets.

@cirrusUK
Created October 19, 2020 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cirrusUK/bdedb401bea08002023b60d75e6bcbe3 to your computer and use it in GitHub Desktop.
Save cirrusUK/bdedb401bea08002023b60d75e6bcbe3 to your computer and use it in GitHub Desktop.
#!/bin/zsh
export DISPLAY=":0"
export XDG_RUNTIME_DIR=/run/user/$(id -u)
IFS=$'\n'
out=("$(rg --files --hidden | fzf --ansi -m --color dark,hl:172,hl+:46,fg+:26,bg+:235 --color info:150,prompt:26,spinner:150,pointer:26,marker:7,border:26 --border=sharp --prompt='➤ ' --pointer='➤ ' --marker='➤ ' --height 60% --expect=ctrl-o,ctrl-e )")
key=$(head -1 <<< "$out")
file=$(head -2 <<< "$out" | tail -1)
if [ -n "$file" ]
then
[ "$key" = ctrl-o ] && open "$file" || ${EDITOR:-vim} "$file"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment