Modules for Elvish Shell
Elvish 75.8%
Nix 24.2%
17 1 0

Clone this repository

https://tangled.org/ejri.dev/mellon
git@knot.ejri.dev:ejri.dev/mellon

For self-hosted knots, clone URLs may differ based on your setup.

README.md

mellon - Speak, friend, and enter#

Modules for Elvish Shell

Install#

epm#

Required until git.sr.ht is added upstream:

use epm
mkdir -p $epm:managed-dir/git.sr.ht/
echo "{
   \"method\": \"git\",
   \"protocol\": \"https\",
   \"levels\": \"2\"
}" > $epm:managed-dir/git.sr.ht/epm-domain.cfg

Install module

use epm
epm:install &silent-if-installed=$true git.sr.ht/~ejri/mellon

NixOS#

flake.nix supplies a NixOS module that lets you import in the same manner as epm

Input

mellon.url = "git+https://git.sr.ht/~ejri/mellon";

Use module

{
    ...
    nixosConfigurations = {
      modules = [
        mellon.nixosModules.default
      ];
    };
}

Usage#

use git.sr.ht/~ejri/mellon/<module>

atuin.elv#

Add bindings for Ctrl-r and Up to use atuin for searching history.

if (has-external atuin) {
	use git.sr.ht/~ejri/mellon/atuin
	set edit:insert:binding[Ctrl-r] = { atuin:search }
	set edit:insert:binding[Up] = { atuin:search-up }
}

fzf.elv#

Add bindings for Ctrl-r and Up to use fzf for searching history.

if (has-external fzf) {
	use git.sr.ht/~ejri/mellon/fzf
	set edit:insert:binding[Ctrl-r] = { fzf:history }
	set edit:insert:binding[Up] = { fzf:history }
}

yazi.elv#

Add an alias y that will cd on quit.

if (has-external yazi) {
	use git.sr.ht/~ejri/mellon/yazi
	edit:add-var y~ $yazi:y~
}