aboutsummaryrefslogtreecommitdiffstats
path: root/.config/fish/config.fish
blob: 82fdbde3550361bca83bdd65435e00a1cfab7da4 (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
# Disable greeting
set -g fish_greeting

abbr -a gs git status
abbr -a gc git commit
abbr -a ga git add
abbr -a gd git diff
abbr -a gds git diff --staged
abbr -a gp git push
abbr -a gpo git push origin
abbr -a gpl git pull
abbr -a gplrb git pull --rebase
abbr -a gl git log
abbr -a gv "git log --graph --decorate --oneline"
abbr -a gch git checkout
abbr -a gcb "git checkout -b"

abbr -a l "ls -al"

function auto_venv --on-variable PWD
  if test -n "$VIRTUAL_ENV"
    set parentdir (dirname "$VIRTUAL_ENV")
    if not string match -q "$parentdir/*" "$PWD"
      if functions -q deactivate
        deactivate
      end
    end
  end
  if test -z "$VIRTUAL_ENV"
    if test -f "$PWD/.venv/bin/activate.fish"
      source "$PWD/.venv/bin/activate.fish"
    end
  end
end