aboutsummaryrefslogtreecommitdiff
path: root/dot_config/fish/config.fish.tmpl
blob: 30c8bc811a01ea5b99f89c7a050bbf811b08a69b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# source /usr/share/cachyos-fish-config/cachyos-config.fish

function fish_greeting
  {{- if eq .chezmoi.hostname "ubuntu" }}
    if test -z "$TMUX"
        tmux new -As default
    end
  {{- else }}
   fastfetch
  {{- end }}
end

# Add ~/.local/bin to PATH
if test -d ~/.local/bin
    if not contains -- ~/.local/bin $PATH
        set -p PATH ~/.local/bin
    end
end

# Add depot_tools to PATH
if test -d ~/Applications/depot_tools
    if not contains -- ~/Applications/depot_tools $PATH
        set -p PATH ~/Applications/depot_tools
    end
end

# Fish command history
function history
    builtin history --show-time='%F %T '
end

# Copy DIR1 DIR2
function copy
    set count (count $argv | tr -d \n)
    if test "$count" = 2; and test -d "$argv[1]"
        set from (echo $argv[1] | trim-right /)
        set to (echo $argv[2])
        command cp -r $from $to
    else
        command cp $argv
    end
end

set -U fish_complete_path $fish_complete_path /nix/var/nix/profiles/default/share/fish/vendor_completions.d
set -Ux EDITOR nvim
set -U fish_history_max 1000

{{ if eq .chezmoi.hostname "ubuntu" -}}
    fish_add_path /opt/nvim-linux-x86_64/bin ~/.cargo/bin/
{{- end }}

alias vim='nvim'
alias cd='z'
alias ls='eza --icons=always --color=always'
alias untar='tar -zxvf '
alias grep='grep --color=auto'
alias cleanup='sudo pacman -Rns (pacman -Qtdq)'

chezmoi completion fish | source
direnv hook fish | source
zoxide init fish | source
starship init fish | source