Files
dotfiles/dot_config/nushell/nu_scripts/sourced/fun/lisp_mode.nu
Cian Hughes 896af887ca Changed . token to _dot
This change allows the dotfiles to work with chezmoi (e.g: on windows)
and improves grepability with neovim/telescope
2024-11-07 13:52:17 +00:00

37 lines
557 B
Nu

# Note: this requires the latest 0.32.1 or later
#
# usage:
# > source lisp_mode.nu
# > (echo (+ 1 (* 3 2)))
def "+" [x, y] { $x + $y }
def "-" [x, y] { $x - $y }
def "*" [x, y] { $x * $y }
def "/" [x, y] { $x / $y }
def in [x, y] { $x in $y }
def not-in [x, y] { $x not-in $y}
def "<" [x, y] { $x < $y }
def "<=" [x, y] { $x <= $y }
def ">" [x, y] { $x > $y }
def ">=" [x, y] { $x >= $y }
def "==" [x, y] { $x == $y }
def "!=" [x, y] { $x != $y }
def "=~" [x, y] { $x =~ $y }
def "!~" [x, y] { $x !~ $y }
def array [...rest] { echo $rest }