Skip to content

Commit

Permalink
fix(fish): move newline fix into config.fish
Browse files Browse the repository at this point in the history
  • Loading branch information
uncenter committed Apr 12, 2024
1 parent 647d271 commit cbd9706
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
15 changes: 0 additions & 15 deletions home/programs/fish.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,6 @@
cwebp -lossless $file -o $output
end
'';

__newlinefix = {
body = ''
if test -z "$NEW_LINE_BEFORE_PROMPT"
set -gx NEW_LINE_BEFORE_PROMPT 1
else if test "$NEW_LINE_BEFORE_PROMPT" -eq 1
echo
end
'';
onEvent = "fish_prompt";
};
clear = ''
set -gx NEW_LINE_BEFORE_PROMPT
command clear
'';
};
};

Expand Down
23 changes: 20 additions & 3 deletions home/programs/fish/config.fish
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
/opt/homebrew/bin/brew shellenv | source

fish_add_path -Pm /etc/profiles/per-user/$USER/bin /run/current-system/sw/bin
# https://fishshell.com/docs/current/cmds/fish_add_path.html

fish_add_path -Pm /etc/profiles/per-user/$USER/bin /run/current-system/sw/bin
fish_add_path $GOPATH/bin
fish_add_path $CARGO_HOME/bin
fish_add_path $PNPM_HOME
fish_add_path $XDG_BIN_HOME
fish_add_path $XDG_SCRIPT_DIR
fish_add_path $HOME/.local/bin

function newlinefix --on-event fish_prompt
if test -z "$NEW_LINE_BEFORE_PROMPT"
set -gx NEW_LINE_BEFORE_PROMPT 1
else if test "$NEW_LINE_BEFORE_PROMPT" -eq 1
echo
end
end
function clear
set -gx NEW_LINE_BEFORE_PROMPT
command clear
end
function reset
set -gx NEW_LINE_BEFORE_PROMPT
command reset
end

starship init fish | source
fnm env | source
atuin init fish | source

# https://fishshell.com/docs/current/cmds/fish_greeting.html
set fish_greeting

0 comments on commit cbd9706

Please sign in to comment.