Files
dotfiles/home/fish/config.fish
T
2026-07-09 17:49:47 +01:00

46 lines
851 B
Fish

set -gx fish_greeting
function nix
if test "$argv[1]" = "develop"
command nix develop -c fish $argv[2..-1]
else if test "$argv[1]" = "shell"
env IN_NIX_SHELL=shell nix $argv
else
command nix $argv
end
end
function a
for arg in $argv
if string match -q '*/' $arg
mkdir -p $arg
else
mkdir -p (dirname $arg)
touch $arg
end
end
end
function y
set tmp (mktemp -t "yazi-cwd.XXXXXX")
yazi $argv --cwd-file="$tmp"
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
builtin cd -- "$cwd"
end
end
function g
if git rev-parse --git-dir >/dev/null 2>&1
gitui
else
echo "Not inside a Git repository."
end
end
function editor
set pos (cat ~/dotfiles/.pos)
y $pos
if test -e ./p.vim
nvim -S ./p.vim
else
nvim
end
echo $PWD > ~/dotfiles/.pos
end