Skip to content

Commit 7f49992

Browse files
committed
update packages and zsh plugins, add dependabot auto-merge
1 parent 170aba6 commit 7f49992

File tree

14 files changed

+688
-473
lines changed

14 files changed

+688
-473
lines changed

.config/coverage.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#:schema https://json.schemastore.org/pyproject
2+
13
# Coverage configuration
24
[tool.coverage]
35
[tool.coverage.paths]

.config/extras/.zshrc

Lines changed: 99 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -82,34 +82,54 @@ ZSH_THEME="powerlevel10k/powerlevel10k"
8282
# Example format: plugins=(rails git textmate ruby lighthouse)
8383
# Add wisely, as too many plugins slow down shell startup.
8484
plugins=(
85-
git
86-
branch
87-
command-not-found
88-
colorize
89-
fd
90-
fig
91-
fzf
92-
jsontools
93-
nmap
94-
nvm
95-
poetry
96-
poetry-env
97-
safe-paste
98-
sudo
99-
ssh-agent
100-
systemadmin
101-
themes
102-
ufw
103-
history
104-
last-working-dir
105-
per-directory-history
106-
zsh-interactive-cd
107-
zsh-history-substring-search
108-
zsh-completions
109-
zsh-syntax-highlighting
110-
zsh-autosuggestions
85+
######################################
86+
history
87+
jsontools
88+
safe-paste
89+
copypath
90+
######################################
91+
command-not-found
92+
sudo
93+
systemadmin
94+
ssh-agent
95+
######################################
96+
colorize
97+
themes
98+
######################################
99+
git
100+
branch
101+
nvm
102+
poetry
103+
######################################
104+
ufw
105+
nmap
106+
######################################
107+
ubuntu
108+
######################################
109+
last-working-dir
110+
per-directory-history
111+
######################################
112+
zsh-completions
113+
zsh-interactive-cd
114+
zsh-navigation-tools
115+
zsh-autosuggestions
116+
zsh-syntax-highlighting
117+
fast-syntax-highlighting
118+
zsh-history-substring-search # load after zsh-syntax-highlighting
119+
######################################
120+
fig
121+
fzf
122+
######################################
123+
auto-color-ls
124+
autoupdate # upgrade_oh_my_zsh_custom
125+
zsh-bat
126+
zsh-safe-rm
127+
######################################
111128
)
112129

130+
# zsh-completions
131+
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
132+
113133
source $ZSH/oh-my-zsh.sh
114134

115135
# User configuration
@@ -136,13 +156,28 @@ source $ZSH/oh-my-zsh.sh
136156
#
137157
# Example aliases
138158
alias zshconfig="nano ~/.zshrc"
159+
alias zshenv="nano ~/.zshenv"
139160
# alias zshconfig="mate ~/.zshrc"
140161
# alias ohmyzsh="mate ~/.oh-my-zsh"
141162

163+
##############################################################################################
164+
# Plugins
165+
142166
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
143167
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
144168
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
145-
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
169+
170+
# autoupdate
171+
UPDATE_ZSH_DAYS=1
172+
# ZSH_CUSTOM_AUTOUPDATE_QUIET=true
173+
174+
# colorls
175+
source $(dirname $(gem which colorls))/tab_complete.sh
176+
alias lc='colorls -lA --sd'
177+
alias ls='colorls'
178+
179+
##############################################################################################
180+
# Custom Environments
146181

147182
# NVM
148183
export NVM_DIR="$HOME/.nvm"
@@ -161,5 +196,42 @@ if [ -z "$SSH_AUTH_SOCK" ]; then
161196
eval `cat $HOME/.ssh/ssh-agent`
162197
fi
163198

199+
##############################################################################################
200+
# History
201+
202+
[ -z "$HISTFILE" ] && HISTFILE="$HOME/.zsh_history"
203+
HISTORY_IGNORE="(l|ls|ls *|la|la *|lc|cd|cd -|cd *|pwd|exit|history|history-delete|hsd)"
204+
205+
setopt HIST_IGNORE_DUPS # don't record an entry that was just recorded again.
206+
setopt HIST_IGNORE_SPACE # remove command line from history when first character is a space
207+
setopt HIST_REDUCE_BLANKS # remove unnecessary blanks
208+
setopt HIST_EXPIRE_DUPS_FIRST # delete duplicates first when HISTSIZE is exceeded
209+
setopt HIST_SAVE_NO_DUPS # don't write duplicate entries in the history file
210+
setopt INC_APPEND_HISTORY_TIME # append command to history file immediately after execution
211+
setopt EXTENDED_HISTORY # record command start time
212+
setopt EXTENDED_GLOB
213+
214+
# https://github.com/junegunn/fzf/issues/3522#issuecomment-1872415948
215+
history-delete() {
216+
local +h HISTORY_IGNORE=
217+
local -a ignore
218+
fc -pa "$HISTFILE"
219+
selection=$(fc -rl 1 |
220+
awk '{ cmd=$0; sub(/^[ \t]*[0-9]+\**[ \t]+/, "", cmd); if (!seen[cmd]++) print $0}' |
221+
fzf --multi --bind 'enter:become:echo {+f1}' --header="Tab: select, Enter: confirm delete, Esc: quit" --prompt="Search: " --no-sort --cycle
222+
)
223+
if [ -n "$selection" ]; then
224+
while IFS= read -r line; do ignore+=("${(b)history[$line]}"); done < "$selection"
225+
HISTORY_IGNORE="(${(j:|:)ignore})"
226+
# Write history excluding lines that match `$HISTORY_IGNORE` and read new history.
227+
fc -W && fc -p "$HISTFILE"
228+
else
229+
echo "nothing deleted from history"
230+
fi
231+
}
232+
alias hsd=history-delete
233+
234+
##############################################################################################
235+
164236
# Fig post block. Keep at the bottom of this file.
165237
[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.post.zsh"

.config/pytest.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#:schema https://json.schemastore.org/pyproject
2+
13
# Configuration for pytest
24
#
35
# https://docs.pytest.org/en/latest/reference.html#ini-options-ref

.config/scripts/post-create.sh

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ sudo apt-get upgrade -y
5555

5656
# Install common packages
5757
sudo apt-get install -y \
58-
shc # Shell script compiler
58+
shc `# Shell script compiler` \
59+
bat `# cat clone with syntax highlighting` \
60+
ruby-full `# Ruby`
5961

6062
# locale
6163
sudo locale-gen ${LANG:-ko_KR.UTF-8}
@@ -88,9 +90,14 @@ if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlightin
8890
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
8991
fi
9092

93+
# Install fast-syntax-highlighting
94+
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting" ]; then
95+
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting
96+
fi
97+
9198
# Install zsh-completions
9299
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-completions" ]; then
93-
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions
100+
git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-completions
94101
fi
95102

96103
# Install zsh-history-substring-search
@@ -100,7 +107,32 @@ fi
100107

101108
# Install Powerlevel10k
102109
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k" ]; then
103-
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
110+
git clone https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k
111+
fi
112+
113+
# Install zsh-safe-rm
114+
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-safe-rm" ]; then
115+
git clone https://github.com/mattmc3/zsh-safe-rm ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-safe-rm
116+
fi
117+
118+
# Install zsh-bat
119+
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-bat" ]; then
120+
git clone https://github.com/fdellwing/zsh-bat.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-bat
121+
fi
122+
123+
# Install autoupdate
124+
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/autoupdate" ]; then
125+
git clone https://github.com/TamCore/autoupdate-oh-my-zsh-plugins ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/autoupdate
126+
fi
127+
128+
# Install auto-color-ls
129+
if [ ! -d "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/auto-color-ls" ]; then
130+
git clone https://github.com/gretzky/auto-color-ls ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/auto-color-ls
131+
fi
132+
133+
# Install colorls dependency (ruby gem)
134+
if ! command -v colorls &>/dev/null; then
135+
sudo gem install colorls
104136
fi
105137

106138
# Change the default shell to zsh

.devcontainer/devcontainer.json

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,24 +70,7 @@
7070
"esbenp.prettier-vscode",
7171
"tamasfe.even-better-toml",
7272
"IronGeek.vscode-env",
73-
"foxundermoon.shell-format",
74-
"GitHub.copilot",
75-
"mhutchie.git-graph",
76-
"aaron-bond.better-comments",
77-
"maptz.regionfolder",
78-
"njpwerner.autodocstring",
79-
"streetsidesoftware.code-spell-checker",
80-
"yzhang.markdown-all-in-one",
81-
"bierner.markdown-checkbox",
82-
"bierner.markdown-emoji",
83-
"bierner.markdown-footnotes",
84-
"bierner.markdown-preview-github-styles",
85-
"bierner.emojisense",
86-
"usernamehw.errorlens",
87-
"natqe.reload",
88-
"mutantdino.resourcemonitor",
89-
"IBM.output-colorizer",
90-
"jerrygoyal.shortcut-menu-bar"
73+
"foxundermoon.shell-format"
9174
]
9275
}
9376
}

.github/dependabot.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,30 @@
66

77
version: 2
88
updates:
9-
- package-ecosystem: "devcontainers"
10-
directory: "/"
11-
schedule:
12-
interval: weekly
9+
- package-ecosystem: devcontainers
10+
directory: /
11+
schedule:
12+
interval: weekly
13+
timezone: Asia/Seoul
14+
target-branch: devcontainer
15+
labels:
16+
- "dependencies"
1317

14-
- package-ecosystem: "pip"
15-
directory: "/"
16-
schedule:
17-
interval: weekly
18+
- package-ecosystem: pip
19+
directory: /
20+
schedule:
21+
interval: weekly
22+
timezone: Asia/Seoul
23+
target-branch: devcontainer
24+
labels:
25+
- "dependencies"
26+
# open-pull-requests-limit: 3
27+
28+
- package-ecosystem: npm
29+
directory: /
30+
schedule:
31+
interval: weekly
32+
timezone: Asia/Seoul
33+
target-branch: devcontainer
34+
labels:
35+
- "dependencies"

.github/workflows/dependabot.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Dependabot auto-merge
2+
on: pull_request
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
8+
jobs:
9+
dependabot:
10+
runs-on: ubuntu-latest
11+
if: github.actor == 'dependabot[bot]'
12+
steps:
13+
- name: Dependabot metadata
14+
id: metadata
15+
uses: dependabot/fetch-metadata@v2
16+
with:
17+
github-token: "${{ secrets.GITHUB_TOKEN }}"
18+
19+
- name: Approve a PR
20+
run: gh pr review --approve "$PR_URL"
21+
env:
22+
PR_URL: ${{github.event.pull_request.html_url}}
23+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
24+
25+
- name: Enable auto-merge for Dependabot PRs
26+
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
27+
run: gh pr merge --auto --merge "$PR_URL"
28+
env:
29+
PR_URL: ${{github.event.pull_request.html_url}}
30+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.prettierrc

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,21 @@
99
"singleAttributePerLine": false,
1010

1111
"plugins": ["prettier-plugin-multiline-arrays"],
12+
"multilineArraysWrapThreshold": 0,
1213

1314
"overrides": [
1415
{
15-
"files": ["*.ini", "*.cfg"],
16+
"files": ["*.yml", "*.yaml"],
1617
"options": {
17-
"iniSpaceAroundEquals": true,
18-
"parser": "ini",
19-
"printWidth": 80,
20-
"plugins": ["prettier-plugin-ini"]
18+
"tabWidth": 2,
19+
"parser": "yaml"
20+
}
21+
},
22+
{
23+
"files": "*.md",
24+
"options": {
25+
"printWidth": 200,
26+
"tabWidth": 2
2127
}
2228
},
2329
{
@@ -26,6 +32,15 @@
2632
"parser": "jsonc",
2733
"trailingComma": "none"
2834
}
35+
},
36+
{
37+
"files": ["*.ini", "*.cfg"],
38+
"options": {
39+
"iniSpaceAroundEquals": true,
40+
"parser": "ini",
41+
"printWidth": 80,
42+
"plugins": ["prettier-plugin-ini"]
43+
}
2944
}
3045
]
3146
}

.vscode/extensions.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"recommendations": [
3+
"GitHub.copilot",
4+
"mhutchie.git-graph",
5+
"aaron-bond.better-comments",
6+
"maptz.regionfolder",
7+
"njpwerner.autodocstring",
8+
"streetsidesoftware.code-spell-checker",
9+
"yzhang.markdown-all-in-one",
10+
"bierner.markdown-preview-github-styles",
11+
"davidanson.vscode-markdownlint",
12+
"bierner.emojisense",
13+
"usernamehw.errorlens",
14+
"natqe.reload",
15+
"mutantdino.resourcemonitor",
16+
"IBM.output-colorizer",
17+
"jerrygoyal.shortcut-menu-bar",
18+
"redhat.vscode-yaml"
19+
]
20+
}

0 commit comments

Comments
 (0)