summaryrefslogtreecommitdiff
path: root/.config/fish/config.fish
blob: 357db65c769e8f09eb0e76d8e97521b3dfd6e26c (plain)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
if status is-interactive
    clear
end

function fish_greeting; end

function spf
    set os $(uname -s)

    if test "$os" = "Linux"
        set spf_last_dir "$HOME/.local/state/superfile/lastdir"
    end

    if test "$os" = "Darwin"
        set spf_last_dir "$HOME/Library/Application Support/superfile/lastdir"
    end

    command spf $argv

    if test -f "$spf_last_dir"
        source "$spf_last_dir"
        rm -f -- "$spf_last_dir" >> /dev/null
    end
end

function f
	set tmp (mktemp -t "yazi-cwd.XXXXXX")
	yazi $argv --cwd-file="$tmp"
	if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
		builtin cd -- "$cwd"
	end
	rm -f -- "$tmp"
end

function lt;
    eza --tree --color=always --icons=always --level=$argv
end

function a
    set max_depth 5
    set current_depth 0
    set dir (pwd)

    while test $current_depth -lt $max_depth
        if test -d "$dir/venv"
            source "$dir/venv/bin/activate.fish"
            return 0
        end
        set dir (dirname $dir)
        set current_depth (math $current_depth + 1)
    end

    echo "venv folder not found within $max_depth levels."
    return 1
end

function gitzip
    git ls-files | zip archive.zip -@
end

alias c=clear
alias g=fg
alias v=nvim
alias vv="nvim ."
alias ic="cd ~/Library/Mobile Documents/com~apple~CloudDocs"
alias cc="clear & cd"
alias l="eza --color=always --long --git --no-filesize --icons=always --no-time --no-user --no-permissions --group-directories-first"
alias ll="eza --color=always --long --git --icons=always --no-user --group-directories-first"
alias la="eza -a --color=always --long --git --no-filesize --icons=always --no-time --no-user --no-permissions --group-directories-first"
alias fa="fastfetch"
alias ff="yazi"
alias p=pgcli
alias t="tmux attach"
# alias d="deactivate"
alias d="zi"
alias venv="python3 -m venv venv"
alias cd="z"
# alias timewr="rm -rf ~/.local/share/timewarrior/data/"
alias s="ssh pi@tom.tinysun.net"
alias gi="git init && aig"
alias gs="git status"
alias aig="cp ~/.config/.gitignore-template ./.gitignore"
alias u="uv run"


function ga
    git add -A
    git commit -m "auto"
end

# Created by `pipx` on 2024-11-25 11:43:56
set PATH $PATH /Users/tom/.local/bin
# Cargo path
set PATH $HOME/.cargo/bin $PATH

eval "$(/opt/homebrew/bin/brew shellenv)"
zoxide init fish | source
atuin init fish --disable-up-arrow | source
export EDITOR="nvim"

# uv
fish_add_path "/Users/tomiko/.local/bin"

starship init fish | source
alias conda="/opt/homebrew/anaconda3/bin/conda"

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
# if test -f /opt/homebrew/anaconda3/bin/conda
#     eval /opt/homebrew/anaconda3/bin/conda "shell.fish" "hook" $argv | source
# else
#     if test -f "/opt/homebrew/anaconda3/etc/fish/conf.d/conda.fish"
#         . "/opt/homebrew/anaconda3/etc/fish/conf.d/conda.fish"
#     else
#         set -x PATH "/opt/homebrew/anaconda3/bin" $PATH
#     end
# end
# <<< conda initialize <<<

set -Ux CARAPACE_BRIDGES 'zsh,fish,bash,inshellisense' # optional
carapace _carapace | source