Merge fzy-edit into fzy-open

This commit is contained in:
Arun Prakash Jana 2019-08-22 19:58:39 +05:30
parent 0fbd68ab48
commit 9feb5ce651
No known key found for this signature in database
GPG key ID: A75979F35C080412
3 changed files with 12 additions and 12 deletions

View file

@ -6,8 +6,7 @@ The currently available plugins are listed below.
| --- | --- | --- | --- | | --- | --- | --- | --- |
| boom | sh | SMPlayer | Play random music from dir (modify `PLAYER`) | | boom | sh | SMPlayer | Play random music from dir (modify `PLAYER`) |
| checksum | sh | md5sum,<br>sha256sum | Create and verify checksums | | checksum | sh | md5sum,<br>sha256sum | Create and verify checksums |
| fzy-edit | sh | fzy | Fuzzy find a file in directory subtree and edit in vim | | fzy-open | sh | fzy, xdg-open | Fuzzy find a file in dir subtree and edit or xdg-open |
| fzy-open | sh | fzy | Fuzzy find a file in directory subtree and open using xdg-open |
| getplugs | sh | wget | Update plugins | | getplugs | sh | wget | Update plugins |
| hexview | sh | xxd | View a file in hex in `$PAGER` | | hexview | sh | xxd | View a file in hex in `$PAGER` |
| imgresize | sh | [imgp](https://github.com/jarun/imgp) | Resize images in directory to screen resolution | | imgresize | sh | [imgp](https://github.com/jarun/imgp) | Resize images in directory to screen resolution |

View file

@ -1,8 +0,0 @@
#!/usr/bin/env sh
# Description: Fuzzy find a file in directory subtree with fzy and edit in vim
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
vim "$(find -type f | fzy)"

View file

@ -1,8 +1,17 @@
#!/usr/bin/env sh #!/usr/bin/env sh
# Description: Fuzzy find a file in directory subtree with fzy and open using xdg-open # Description: Fuzzy find a file in directory subtree with fzy
# Opens in $VISUAL or $EDITOR if text
# Opens other type of files with xdg-open
# #
# Shell: POSIX compliant # Shell: POSIX compliant
# Author: Arun Prakash Jana # Author: Arun Prakash Jana
xdg-open "$(find -type f | fzy)" >/dev/null 2>&1 entry="$(find -type f | fzy)"
case "$(file -biL "$entry")" in
*text*)
"${VISUAL:-$EDITOR}" "$entry" ;;
*)
xdg-open "$entry" >/dev/null 2>&1 ;;
esac