index — dots-the-third @ ec94cc7699466753fa608f482cde8ef147a9cd7c

I don't need nix, I have a way worse solution!

fish/.config/fish/functions/_pisces_backspace.fish (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
function _pisces_backspace -d "Overrides backspace to handle empty pairs removal"

    set -l line (commandline | string join \n)
    set -l index (commandline -C)
    if [ $index -ge 1 ]
        set -l char (string sub -s $index -l 1 -- "$line")
        for pair in $pisces_pairs
            set -l var (string split -- ',' $pair)
            if [ $var[1] = $char ]
                _pisces_remove $var
                and return 0
            end
        end
    end

    commandline -f backward-delete-char
end