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.
This commit is contained in:
Gabriel Arazas 2023-06-23 18:15:05 +08:00
parent 4cbb300dae
commit 7ea15ea9fa
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -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