···
1
-
{{ $brewPath := lookPath "brew" }}
4
-
set -x HOMEBREW_NO_INSTALL_CLEANUP 1
5
-
set -x HOMEBREW_NO_ANALYTICS 1
6
-
set -x HOMEBREW_NO_AUTO_UPDATE 1
7
-
set -x HOMEBREW_NO_INSTALL_CLEANUP 1
8
-
set -x HOMEBREW_NO_INSTALL_UPGRADE 1
9
-
set -x HOMEBREW_NO_UPDATE_REPORT_NEW 1
10
-
set -x HOMEBREW_NO_ENV_HINTS 1
11
-
eval ({{ $brewPath | quote }} shellenv)
4
+
{{ $brewPath := lookPath "brew" -}}
5
+
if test -x {{ $brewPath | quote }}
6
+
set -x HOMEBREW_NO_ANALYTICS 1
7
+
set -x HOMEBREW_NO_AUTO_UPDATE 1
8
+
set -x HOMEBREW_NO_ENV_HINTS 1
9
+
set -x HOMEBREW_NO_INSTALL_CLEANUP 1
10
+
set -x HOMEBREW_NO_INSTALL_UPGRADE 1
11
+
set -x HOMEBREW_NO_UPDATE_REPORT_NEW 1
12
+
eval ({{ $brewPath | quote }} shellenv)
14
-
# Add directories to path.
16
+
# Add directories to PATH.
fish_add_path --global {{ joinPath .chezmoi.homeDir ".cargo/bin" | quote }}
fish_add_path --global {{ joinPath .chezmoi.homeDir ".local/bin" | quote }}
21
+
{{ if eq .chezmoi.os "linux" -}}
# Set XDG data directories.
set -x XDG_CACHE_HOME {{ joinPath .chezmoi.homeDir ".cache" | quote }}
set -x XDG_CONFIG_HOME {{ joinPath .chezmoi.homeDir ".config" | quote }}
set -x XDG_DATA_HOME {{ joinPath .chezmoi.homeDir ".local/share" | quote }}
set -x XDG_STATE_HOME {{ joinPath .chezmoi.homeDir ".local/state" | quote }}
24
-
{{ $editorName := .editor | default "vi" -}}
25
-
{{ $editorPath := lookPath $editorName -}}
26
-
{{ if $editorPath -}}
27
-
set -x EDITOR {{ $editorPath | quote }}
34
+
{{ $editorName := .editor -}}
35
+
if command --query {{ $editorName | quote }}
36
+
set -x EDITOR {{ $editorName | quote }}
30
-
{{ $batPath := lookPath "bat" }}
34
-
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
35
-
set -x MANROFFOPT "-c"
36
-
set -x BAT_PAGER "less -FIKMFRS"
42
+
if command --query bat
44
+
set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
45
+
set -x MANROFFOPT "-c"
46
+
set -x BAT_PAGER "less -FIKMFRS"
39
-
# Set default less options.
40
-
set -x SYSTEMD_LESS FIKMRS
49
+
{{ if eq .chezmoi.os "linux" -}}
51
+
# Configure systemd.
53
+
set -x SYSTEMD_LESS "FIKMRS"
42
-
{{ $jjPath := lookPath "jj" }}
44
-
# Enable JJ completions.
45
-
COMPLETE=fish {{ $jjPath | quote }} | source
57
+
# Enable Jujutsu completions.
59
+
if command --query jj
60
+
COMPLETE=fish jj | source
48
-
{{ $gioPath := lookPath "gio" }}
50
-
# Disable rm if the trash is enabled.
51
-
alias ts "{{ $gioPath }} trash"
53
-
echo "'rm' is disabled. use 'ts' to move items to trash, or 'command rm' to use rm."
63
+
{{ if eq .chezmoi.os "linux" -}}
65
+
# Replace 'rm' with 'ts'.
67
+
if command --query gio
68
+
alias ts "gio trash"
70
+
echo "'rm' is disabled. use 'ts' to move items to trash, or 'command rm' to use rm."
if status --is-interactive
59
-
{{ $atuinPath := lookPath "atuin" }}
62
-
atuin init fish | source
80
+
if command --query atuin
81
+
atuin init fish | source