broot icon indicating copy to clipboard operation
broot copied to clipboard

Add support for Elvish

Open alexherbo2 opened this issue 5 years ago • 2 comments

Homepage | GitHub

Module

~/.elvish/lib/broot.elv

# Broot
# https://dystroy.org/broot/

fn br [@arguments]{
  path = (mktemp)
  broot --out $path $@arguments
  cd (cat $path)
  rm -f $path
}

Configuration

~/.elvish/rc.elv

# Modules
use broot

# Functions
fn br [@arguments]{
  broot:br $@arguments
}

alexherbo2 avatar Sep 16 '20 16:09 alexherbo2

Can you come to my chat and discuss this ?

https://miaou.dystroy.org/3490

Canop avatar Sep 16 '20 16:09 Canop

Updated version for the latest elvish and broot versions

fn br {|@arguments|
  var path = (mktemp)
  broot --outcmd $path $@arguments
  if ?(test -s $path) {
    eval (cat $path)
  }
  e:rm -f $path
}

haxscramper avatar Sep 29 '22 06:09 haxscramper