elvish_config/aliases/bat.elv

17 lines
292 B
Plaintext
Raw Normal View History

2020-03-13 14:03:36 +00:00
#alias:new bat e:bat
fn bat [@_args]{
styles = [ --style -n --number -p --plain -pp ]
has_style = $false
for e $_args {
if (has-value $styles $e) {
has_style = true
break
}
}
@pargs = $@_args
if (not $has_style) {
@pargs = -p $@_args
}
e:bat $@pargs
}