-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·105 lines (85 loc) · 2.93 KB
/
Copy pathinit.sh
File metadata and controls
executable file
·105 lines (85 loc) · 2.93 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
#!/usr/bin/env bash
set -Eeuo pipefail
# setup
mkdir -p ~/.config/lazygit || true
mkdir -p ~/.local/bin || true
cp .env.example .env
########
# stow
########
echo "stow beginning!!!"
stow_exclude=('~/' 'ibus-rime/' 'sublime-text/' 'wakatime/' 'gnupg/' 'raycast-script/' 'tampermonkey-scripts')
for i in `ls -d */`; do
printf "%s\n" "${stow_exclude[@]}" | grep -x -q "$i" ||
( echo " stow $i" && stow $i )
done
zsh ~/.zshrc
########
# ZSH
########
ZSH="${HOME}/.config/zsh/.oh-my-zsh"
if [[ -d ${ZSH} ]]; then
echo "oh-my-zsh is already installed."
else
echo "Install oh-my-zsh..."
git clone --depth=1 https://github.com/ohmyzsh/ohmyzsh.git ${ZSH}
fi
install_zsh_plugin() {
local name=$1 repo=$2
local dest="${ZSH}/custom/plugins/${name}"
if [[ -d "$dest" ]]; then
echo "${name} is already installed."
else
echo "Install zsh plug: ${name}..."
git clone --depth=1 "$repo" "$dest"
fi
}
install_zsh_plugin zsh-autosuggestions https://github.com/zsh-users/zsh-autosuggestions
install_zsh_plugin fzf-tab https://github.com/Aloxaf/fzf-tab.git
install_zsh_plugin z.lua https://github.com/skywind3000/z.lua.git
install_zsh_plugin zsh-autopair https://github.com/hlissner/zsh-autopair
install_zsh_plugin you-should-use https://github.com/MichaelAquilina/zsh-you-should-use.git
install_zsh_plugin fast-syntax-highlighting https://github.com/zdharma-continuum/fast-syntax-highlighting.git
install_zsh_plugin zsh-completions https://github.com/zsh-users/zsh-completions.git
######## neovim ########
echo "\n"
echo "neovim beginning!!!"
echo "\n"
if [[ -d ~/.config/nvim ]];then
echo "~/.config/nvim is already installed."
else
git clone --depth=1 git@github.com:kang8/.vimrc.git ~/.config/nvim
fi
########
# gpg
########
echo "\n"
echo "gpg beginning!!!"
echo "\n"
# create ~/.gnupg/
gpg -k
if [[ -d ~/kang/gpg-key-ring ]]; then
echo "~/kang/gpg-key-ring is already installed."
else
git clone --depth=1 git@github.com:kang8/gpg-key-ring.git ~/kang/gpg-key-ring
fi
stow gnupg
# Create symlink for pinentry-mac to support both Apple Silicon and Intel
ln -sf "$(brew --prefix pinentry-mac)/bin/pinentry-mac" ~/.local/bin/pinentry-mac
########
# MacOS setting
########
# Disable the .DS file creation
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
# Show the path bar in the Finder
defaults write com.apple.finder "ShowPathbar" -bool "true" && killall Finder
# Show hidden files in the Finder
defaults write com.apple.finder "AppleShowAllFiles" -bool "true" && killall Finder
########
# Miscellaneous items
########
# Make these files immutable to prevent external programs from modifying them
chflags uimmutable ~/.zprofile
chflags -h uimmutable ~/.zshrc # Use `-h` flag for symbolic links to change the link's flags rather than the target file
# `chflags nouimmutable ~/.zprofile` If you want to modify them