-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.fish
More file actions
128 lines (106 loc) · 2.91 KB
/
Copy pathconfig.fish
File metadata and controls
128 lines (106 loc) · 2.91 KB
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
122
123
124
125
126
127
128
set fish_greeting ""
set MC_SKIN $HOME/dotfiles/mc_solarized_light.ini
set HOMEBREW_NO_ENV_HINTS 1
set EDITOR (which vim)
function free-space
sudo apt-get autoremove
brew cleanup
rm -rf ~/Downloads/tmp/*
rm -rf /tmp/*
rvm cleanup all
npm cache clear
yarn cache clean
end
function localnet
nmap -sn 192.168.1.0/24 -oG - | awk '/Up$/{print $2}'
end
function words
vim -c 'execute ":WikiJournal" | :Goyo'
end
function wiki
vim -c 'execute ":WikiIndex"'
end
function links
vim ~/Nextcloud/wiki/links/(date +%Y.%m.%d).md -c ':AutoSaveToggle'
end
function gprom
git pull --rebase origin main
end
function gprot
git pull --rebase origin trunk
end
function gprod
git pull --rebase origin develop
end
function ...
../..
end
function ud
pushd .
cd ..
popd
end
function pbedit
pbpaste | vipe | pbcopy
end
function public-ip
curl icanhazip.com
end
function my-ip
ifconfig | grep "inet " | grep -i mask | grep -v 127.0.0.1 | perl -pe 's/^\s+//' | cut -d ' ' -f2 | sed 's/addr://'
end
# https://github.com/gsamokovarov/.files/blob/master/.config/fish/aliases.fish
abbr -a be bundle exec
abbr mkdir "mkdir -p"
abbr cdd "cd ~/dotfiles"
abbr cdg "cd ~/github"
abbr cddm "cd ~/github/deanmarano/"
abbr cdra "cd ~/github/deanmarano/recipes-api"
abbr cdru "cd ~/github/deanmarano/recipes-ui"
abbr -a vi vim
abbr -a bb "cd ~/dotfiles; and brew bundle; and cd -;"
abbr kaboom "rm -rf node_modules tmp dist; and npm install"
abbr -a gcp "git cherry-pick"
function git --wraps git --description "git wrapper with cd subcommand"
if test (count $argv) -ge 2 && test "$argv[1]" = "cd"
set -l github_user
set -l github_repo
if string match -q '*/*' $argv[2]
set github_user (string split '/' $argv[2])[1]
set github_repo (string split '/' $argv[2])[2]
else
set github_user (command git config github.user)
set github_repo $argv[2]
end
mkdir -p ~/github/$github_user
if not test -d ~/github/$github_user/$github_repo
command git clone git@github.com:$github_user/$github_repo.git ~/github/$github_user/$github_repo
end
cd ~/github/$github_user/$github_repo
else
command git $argv
end
end
# http://transit.iut2.upmf-grenoble.fr/doc/kitty/html/kittens/icat.html
alias icat="kitty +kitten icat"
# https://github.com/fish-shell/fish-shell/issues/1363
function nohist
set -l prefix $HOME/.config
set -l path fish/fish_history
if set -q XDG_CONFIG_HOME
set prefix $XDG_CONFIG_HOME
end
if test -f $prefix/$path.copy
mv $prefix/$path.copy $prefix/$path
else
cp -f $prefix/$path $prefix/$path.copy
echo y | history --clear > /dev/null
end
end
# Auto-install asdf from source
if test -e ~/.asdf/asdf.fish
source ~/.asdf/asdf.fish
else
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.9.0
source ~/.asdf/asdf.fish
end