From 54998dce5c444349bdfb8bd1f7a520bb8fd858e1 Mon Sep 17 00:00:00 2001 From: Eric Zhang Date: Sun, 29 Sep 2024 02:41:49 -0700 Subject: [PATCH] Periodic dotfiles update (#3) * Update README.md * Update README.md * Bump submodule * Update * Some updates from new computer * More updates * path update * path update * Alacritty now uses toml * Some deprecation fixes * oops --- README.md | 10 +- alacritty.toml | 613 ++++++++++++++++++++++++++++++++++++++++++++++ alacritty.yml | 3 +- dotbot | 2 +- fzf.zsh | 8 +- gitconfig | 2 +- install.conf.yaml | 14 +- zshenv | 28 ++- zshrc | 6 +- 9 files changed, 666 insertions(+), 20 deletions(-) create mode 100644 alacritty.toml diff --git a/README.md b/README.md index 1a5db9e..2290596 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,13 @@ ![status](https://github.com/ezhang887/dotfiles/actions/workflows/test.yaml/badge.svg) - My collection of dotfiles/setup scripts. + +Setup: +1. Install dotbot submodule: `git submodule init --update --recursive` +2. `./install` + +Other things that are not automated: +- Install [vim-plug](https://github.com/junegunn/vim-plug) +- Install [.tmux](https://github.com/gpakosz/.tmux) +- Install [ohmyzsh](https://github.com/ohmyzsh/ohmyzsh) + the associated plugins (look in `zshrc`) diff --git a/alacritty.toml b/alacritty.toml new file mode 100644 index 0000000..e56a22e --- /dev/null +++ b/alacritty.toml @@ -0,0 +1,613 @@ +live_config_reload = true +working_directory = "None" + +[colors] +draw_bold_text_with_bright_colors = false + +[colors.bright] +black = "0x676e95" +blue = "0x8796b0" +cyan = "0xff5370" +green = "0x444267" +magenta = "0x959dcb" +red = "0xf78c6c" +white = "0xffffff" +yellow = "0x32374d" + +[colors.cursor] +cursor = "0x959dcb" +text = "0x292d3e" + +[colors.normal] +black = "0x292d3e" +blue = "0x82aaff" +cyan = "0x89ddff" +green = "0xc3e88d" +magenta = "0xc792ea" +red = "0xf07178" +white = "0x959dcb" +yellow = "0xffcb6b" + +[colors.primary] +background = "0x292d3e" +foreground = "0x959dcb" + +[cursor] +style = "Block" +unfocused_hollow = true + +[debug] +log_level = "Warn" +persistent_logging = false +print_events = false +render_timer = false + +[font] +size = 11.0 + +[font.glyph_offset] +x = 0 +y = 0 + +[font.offset] +x = 0 +y = 0 + +[[hints.enabled]] +command = "xdg-open" +post_processing = true +regex = "(mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-Ÿ<>\" {-}\\^⟨⟩`]+" + +[hints.enabled.mouse] +enabled = true +mods = "Control" + +[[keyboard.bindings]] +action = "Paste" +key = "Paste" + +[[keyboard.bindings]] +action = "Copy" +key = "Copy" + +[[keyboard.bindings]] +action = "ClearLogNotice" +key = "L" +mods = "Control" + +[[keyboard.bindings]] +chars = "\f" +key = "L" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;3H" +key = "Home" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001BOH" +key = "Home" +mode = "AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[H" +key = "Home" +mode = "~AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[1;3F" +key = "End" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001BOF" +key = "End" +mode = "AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[F" +key = "End" +mode = "~AppCursor" + +[[keyboard.bindings]] +action = "ScrollPageUp" +key = "PageUp" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[5;2~" +key = "PageUp" +mode = "Alt" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[5;5~" +key = "PageUp" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[5;3~" +key = "PageUp" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[5~" +key = "PageUp" + +[[keyboard.bindings]] +action = "ScrollPageDown" +key = "PageDown" +mode = "~Alt" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[6;2~" +key = "PageDown" +mode = "Alt" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[6;5~" +key = "PageDown" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[6;3~" +key = "PageDown" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[6~" +key = "PageDown" + +[[keyboard.bindings]] +chars = "\u001B[Z" +key = "Tab" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u007F" +key = "Back" + +[[keyboard.bindings]] +chars = "\u001B\u007F" +key = "Back" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[2~" +key = "Insert" + +[[keyboard.bindings]] +chars = "\u001B[3~" +key = "Delete" + +[[keyboard.bindings]] +chars = "\u001B[1;2D" +key = "Left" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[1;5D" +key = "Left" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;3D" +key = "Left" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[D" +key = "Left" +mode = "~AppCursor" + +[[keyboard.bindings]] +chars = "\u001BOD" +key = "Left" +mode = "AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[1;2C" +key = "Right" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[1;5C" +key = "Right" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;3C" +key = "Right" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[C" +key = "Right" +mode = "~AppCursor" + +[[keyboard.bindings]] +chars = "\u001BOC" +key = "Right" +mode = "AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[1;2A" +key = "Up" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[1;5A" +key = "Up" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;3A" +key = "Up" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[A" +key = "Up" +mode = "~AppCursor" + +[[keyboard.bindings]] +chars = "\u001BOA" +key = "Up" +mode = "AppCursor" + +[[keyboard.bindings]] +chars = "\u001B[1;2B" +key = "Down" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[1;5B" +key = "Down" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;3B" +key = "Down" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[B" +key = "Down" +mode = "~AppCursor" + +[[keyboard.bindings]] +chars = "\u001BOB" +key = "Down" +mode = "AppCursor" + +[[keyboard.bindings]] +chars = "\u001BOP" +key = "F1" + +[[keyboard.bindings]] +chars = "\u001BOQ" +key = "F2" + +[[keyboard.bindings]] +chars = "\u001BOR" +key = "F3" + +[[keyboard.bindings]] +chars = "\u001BOS" +key = "F4" + +[[keyboard.bindings]] +chars = "\u001B[15~" +key = "F5" + +[[keyboard.bindings]] +chars = "\u001B[17~" +key = "F6" + +[[keyboard.bindings]] +chars = "\u001B[18~" +key = "F7" + +[[keyboard.bindings]] +chars = "\u001B[19~" +key = "F8" + +[[keyboard.bindings]] +chars = "\u001B[20~" +key = "F9" + +[[keyboard.bindings]] +chars = "\u001B[21~" +key = "F10" + +[[keyboard.bindings]] +chars = "\u001B[23~" +key = "F11" + +[[keyboard.bindings]] +chars = "\u001B[24~" +key = "F12" + +[[keyboard.bindings]] +chars = "\u001B[1;2P" +key = "F1" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[1;2Q" +key = "F2" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[1;2R" +key = "F3" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[1;2S" +key = "F4" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[15;2~" +key = "F5" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[17;2~" +key = "F6" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[18;2~" +key = "F7" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[19;2~" +key = "F8" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[20;2~" +key = "F9" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[21;2~" +key = "F10" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[23;2~" +key = "F11" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[24;2~" +key = "F12" +mods = "Shift" + +[[keyboard.bindings]] +chars = "\u001B[1;5P" +key = "F1" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;5Q" +key = "F2" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;5R" +key = "F3" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;5S" +key = "F4" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[15;5~" +key = "F5" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[17;5~" +key = "F6" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[18;5~" +key = "F7" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[19;5~" +key = "F8" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[20;5~" +key = "F9" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[21;5~" +key = "F10" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[23;5~" +key = "F11" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[24;5~" +key = "F12" +mods = "Control" + +[[keyboard.bindings]] +chars = "\u001B[1;6P" +key = "F1" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[1;6Q" +key = "F2" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[1;6R" +key = "F3" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[1;6S" +key = "F4" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[15;6~" +key = "F5" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[17;6~" +key = "F6" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[18;6~" +key = "F7" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[19;6~" +key = "F8" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[20;6~" +key = "F9" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[21;6~" +key = "F10" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[23;6~" +key = "F11" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[24;6~" +key = "F12" +mods = "Alt" + +[[keyboard.bindings]] +chars = "\u001B[1;3P" +key = "F1" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[1;3Q" +key = "F2" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[1;3R" +key = "F3" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[1;3S" +key = "F4" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[15;3~" +key = "F5" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[17;3~" +key = "F6" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[18;3~" +key = "F7" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[19;3~" +key = "F8" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[20;3~" +key = "F9" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[21;3~" +key = "F10" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[23;3~" +key = "F11" +mods = "Super" + +[[keyboard.bindings]] +chars = "\u001B[24;3~" +key = "F12" +mods = "Super" + +[[keyboard.bindings]] +chars = """ + +""" +key = "NumpadEnter" + +[mouse] +hide_when_typing = false + +[[mouse.bindings]] +action = "PasteSelection" +mouse = "Middle" + +[scrolling] +history = 10000 +multiplier = 3 + +[selection] +save_to_clipboard = false +semantic_escape_chars = ",│`|:\"' ()[]{}<>" + +[shell] +args = ["--login", "-c", "tmux attach -t TMUX || tmux new -s TMUX"] +program = "/bin/zsh" + +[window] +decorations = "full" +dynamic_padding = false +opacity = 1.0 +startup_mode = "Windowed" +option_as_alt = "Both" + +[window.dimensions] +columns = 0 +lines = 0 + +[window.padding] +x = 0 +y = 0 diff --git a/alacritty.yml b/alacritty.yml index bc38ca6..69b31b3 100644 --- a/alacritty.yml +++ b/alacritty.yml @@ -276,7 +276,8 @@ live_config_reload: true # args: # - --login shell: - program: /usr/local/bin/zsh + # program: /usr/local/bin/zsh + program: /bin/zsh args: - --login - -c diff --git a/dotbot b/dotbot index 076939d..7202065 160000 --- a/dotbot +++ b/dotbot @@ -1 +1 @@ -Subproject commit 076939da8ee683d3cba791914c227f29c21fe042 +Subproject commit 720206578a8daf1e7167200e73e314fc4b8af52e diff --git a/fzf.zsh b/fzf.zsh index a82e6a5..4a4328f 100644 --- a/fzf.zsh +++ b/fzf.zsh @@ -1,13 +1,13 @@ # Setup fzf # --------- -if [[ ! "$PATH" == */home/ezhang/.fzf/bin* ]]; then - export PATH="${PATH:+${PATH}:}/home/ezhang/.fzf/bin" +if [[ ! "$PATH" == *$HOME/.fzf/bin* ]]; then + export PATH="${PATH:+${PATH}:}$HOME/.fzf/bin" fi # Auto-completion # --------------- -[[ $- == *i* ]] && source "/home/ezhang/.fzf/shell/completion.zsh" 2> /dev/null +[[ $- == *i* ]] && source "$HOME/.fzf/shell/completion.zsh" 2> /dev/null # Key bindings # ------------ -source "/home/ezhang/.fzf/shell/key-bindings.zsh" +source "$HOME/.fzf/shell/key-bindings.zsh" diff --git a/gitconfig b/gitconfig index 9f2ad98..a2943fe 100644 --- a/gitconfig +++ b/gitconfig @@ -4,7 +4,7 @@ [core] editor = vim - excludesfile = /home/ezhang/.gitignore_global + excludesfile = ~/.gitignore_global [credential] helper = cache --timeout=3600 diff --git a/install.conf.yaml b/install.conf.yaml index 93ab6e6..4c72d13 100644 --- a/install.conf.yaml +++ b/install.conf.yaml @@ -6,9 +6,17 @@ - link: ~/.vimrc: vimrc - ~/.zshrc: zshrc + ~/.zshrc: + force: true + path: zshrc ~/.zshenv: zshenv - ~/.gitconfig: gitconfig + ~/.gitconfig: + force: true + path: gitconfig ~/.gitignore_global: gitignore_global - ~/.alacritty.yml: alacritty.yml + # ~/.alacritty.yml: alacritty.yml + ~/.alacritty.toml: alacritty.toml ~/.fzf.zsh: fzf.zsh + ~/.tmux.conf.local: + force: true + path: tmux.conf.local diff --git a/zshenv b/zshenv index 36afaed..f276960 100644 --- a/zshenv +++ b/zshenv @@ -1,17 +1,21 @@ # path -export PATH=/usr/local/bin:/home/ezhang/.local/bin:$PATH +export PATH=/usr/local/bin:$HOME/.local/bin:$PATH # oh my zsh export ZSH="$HOME/.oh-my-zsh" # golang -export PATH=$PATH:/usr/local/go/bin -export GOPATH=$HOME/go_workspace -export PATH=$PATH:$(go env GOPATH)/bin +if which go &> /dev/null; then + export PATH=$PATH:/usr/local/go/bin + export GOPATH=$HOME/go_workspace + export PATH=$PATH:$(go env GOPATH)/bin +fi # cargo (rust) -export PATH="$HOME/.cargo/bin:$PATH" -. "$HOME/.cargo/env" +if which cargo &> /dev/null; then + export PATH="$HOME/.cargo/bin:$PATH" + . "$HOME/.cargo/env" +fi # ros if [ -d "/opt/ros/melodic" ]; then @@ -20,3 +24,15 @@ fi # editor export EDITOR='vim' + +# nvm +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion + +# ruby +if [ -d "/opt/homebrew/opt/chruby/share/chruby" ]; then + source /opt/homebrew/opt/chruby/share/chruby/chruby.sh + source /opt/homebrew/opt/chruby/share/chruby/auto.sh + chruby ruby-3.1.3 # run chruby to see actual version +fi diff --git a/zshrc b/zshrc index 60d1269..ec555bb 100644 --- a/zshrc +++ b/zshrc @@ -36,9 +36,9 @@ unset __conda_setup # Make background color work in vim in tmux alias tmux='tmux -2' -# Replace `ls` with `exa` -# https://github.com/ogham/exa -alias ls='exa' +# Replace `ls` with `eza` +# https://github.com/eza-community/eza +alias ls='eza' # Replace `cat` with `bat` # https://github.com/sharkdp/bat