R. L. Dane :debian: :openbsd:🧉 on Nostr: Why didn't I think of this a long time ago? ``` function fopen { #"fzf-open" local ...
Why didn't I think of this a long time ago?
```
function fopen { #"fzf-open"
local selection="$(ls |fzf)"
local oIFS="$IFS"
IFS=$'\n'
[[ -n $selection ]] && open $selection
IFS="$oIFS"
}
```
(yes, I know fopen() is a C function. I just couldn't think of a better name than that or fzf-open, which is a pain to type)
```
function fopen { #"fzf-open"
local selection="$(ls |fzf)"
local oIFS="$IFS"
IFS=$'\n'
[[ -n $selection ]] && open $selection
IFS="$oIFS"
}
```
(yes, I know fopen() is a C function. I just couldn't think of a better name than that or fzf-open, which is a pain to type)