mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 10:58:02 +00:00
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:
parent
4cbb300dae
commit
7ea15ea9fa
@ -88,58 +88,6 @@ in {
|
|||||||
"ls"
|
"ls"
|
||||||
"nvim"
|
"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
|
# Supercharging your shell history. Just don't forget to flush them out
|
||||||
|
Loading…
Reference in New Issue
Block a user