-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
44 lines (36 loc) · 1.59 KB
/
install.sh
File metadata and controls
44 lines (36 loc) · 1.59 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
#!/bin/bash
set -eu
readonly DOTFILES_DIR="${HOME}/dotfiles"
[ ! -d ${DOTFILES_DIR} ] && \
git clone https://github.com/uji/dotfiles.git ${DOTFILES_DIR} && \
echo "source ${DOTFILES_DIR}/bashrc" >> "${HOME}/.bashrc"
# copy local setting files
[ ! -d ${HOME}/.tmux.conf.local ] && cp "${DOTFILES_DIR}/.tmux.conf.local.sample" "${HOME}/.tmux.conf.local"
# create symbolic link
mkdir -p "${HOME}/.config"
ln -sf "${DOTFILES_DIR}/vimrc/vim" "${HOME}/.vim"
ln -sf "${DOTFILES_DIR}/vimrc/vim" "${HOME}/.config/nvim"
ln -sf "${DOTFILES_DIR}/vimrc/.vimrc" "${HOME}/.vimrc"
ln -sf "${DOTFILES_DIR}/vimrc/.vimrc" "${HOME}/.config/nvim/init.vim"
ln -sf "${DOTFILES_DIR}/.tmux.conf" "${HOME}/.tmux.conf"
ln -sf "${DOTFILES_DIR}/ghostty" "${HOME}/.config/ghostty"
mkdir -p "${HOME}/.claude"
ln -sf "${DOTFILES_DIR}/.claude/settings.json" "${HOME}/.claude/settings.json"
# git config
git config --global include.path "${DOTFILES_DIR}/.gitconfig"
# install vim/neovim packages
mkdir -p "${DOTFILES_DIR}/vimrc/vim/pack/mypackage/opt"
[ ! -d ${DOTFILES_DIR}/vimrc/vim/pack/mypackage/opt/minpac ] && git clone https://github.com/k-takata/minpac.git "${DOTFILES_DIR}/vimrc/vim/pack/mypackage/opt/minpac"
if type "nvim" > /dev/null 2>&1; then
git config --global core.editor nvim
nvim -c 'call minpac#clean()' \
-c 'call minpac#update("", {"do": "quit"})' \
-c ':q'
else
git config --global core.editor vim
vim -c 'call minpac#clean()' \
-c 'call minpac#update("", {"do": "quit"})' \
-c ':q'
fi
# install tpm
[ ! -d ~/tmux/plugins/tpm ] && git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm