bind ctrl-n to nix run

This commit is contained in:
Noah Masur 2022-07-05 20:42:49 -04:00
parent 758321adc3
commit 682acdc8ae
2 changed files with 7 additions and 1 deletions

View File

@ -45,7 +45,11 @@
nix-shell-run = { nix-shell-run = {
body = '' body = ''
set program $argv[1] set program $argv[1]
commandline -r "nix-shell -p $program --run \"$program $argv[2..-1]\"" if test (count $argv) -ge 1
commandline -r "nix run nixpkgs#$program -- $argv[2..-1]"
else
commandline -r "nix run nixpkgs#$program"
end
commandline -f execute commandline -f execute
''; '';
}; };

View File

@ -14,3 +14,5 @@ bind -M insert \cp projects
bind -M default \cp projects bind -M default \cp projects
bind -M insert \x1F accept-autosuggestion bind -M insert \x1F accept-autosuggestion
bind -M default \x1F accept-autosuggestion bind -M default \x1F accept-autosuggestion
bind -M insert \cn 'commandline -r "nix run nixpkgs#"'
bind -M default \cn 'commandline -r "nix run nixpkgs#"'