diff --git a/.chezmoiexternal.toml b/.chezmoiexternal.toml index 2d11171..ce89e8f 100644 --- a/.chezmoiexternal.toml +++ b/.chezmoiexternal.toml @@ -34,8 +34,15 @@ refreshPeriod = "168h" [".config/nvim"] - type = "git-repo" - url = "https://xvzc@github.com/xvzc/nvim.git" + type = "git-repo" + url = "https://github.com/xvzc/nvim.git" + exact = true + stripComponents = 1 + refreshPeriod = "168h" + +[".config/assets"] + type = "git-repo" + url = "https://github.com/xvzc/assets.git" exact = true stripComponents = 1 refreshPeriod = "168h" diff --git a/dot_config/wezterm/themes/ontario.lua b/dot_config/wezterm/themes/miami.lua similarity index 95% rename from dot_config/wezterm/themes/ontario.lua rename to dot_config/wezterm/themes/miami.lua index 6038138..6cb1ef0 100644 --- a/dot_config/wezterm/themes/ontario.lua +++ b/dot_config/wezterm/themes/miami.lua @@ -1,6 +1,6 @@ local palette = { black = "#2c2c2c", - grey = "#757474", + grey = "#8c8787", red = "#ba5458", pink = "#cc6666", olive = "#b5bd68", @@ -8,7 +8,7 @@ local palette = { light_orange = "#ebba7a", yellow = "#e6b137", carolina = "#b3cbe3", - sky = "#89a4f0", + ocean = "#89a4f0", dimmed_ilac = "#6c6882", violet = "#b294bb", plum = "#c397d8", @@ -33,7 +33,7 @@ local colors = { palette.red, palette.green, palette.light_orange, - palette.carolina, + palette.ocean, palette.violet, palette.aquamarine, palette.antique_white, @@ -44,7 +44,7 @@ local colors = { palette.pink, palette.olive, palette.yellow, - palette.sky, + palette.ocean, palette.plum, palette.mint, palette.lemon_white, diff --git a/dot_gitconfig b/dot_gitconfig index e53cc9d..7120322 100644 --- a/dot_gitconfig +++ b/dot_gitconfig @@ -7,3 +7,7 @@ [includeIf "gitdir:~/work/"] path = ~/.gitconfig + +[init] + defaultBranch = main + diff --git a/dot_scripts/git/executable_git-ssh b/dot_scripts/git/executable_git-login similarity index 100% rename from dot_scripts/git/executable_git-ssh rename to dot_scripts/git/executable_git-login diff --git a/dot_wezterm.lua b/dot_wezterm.lua index 40ba6fb..38bc98d 100644 --- a/dot_wezterm.lua +++ b/dot_wezterm.lua @@ -15,7 +15,7 @@ config.default_cursor_style = "BlinkingBlock" config.audible_bell = "Disabled" config.window_background_opacity = 0.93 -config.colors = require("themes/ontario") +config.colors = require("themes/miami") config.window_padding = { left = 4, @@ -26,7 +26,7 @@ config.window_padding = { config.font = wezterm.font_with_fallback({ "JetBrainsMonoNL Nerd Font", - "hesalche", + "D2Coding", }) config.keys = { diff --git a/dot_zsh/alias.zsh.tmpl b/dot_zsh/alias.zsh similarity index 91% rename from dot_zsh/alias.zsh.tmpl rename to dot_zsh/alias.zsh index 11b5d26..0ad2f05 100644 --- a/dot_zsh/alias.zsh.tmpl +++ b/dot_zsh/alias.zsh @@ -15,21 +15,12 @@ if [ -x "$(command -v eza)" ]; then alias la='eza -alg --sort=type' fi -alias g++='g++ -std=c++17' - -# {{ if eq .osid "darwin" }} -alias ofd='open .' -# {{ else if eq .osid "linux-arch" }} -alias open='thunar' -# {{ end }} - -alias pgh='GITHUB_TOKEN=$PERSONAL_GITHUB_TOKEN gh' -alias wgh='GITHUB_TOKEN=$WORK_GITHUB_TOKEN gh' +alias 'bat'='bat --style=plain' +alias 'bat -nu'='bat --style=numbers' -alias live-server='live-server --port=8080 --browser=chromium' +_is_linux && alias open='thunar' -alias bat='bat --style=plain' -alias 'bat -nu'='bat --style=numbers' +alias g++='g++ -std=c++17' alias lazygit='lazygit --use-config-file=$HOME/.config/lazygit/config.yml' alias lg='lazygit --use-config-file=$HOME/.config/lazygit/config.yml' @@ -55,6 +46,11 @@ alias 8='cd -8 &> /dev/null' alias 9='cd -9 &> /dev/null' +# ┌─────┐ +# │ GIT │ +# └─────┘ +alias ggpush='git push origin "$(git_current_branch)"' + # ┌─────────┐ # │ CHEZMOI │ # └─────────┘ @@ -122,6 +118,9 @@ if [ -x "$(command -v kubectl)" ]; then alias kcv='kubectl config view' alias kaf='kubectl apply -f' + + alias kx='kubectl exec' + alias kxi='kubectl exec -it' fi # ┌───────────┐ diff --git a/dot_zsh/style.zsh b/dot_zsh/style.zsh index 60a5c95..8d0404c 100644 --- a/dot_zsh/style.zsh +++ b/dot_zsh/style.zsh @@ -22,7 +22,8 @@ export LS_COLORS="\ *.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90: \ *.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90: \ *.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90: \ - *.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:*.pub=00;00:*.zwc=00;90: \ + *.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90: \ + *.pub=00;00:*.zwc=00;90: \ " export EZA_COLORS="da=00;00:uu=01;37:gu=01;37:" @@ -42,10 +43,11 @@ ZSH_HIGHLIGHT_STYLES[single-quoted-argument]=fg=yellow ZSH_HIGHLIGHT_STYLES[double-quoted-argument]=fg=yellow ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]=fg=cyan ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]=fg=cyan -ZSH_HIGHLIGHT_STYLES[comment]='fg=#7d807e' -ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=#eb87ff' +# ZSH_HIGHLIGHT_STYLES[comment]='fg=#7d807e' +# ZSH_HIGHLIGHT_STYLES[commandseparator]='fg=#eb87ff' -zstyle :prompt:pure:path color '#89a4f0' +# zstyle :prompt:pure:path color '#89a4f0' +zstyle :prompt:pure:path color blue zstyle :prompt:pure:git:dirty color red zstyle :prompt:pure:git:branch color cyan @@ -64,10 +66,8 @@ zstyle :prompt:pure:virtualenv show yes # Do menu-driven completion. zstyle ':completion:*' menu select -# zstyle ':completion:*:*:git:*' user-commands login:'git_login' \ -# list-pr:'hub_list_pr' \ -# make-pr:'hub_make_pr' \ -# merge-pr:'hub_make_pr' +zstyle ':completion:*:*:git:*' user-commands \ + login:'authenticate current git repository with ssh key' # formatting and messages zstyle ':completion:*' verbose yes diff --git a/dot_zshrc b/dot_zshrc index 5965daa..d3a9d4a 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -4,7 +4,7 @@ export DOT_ZSH=$HOME/.zsh plugins=( - git + # git fzf vi-mode zsh-defer diff --git a/init_private_resources.sh b/init_private_resources.sh index f22d545..f17028d 100755 --- a/init_private_resources.sh +++ b/init_private_resources.sh @@ -21,23 +21,6 @@ check-1password() { fi } -cur_os=$(uname) - -assets_dir="$HOME/.config/assets" - -# Install packages -if [ "$cur_os" = "Darwin" ]; then - font_dir=~/Library/Fonts/ - brewfile="$HOME/.local/share/chezmoi/setup/Brewfile.personal" - if ! brew bundle --no-lock --no-upgrade --file="$brewfile"; then - error "Filed to install packages" - fi - - source ~/.local/share/chezmoi/setup/macos-setup.sh && all -elif [ "$cur_os" = "Linux" ]; then - font_dir=~/.local/share/fonts/ -fi - check-1password op read "op://Personal/SSH Github xvzc/public key" >~/.ssh/xvzc.pub && @@ -45,14 +28,3 @@ op read "op://Personal/SSH Github xvzc/public key" >~/.ssh/xvzc.pub && op read "op://Personal/SSH Arch Linux/public key" >~/.ssh/arch.pub && chmod 600 ~/.ssh/arch.pub - -if [ -d "$assets_dir/.git" ]; then - echo "'$assets_dir/.git' already exists." - git --git-dir "$assets_dir/.git" remote set-url origin git@xvzc.github.com:xvzc/assets.git -else - git clone git@xvzc.github.com:xvzc/assets.git "$assets_dir" -fi - -cp ~/.config/assets/fonts/hesalche/ttf/hesalche-Light.ttf "$font_dir" -cp ~/.config/assets/fonts/hesalche/ttf/hesalche-Regular.ttf "$font_dir" - diff --git a/install.sh b/install.sh index 7483366..8f537e0 100755 --- a/install.sh +++ b/install.sh @@ -7,7 +7,7 @@ error() { } require-sudo() { - sudo -v --prompt "Administrator privilege required. Please type your local password: " + sudo -v --prompt "Administrator privilege required. Please type your password: " # Keep-alive: update existing `sudo` time stamp until `.osx` has finished while true; do @@ -17,7 +17,7 @@ require-sudo() { done 2>/dev/null & } -check-or-install-xcode() { +install-xcode() { if ! xcode-select --print-path &>/dev/null; then # Install XCode Command Line Tools. xcode-select --install &>/dev/null @@ -29,7 +29,7 @@ check-or-install-xcode() { fi } -check-or-install-brew() { +install-brew() { if ! /opt/homebrew/bin/brew shellenv 2>&1; then echo "homdbrew not found. installing.." require-sudo @@ -47,7 +47,7 @@ check-or-install-brew() { fi } -check-or-install-chezmoi() { +install-chezmoi() { if type chezmoi >/dev/null 2>&1; then echo "Found chezmoi at $(whereis chezmoi). Skipping install." else @@ -73,13 +73,15 @@ esac echo "Detected OS: ${machine}" if [ "$machine" == "Mac" ]; then - check-or-install-xcode - check-or-install-chezmoi - check-or-install-brew - brewfile="$HOME/.local/share/chezmoi/setup/Brewfile.essential" + install-xcode + install-chezmoi + install-brew + brewfile="$HOME/.local/share/chezmoi/setup/Brewfile" if ! brew bundle --no-lock --no-upgrade --file="$brewfile"; then - error "Failed to install packages" + error "Failed to install MacOS packages" fi + + source "$HOME/.local/share/chezmoi/setup/macos-setup.sh" && all elif [ "$machine" == "Linux" ]; then echo "Installing Linux packages.." yay -S --needed --noconfirm - <~/.local/share/chezmoi/setup/aur_packages.txt @@ -102,5 +104,6 @@ if ! command -v cargo &> /dev/null; then curl https://sh.rustup.rs -sSf | sh fi +# Install neovim version manager bob install nightly bob use nightly diff --git a/setup/Brewfile.personal b/setup/Brewfile similarity index 52% rename from setup/Brewfile.personal rename to setup/Brewfile index 0b78514..0df6cd6 100644 --- a/setup/Brewfile.personal +++ b/setup/Brewfile @@ -1,5 +1,23 @@ +tap "homebrew/bundle" +tap "homebrew/services" +tap "koekeishiya/formulae" +tap "homebrew/cask-fonts" tap "daipeihust/tap" -tap "kardolus/chatgpt-cli" +brew "python@3.11" +brew "go" +brew "node@18", link: :force +brew "bob" +brew "bat" +brew "chezmoi" +brew "eza" +brew "fd" +brew "fzf" +brew "git" +brew "tmux" +brew "tmuxinator" +brew "tree" +brew "mas" +brew "luarocks" brew "daipeihust/tap/im-select" brew "kardolus/chatgpt-cli/chatgpt-cli" brew "cmake" @@ -13,11 +31,14 @@ brew "ranger" brew "ripgrep" brew "terraform" brew "wakeonlan" -mas "KakaoTalk ", id: 869223134 -mas "Gifski ", id: 1351639930 +cask "font-jetbrains-mono-nerd-font" +cask "font-d2coding" +cask "wezterm" cask "1password" cask "1password-cli" cask "google-chrome" cask "discord" cask "alfred" cask "bettertouchtool" +mas "KakaoTalk ", id: 869223134 +mas "Gifski ", id: 1351639930 diff --git a/setup/Brewfile.essential b/setup/Brewfile.essential deleted file mode 100644 index 310e743..0000000 --- a/setup/Brewfile.essential +++ /dev/null @@ -1,21 +0,0 @@ -tap "homebrew/bundle" -tap "homebrew/services" -tap "koekeishiya/formulae" -tap "homebrew/cask-fonts" -brew "python@3.11" -brew "go" -brew "node@18", link: :force -brew "bob" -brew "bat" -brew "chezmoi" -brew "eza" -brew "fd" -brew "fzf" -brew "git" -brew "tmux" -brew "tmuxinator" -brew "tree" -brew "mas" -brew "luarocks" -cask "font-jetbrains-mono-nerd-font" -cask "wezterm" diff --git a/setup/Default.bttpreset b/setup/Default.bttpreset index cd633b0..b508525 100644 --- a/setup/Default.bttpreset +++ b/setup/Default.bttpreset @@ -211,4 +211,4 @@ "BTTPresetSnapAreas" : [ ] -} \ No newline at end of file +}