Skip to content

Commit 6a74759

Browse files
committed
refactor(config): update zshrc settings
1 parent 7a76bc4 commit 6a74759

File tree

9 files changed

+127
-6
lines changed

9 files changed

+127
-6
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: ⬇️ Checkout project
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1717

1818
- name: ⚪️ Set needed environment variables
1919
run: |
@@ -29,7 +29,7 @@ jobs:
2929

3030
steps:
3131
- name: ⬇️ Checkout project
32-
uses: actions/checkout@v2
32+
uses: actions/checkout@v4
3333

3434
- name: 🐿️ Setup go version
3535
uses: actions/setup-go@v2
@@ -59,7 +59,7 @@ jobs:
5959

6060
steps:
6161
- name: ⬇️ Checkout project
62-
uses: actions/checkout@v2
62+
uses: actions/checkout@v4
6363

6464
- name: 📥 Install .dotfiles
6565
run: echo "$HOME/.dotfiles" | bash installer

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<br>
77
<br>
88

9-
![GitHub CI Workflow Status](https://img.shields.io/github/workflow/status/borjapazr/dotfiles/CI?style=flat-square&logo=github&label=CI)
9+
![GitHub CI Workflow Status](https://img.shields.io/github/actions/workflow/status/borjapazr/dotfiles/ci.yml?style=flat-square&logo=github&label=CI)
1010

1111
<h4>
1212
💻🚀 Custom dotfiles for UNIX based systems

git/.gitconfig

+7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
[push]
3333
default = simple
34+
autoSetupRemote = true
3435

3536
[apply]
3637
whitespace = fix
@@ -81,6 +82,9 @@
8182
[commit]
8283
gpgsign = true
8384

85+
[credential]
86+
helper = osxkeychain
87+
8488
[tag]
8589
gpgsign = true
8690

@@ -90,3 +94,6 @@
9094
[alias]
9195
nah = "!f(){ git reset --hard; git clean -df; if [ -d ".git/rebase-apply" ] || [ -d ".git/rebase-merge" ]; then git rebase --abort; fi; }; f"
9296
undo = "reset HEAD~1 --mixed"
97+
98+
[init]
99+
defaultBranch = main

git/.gitignore_global

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
# Clojure
1212
.lein-repl-history
1313
.lein-failures
14-
completer.hist
14+
completer.histw
1515
.nrepl-port
16+
.lsp
17+
.clj-kondo
1618

1719
# Scala
1820
libsigar-universal64-macosx.dylib

scripts/core/_main.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
if ! ${DOT_MAIN_SOURCED:-false}; then
2-
for file in $DOTFILES_PATH/scripts/core/{args,docs,dot,git,log,platform,str}.sh; do
2+
for file in $DOTFILES_PATH/scripts/core/{args,docs,dot,git,log,platform,selector,str}.sh; do
33
source "$file"
44
done
55
unset file

scripts/core/selector.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
selector::select() {
2+
options=""
3+
while read -r data; do
4+
options="$options\n$data"
5+
done
6+
7+
printf "$options" | choose -c 31d6e0
8+
}

scripts/docker/logs

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
source "$DOTFILES_PATH/scripts/core/_main.sh"
6+
7+
##? Shows the logs of the selected container
8+
##?
9+
##? Usage:
10+
##? logs
11+
docs::parse "$@"
12+
13+
if docker ps >/dev/null 2>&1; then
14+
container=$(docker ps | awk '{if (NR!=1) print $1 ": " $(NF)}' | fzf --height 40%)
15+
16+
if [[ -n $container ]]; then
17+
container_id=$(echo $container | awk -F ': ' '{print $1}')
18+
19+
docker logs -f --tail 100 $container_id
20+
else
21+
echo "You haven't selected any container! ༼つ◕_◕༽つ"
22+
fi
23+
else
24+
echo "Docker daemon is not running! (ಠ_ಠ)"
25+
fi

scripts/system/empty_trash

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
source "$DOTLY_PATH/scripts/core/_main.sh"
6+
7+
##? Empty the trash and remove cache files
8+
#?? 1.0.0
9+
##?
10+
##? Usage:
11+
##? empty_trash
12+
docs::parse "$@"
13+
14+
free_space_in_home() {
15+
df -h ~ | tail -n1 | awk '{print $4}'
16+
}
17+
18+
free_space_before_empty=$(free_space_in_home)
19+
20+
ls /Volumes | grep -v GoogleDrive | xargs -I_ sudo rm -rfv /Volumes/_/.Trashes
21+
sudo rm -rfv ~/.Trash/*
22+
echo '🗑 All trashes empty'
23+
24+
sudo rm -rfv /private/var/log/asl/*.asl
25+
sudo rm -rfv /var/log/asl/*.asl
26+
echo '📜 Mac logs empty'
27+
28+
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'
29+
echo '⏬ Mac downloads history empty'
30+
31+
rm -rf "$HOME/Movies/"*.fcpbundle"/"*"/Render Files/High Quality Media"
32+
echo '🎬 Final Cut rendered media cleared'
33+
34+
brew cleanup
35+
brew cleanup --prune-prefix
36+
rm -rf ~/Library/Caches/Homebrew
37+
echo '🍺 Brew cache cleared'
38+
39+
rm -rf ~/Library/Caches/com.tinyspeck.slackmacgap
40+
rm -rf ~/Library/Caches/com.tinyspeck.slackmacgap.ShipIt
41+
rm -rf ~/Library/Application Support/Slack/Cache
42+
rm -rf "$HOME/Library/Application Support/Slack/Service Worker/CacheStorage"
43+
echo '💬 Slack cache cleared'
44+
45+
rm -rf ~/Library/Caches/com.spotify.client/Data
46+
echo '🎶 Spotify cache cleared'
47+
48+
rm -rf ~/Library/Caches/JetBrains
49+
echo '🅸 JetBrains cache cleared'
50+
51+
rm -rf ~/Library/Caches/Yarn/
52+
echo '💪 Yarn cache cleared'
53+
54+
rm -rf ~/.gradle/wrapper/dists/
55+
rm -rf ~/.gradle/caches/
56+
echo '🐘 Gradle cache cleared'
57+
58+
rm -rf ~/.composer/cache/
59+
echo '👨‍🎤 Composer cache cleared'
60+
61+
rm -rf ~/Library/Caches/Google/Chrome || true
62+
rm -rf "$HOME/Library/Application Support/Google/Chrome/"*"/Service Worker/CacheStorage" || true
63+
rm -rf "$HOME/Library/Application Support/Google/Chrome/"*"/Application Cache/Cache" || true
64+
echo '🟡 Chrome cache cleared'
65+
66+
free_space_after_empty=$(free_space_in_home)
67+
68+
echo "Done! Free space before: $free_space_before_empty, free space now: $free_space_after_empty"

shell/zsh/.zshrc

+11
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ fi
1111
# Options
1212
setopt HIST_IGNORE_ALL_DUPS
1313
setopt HIST_FCNTL_LOCK
14+
setopt HIST_SAVE_NO_DUPS
15+
setopt HIST_REDUCE_BLANKS
16+
setopt INC_APPEND_HISTORY_TIME
17+
setopt EXTENDED_HISTORY
18+
setopt HIST_NO_STORE
1419
setopt +o nomatch
1520
unset zle_bracketed_paste
1621

@@ -19,10 +24,16 @@ ZSH_THEME="powerlevel10k/powerlevel10k"
1924
ZLE_RPROMPT_INDENT=0
2025
export LS_COLORS="no=00:rs=0:fi=00:di=01;34:ln=36:mh=04;36:pi=04;01;36:so=04;33:do=04;01;36:bd=01;33:cd=33:or=31:mi=01;37;41:ex=01;36:su=01;04;37:sg=01;04;37:ca=01;37:tw=01;37;44:ow=01;04;34:st=04;37;44:*.7z=01;32:*.ace=01;32:*.alz=01;32:*.arc=01;32:*.arj=01;32:*.bz=01;32:*.bz2=01;32:*.cab=01;32:*.cpio=01;32:*.deb=01;32:*.dz=01;32:*.ear=01;32:*.gz=01;32:*.jar=01;32:*.lha=01;32:*.lrz=01;32:*.lz=01;32:*.lz4=01;32:*.lzh=01;32:*.lzma=01;32:*.lzo=01;32:*.rar=01;32:*.rpm=01;32:*.rz=01;32:*.sar=01;32:*.t7z=01;32:*.tar=01;32:*.taz=01;32:*.tbz=01;32:*.tbz2=01;32:*.tgz=01;32:*.tlz=01;32:*.txz=01;32:*.tz=01;32:*.tzo=01;32:*.tzst=01;32:*.war=01;32:*.xz=01;32:*.z=01;32:*.Z=01;32:*.zip=01;32:*.zoo=01;32:*.zst=01;32:*.aac=32:*.au=32:*.flac=32:*.m4a=32:*.mid=32:*.midi=32:*.mka=32:*.mp3=32:*.mpa=32:*.mpeg=32:*.mpg=32:*.ogg=32:*.opus=32:*.ra=32:*.wav=32:*.3des=01;35:*.aes=01;35:*.gpg=01;35:*.pgp=01;35:*.doc=32:*.docx=32:*.dot=32:*.odg=32:*.odp=32:*.ods=32:*.odt=32:*.otg=32:*.otp=32:*.ots=32:*.ott=32:*.pdf=32:*.ppt=32:*.pptx=32:*.xls=32:*.xlsx=32:*.app=01;36:*.bat=01;36:*.btm=01;36:*.cmd=01;36:*.com=01;36:*.exe=01;36:*.reg=01;36:*~=02;37:*.bak=02;37:*.BAK=02;37:*.log=02;37:*.log=02;37:*.old=02;37:*.OLD=02;37:*.orig=02;37:*.ORIG=02;37:*.swo=02;37:*.swp=02;37:*.bmp=32:*.cgm=32:*.dl=32:*.dvi=32:*.emf=32:*.eps=32:*.gif=32:*.jpeg=32:*.jpg=32:*.JPG=32:*.mng=32:*.pbm=32:*.pcx=32:*.pgm=32:*.png=32:*.PNG=32:*.ppm=32:*.pps=32:*.ppsx=32:*.ps=32:*.svg=32:*.svgz=32:*.tga=32:*.tif=32:*.tiff=32:*.xbm=32:*.xcf=32:*.xpm=32:*.xwd=32:*.xwd=32:*.yuv=32:*.anx=32:*.asf=32:*.avi=32:*.axv=32:*.flc=32:*.fli=32:*.flv=32:*.gl=32:*.m2v=32:*.m4v=32:*.mkv=32:*.mov=32:*.MOV=32:*.mp4=32:*.mpeg=32:*.mpg=32:*.nuv=32:*.ogm=32:*.ogv=32:*.ogx=32:*.qt=32:*.rm=32:*.rmvb=32:*.swf=32:*.vob=32:*.webm=32:*.wmv=32:"
2126
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
27+
if [[ -z $TMUX ]]; then
28+
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'exa -1 --color=always $realpath'
29+
else
30+
zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup
31+
fi;
2232

2333
# Configuration
2434
COMPLETION_WAITING_DOTS="false"
2535
ZSH_AUTOSUGGEST_USE_ASYNC=true
36+
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
2637
ZSH_HIGHLIGHT_MAXLENGTH=300
2738
ZSH_DISABLE_COMPFIX="true"
2839
DEFAULT_USER=$(whoami)

0 commit comments

Comments
 (0)