From 7ea15ea9fa7dc3e8c5757f00415a37efebdb8c45 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 23 Jun 2023 18:15:05 +0800 Subject: [PATCH] profiles/dev: remove extra Bash functions It turns out fzf has some niceties with history and file selection which is closer to how I imagine it. PRETTY NICE! But it does override my Atuin configuration which doesn't have its shell integration enabled. It does have some conflict with the Wezterm shell integration. This is a problem for future me to deal with. --- modules/home-manager/profiles/dev.nix | 52 --------------------------- 1 file changed, 52 deletions(-) diff --git a/modules/home-manager/profiles/dev.nix b/modules/home-manager/profiles/dev.nix index 1b85cf83..1eb29090 100644 --- a/modules/home-manager/profiles/dev.nix +++ b/modules/home-manager/profiles/dev.nix @@ -88,58 +88,6 @@ in { "ls" "nvim" ]; - bashrcExtra = '' - function f() { - dir=''${1:-$PWD} - dest=$(${pkgs.fd}/bin/fd --type directory --ignore-vcs --base-directory "$dir" \ - | ${pkgs.fzf}/bin/fzf --prompt "Go to directory ") - destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest") - - [ "$dest" ] && cd "$destPrime" - } - - function fh() { - dir=''${1:-$PWD} - dest=$(${pkgs.fd}/bin/fd --type directory --hidden --ignore-vcs --base-directory "$dir" \ - | ${pkgs.fzf}/bin/fzf --prompt "Go to directory ") - destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest") - - [ "$dest" ] && cd "$destPrime" - } - - function ff() { - dir=''${1:-$PWD} - dest=$(${pkgs.fd}/bin/fd --ignore-vcs --base-directory "$dir" \ - | ${pkgs.fzf}/bin/fzf --prompt "Open file ") - destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest") - - if [ -d "$destPrime" ]; then - [ "$dest" ] && cd "$destPrime"; - else - [ "$dest" ] && ${pkgs.xdg-utils}/bin/xdg-open "$destPrime"; - fi - } - - function ffh() { - dir=''${1:-$PWD} - dest=$(${pkgs.fd}/bin/fd --hidden --ignore-vcs --base-directory "$dir" \ - | ${pkgs.fzf}/bin/fzf --prompt "Open file ") - destPrime=$(${pkgs.coreutils}/bin/realpath --canonicalize-existing --logical "$dir/$dest") - - if [ -d "$destPrime" ]; then - [ "$dest" ] && cd "$destPrime"; - else - [ "$dest" ] && ${pkgs.xdg-utils}/bin/xdg-open "$destPrime"; - fi - } - - function fm() { - ${pkgs.man}/bin/man -k . \ - | ${pkgs.fzf}/bin/fzf --multi --prompt "Open manpage(s) " \ - | ${pkgs.gawk}/bin/awk '{ print $1 "." gensub(/[()]/, "", "g", $2) }' \ - | ${pkgs.findutils}/bin/xargs man - } - ''; }; # Supercharging your shell history. Just don't forget to flush them out