├── .github └── workflows │ └── openai-review.yml ├── README.md ├── dot_aliases ├── dot_completions ├── _circleci ├── _gt └── _parallel ├── dot_config ├── broot │ └── conf.hjson ├── fsh │ ├── current_theme.zsh │ └── secondary_theme.zsh ├── ghostty │ └── config ├── nvim │ ├── coc-settings.json │ ├── ginit.vim │ └── init.vim ├── pip │ └── pip.conf └── smug │ ├── dotfiles-personal.yml │ └── dotfiles.yml ├── dot_gitconfig ├── dot_gitconfig_themes ├── dot_golangci.yml ├── dot_prettierrc ├── dot_tmux.conf ├── dot_tmux.conf.settings ├── dot_urlview ├── dot_vim └── after │ └── autoload │ └── coc │ └── ui.vim ├── dot_vimrc ├── dot_zprofile ├── dot_zshrc ├── notes ├── dot_vale.ini └── styles │ └── Vocab │ └── symlink_FluxNinja └── sw ├── assets ├── apple_gruvbox.heic ├── base16-gruvbox-dark-medium.config ├── executable_dot_session_preview ├── executable_dotfiles-edit.sh ├── executable_install.sh ├── executable_install_gruvbox.sh ├── executable_insults.zsh ├── executable_iterm2_default.py ├── executable_lessfilter ├── executable_set_colors.zsh ├── executable_utils.zsh ├── fuzzymenu.png ├── iterm2_gruvbox.json ├── lose.ogg ├── lose.png ├── tmux-fzf.png ├── tmux-menu.png ├── vim.png ├── vim_ide.png ├── win.ogg ├── win.png ├── zsh.png └── zsh_cnf.zsh └── bin ├── executable_autoupdate.zsh ├── executable_explain_prompt ├── executable_gh_checks_status.sh ├── executable_gh_clone_all.sh ├── executable_git_ship ├── executable_pull_all.sh ├── executable_spinner ├── executable_sync_brews.sh ├── executable_sync_coderabbitai.sh ├── executable_sync_fluxninja.sh ├── executable_win_split └── executable_wttr.sh /.github/workflows/openai-review.yml: -------------------------------------------------------------------------------- 1 | name: OpenAI Reviewer 2 | 3 | permissions: 4 | contents: read 5 | pull-requests: write 6 | 7 | on: 8 | pull_request: 9 | pull_request_review_comment: 10 | types: [created] 11 | 12 | concurrency: 13 | group: 14 | ${{ github.repository }}-${{ github.event.number || github.head_ref || 15 | github.sha }}-${{ github.workflow }}-${{ github.event_name == 16 | 'pull_request_review_comment' && 'pr_comment' || 'pr' }} 17 | cancel-in-progress: ${{ github.event_name != 'pull_request_review_comment' }} 18 | 19 | jobs: 20 | review: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - uses: fluxninja/openai-pr-reviewer@main 24 | env: 25 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 26 | OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} 27 | with: 28 | debug: false 29 | review_comment_lgtm: false 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CodeRabbit Dotfiles 2 | 3 | ![CodeRabbit Neovim](./sw/assets/vim.png) 4 | 5 | ## Introduction 6 | 7 | Welcome to CodeRabbit optimized development environment that is well integrated 8 | with our stack. 9 | 10 | ## Setup 11 | 12 | We use [chezmoi](https://www.chezmoi.io) to manage CodeRabbit dotfiles in your 13 | home directory. 14 | 15 | ### Automatic Setup 16 | 17 | ``` 18 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/coderabbitai/dotfiles/master/sw/assets/executable_install.sh)" 19 | ``` 20 | 21 | ### Manual Setup 22 | 23 | ``` 24 | cd $HOME 25 | chezmoi init git@github.com:coderabbitai/dotfiles.git 26 | # show diff of changes that will be made 27 | chezmoi diff 28 | # If you are happy with the changes, apply away! 29 | chezmoi apply -v 30 | ``` 31 | 32 | Please close and reopen the terminal to trigger first time install/updates. 33 | 34 | Recommend using `GitHub CLI` for authenticating with GitHub. Run 35 | `gh auth login`. Alternatively, add 36 | [SSH key to your GitHub account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh). 37 | 38 | ## Git setup 39 | 40 | ### Username and local settings 41 | 42 | Provide username and email address by creating `.gitconfig_local` e.g. 43 | 44 | ``` 45 | [user] 46 | name = Harjot Gill 47 | email = harjot@coderabbit.ai 48 | [github] 49 | user = 50 | token = 51 | ``` 52 | 53 | You can generate 54 | [personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) 55 | for GitHub to use HTTP API. Also, it's useful to add this token to your 56 | `$HOME/.netrc` file. Run - 57 | `echo 'machine api.github.com login password ' >> $HOME/.netrc` 58 | 59 | ### GitHub org cloning script 60 | 61 | To clone CodeRabbit, run: `gh_clone_all.sh coderabbitai $HOME/work`. This step 62 | is performed automatically on installation. 63 | 64 | ### Git pull all repos script 65 | 66 | To update all repos in a directory, run: `pull_all.sh $HOME/work/coderabbitai`. 67 | This step is performed automatically on auto-updates. 68 | 69 | ## Preparing your terminal 70 | 71 | - **Nerd fonts**: Please enable a nerd font such as `Hack Nerd Font` in your 72 | terminal profile to see icons properly when using `nvim` in terminal mode. 73 | - **Terminal colors**: See the section about [colors](#colors). 74 | 75 | ## Homebrew 76 | 77 | Homebrew is the default package manager for this environment. You can provide 78 | private packages by adding them to: `$HOME/.brew_local` 79 | 80 | ## Autoupdates 81 | 82 | This environment is set to autoupdate every 7 days by default. You can trigger 83 | autoupdates manually by calling `autoupdate.zsh --force` You can provide custom 84 | autoupdate commands by adding them to: `$HOME/.autoupdate_local.zsh` 85 | 86 | ## zshrc 87 | 88 | You can provide additional zshrc settings by adding them to: 89 | `$HOME/.zshrc_local` 90 | 91 | ![zsh](./sw/assets/zsh.png) 92 | 93 | ### Features 94 | 95 | - Fuzzy menus: Fuzzy menus are available for command completion (press `TAB`) 96 | menus and command history (press `^r`). 97 | - Vi mode: Press `ESC` to enter Vi `NORMAL` mode. Cool tip - while in normal 98 | mode, press `vv` to switch to visual mode (it will open `nvim` editor) and in 99 | that mode you can use GitHub Copilot to build sophisticated commands using AI! 100 | - Prompt flags: Type `yazpt_explain_git` to understand the meaning of various 101 | flags in the prompt. 102 | - Forgit: You can use `forgit` as an interactive frontend for various git 103 | commands. E.g. try `git forgit log`. 104 | - iTerm2 integration: On macOS, please install iTerm2 shell 105 | [integration](https://iterm2.com/documentation-shell-integration.html) to use 106 | nice features such as navigating marks in prompt. 107 | 108 | ## tmux 109 | 110 | ![tmux Menu](./sw/assets/tmux-menu.png) 111 | ![tmux Fuzzy Menu](./sw/assets/tmux-fzf.png) 112 | 113 | `tmux` sessions are automatically started as part of `.zshrc` execution. You 114 | will be shown an option to join an existing detached session if they exist, 115 | otherwise a new session will be created and attached to. 116 | 117 | ### Features 118 | 119 | - Prefix: `C-a` or `C-b` 120 | - Fuzzy menu: Press `C-a C-Space` to access fuzzy menu for quick tmux management 121 | and shortcuts to various commands. 122 | - tmux menu: Press `F12` to access tmux session/window/pane management menu. 123 | - Nested tmux sessions (e.g. remote ssh): Press `F1` to suspend/unsuspend local 124 | tmux. 125 | - [Smug](https://github.com/ivaaaan/smug): Define and orchestrate tmux sessions 126 | with smug. e.g. use smug to start/stop local dev Kubernetes cluster and so on. 127 | - Fuzzy search tmux terminal buffer: Press `C-a C-/` 128 | - Vi bindings are enabled in tmux copy mode 129 | - Facebook PathPicker: Press `C-a C-P` to select any line from scrollback buffer 130 | (e.g. git status) and use those in another command. 131 | - Urlview: Press `C-a C-U` to select any url in scrollback buffer and open in 132 | browser. 133 | 134 | ## Neovim 135 | 136 | This environment is highly tuned towards providing a modern neovim/vim setup for 137 | development using modern languages such as Golang, Typescript etc. 138 | 139 | ![Fuzzy Menu](./sw/assets/fuzzymenu.png) 140 | 141 | ![IDE](./sw/assets/vim_ide.png) 142 | 143 | ### vimrc 144 | 145 | You can provide additional `vimrc` settings by adding them to: 146 | `$HOME/.vimrc_local`. You can also use **FuzzyMenu** (``) to tweak 147 | and persist local settings. In addition, you can provide additional vim plugins 148 | by adding them to `$HOME/.vimrc_plugins`. 149 | 150 | Several `colorschemes` are bundled and `gruvbox` is chosen by default. You can 151 | override `colorscheme` by providing `let colorscheme = ` in your 152 | `.vimrc_local` file. 153 | 154 | See `.vimrc` file for available `colorschemes`. Also see 155 | `~/.config/nvim/init.vim` for Neovim specific settings. 156 | 157 | ### Discoverability of commands and plugins 158 | 159 | - Landing page for new tabs contains several useful links that help with 160 | discoverability. 161 | - Press `` (double space) or `Shift + LeftMouse` click to open a 162 | contextual FuzzyMenu for the word under cursor or selection. 163 | 164 | ### AI-based autocompletion 165 | 166 | - GitHub Copilot - Type `:Copilot setup` in Neovim to set up. 167 | - CodeGPT - Just highlight the code and press `` to see CodeGPT 168 | options in the FuzzyMenu. You must provide `OPENAI_API_KEY` environment 169 | variable in your `.zshrc_local` to use this feature. 170 | 171 | ### LanguageTool 172 | 173 | If you have LanguageTool Premium, you can provide `LANGTOOL_HTTP_URI`, 174 | `LANGTOOL_USERNAME` and `LANGTOOL_API_KEY` environment variables to use the 175 | language server in Neovim. 176 | 177 | ## Colors 178 | 179 | Unlike `nvim` which allows setting themes easily via `.vimrc_local`, color 180 | themes for terminal interface are spread across multiple settings. 181 | 182 | - **Terminal theme** - 183 | - macOS: For iTerm2, the option will be provided to install bundled profile 184 | that contains font/color settings. If you do not wish to install the 185 | profile, then the colors will be set via terminal escape codes unless 186 | `SET_TERMINAL_COLORS` is set to `false` in your `.zshrc_local`. 187 | - Linux: Colors will be set automatically using terminal escape codes unless 188 | `SET_TERMINAL_COLORS` is set to `false` in your `.zshrc_local`. 189 | Alternatively, you can install default color profile using 190 | `$HOME/sw/assets/install_gruvbox.sh`. Make sure to set `SET_TERMINAL_COLORS` 191 | to `false` in your `.zshrc_local` if you would like to use terminal's color 192 | profiles. 193 | - tmux theme - See `.tmux.conf.settings` for example configuration and override 194 | it in your personal `.tmux.conf_local` file. The tmux theme configures the 195 | tmux status line and not the terminal itself. 196 | - bat theme (cat replacement) - Environment variable `BAT_THEME` sets the theme. 197 | See `bat --list-themes` to get the list. You can override this theme in your 198 | `.zshrc_local` file. Bat is used extensively for fzf previews, git pager 199 | (delta), less command filter and so on. 200 | - FZF colors - Get and source color schemes from 201 | [base16-fzf](https://github.com/fnune/base16-fzf) in your 202 | `$HOME/.zshrc_local`. 203 | - LS_COLORS - We use [vivid](https://github.com/sharkdp/vivid) to set the 204 | themes. Run `vivid themes` to get the list. You can override this theme in 205 | your `.zshrc_local` file. 206 | - Git pager - See `.gitconfig_themes` to see the available themes. You can 207 | override them in your local `.gitconfig_local`. 208 | - Fast Syntax Highlighting (zsh) - You can run `fast-theme -l` to get the list. 209 | To set the theme, first, override `FAST_WORK_DIR` environment variable in your 210 | `.zshrc` and point it to `$HOME/.config/fsh_local`. Next, run 211 | `fast-theme ` to switch the theme. 212 | 213 | Note: Currently all these settings are configured to match `gruvbox-dark` color 214 | palette. But it's pretty easy to override them to match `onedark` or 215 | [Nord](https://www.nordtheme.com) 216 | 217 | Bonus: 218 | 219 | - Slack Gruvbox - Paste this in your DM to Slackbot and click the 220 | `Switch sidebar theme` button. 221 | ` gruvbox dark #282828,#3c3836,#ebdbb2,#1d2021,#3e313c,#ebdbb2,#689d6a,#fb4934` 222 | 223 | ## Managing `*_local` override files 224 | 225 | You can use [vcsh](https://github.com/RichiH/vcsh) utility to version local 226 | files and sync them across machines. 227 | -------------------------------------------------------------------------------- /dot_aliases: -------------------------------------------------------------------------------- 1 | eza_options='--links --git --group --changed --time-style long-iso --icons' 2 | # replace ls with eza 3 | alias ls='eza $(printf $eza_options)' 4 | alias tree='eza --tree $(printf $eza_options)' 5 | 6 | # Homebrew stuffs 7 | alias update="brew update" 8 | alias upgrade="brew upgrade" 9 | alias cleanup="brew cleanup" 10 | alias install="brew install" 11 | alias doctor="echo '\nDoctor? Doctor who?\n' && brew doctor" 12 | alias uud="update; upgrade; cleanup; doctor" 13 | alias ood="uud" 14 | 15 | # Utility commands (mostly from https://news.ycombinator.com/item?id=9869231) 16 | alias o='open' 17 | alias q='exit' 18 | alias c='clear' 19 | # Search process by name and highlight 20 | function psgrep() { ps axu | grep -v grep | grep "$@" -i --color=auto; } 21 | alias du='dust' 22 | alias df='duf' 23 | alias curl='curlie' 24 | 25 | alias cat='bat -P' 26 | alias diff='batdiff' 27 | alias bathelp='bat --plain --language=help' 28 | help() { 29 | "$@" --help 2>&1 | bathelp 30 | } 31 | 32 | alias top='btm -b' 33 | 34 | if [[ $OSTYPE == 'darwin'* ]]; then 35 | #icloud drive 36 | alias icloud='cd ~/Library/Mobile\ Documents/com\~apple\~CloudDocs/' 37 | fi 38 | 39 | alias k='kubectl' 40 | 41 | alias root='cd $(git rev-parse --show-toplevel || echo ".")' 42 | alias '?'='gh copilot explain' 43 | alias '??'='gh copilot suggest' 44 | -------------------------------------------------------------------------------- /dot_completions/_circleci: -------------------------------------------------------------------------------- 1 | #compdef circleci 2 | 3 | # zsh completion for circleci -*- shell-script -*- 4 | 5 | __circleci_debug() 6 | { 7 | local file="$BASH_COMP_DEBUG_FILE" 8 | if [[ -n ${file} ]]; then 9 | echo "$*" >> "${file}" 10 | fi 11 | } 12 | 13 | _circleci() 14 | { 15 | local shellCompDirectiveError=1 16 | local shellCompDirectiveNoSpace=2 17 | local shellCompDirectiveNoFileComp=4 18 | local shellCompDirectiveFilterFileExt=8 19 | local shellCompDirectiveFilterDirs=16 20 | 21 | local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace 22 | local -a completions 23 | 24 | __circleci_debug "\n========= starting completion logic ==========" 25 | __circleci_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}" 26 | 27 | # The user could have moved the cursor backwards on the command-line. 28 | # We need to trigger completion from the $CURRENT location, so we need 29 | # to truncate the command-line ($words) up to the $CURRENT location. 30 | # (We cannot use $CURSOR as its value does not work when a command is an alias.) 31 | words=("${=words[1,CURRENT]}") 32 | __circleci_debug "Truncated words[*]: ${words[*]}," 33 | 34 | lastParam=${words[-1]} 35 | lastChar=${lastParam[-1]} 36 | __circleci_debug "lastParam: ${lastParam}, lastChar: ${lastChar}" 37 | 38 | # For zsh, when completing a flag with an = (e.g., circleci -n=) 39 | # completions must be prefixed with the flag 40 | setopt local_options BASH_REMATCH 41 | if [[ "${lastParam}" =~ '-.*=' ]]; then 42 | # We are dealing with a flag with an = 43 | flagPrefix="-P ${BASH_REMATCH}" 44 | fi 45 | 46 | # Prepare the command to obtain completions 47 | requestComp="${words[1]} __complete ${words[2,-1]}" 48 | if [ "${lastChar}" = "" ]; then 49 | # If the last parameter is complete (there is a space following it) 50 | # We add an extra empty parameter so we can indicate this to the go completion code. 51 | __circleci_debug "Adding extra empty parameter" 52 | requestComp="${requestComp} \"\"" 53 | fi 54 | 55 | __circleci_debug "About to call: eval ${requestComp}" 56 | 57 | # Use eval to handle any environment variables and such 58 | out=$(eval ${requestComp} 2>/dev/null) 59 | __circleci_debug "completion output: ${out}" 60 | 61 | # Extract the directive integer following a : from the last line 62 | local lastLine 63 | while IFS='\n' read -r line; do 64 | lastLine=${line} 65 | done < <(printf "%s\n" "${out[@]}") 66 | __circleci_debug "last line: ${lastLine}" 67 | 68 | if [ "${lastLine[1]}" = : ]; then 69 | directive=${lastLine[2,-1]} 70 | # Remove the directive including the : and the newline 71 | local suffix 72 | (( suffix=${#lastLine}+2)) 73 | out=${out[1,-$suffix]} 74 | else 75 | # There is no directive specified. Leave $out as is. 76 | __circleci_debug "No directive found. Setting do default" 77 | directive=0 78 | fi 79 | 80 | __circleci_debug "directive: ${directive}" 81 | __circleci_debug "completions: ${out}" 82 | __circleci_debug "flagPrefix: ${flagPrefix}" 83 | 84 | if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then 85 | __circleci_debug "Completion received error. Ignoring completions." 86 | return 87 | fi 88 | 89 | local activeHelpMarker="_activeHelp_ " 90 | local endIndex=${#activeHelpMarker} 91 | local startIndex=$((${#activeHelpMarker}+1)) 92 | local hasActiveHelp=0 93 | while IFS='\n' read -r comp; do 94 | # Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker) 95 | if [ "${comp[1,$endIndex]}" = "$activeHelpMarker" ];then 96 | __circleci_debug "ActiveHelp found: $comp" 97 | comp="${comp[$startIndex,-1]}" 98 | if [ -n "$comp" ]; then 99 | compadd -x "${comp}" 100 | __circleci_debug "ActiveHelp will need delimiter" 101 | hasActiveHelp=1 102 | fi 103 | 104 | continue 105 | fi 106 | 107 | if [ -n "$comp" ]; then 108 | # If requested, completions are returned with a description. 109 | # The description is preceded by a TAB character. 110 | # For zsh's _describe, we need to use a : instead of a TAB. 111 | # We first need to escape any : as part of the completion itself. 112 | comp=${comp//:/\\:} 113 | 114 | local tab="$(printf '\t')" 115 | comp=${comp//$tab/:} 116 | 117 | __circleci_debug "Adding completion: ${comp}" 118 | completions+=${comp} 119 | lastComp=$comp 120 | fi 121 | done < <(printf "%s\n" "${out[@]}") 122 | 123 | # Add a delimiter after the activeHelp statements, but only if: 124 | # - there are completions following the activeHelp statements, or 125 | # - file completion will be performed (so there will be choices after the activeHelp) 126 | if [ $hasActiveHelp -eq 1 ]; then 127 | if [ ${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then 128 | __circleci_debug "Adding activeHelp delimiter" 129 | compadd -x "--" 130 | hasActiveHelp=0 131 | fi 132 | fi 133 | 134 | if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then 135 | __circleci_debug "Activating nospace." 136 | noSpace="-S ''" 137 | fi 138 | 139 | if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then 140 | # File extension filtering 141 | local filteringCmd 142 | filteringCmd='_files' 143 | for filter in ${completions[@]}; do 144 | if [ ${filter[1]} != '*' ]; then 145 | # zsh requires a glob pattern to do file filtering 146 | filter="\*.$filter" 147 | fi 148 | filteringCmd+=" -g $filter" 149 | done 150 | filteringCmd+=" ${flagPrefix}" 151 | 152 | __circleci_debug "File filtering command: $filteringCmd" 153 | _arguments '*:filename:'"$filteringCmd" 154 | elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then 155 | # File completion for directories only 156 | local subdir 157 | subdir="${completions[1]}" 158 | if [ -n "$subdir" ]; then 159 | __circleci_debug "Listing directories in $subdir" 160 | pushd "${subdir}" >/dev/null 2>&1 161 | else 162 | __circleci_debug "Listing directories in ." 163 | fi 164 | 165 | local result 166 | _arguments '*:dirname:_files -/'" ${flagPrefix}" 167 | result=$? 168 | if [ -n "$subdir" ]; then 169 | popd >/dev/null 2>&1 170 | fi 171 | return $result 172 | else 173 | __circleci_debug "Calling _describe" 174 | if eval _describe "completions" completions $flagPrefix $noSpace; then 175 | __circleci_debug "_describe found some completions" 176 | 177 | # Return the success of having called _describe 178 | return 0 179 | else 180 | __circleci_debug "_describe did not find completions." 181 | __circleci_debug "Checking if we should do file completion." 182 | if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then 183 | __circleci_debug "deactivating file completion" 184 | 185 | # We must return an error code here to let zsh know that there were no 186 | # completions found by _describe; this is what will trigger other 187 | # matching algorithms to attempt to find completions. 188 | # For example zsh can match letters in the middle of words. 189 | return 1 190 | else 191 | # Perform file completion 192 | __circleci_debug "Activating file completion" 193 | 194 | # We must return the result of this command, so it must be the 195 | # last command, or else we must store its result to return it. 196 | _arguments '*:filename:_files'" ${flagPrefix}" 197 | fi 198 | fi 199 | fi 200 | } 201 | 202 | # don't run the completion function when being source-ed or eval-ed 203 | if [ "$funcstack[1]" = "_circleci" ]; then 204 | _circleci 205 | fi 206 | -------------------------------------------------------------------------------- /dot_completions/_gt: -------------------------------------------------------------------------------- 1 | #compdef gt 2 | ###-begin-gt-completions-### 3 | # 4 | # yargs command completion script 5 | # 6 | # Installation: /opt/homebrew/bin/gt completion >> ~/.zshrc 7 | # or /opt/homebrew/bin/gt completion >> ~/.zprofile on OSX. 8 | # 9 | _gt_yargs_completions() 10 | { 11 | local reply 12 | local si=$IFS 13 | IFS=$' 14 | ' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" $(brew --prefix)/bin/gt --get-yargs-completions "${words[@]}")) 15 | IFS=$si 16 | _describe 'values' reply 17 | } 18 | compdef _gt_yargs_completions gt 19 | ###-end-gt-completions-### 20 | 21 | -------------------------------------------------------------------------------- /dot_completions/_parallel: -------------------------------------------------------------------------------- 1 | #compdef parallel 2 | 3 | (( $+functions[_comp_parallel] )) || 4 | eval "$(parallel --shell-completion auto)" && 5 | _comp_parallel 6 | 7 | -------------------------------------------------------------------------------- /dot_config/broot/conf.hjson: -------------------------------------------------------------------------------- 1 | ############################################################### 2 | # This configuration file lets you 3 | # - define new commands 4 | # - change the shortcut or triggering keys of built-in verbs 5 | # - change the colors 6 | # - set default values for flags 7 | # - set special behaviors on specific paths 8 | # - and more... 9 | # 10 | # Configuration documentation is available at 11 | # https://dystroy.org/broot 12 | # 13 | # This file's format is Hjson ( https://hjson.github.io/ ). Some 14 | # properties are commented out. To enable them, remove the `#`. 15 | # 16 | ############################################################### 17 | { 18 | 19 | ############################################################### 20 | # Default flags 21 | # You can set up flags you want broot to start with by 22 | # default, for example `default_flags="ihp"` if you usually want 23 | # to see hidden and gitignored files and the permissions (then 24 | # if you don't want the hidden files you can launch `br -H`) 25 | # A popular flag is the `g` one which displays git related info. 26 | # 27 | # default_flags: 28 | 29 | ############################################################### 30 | # Date/Time format 31 | # If you want to change the format for date/time, uncomment the 32 | # following line and change it according to 33 | # https://docs.rs/chrono/0.4.11/chrono/format/strftime/index.html 34 | # 35 | # date_time_format: %Y/%m/%d %R 36 | 37 | ############################################################### 38 | # uncomment to activate modal mode 39 | # 40 | # (you really should read https://dystroy.org/broot/modal/ 41 | # before as it may not suit everybody even among vim users) 42 | # 43 | # modal: true 44 | 45 | ############################################################### 46 | # Whether to mark the selected line with a triangle 47 | # 48 | show_selection_mark: true 49 | 50 | ############################################################### 51 | # Column order 52 | # cols_order, if specified, must be a permutation of the following 53 | # array. You should keep the name at the end as it has a variable 54 | # length. 55 | # 56 | # cols_order: [ 57 | # mark 58 | # git 59 | # size 60 | # permission 61 | # date 62 | # count 63 | # branch 64 | # name 65 | # ] 66 | 67 | ############################################################### 68 | # True Colors 69 | # If this parameter isn't set, broot tries to automatically 70 | # determine whether true colors (24 bits) are available. 71 | # As this process is unreliable, you may uncomment this setting 72 | # and set it to false or true if you notice the colors in 73 | # previewed images are too off. 74 | # 75 | # true_colors: false 76 | 77 | ############################################################### 78 | # Icons 79 | # If you want to display icons in broot, uncomment this line 80 | # (see https://dystroy.org/broot/icons for installation and 81 | # troubleshooting) 82 | # 83 | # icon_theme: vscode 84 | 85 | ############################################################### 86 | # Special paths 87 | # If some paths must be handled specially, uncomment (and change 88 | # this section as per the examples) 89 | # 90 | # special_paths: { 91 | # "/media/slow-backup-disk" : no-enter 92 | # "/home/dys/useless" : hide 93 | # "/home/dys/my-link-I-want-to-explore" : enter 94 | # } 95 | 96 | ############################################################### 97 | # Quit on last cancel 98 | # You can usually cancel the last state change on escape. 99 | # If you want the escape key to quit broot when there's nothing 100 | # to cancel (for example when you just opened broot), uncomment 101 | # this parameter 102 | # 103 | # quit_on_last_cancel: true 104 | 105 | ############################################################### 106 | # Search modes 107 | # 108 | # broot allows many search modes. 109 | # A search mode is defined by 110 | # - the way to search: 'fuzzy', 'exact', 'regex', or 'tokens'. 111 | # - where to search: file 'name', 'path', or file 'content' 112 | # A search pattern may for example be "fuzzy path" (default), 113 | # "regex content" or "exact path". 114 | # 115 | # The search mode is selected from its prefix. For example, if 116 | # you type "abc", the default mode is "fuzzy path". If you type 117 | # "/abc", the mode is "regex path". If you type "rn/abc", the mode 118 | # is "regex name". 119 | # 120 | # This mapping may be modified. You may want to dedicate the 121 | # empty prefix (the one which doesn't need a '/') to the 122 | # search mode you use most often. The example below makes it 123 | # easy to search on name rather than on the subpath. 124 | # 125 | # More information on 126 | # https://dystroy.org/broot/input/#the-filtering-pattern 127 | # 128 | # search_modes: { 129 | # : fuzzy name 130 | # /: regex name 131 | # } 132 | 133 | ############################################################### 134 | # Verbs and shortcuts 135 | # You can define your own commands which would be applied to 136 | # the selection. 137 | # You'll also find below verbs that you can customize or enable. 138 | verbs: [ 139 | 140 | { 141 | name: open-code 142 | key: enter 143 | extensions: [ 144 | go 145 | mod 146 | work 147 | gitignore 148 | c 149 | cc 150 | cpp 151 | cs 152 | css 153 | java 154 | js 155 | sass 156 | scss 157 | less 158 | vue 159 | cfg 160 | json 161 | jsx 162 | log 163 | lua 164 | md 165 | php 166 | pl 167 | py 168 | rb 169 | ts 170 | tsx 171 | txt 172 | cfg 173 | conf 174 | yaml 175 | yml 176 | toml 177 | xml 178 | xsl 179 | xsd 180 | vim 181 | vimrc 182 | gitconfig 183 | gitignore 184 | sh 185 | zsh 186 | bash 187 | ] 188 | execution: "$EDITOR +{line} {file}" 189 | working_dir: "{root}" 190 | leave_broot: false 191 | } 192 | # Example 1: launching `tail -n` on the selected file (leaving broot) 193 | # { 194 | # name: tail_lines 195 | # invocation: tl {lines_count} 196 | # execution: "tail -f -n {lines_count} {file}" 197 | # } 198 | 199 | # Example 2: creating a new file without leaving broot 200 | # { 201 | # name: touch 202 | # invocation: touch {new_file} 203 | # execution: "touch {directory}/{new_file}" 204 | # leave_broot: false 205 | # } 206 | 207 | # A standard recommended command for editing files, that you 208 | # can customize. 209 | # If $EDITOR isn't set on your computer, you should either set it using 210 | # something similar to 211 | # export EDITOR=nvim 212 | # or just replace it with your editor of choice in the 'execution' 213 | # pattern. 214 | # If your editor is able to open a file on a specific line, use {line} 215 | # so that you may jump directly at the right line from a preview. 216 | # Example: 217 | # execution: nvim +{line} {file} 218 | { 219 | invocation: edit 220 | shortcut: e 221 | execution: "$EDITOR +{line} {file}" 222 | leave_broot: false 223 | } 224 | 225 | # A convenient shortcut to create new text files in 226 | # the current directory or below 227 | { 228 | invocation: create {subpath} 229 | execution: "$EDITOR {directory}/{subpath}" 230 | leave_broot: false 231 | } 232 | 233 | { 234 | invocation: git_diff 235 | shortcut: gd 236 | leave_broot: false 237 | execution: "git difftool -y {file}" 238 | } 239 | 240 | # On ctrl-b, propose the creation of a copy of the selection. 241 | # While this might occasionally be useful, this verb is mostly here 242 | # as an example to demonstrate rare standard groups like {file-stem} 243 | # and {file-dot-extension} and the auto_exec verb property which 244 | # allows verbs not executed until you hit enter 245 | { 246 | invocation: "backup {version}" 247 | key: ctrl-b 248 | leave_broot: false 249 | auto_exec: false 250 | execution: "cp -r {file} {parent}/{file-stem}-{version}{file-dot-extension}" 251 | } 252 | 253 | # This verb lets you launch a terminal on ctrl-T 254 | # (on exit you'll be back in broot) 255 | { 256 | invocation: terminal 257 | key: ctrl-t 258 | execution: "$SHELL" 259 | set_working_dir: true 260 | leave_broot: false 261 | } 262 | 263 | # Here's an example of a shortcut bringing you to your home directory 264 | # { 265 | # invocation: home 266 | # key: ctrl-home 267 | # execution: ":focus ~" 268 | # } 269 | 270 | # A popular set of shortcuts for going up and down: 271 | # 272 | # { 273 | # key: ctrl-k 274 | # execution: ":line_up" 275 | # } 276 | # { 277 | # key: ctrl-j 278 | # execution: ":line_down" 279 | # } 280 | # { 281 | # key: ctrl-u 282 | # execution: ":page_up" 283 | # } 284 | # { 285 | # key: ctrl-d 286 | # execution: ":page_down" 287 | # } 288 | 289 | # If you develop using git, you might like to often switch 290 | # to the git status filter: 291 | # { 292 | # key: ctrl-g 293 | # execution: ":toggle_git_status" 294 | # } 295 | 296 | # You can reproduce the bindings of Norton Commander 297 | # on copying or moving to the other panel: 298 | # { 299 | # key: F5 300 | # external: "cp -r {file} {other-panel-directory}" 301 | # leave_broot: false 302 | # } 303 | # { 304 | # key: F6 305 | # external: "mv {file} {other-panel-directory}" 306 | # leave_broot: false 307 | # } 308 | ] 309 | 310 | ############################################################### 311 | # Skin 312 | # If you want to change the colors of broot, 313 | # uncomment the following bloc and start messing 314 | # with the various values. 315 | # A skin entry value is made of two parts separated with a '/': 316 | # The first one is the skin for the active panel. 317 | # The second one, optional, is the skin for non active panels. 318 | # You may find explanations and other skins on 319 | # https://dystroy.org/broot/skins 320 | ############################################################### 321 | # If you only want to set the default color and a transparent 322 | # background, uncomment this simplified skin: 323 | # skin: { 324 | # default: none none / gray(20) none 325 | # } 326 | # 327 | # To experiment with a whole skin, uncomment this one: 328 | # skin: { 329 | # default: gray(23) none / gray(20) none 330 | # tree: ansi(94) None / gray(3) None 331 | # parent: gray(18) None / gray(13) None 332 | # file: gray(20) None / gray(15) None 333 | # directory: ansi(208) None Bold / ansi(172) None bold 334 | # exe: Cyan None 335 | # link: Magenta None 336 | # pruning: gray(12) None Italic 337 | # perm__: gray(5) None 338 | # perm_r: ansi(94) None 339 | # perm_w: ansi(132) None 340 | # perm_x: ansi(65) None 341 | # owner: ansi(138) None 342 | # group: ansi(131) None 343 | # count: ansi(136) gray(3) 344 | # dates: ansi(66) None 345 | # sparse: ansi(214) None 346 | # content_extract: ansi(29) None 347 | # content_match: ansi(34) None 348 | # git_branch: ansi(229) None 349 | # git_insertions: ansi(28) None 350 | # git_deletions: ansi(160) None 351 | # git_status_current: gray(5) None 352 | # git_status_modified: ansi(28) None 353 | # git_status_new: ansi(94) None Bold 354 | # git_status_ignored: gray(17) None 355 | # git_status_conflicted: ansi(88) None 356 | # git_status_other: ansi(88) None 357 | # selected_line: None gray(5) / None gray(4) 358 | # char_match: Yellow None 359 | # file_error: Red None 360 | # flag_label: gray(15) None 361 | # flag_value: ansi(208) None Bold 362 | # input: White None / gray(15) gray(2) 363 | # status_error: gray(22) ansi(124) 364 | # status_job: ansi(220) gray(5) 365 | # status_normal: gray(20) gray(3) / gray(2) gray(2) 366 | # status_italic: ansi(208) gray(3) / gray(2) gray(2) 367 | # status_bold: ansi(208) gray(3) Bold / gray(2) gray(2) 368 | # status_code: ansi(229) gray(3) / gray(2) gray(2) 369 | # status_ellipsis: gray(19) gray(1) / gray(2) gray(2) 370 | # purpose_normal: gray(20) gray(2) 371 | # purpose_italic: ansi(178) gray(2) 372 | # purpose_bold: ansi(178) gray(2) Bold 373 | # purpose_ellipsis: gray(20) gray(2) 374 | # scrollbar_track: gray(7) None / gray(4) None 375 | # scrollbar_thumb: gray(22) None / gray(14) None 376 | # help_paragraph: gray(20) None 377 | # help_bold: ansi(208) None Bold 378 | # help_italic: ansi(166) None 379 | # help_code: gray(21) gray(3) 380 | # help_headers: ansi(208) None 381 | # help_table_border: ansi(239) None 382 | # preview: gray(20) gray(1) / gray(18) gray(2) 383 | # preview_line_number: gray(12) gray(3) 384 | # preview_match: None ansi(29) 385 | # hex_null: gray(11) None 386 | # hex_ascii_graphic: gray(18) None 387 | # hex_ascii_whitespace: ansi(143) None 388 | # hex_ascii_other: ansi(215) None 389 | # hex_non_ascii: ansi(167) None 390 | # } 391 | skin: { 392 | default: rgb(235, 219, 178) none / rgb(189, 174, 147) none 393 | tree: rgb(168, 153, 132) None / rgb(102, 92, 84) None 394 | parent: rgb(235, 219, 178) none / rgb(189, 174, 147) none Italic 395 | file: None None / None None Italic 396 | directory: rgb(131, 165, 152) None Bold / rgb(131, 165, 152) None 397 | exe: rgb(184, 187, 38) None 398 | link: rgb(104, 157, 106) None 399 | pruning: rgb(124, 111, 100) None Italic 400 | perm__: None None 401 | perm_r: rgb(215, 153, 33) None 402 | perm_w: rgb(204, 36, 29) None 403 | perm_x: rgb(152, 151, 26) None 404 | owner: rgb(215, 153, 33) None Bold 405 | group: rgb(215, 153, 33) None 406 | count: rgb(69, 133, 136) rgb(50, 48, 47) 407 | dates: rgb(168, 153, 132) None 408 | sparse: rgb(250, 189,47) None 409 | content_extract: ansi(29) None Italic 410 | content_match: ansi(34) None Bold 411 | git_branch: rgb(251, 241, 199) None 412 | git_insertions: rgb(152, 151, 26) None 413 | git_deletions: rgb(190, 15, 23) None 414 | git_status_current: rgb(60, 56, 54) None 415 | git_status_modified: rgb(152, 151, 26) None 416 | git_status_new: rgb(104, 187, 38) None Bold 417 | git_status_ignored: rgb(213, 196, 161) None 418 | git_status_conflicted: rgb(204, 36, 29) None 419 | git_status_other: rgb(204, 36, 29) None 420 | selected_line: None rgb(60, 56, 54) / None rgb(50, 48, 47) 421 | char_match: rgb(250, 189, 47) None 422 | file_error: rgb(251, 73, 52) None 423 | flag_label: rgb(189, 174, 147) None 424 | flag_value: rgb(211, 134, 155) None Bold 425 | input: rgb(251, 241, 199) None / rgb(189, 174, 147) None Italic 426 | status_error: rgb(213, 196, 161) rgb(204, 36, 29) 427 | status_job: rgb(250, 189, 47) rgb(60, 56, 54) 428 | status_normal: None rgb(40, 38, 37) / None None 429 | status_italic: rgb(211, 134, 155) rgb(40, 38, 37) Italic / None None 430 | status_bold: rgb(211, 134, 155) rgb(40, 38, 37) Bold / None None 431 | status_code: rgb(251, 241, 199) rgb(40, 38, 37) / None None 432 | status_ellipsis: rgb(251, 241, 199) rgb(40, 38, 37) Bold / None None 433 | purpose_normal: None None 434 | purpose_italic: rgb(177, 98, 134) None Italic 435 | purpose_bold: rgb(177, 98, 134) None Bold 436 | purpose_ellipsis: None None 437 | scrollbar_track: rgb(80, 73, 69) None / rgb(50, 48, 47) None 438 | scrollbar_thumb: rgb(213, 196, 161) None / rgb(102, 92, 84) None 439 | help_paragraph: None None 440 | help_bold: rgb(214, 93, 14) None Bold 441 | help_italic: rgb(211, 134, 155) None Italic 442 | help_code: rgb(142, 192, 124) rgb(50, 48, 47) 443 | help_headers: rgb(254, 128, 25) None Bold 444 | help_table_border: rgb(80, 73, 69) None 445 | preview_title: rgb(235, 219, 178) rgb(40, 40, 40) / rgb(189, 174, 147) rgb(40, 40, 40) 446 | preview: rgb(235, 219, 178) rgb(40, 40, 40) / rgb(235, 219, 178) rgb(40, 40, 40) 447 | preview_line_number: rgb(124, 111, 100) None / rgb(124, 111, 100) rgb(40, 40, 40) 448 | preview_match: None ansi(29) Bold 449 | hex_null: rgb(189, 174, 147) None 450 | hex_ascii_graphic: rgb(213, 196, 161) None 451 | hex_ascii_whitespace: rgb(152, 151, 26) None 452 | hex_ascii_other: rgb(254, 128, 25) None 453 | hex_non_ascii: rgb(214, 93, 14) None 454 | staging_area_title: rgb(235, 219, 178) rgb(40, 40, 40) / rgb(189, 174, 147) rgb(40, 40, 40) 455 | mode_command_mark: gray(5) ansi(204) Bold 456 | } 457 | 458 | ############################################################### 459 | # File Extension Colors 460 | # 461 | # uncomment and modify the next section if you want to color 462 | # file name depending on their extension 463 | # 464 | # ext_colors: { 465 | # png: rgb(255, 128, 75) 466 | # rs: yellow 467 | # } 468 | 469 | 470 | ############################################################### 471 | # Max Panels Count 472 | # 473 | # Change this if you sometimes want to have more than 2 panels 474 | # open 475 | # max_panels_count: 2 476 | } 477 | -------------------------------------------------------------------------------- /dot_config/fsh/current_theme.zsh: -------------------------------------------------------------------------------- 1 | zstyle :plugin:fast-syntax-highlighting theme "default" 2 | typeset -g FAST_THEME_NAME="default" 3 | : ${FAST_HIGHLIGHT_STYLES[defaultdefault]:=none} 4 | : ${FAST_HIGHLIGHT_STYLES[defaultunknown-token]:=fg=red,bold} 5 | : ${FAST_HIGHLIGHT_STYLES[defaultreserved-word]:=fg=yellow} 6 | : ${FAST_HIGHLIGHT_STYLES[defaultalias]:=fg=green} 7 | : ${FAST_HIGHLIGHT_STYLES[defaultsuffix-alias]:=fg=green} 8 | : ${FAST_HIGHLIGHT_STYLES[defaultbuiltin]:=fg=green} 9 | : ${FAST_HIGHLIGHT_STYLES[defaultfunction]:=fg=green} 10 | : ${FAST_HIGHLIGHT_STYLES[defaultcommand]:=fg=green} 11 | : ${FAST_HIGHLIGHT_STYLES[defaultprecommand]:=fg=green} 12 | : ${FAST_HIGHLIGHT_STYLES[defaultcommandseparator]:=none} 13 | : ${FAST_HIGHLIGHT_STYLES[defaulthashed-command]:=fg=green} 14 | : ${FAST_HIGHLIGHT_STYLES[defaultpath]:=fg=magenta} 15 | : ${FAST_HIGHLIGHT_STYLES[defaultpath_pathseparator]:=} 16 | : ${FAST_HIGHLIGHT_STYLES[defaultglobbing]:=fg=blue,bold} 17 | : ${FAST_HIGHLIGHT_STYLES[defaultglobbing-ext]:=fg=13} 18 | : ${FAST_HIGHLIGHT_STYLES[defaulthistory-expansion]:=fg=blue,bold} 19 | : ${FAST_HIGHLIGHT_STYLES[defaultsingle-hyphen-option]:=fg=cyan} 20 | : ${FAST_HIGHLIGHT_STYLES[defaultdouble-hyphen-option]:=fg=cyan} 21 | : ${FAST_HIGHLIGHT_STYLES[defaultback-quoted-argument]:=none} 22 | : ${FAST_HIGHLIGHT_STYLES[defaultsingle-quoted-argument]:=fg=yellow} 23 | : ${FAST_HIGHLIGHT_STYLES[defaultdouble-quoted-argument]:=fg=yellow} 24 | : ${FAST_HIGHLIGHT_STYLES[defaultdollar-quoted-argument]:=fg=yellow} 25 | : ${FAST_HIGHLIGHT_STYLES[defaultback-or-dollar-double-quoted-argument]:=fg=cyan} 26 | : ${FAST_HIGHLIGHT_STYLES[defaultback-dollar-quoted-argument]:=fg=cyan} 27 | : ${FAST_HIGHLIGHT_STYLES[defaultassign]:=none} 28 | : ${FAST_HIGHLIGHT_STYLES[defaultredirection]:=none} 29 | : ${FAST_HIGHLIGHT_STYLES[defaultcomment]:=fg=black,bold} 30 | : ${FAST_HIGHLIGHT_STYLES[defaultvariable]:=fg=113} 31 | : ${FAST_HIGHLIGHT_STYLES[defaultmathvar]:=fg=blue,bold} 32 | : ${FAST_HIGHLIGHT_STYLES[defaultmathnum]:=fg=magenta} 33 | : ${FAST_HIGHLIGHT_STYLES[defaultmatherr]:=fg=red} 34 | : ${FAST_HIGHLIGHT_STYLES[defaultassign-array-bracket]:=fg=green} 35 | : ${FAST_HIGHLIGHT_STYLES[defaultfor-loop-variable]:=none} 36 | : ${FAST_HIGHLIGHT_STYLES[defaultfor-loop-number]:=fg=magenta} 37 | : ${FAST_HIGHLIGHT_STYLES[defaultfor-loop-operator]:=fg=yellow} 38 | : ${FAST_HIGHLIGHT_STYLES[defaultfor-loop-separator]:=fg=yellow,bold} 39 | : ${FAST_HIGHLIGHT_STYLES[defaultexec-descriptor]:=fg=yellow,bold} 40 | : ${FAST_HIGHLIGHT_STYLES[defaulthere-string-tri]:=fg=yellow} 41 | : ${FAST_HIGHLIGHT_STYLES[defaulthere-string-text]:=fg=18} 42 | : ${FAST_HIGHLIGHT_STYLES[defaulthere-string-var]:=fg=cyan,bg=18} 43 | : ${FAST_HIGHLIGHT_STYLES[defaultsecondary]:=free} 44 | : ${FAST_HIGHLIGHT_STYLES[defaultcase-input]:=fg=green} 45 | : ${FAST_HIGHLIGHT_STYLES[defaultcase-parentheses]:=fg=yellow} 46 | : ${FAST_HIGHLIGHT_STYLES[defaultcase-condition]:=bg=blue} 47 | : ${FAST_HIGHLIGHT_STYLES[defaultcorrect-subtle]:=fg=12} 48 | : ${FAST_HIGHLIGHT_STYLES[defaultincorrect-subtle]:=fg=red} 49 | : ${FAST_HIGHLIGHT_STYLES[defaultsubtle-separator]:=fg=green} 50 | : ${FAST_HIGHLIGHT_STYLES[defaultsubtle-bg]:=bg=18} 51 | : ${FAST_HIGHLIGHT_STYLES[defaultpath-to-dir]:=fg=magenta,underline} 52 | : ${FAST_HIGHLIGHT_STYLES[defaultpaired-bracket]:=bg=blue} 53 | : ${FAST_HIGHLIGHT_STYLES[defaultbracket-level-1]:=fg=green,bold} 54 | : ${FAST_HIGHLIGHT_STYLES[defaultbracket-level-2]:=fg=yellow,bold} 55 | : ${FAST_HIGHLIGHT_STYLES[defaultbracket-level-3]:=fg=cyan,bold} 56 | : ${FAST_HIGHLIGHT_STYLES[defaultglobal-alias]:=bg=blue} 57 | : ${FAST_HIGHLIGHT_STYLES[defaultsubcommand]:=fg=yellow} 58 | : ${FAST_HIGHLIGHT_STYLES[defaultsingle-sq-bracket]:=fg=green} 59 | : ${FAST_HIGHLIGHT_STYLES[defaultdouble-sq-bracket]:=fg=green} 60 | : ${FAST_HIGHLIGHT_STYLES[defaultdouble-paren]:=fg=yellow} 61 | : ${FAST_HIGHLIGHT_STYLES[defaultoptarg-string]:=fg=yellow} 62 | : ${FAST_HIGHLIGHT_STYLES[defaultoptarg-number]:=fg=magenta} 63 | : ${FAST_HIGHLIGHT_STYLES[defaultrecursive-base]:=none} 64 | -------------------------------------------------------------------------------- /dot_config/fsh/secondary_theme.zsh: -------------------------------------------------------------------------------- 1 | : ${FAST_HIGHLIGHT_STYLES[freedefault]:=none} 2 | : ${FAST_HIGHLIGHT_STYLES[freeunknown-token]:=fg=red,bold} 3 | : ${FAST_HIGHLIGHT_STYLES[freereserved-word]:=fg=150} 4 | : ${FAST_HIGHLIGHT_STYLES[freealias]:=fg=180} 5 | : ${FAST_HIGHLIGHT_STYLES[freesuffix-alias]:=fg=180} 6 | : ${FAST_HIGHLIGHT_STYLES[freebuiltin]:=fg=180} 7 | : ${FAST_HIGHLIGHT_STYLES[freefunction]:=fg=180} 8 | : ${FAST_HIGHLIGHT_STYLES[freecommand]:=fg=180} 9 | : ${FAST_HIGHLIGHT_STYLES[freeprecommand]:=fg=180} 10 | : ${FAST_HIGHLIGHT_STYLES[freecommandseparator]:=none} 11 | : ${FAST_HIGHLIGHT_STYLES[freehashed-command]:=fg=180} 12 | : ${FAST_HIGHLIGHT_STYLES[freepath]:=fg=166} 13 | : ${FAST_HIGHLIGHT_STYLES[freepath_pathseparator]:=} 14 | : ${FAST_HIGHLIGHT_STYLES[freeglobbing]:=fg=112} 15 | : ${FAST_HIGHLIGHT_STYLES[freeglobbing-ext]:=fg=118} 16 | : ${FAST_HIGHLIGHT_STYLES[freehistory-expansion]:=fg=blue,bold} 17 | : ${FAST_HIGHLIGHT_STYLES[freesingle-hyphen-option]:=fg=110} 18 | : ${FAST_HIGHLIGHT_STYLES[freedouble-hyphen-option]:=fg=110} 19 | : ${FAST_HIGHLIGHT_STYLES[freeback-quoted-argument]:=none} 20 | : ${FAST_HIGHLIGHT_STYLES[freesingle-quoted-argument]:=fg=150} 21 | : ${FAST_HIGHLIGHT_STYLES[freedouble-quoted-argument]:=fg=150} 22 | : ${FAST_HIGHLIGHT_STYLES[freedollar-quoted-argument]:=fg=150} 23 | : ${FAST_HIGHLIGHT_STYLES[freeback-or-dollar-double-quoted-argument]:=fg=110} 24 | : ${FAST_HIGHLIGHT_STYLES[freeback-dollar-quoted-argument]:=fg=110} 25 | : ${FAST_HIGHLIGHT_STYLES[freeassign]:=none} 26 | : ${FAST_HIGHLIGHT_STYLES[freeredirection]:=none} 27 | : ${FAST_HIGHLIGHT_STYLES[freecomment]:=fg=black,bold} 28 | : ${FAST_HIGHLIGHT_STYLES[freevariable]:=none} 29 | : ${FAST_HIGHLIGHT_STYLES[freemathvar]:=fg=blue,bold} 30 | : ${FAST_HIGHLIGHT_STYLES[freemathnum]:=fg=166} 31 | : ${FAST_HIGHLIGHT_STYLES[freematherr]:=fg=red} 32 | : ${FAST_HIGHLIGHT_STYLES[freeassign-array-bracket]:=fg=180} 33 | : ${FAST_HIGHLIGHT_STYLES[freefor-loop-variable]:=none} 34 | : ${FAST_HIGHLIGHT_STYLES[freefor-loop-number]:=fg=150} 35 | : ${FAST_HIGHLIGHT_STYLES[freefor-loop-operator]:=fg=150} 36 | : ${FAST_HIGHLIGHT_STYLES[freefor-loop-separator]:=fg=109} 37 | : ${FAST_HIGHLIGHT_STYLES[freeexec-descriptor]:=fg=yellow,bold} 38 | : ${FAST_HIGHLIGHT_STYLES[freehere-string-tri]:=fg=yellow} 39 | : ${FAST_HIGHLIGHT_STYLES[freehere-string-text]:=bg=19} 40 | : ${FAST_HIGHLIGHT_STYLES[freehere-string-var]:=fg=110,bg=19} 41 | : ${FAST_HIGHLIGHT_STYLES[freesecondary]:=zdharma} 42 | : ${FAST_HIGHLIGHT_STYLES[freecase-input]:=fg=180} 43 | : ${FAST_HIGHLIGHT_STYLES[freecase-parentheses]:=fg=116} 44 | : ${FAST_HIGHLIGHT_STYLES[freecase-condition]:=bg=19} 45 | : ${FAST_HIGHLIGHT_STYLES[freecorrect-subtle]:=bg=55} 46 | : ${FAST_HIGHLIGHT_STYLES[freeincorrect-subtle]:=bg=52} 47 | : ${FAST_HIGHLIGHT_STYLES[freesubtle-separator]:=none} 48 | : ${FAST_HIGHLIGHT_STYLES[freesubtle-bg]:=bg=18} 49 | : ${FAST_HIGHLIGHT_STYLES[freepath-to-dir]:=fg=166,underline} 50 | : ${FAST_HIGHLIGHT_STYLES[freepaired-bracket]:=bg=blue} 51 | : ${FAST_HIGHLIGHT_STYLES[freebracket-level-1]:=fg=130} 52 | : ${FAST_HIGHLIGHT_STYLES[freebracket-level-2]:=fg=70} 53 | : ${FAST_HIGHLIGHT_STYLES[freebracket-level-3]:=fg=69} 54 | : ${FAST_HIGHLIGHT_STYLES[freeglobal-alias]:=bg=19} 55 | : ${FAST_HIGHLIGHT_STYLES[freesubcommand]:=fg=150} 56 | : ${FAST_HIGHLIGHT_STYLES[freesingle-sq-bracket]:=fg=180} 57 | : ${FAST_HIGHLIGHT_STYLES[freedouble-sq-bracket]:=fg=180} 58 | : ${FAST_HIGHLIGHT_STYLES[freedouble-paren]:=fg=150} 59 | : ${FAST_HIGHLIGHT_STYLES[freeoptarg-string]:=fg=150} 60 | : ${FAST_HIGHLIGHT_STYLES[freeoptarg-number]:=fg=166} 61 | : ${FAST_HIGHLIGHT_STYLES[freerecursive-base]:=fg=183} 62 | -------------------------------------------------------------------------------- /dot_config/ghostty/config: -------------------------------------------------------------------------------- 1 | theme = GruvboxDark 2 | font-family = "Hack Nerd Font Mono Regular" 3 | font-size = 16 4 | -------------------------------------------------------------------------------- /dot_config/nvim/coc-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "notification.statusLineProgress": false, 3 | "coc.preferences.extensionUpdateCheck": "daily", 4 | "coc.preferences.enableMessageDialog": true, 5 | "coc.preferences.enableLinkedEditing": true, 6 | "coc.preferences.silentAutoupdate": true, 7 | "coc.preferences.formatOnSave": true, 8 | "semanticTokens.enable": true, 9 | "colors.enable": true, 10 | "codeLens.enable": true, 11 | "codeLens.position": "top", 12 | "codeLens.separator": "󰌵 CodeLens Actions:", 13 | "codeLens.subseparator": " 󰝨 ", 14 | "explorer.icon.enableNerdfont": true, 15 | "explorer.icon.source": "vim-devicons", 16 | "explorer.floating.border.title": "Explorer: Press ? to show help", 17 | "diagnostic.locationlistLevel": "warning", 18 | "diagnostic.locationlistUpdate": true, 19 | "diagnostic.autoRefresh": true, 20 | "diagnostic.hintSign": "", 21 | "diagnostic.infoSign": "", 22 | "diagnostic.warningSign": "", 23 | "diagnostic.errorSign": "", 24 | "suggest.removeDuplicateItems": true, 25 | "suggest.completionItemKindLabels": { 26 | "keyword": "", 27 | "variable": "", 28 | "value": "", 29 | "operator": "", 30 | "constructor": "", 31 | "function": "󰊕", 32 | "reference": "", 33 | "constant": "", 34 | "method": "", 35 | "struct": "", 36 | "class": "", 37 | "interface": "", 38 | "text": "", 39 | "enum": "", 40 | "enumMember": "", 41 | "module": "", 42 | "color": "", 43 | "property": "", 44 | "field": "", 45 | "unit": "", 46 | "event": "", 47 | "file": "", 48 | "folder": "", 49 | "snippet": "", 50 | "typeParameter": "", 51 | "default": "" 52 | }, 53 | "snippets.priority": 89, 54 | "coc.source.zsh.priority": 99, 55 | "go.checkForUpdates": "install", 56 | "go.goplsOptions": { 57 | "local": "fluxninja.com", 58 | "gofumpt": true, 59 | "staticcheck": true, 60 | "semanticTokens": true, 61 | "analyses": { 62 | "fieldalignment": true, 63 | "nilness": true, 64 | "unusedparams": true, 65 | "unusedwrite": true, 66 | "shadow": true, 67 | "useany": true 68 | }, 69 | "codelenses": { 70 | "gc_details": true, 71 | "generate": true, 72 | "regenerate_cgo": true, 73 | "tidy": true, 74 | "upgrade_dependency": true, 75 | "vendor": true 76 | } 77 | }, 78 | "languageserver": { 79 | "graphql": { 80 | "command": "graphql-lsp", 81 | "args": ["server", "-m", "stream"], 82 | "filetypes": ["typescript", "typescriptreact", "graphql"] 83 | }, 84 | "terraform": { 85 | "command": "terraform-ls", 86 | "args": ["serve"], 87 | "filetypes": ["terraform", "tf"], 88 | "initializationOptions": {} 89 | }, 90 | "lua": { 91 | "command": "lua-lsp", 92 | "filetypes": ["lua"] 93 | }, 94 | "bash": { 95 | "command": "bash-language-server", 96 | "args": ["start"], 97 | "filetypes": ["sh", "bash"] 98 | }, 99 | "dockerfile": { 100 | "command": "docker-langserver", 101 | "filetypes": ["dockerfile"], 102 | "args": ["--stdio"] 103 | }, 104 | "buf": { 105 | "command": "bufls", 106 | "args": ["serve"], 107 | "filetypes": ["proto"] 108 | }, 109 | "jsonnet": { 110 | "command": "jsonnet-language-server", 111 | "args": ["-t"], 112 | "rootPatterns": [".git/", "jsonnetfile.json"], 113 | "filetypes": ["jsonnet", "libsonnet"] 114 | } 115 | }, 116 | "diagnostic-languageserver.mergeConfig": true, 117 | "diagnostic-languageserver.debug": true, 118 | "diagnostic-languageserver.linters": { 119 | "golangci-lint2": { 120 | "command": "golangci-lint", 121 | "rootPatterns": ["go.mod"], 122 | "debounce": 100, 123 | "args": ["--out-format", "json", "--deadline", "5s", "run", "%dirname"], 124 | "sourceName": "golangci-lint", 125 | "parseJson": { 126 | "sourceName": "Pos.Filename", 127 | "sourceNameFilter": true, 128 | "errorsRoot": "Issues", 129 | "line": "Pos.Line", 130 | "column": "Pos.Column", 131 | "message": "${Text} [${FromLinter}]" 132 | } 133 | }, 134 | "zsh": { 135 | "command": "zsh", 136 | "args": ["-n", "%file"], 137 | "isStdout": false, 138 | "isStderr": true, 139 | "sourceName": "zsh", 140 | "formatLines": 1, 141 | "formatPattern": [ 142 | "^[^:]+:(\\d+):\\s+(.*)$", 143 | { 144 | "line": 1, 145 | "message": 2 146 | } 147 | ] 148 | } 149 | }, 150 | "diagnostic-languageserver.filetypes": { 151 | "go": "golangci-lint2", 152 | "zsh": "zsh" 153 | }, 154 | "diagnostic-languageserver.formatFiletypes": { 155 | "sh": "shfmt", 156 | "bash": "shfmt", 157 | "terraform": "tffmt" 158 | }, 159 | "ltex.configurationTarget": { 160 | "dictionary": "userExternalFile", 161 | "disabledRules": "workspaceFolderExternalFile", 162 | "hiddenFalsePositives": "workspaceFolderExternalFile" 163 | }, 164 | "ltex.diagnosticSeverity": "warning", 165 | "ltex.dictionary": { 166 | "en-US": [ 167 | ":~/Work/fluxninja/aperture/.github/styles/Vocab/FluxNinja/accept.txt" 168 | ] 169 | }, 170 | "ltex.completionEnabled": true, 171 | /* "ltex.enabled": [ 172 | "bibtex", 173 | "context", 174 | "context.tex", 175 | "html", 176 | "latex", 177 | "markdown", 178 | "org", 179 | "restructuredtext", 180 | "rsweave", 181 | "go", 182 | "typescript", 183 | "python", 184 | "shellscript", 185 | "java", 186 | "javascript", 187 | "javascriptreact", 188 | "lua" 189 | ],*/ 190 | "ltex.languageToolHttpServerUri": "${env:LANGTOOL_HTTP_URI}", 191 | "ltex.languageToolOrg.username": "${env:LANGTOOL_USERNAME}", 192 | "ltex.languageToolOrg.apiKey": "${env:LANGTOOL_API_KEY}", 193 | "eslint.packageManager": "pnpm", 194 | "eslint.experimental.useFlatConfig": true, 195 | "python.formatting.provider": "black", 196 | "cSpell.showStatus": false, 197 | "cSpell.allowCompoundWords": true, 198 | "cSpell.userWords": [], 199 | "cSpell.dictionaryDefinitions": [ 200 | { 201 | "name": "FluxNinja", 202 | "path": "${userHome}/Work/fluxninja/aperture/.github/styles/Vocab/FluxNinja/accept.txt" 203 | } 204 | ], 205 | "cSpell.dictionaries": [ 206 | "FluxNinja", 207 | "wordsEn", 208 | "en_US", 209 | "softwareTerms", 210 | "misc", 211 | "go", 212 | "typescript", 213 | "bash", 214 | "node" 215 | ], 216 | "cSpell.languageSettings": [ 217 | { 218 | "languageId": "python", 219 | "includeRegExpList": ["/#.*/", "/('''|\"\"\")[^\\1]+?\\1/g", "strings"] 220 | }, 221 | { 222 | "languageId": "javascript,typescript", 223 | "includeRegExpList": ["CStyleComment", "strings"] 224 | }, 225 | { 226 | "languageId": "cpp,c", 227 | // Only check comments and strings 228 | "includeRegExpList": ["CStyleComment", "string"], 229 | // Exclude includes, because they are also strings. 230 | "ignoreRegExpList": ["/#include.*/"] 231 | }, 232 | { 233 | "languageId": "go", 234 | // Only check comments and strings 235 | "includeRegExpList": ["CStyleComment", "string"], 236 | // Exclude imports, because they are also strings. 237 | "ignoreRegExpList": [ 238 | // ignore multiline imports 239 | "import\\s*\\((.|[\r\n])*?\\)", 240 | // ignore single line imports 241 | "import\\s*.*\".*?\"" 242 | ] 243 | }, 244 | { 245 | "languageId": "vim", 246 | "includeRegExpList": ["^\\s*\".*", "strings"] 247 | }, 248 | { 249 | "languageId": "proto", 250 | "includeRegExpList": ["CStyleComment", "string"], 251 | "ignoreRegExpList": [ 252 | "/package.*/", 253 | "/import.*/", 254 | "/option.*/", 255 | "/@gotags.*/" 256 | ] 257 | } 258 | ], 259 | "cSpell.enabledLanguageIds": [ 260 | "asciidoc", 261 | "c", 262 | "cpp", 263 | "csharp", 264 | "css", 265 | "git-commit", 266 | "gitcommit", 267 | "go", 268 | "handlebars", 269 | "haskell", 270 | "html", 271 | "jade", 272 | "java", 273 | "javascript", 274 | "javascriptreact", 275 | "json", 276 | "jsonc", 277 | "latex", 278 | "less", 279 | "markdown", 280 | "php", 281 | "plaintext", 282 | "proto", 283 | "pug", 284 | "python", 285 | "restructuredtext", 286 | "rust", 287 | "scala", 288 | "scss", 289 | "text", 290 | "typescript", 291 | "typescriptreact", 292 | "vim", 293 | "yaml", 294 | "yml" 295 | ] 296 | } 297 | -------------------------------------------------------------------------------- /dot_config/nvim/ginit.vim: -------------------------------------------------------------------------------- 1 | if has("linux") 2 | if exists(':GuiTabline') 3 | GuiTabline 0 4 | endif 5 | 6 | if exists(':GuiAdaptiveColor') 7 | GuiAdaptiveColor 1 8 | endif 9 | 10 | if exists(':GuiPopupmenu') 11 | GuiPopupmenu 0 12 | endif 13 | 14 | if exists(':GuiScrollBar') 15 | GuiScrollBar 1 16 | endif 17 | 18 | if exists(':GuiRenderLigatures') 19 | GuiRenderLigatures 1 20 | endif 21 | 22 | if exists(':GuiAdaptiveStyle') 23 | GuiAdaptiveStyle Fusion 24 | endif 25 | 26 | " Right Click Context Menu (Copy-Cut-Paste) 27 | nnoremap :call GuiShowContextMenu() 28 | inoremap :call GuiShowContextMenu() 29 | xnoremap :call GuiShowContextMenu()gv 30 | snoremap :call GuiShowContextMenu()gv 31 | endif 32 | -------------------------------------------------------------------------------- /dot_config/nvim/init.vim: -------------------------------------------------------------------------------- 1 | set runtimepath^=~/.vim runtimepath+=~/.vim/after 2 | let &packpath=&runtimepath 3 | 4 | " Note: Plugins are listed in ~/.vimrc 5 | source ~/.vimrc 6 | 7 | lua << EOF 8 | 9 | -- update remote plugins to make wilder work 10 | local UpdatePlugs = vim.api.nvim_create_augroup("UpdateRemotePlugs", {}) 11 | vim.api.nvim_create_autocmd({ "VimEnter", "VimLeave" }, { 12 | pattern = "*", 13 | group = UpdatePlugs, 14 | command = "runtime! plugin/rplugin.vim", 15 | }) 16 | vim.api.nvim_create_autocmd({ "VimEnter", "VimLeave" }, { 17 | pattern = "*", 18 | group = UpdatePlugs, 19 | command = "silent! UpdateRemotePlugins", 20 | }) 21 | 22 | require'nvim-web-devicons'.setup { 23 | color_icons = true; 24 | default = true; 25 | strict = true; 26 | } 27 | 28 | require'nvim-treesitter.configs'.setup { 29 | ensure_installed = { "go", "rust", "c", "python", "lua", "javascript", "bash", "cpp", "css", "dockerfile", "gomod", "gowork", "graphql", "hcl", "http", "html", "java", "json", "proto", "regex", "rego", "toml", "tsx", "typescript", "vim", "yaml", "make"}, 30 | sync_install = false, 31 | highlight = { 32 | enable = true, 33 | disable = {"yaml"}, 34 | }, 35 | indent = { 36 | enable = true, 37 | } 38 | } 39 | 40 | require('telescope').load_extension('fzf') 41 | 42 | require('bufferline').setup { 43 | options = { 44 | mode = "tabs", 45 | diagnostics = "coc", 46 | buffer_close_icon = "󰅙", 47 | modified_icon = "", 48 | close_icon = "󰅙", 49 | left_trunc_marker = "", 50 | right_trunc_marker = "", 51 | offsets = { 52 | {filetype = "coc-explorer", text = "File Explorer", text_align = "center"}, 53 | {filetype = "coctree", text = "Tree", text_align = "center"}, 54 | {filetype = "Mundo", text = "Mundo", text_align = "center"}, 55 | {filetype = "MundoDiff", text = "Mundo", text_align = "center"} 56 | }, 57 | color_icons = true, 58 | separator_style = "slant", 59 | hover = { 60 | enabled = true, 61 | delay = 100, 62 | reveal = {'close'} 63 | }, 64 | } 65 | } 66 | 67 | 68 | vim.notify = require("notify") 69 | require("telescope").load_extension("notify") 70 | local config = { 71 | background_colour = "NotifyBackground", 72 | fps = 30, 73 | icons = { 74 | DEBUG = "", 75 | ERROR = "", 76 | INFO = "", 77 | TRACE = "✎", 78 | WARN = "" 79 | }, 80 | level = "info", 81 | minimum_width = 25, 82 | render = "minimal", 83 | stages = "fade_in_slide_out", 84 | timeout = 1000, 85 | top_down = true 86 | } 87 | vim.notify.setup(config) 88 | 89 | local coc_status_record = {} 90 | 91 | function coc_status_notify(msg, level) 92 | -- if message contains cSpell then return 93 | if string.find(msg, "cSpell") then 94 | return 95 | end 96 | local notify_opts = { title = "LSP Status", timeout = 500, hide_from_history = true, on_close = reset_coc_status_record, icon = "" } 97 | -- if coc_status_record is not {} then add it to notify_opts to key called "replace" 98 | if coc_status_record ~= {} then 99 | notify_opts["replace"] = coc_status_record.id 100 | notify_opts["hide_from_history"] = true 101 | end 102 | coc_status_record = vim.notify(msg, level, notify_opts) 103 | end 104 | 105 | function reset_coc_status_record(window) 106 | coc_status_record = {} 107 | end 108 | 109 | local coc_diag_record = {} 110 | 111 | function coc_diag_notify(msg, level) 112 | local notify_opts = { title = "LSP Diagnostics", timeout = 500, on_close = reset_coc_diag_record, icon = "" } 113 | -- if coc_diag_record is not {} then add it to notify_opts to key called "replace" 114 | if coc_diag_record ~= {} then 115 | notify_opts["replace"] = coc_diag_record.id 116 | notify_opts["hide_from_history"] = true 117 | end 118 | coc_diag_record = vim.notify(msg, level, notify_opts) 119 | end 120 | 121 | function reset_coc_diag_record(window) 122 | coc_diag_record = {} 123 | end 124 | 125 | function notify(title, msg, level) 126 | local notify_opts = { title = title, timeout = 500, icon = "!" } 127 | vim.notify(msg, level, notify_opts) 128 | end 129 | 130 | function notify_job(command, opts) 131 | local output = "" 132 | local notification 133 | local notify = function(msg, level, time) 134 | local notify_opts = vim.tbl_extend( 135 | "keep", 136 | opts or {}, 137 | { title = table.concat(command, " "), 138 | icon = "", 139 | timeout = time, 140 | replace = notification, 141 | hide_from_history = true, 142 | } 143 | ) 144 | notification = vim.notify(msg, level, notify_opts) 145 | end 146 | local on_data = function(_, data) 147 | output = output .. table.concat(data, "\n") 148 | -- remove all lines from output except the last 30 and save those to output 149 | local lines = vim.split(output, "\n") 150 | local num_lines = vim.fn.len(lines) 151 | if num_lines > 30 then 152 | local start_idx = num_lines - 30 + 1 153 | local end_idx = num_lines 154 | output = table.concat(lines, "\n", start_idx, end_idx) 155 | end 156 | notify(output, "info", false) 157 | end 158 | 159 | -- Prepare the command to run with Bash 160 | local command_str = table.concat(command, " ") 161 | local bash_command = {"bash", "--norc", "--noprofile", "-c", command_str} 162 | 163 | vim.fn.jobstart(bash_command, { 164 | on_stdout = on_data, 165 | on_stderr = on_data, 166 | on_exit = function(_, code) 167 | if #output == 0 then 168 | notify("No output of command, exit code: " .. code, "warn", 1000) 169 | elseif code ~= 0 then 170 | notify(output, "error", 5000) 171 | else 172 | notify(output, "info", 2000) 173 | end 174 | end, 175 | }) 176 | end 177 | 178 | require"octo".setup() 179 | 180 | require("early-retirement").setup({ 181 | retirementAgeMins = 120, 182 | notificationOnAutoClose = true, 183 | }) 184 | 185 | function input_args(args, arg_values, callback, cmd) 186 | if #args == 0 then 187 | vim.call(callback, cmd, arg_values) 188 | return 189 | end 190 | local arg_name, required = unpack(args[1]) 191 | vim.ui.input({prompt = arg_name .. ': '}, function(input_value) 192 | -- cancel on escape 193 | if input_value == nil then 194 | notify("󰌌 Input", "Command cancelled.", "warn") 195 | return 196 | elseif input_value ~= '' then 197 | table.insert(arg_values, input_value) 198 | input_args({unpack(args, 2)}, arg_values, callback, cmd) 199 | elseif required then 200 | notify("󰌌 Input", "Required argument " .. arg_name .. " is missing.", "error") 201 | else 202 | input_args({unpack(args, 2)}, arg_values, callback, cmd) 203 | end 204 | end) 205 | end 206 | 207 | function select_choice(choices, callback) 208 | vim.ui.select(choices, {}, function(selected_choice, choice_idx) 209 | if selected_choice == nil then 210 | notify("󰄴 Selection", "Command cancelled.", "warn") 211 | return 212 | else 213 | vim.call(callback, selected_choice) 214 | end 215 | end) 216 | end 217 | 218 | function select_buffer_or_cancel(callback, cmd) 219 | local visual_mode = vim.fn.visualmode() 220 | if visual_mode ~= 'V' and visual_mode ~= '' then 221 | vim.ui.select({"Yes", "No"}, { 222 | prompt = "No visual selection, run on whole buffer?" 223 | }, function(choice, choice_idx) 224 | if choice == "Yes" then 225 | vim.cmd("normal! ggVG") 226 | vim.cmd("normal! ") 227 | vim.call(callback, cmd) 228 | end 229 | end) 230 | else 231 | vim.call(callback, cmd) 232 | end 233 | end 234 | 235 | if vim.env.OPENAI_API_KEY ~= nil then 236 | local CodeGPTModule = require("codegpt") 237 | require("codegpt.config") 238 | 239 | -- until the plugin integrates with tiktoken 240 | -- assume 1 token = 4 characters of text 241 | -- as a rule of thumb 242 | local heavy_llm_config = { 243 | model = "gpt-4o", 244 | max_tokens = 111616, 245 | max_output_tokens = 16384, 246 | temperature = 0.1, 247 | } 248 | 249 | local heavy_llm_commands = { 250 | "completion", 251 | "code_edit", 252 | "debug", 253 | "opt", 254 | "tests", 255 | "chat", 256 | } 257 | 258 | local light_llm_config = { 259 | model = "gpt-4o-mini", 260 | max_tokens = 111614, 261 | max_output_tokens = 16384, 262 | temperature = 0.1, 263 | } 264 | 265 | local light_llm_commands = { 266 | "explain", 267 | "question", 268 | "doc", 269 | } 270 | 271 | local override_config = vim.g["codegpt_commands_defaults"] 272 | 273 | for _, command in ipairs(heavy_llm_commands) do 274 | -- and merge it with gpt-4-config 275 | override_config[command] = vim.tbl_extend("force", vim.g.codegpt_commands_defaults[command], heavy_llm_config) 276 | end 277 | 278 | for _, command in ipairs(light_llm_commands) do 279 | -- and merge it with gpt-3.5-config 280 | override_config[command] = vim.tbl_extend("force", vim.g.codegpt_commands_defaults[command], light_llm_config) 281 | end 282 | 283 | vim.g["codegpt_commands_defaults"] = override_config 284 | 285 | vim.g["codegpt_commands"] = { 286 | ["refactor"] = { 287 | user_message_template = "I have the following {{language}} code: ```{{filetype}}\n{{text_selection}}```\nRefactor the above code to reduce it's complexity and improve maintainability and code reuse. Add new methods if needed to improve modularity. Only return the code snippet. {{language_instructions}}", 288 | callback_type = "replace_lines", 289 | model = heavy_llm_config.model, 290 | max_tokens = heavy_llm_config.max_tokens, 291 | max_output_tokens = heavy_llm_config.max_output_tokens, 292 | temperature = heavy_llm_config.temperature, 293 | }, 294 | ["simplify"] = { 295 | user_message_template = "I have the following {{language}} code: ```{{filetype}}\n{{text_selection}}```\nSimplify the above code to reduce it's complexity by reducing repetition, excessive branching, logic etc. Only return the code snippet. {{language_instructions}}", 296 | callback_type = "replace_lines", 297 | model = heavy_llm_config.model, 298 | max_tokens = heavy_llm_config.max_tokens, 299 | max_output_tokens = heavy_llm_config.max_output_tokens, 300 | temperature = heavy_llm_config.temperature, 301 | }, 302 | ["grammar"] = { 303 | user_message_template = "I have the following {{language}} text: ```{{filetype}}\n{{text_selection}}```\nFix typos, grammatical errors and improve prose. Only return the text snippet. {{language_instructions}}", 304 | callback_type = "replace_lines", 305 | }, 306 | ["fix"] = { 307 | user_message_template = "I have the following {{language}} code: ```{{filetype}}\n{{text_selection}}```\nAutomatically check for potential issues in the code and fix them. Only return the code snippet. {{language_instructions}}", 308 | callback_type = "replace_lines", 309 | model = heavy_llm_config.model, 310 | max_tokens = heavy_llm_config.max_tokens, 311 | max_output_tokens = heavy_llm_config.max_output_tokens, 312 | temperature = heavy_llm_config.temperature, 313 | } 314 | } 315 | 316 | local chatgpt_diag_record = {} 317 | local timer = vim.loop.new_timer() 318 | local timer_counter = 0 319 | 320 | vim.g["codegpt_hooks"] = { 321 | request_started = function() 322 | local notify_opts = { title = "ChatGPT", timeout = 2000, on_close = reset_chatgpt_diag_record, icon = "ﮧ" } 323 | if chatgpt_diag_record ~= {} then 324 | notify_opts["replace"] = chatgpt_diag_record.id 325 | notify_opts["hide_from_history"] = true 326 | end 327 | local msg = "Requesting" 328 | chatgpt_diag_record = vim.notify(msg, "info", notify_opts) 329 | if not timer:is_active() then 330 | -- start a timer to update the notification every 100ms 331 | timer:start(100, 100, vim.schedule_wrap(function() 332 | if chatgpt_diag_record ~= {} then 333 | notify_opts["replace"] = chatgpt_diag_record.id 334 | notify_opts["hide_from_history"] = true 335 | end 336 | local msg = "Please wait" 337 | local time_elapsed = timer_counter * 0.1 338 | msg = msg .. " | " .. time_elapsed .. "s" 339 | local status = CodeGPTModule.get_status() 340 | if status ~= "" then 341 | msg = msg .. " | " .. status 342 | end 343 | chatgpt_diag_record = vim.notify(msg, "info", notify_opts) 344 | if timer_counter == 3600 then 345 | reset_chatgpt_diag_record() 346 | end 347 | timer_counter = timer_counter + 1 348 | end)) 349 | end 350 | end, 351 | request_finished = vim.schedule_wrap(function() 352 | local notify_opts = { title = "ChatGPT", timeout = 1000, icon = "ﮧ" } 353 | vim.notify("Request finished", "info", notify_opts) 354 | reset_chatgpt_diag_record() 355 | end) 356 | } 357 | 358 | function reset_chatgpt_diag_record(window) 359 | timer:stop() 360 | timer_counter = 0 361 | chatgpt_diag_record = {} 362 | end 363 | 364 | vim.g["codegpt_popup_type"] = "horizontal" 365 | else 366 | notify("🤖 ChatGPT", "OPENAI_API_KEY is not set", "warn") 367 | end 368 | 369 | require('gitsigns').setup() 370 | 371 | require('hlslens').setup({ 372 | calm_down = true, 373 | }) 374 | local kopts = {noremap = true, silent = true} 375 | 376 | vim.api.nvim_set_keymap('n', 'n', 377 | [[execute('normal! ' . v:count1 . 'n')lua require('hlslens').start()]], 378 | kopts) 379 | vim.api.nvim_set_keymap('n', 'N', 380 | [[execute('normal! ' . v:count1 . 'N')lua require('hlslens').start()]], 381 | kopts) 382 | vim.api.nvim_set_keymap('n', '*', [[*lua require('hlslens').start()]], kopts) 383 | vim.api.nvim_set_keymap('n', '#', [[#lua require('hlslens').start()]], kopts) 384 | vim.api.nvim_set_keymap('n', 'g*', [[g*lua require('hlslens').start()]], kopts) 385 | vim.api.nvim_set_keymap('n', 'g#', [[g#lua require('hlslens').start()]], kopts) 386 | vim.api.nvim_set_keymap('n', 'l', 'noh', kopts) 387 | 388 | function _G.symbol_line() 389 | local curwin = vim.g.statusline_winid or 0 390 | local curbuf = vim.api.nvim_win_get_buf(curwin) 391 | local ok, line = pcall(vim.api.nvim_buf_get_var, curbuf, 'coc_symbol_line') 392 | return ok and line or '' 393 | end 394 | 395 | vim.o.winbar = '%!v:lua.symbol_line()' 396 | 397 | require("scrollbar").setup({ 398 | handle = { 399 | text = " ", 400 | blend = 0, -- Integer between 0 and 100. 0 for fully opaque and 100 to full transparent. Defaults to 30. 401 | color = nil, 402 | color_nr = nil, -- cterm 403 | highlight = "Visual", 404 | hide_if_all_visible = true, -- Hides handle if all lines are visible 405 | }, 406 | excluded_filetypes = { 407 | "prompt", 408 | "TelescopePrompt", 409 | "noice", 410 | "coc-explorer", 411 | }, 412 | handlers = { 413 | cursor = true, 414 | diagnostic = true, 415 | gitsigns = false, 416 | handle = true, 417 | search = true, 418 | }, 419 | }) 420 | 421 | require('tmux-awesome-manager').setup({ 422 | per_project_commands = { -- Configure your per project servers with 423 | aperture = { { cmd = 'make generate-config-markdown', name = 'Make' } }, 424 | }, 425 | session_name = 'Neovim Terminals', 426 | use_icon = true, -- use prefix icon 427 | icon = ' ', -- Prefix icon to use 428 | project_open_as = 'separated_session', -- Open per_project_commands as. Default: separated_session 429 | default_size = '30%', -- on panes, the default size 430 | open_new_as = 'pane' -- open new command as. options: pane, window, separated_session. 431 | }) 432 | 433 | tmux = require('tmux-awesome-manager') 434 | 435 | vim.keymap.set('v', 'l', tmux.send_text_to, {}) -- Send text to a open terminal? 436 | vim.keymap.set('n', 'lo', tmux.switch_orientation, {}) -- Open new panes as vertical / horizontal? 437 | vim.keymap.set('n', 'lp', tmux.switch_open_as, {}) -- Open new terminals as panes or windows? 438 | vim.keymap.set('n', 'lk', tmux.kill_all_terms, {}) -- Kill all open terms. 439 | vim.keymap.set('n', 'l!', tmux.run_project_terms, {}) -- Run the per project commands 440 | vim.keymap.set('n', 'lf', function() vim.cmd(":Telescope tmux-awesome-manager list_terms") end, {}) -- List all terminals 441 | vim.keymap.set('n', 'll', function() vim.cmd(":Telescope tmux-awesome-manager list_open_terms") end, {}) -- List open terminals 442 | 443 | tmux_term = require('tmux-awesome-manager.src.term') 444 | 445 | EOF 446 | 447 | autocmd FileType octo inoremap @ @ 448 | autocmd FileType octo inoremap # # 449 | 450 | function! s:DiagnosticNotify() abort 451 | let l:info = get(b:, 'coc_diagnostic_info', {}) 452 | if empty(l:info) | return '' | endif 453 | let l:msgs = [] 454 | let l:level = 'info' 455 | if get(l:info, 'warning', 0) 456 | let l:level = 'warn' 457 | endif 458 | if get(l:info, 'error', 0) 459 | let l:level = 'error' 460 | endif 461 | 462 | if get(l:info, 'error', 0) 463 | call add(l:msgs, ' Errors: ' . l:info['error']) 464 | endif 465 | if get(l:info, 'warning', 0) 466 | call add(l:msgs, ' Warnings: ' . l:info['warning']) 467 | endif 468 | if get(l:info, 'information', 0) 469 | call add(l:msgs, '󰋼 Infos: ' . l:info['information']) 470 | endif 471 | if get(l:info, 'hint', 0) 472 | call add(l:msgs, ' Hints: ' . l:info['hint']) 473 | endif 474 | let l:msg = join(l:msgs, "\n") 475 | if empty(l:msg) | let l:msg = ' All OK' | endif 476 | call v:lua.coc_diag_notify(l:msg, l:level) 477 | endfunction 478 | 479 | function! s:StatusNotify() abort 480 | let l:status = get(g:, 'coc_status', '') 481 | let l:level = 'info' 482 | if empty(l:status) | return '' | endif 483 | call v:lua.coc_status_notify(l:status, l:level) 484 | endfunction 485 | 486 | function! s:InitCoc() abort 487 | " load overrides 488 | runtime! autoload/coc/ui.vim 489 | endfunction 490 | 491 | " notifications 492 | autocmd User CocNvimInit call s:InitCoc() 493 | autocmd User CocDiagnosticChange call s:DiagnosticNotify() 494 | autocmd User CocStatusChange call s:StatusNotify() 495 | 496 | command CocRename call CocActionAsync('rename', function('NotifyCocResponse')) 497 | 498 | function! NotifyCocResponse(error, response) abort 499 | " print the values of error and response if they exist 500 | let l:msg = '' 501 | let l:level = 'info' 502 | if a:error 503 | let l:level = 'error' 504 | let l:msg = 'Error: '.a:error.'\nResponse: '.a:response 505 | endif 506 | if l:msg == '' 507 | let l:msg = ' Done!' 508 | endif 509 | call v:lua.notify('LSP Response', l:msg, l:level) 510 | endfunction 511 | 512 | 513 | command! -complete=shellcmd -nargs=+ Sh call s:RunSh() 514 | function! s:RunSh(cmdline) 515 | echo a:cmdline 516 | let expanded_cmdline = a:cmdline 517 | let cmd = [] 518 | for part in split(a:cmdline, ' ') 519 | if part[0] =~ '\v[%#<]' 520 | let part = fnameescape(expand(part)) 521 | endif 522 | call add(cmd, part) 523 | endfor 524 | call v:lua.notify_job(cmd) 525 | endfunction 526 | 527 | " Vim function that detects local Makefile and its targets 528 | " and asks the user which target to execute 529 | function! SelectMakeTarget() 530 | " Check if Makefile exists in the current directory 531 | if !filereadable("Makefile") 532 | echo "No Makefile found in the current directory" 533 | return 534 | endif 535 | 536 | " Extract targets from the Makefile 537 | let l:makefile_lines = readfile("Makefile") 538 | let l:targets = [] 539 | for l:line in l:makefile_lines 540 | " Match lines that have a target name followed by a colon, but ignore those that start with a comment, include a variable assignment, contain a wildcard, .PHONY or a variable 541 | if l:line =~ '^\s*\([^#:=*$@%]\+\s*:\)\@=' && l:line !~ '^\s*\w\+\s*[:?+]?=\|^\s*\w\+\s*:=\|^\s*#' && l:line !~ '^\s*\.PHONY' 542 | " Extract the target name without leading/trailing spaces 543 | let l:target = matchstr(l:line, '^\s*\zs[^#:=\s]\+\ze\s*:') 544 | " Skip empty entries 545 | if !empty(l:target) 546 | call add(l:targets, l:target) 547 | endif 548 | endif 549 | endfor 550 | 551 | " Select target using inputlist() in vim or select_choice() in nvim 552 | if has('nvim') 553 | call luaeval('select_choice(_A.targets, "ExecuteMakeTarget")', {'targets': l:targets}) 554 | else 555 | let l:choice = inputlist(map(copy(l:targets), 'v:key + 1 . ". " . v:val')) 556 | if l:choice >= 1 && l:choice <= len(l:targets) 557 | call ExecuteMakeTarget(l:targets[l:choice - 1]) 558 | endif 559 | endif 560 | endfunction 561 | 562 | function! ExecuteMakeTarget(target) 563 | " Execute the selected target using luaeval and tmux 564 | let l:done = '\n\nDone!' 565 | call luaeval('tmux.execute_command({ cmd = "(make ' . a:target . ' && echo; echo; echo Done) || (echo; echo; echo Failed)", name = "Make", use_cwd = true })') 566 | endfunction 567 | 568 | 569 | " Tree sitter based folding 570 | "set foldmethod=expr 571 | "set foldexpr=nvim_treesitter#foldexpr() 572 | -------------------------------------------------------------------------------- /dot_config/pip/pip.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | break-system-packages = true 3 | user = true 4 | -------------------------------------------------------------------------------- /dot_config/smug/dotfiles-personal.yml: -------------------------------------------------------------------------------- 1 | session: dotfiles-personal 2 | root: ~ 3 | 4 | windows: 5 | - name: nvim-dotfiles-personal 6 | layout: main-vertical 7 | commands: 8 | - ~/sw/assets/dotfiles-edit.sh personal 9 | -------------------------------------------------------------------------------- /dot_config/smug/dotfiles.yml: -------------------------------------------------------------------------------- 1 | session: dotfiles 2 | root: ~ 3 | 4 | windows: 5 | - name: nvim-dotfiles 6 | layout: main-vertical 7 | commands: 8 | - ~/sw/assets/dotfiles-edit.sh 9 | -------------------------------------------------------------------------------- /dot_gitconfig: -------------------------------------------------------------------------------- 1 | # This is Git's per-user configuration file. 2 | [core] 3 | editor = nvim 4 | pager = delta 5 | [help] 6 | autoCorrect = prompt 7 | [filter "lfs"] 8 | clean = git-lfs clean -- %f 9 | smudge = git-lfs smudge -- %f 10 | process = git-lfs filter-process 11 | required = true 12 | [push] 13 | default = current 14 | [merge] 15 | tool = nvim_mergetool 16 | conflictstyle = diff3 17 | [mergetool "nvim_mergetool"] 18 | cmd = nvim -f -c "MergetoolStart" "$MERGED" "$BASE" "$LOCAL" "$REMOTE" 19 | trustExitCode = true 20 | [pull] 21 | ff = only 22 | rebase = false 23 | [interactive] 24 | diffFilter = delta --color-only --features=interactive 25 | [diff] 26 | colorMoved = default 27 | [include] 28 | path = ~/.gitconfig_themes 29 | [delta] 30 | features = fn-gruvbox 31 | navigate = true # use n and N to move between diff sections 32 | side-by-side = true 33 | line-numbers = true 34 | [delta "interactive"] 35 | keep-plus-minus-markers = false 36 | # Use ~/.gitconfig_local to provide username etc. 37 | [include] 38 | path = ~/.gitconfig_local 39 | [diff "sopsdiffer"] 40 | textconv = sops --decrypt 41 | [url "ssh://git@github.com/"] 42 | insteadOf = https://github.com/ 43 | -------------------------------------------------------------------------------- /dot_gitconfig_themes: -------------------------------------------------------------------------------- 1 | # To use these themes, first include this file in your own gitconfig file: 2 | # 3 | # [include] 4 | # path = PATH/TO/delta/themes.gitconfig 5 | # 6 | # Then, in your own gitconfig file, activate the chosen theme, e.g. 7 | # 8 | # [delta] 9 | # features = kingfisher 10 | # 11 | # Please add your own themes to this file, and open a PR. 12 | # 13 | # Instructions: 14 | # 15 | # 1. The name of the theme must be the name of some sort of wild organism: 16 | # mammal, bird, plant, mollusk -- whatever. It can be in any language. 17 | # 18 | # 2. Use `delta --show-config` to list all the style settings that are active in 19 | # your current delta environment, but only include settings in your theme 20 | # that are essential to its appearance. 21 | # 22 | # 3. Include either `dark = true` or `light = true` according to whether it is 23 | # designed for a light or dark terminal background. (This marks a feature as 24 | # a "theme", causing it to be picked up by `delta --show-themes`). 25 | # 26 | # 4. Feel free to include a comment line indicating who is the author of the 27 | # theme. E.g. a link to your github user page. 28 | 29 | [delta "fn-gruvbox"] 30 | plus-style = syntax "#004000" 31 | minus-style = syntax "#400000" 32 | syntax-theme = gruvbox-dark 33 | line-numbers-minus-style = "#cc241d" 34 | line-numbers-zero-style = "#ebdbb2" 35 | line-numbers-plus-style = "#98971a" 36 | line-numbers-left-format = "{nm:>4}┊" 37 | line-numbers-right-format = "{np:>4}│" 38 | line-numbers-left-style = "#076678" 39 | line-numbers-right-style = "#076678" 40 | commit-decoration-style = bold "#d79921" box ul 41 | file-style = bold "#d79921" ul 42 | file-decoration-style = none 43 | hunk-header-decoration-style = "#d79921" box 44 | 45 | [delta "collared-trogon"] 46 | # author: https://github.com/clnoll 47 | commit-decoration-style = bold box ul 48 | dark = true 49 | file-decoration-style = none 50 | file-style = omit 51 | hunk-header-decoration-style = "#022b45" box ul 52 | hunk-header-file-style = "#999999" 53 | hunk-header-line-number-style = bold "#003300" 54 | hunk-header-style = file line-number syntax 55 | line-numbers = true 56 | line-numbers-left-style = "#022b45" 57 | line-numbers-minus-style = "#80002a" 58 | line-numbers-plus-style = "#003300" 59 | line-numbers-right-style = "#022b45" 60 | line-numbers-zero-style = "#999999" 61 | minus-emph-style = normal "#80002a" 62 | minus-style = normal "#330011" 63 | plus-emph-style = syntax "#003300" 64 | plus-style = syntax "#001a00" 65 | syntax-theme = Nord 66 | 67 | [delta "coracias-caudatus"] 68 | # author: https://github.com/clnoll 69 | commit-decoration-style = ol "#7536ff" 70 | commit-style = "#200078" 71 | file-decoration-style = none 72 | file-style = omit 73 | hunk-header-decoration-style = "#cfd6ff" ul 74 | hunk-header-file-style = "#858dff" 75 | hunk-header-line-number-style = "#7536ff" 76 | hunk-header-style = file line-number syntax 77 | light = true 78 | line-numbers = true 79 | line-numbers-left-format = "{nm:>4} ." 80 | line-numbers-left-style = "#e3ab02" 81 | line-numbers-minus-style = "#ff38b6" 82 | line-numbers-plus-style = "#00e0c2" 83 | line-numbers-right-format = "{np:>4} " 84 | line-numbers-right-style = white 85 | line-numbers-zero-style = "#cccccc" 86 | minus-emph-style = bold "#ff3838" "#ffe3f7" 87 | minus-style = "#ff0080" 88 | plus-emph-style = "#008a81" bold "#00ffbf" 89 | plus-style = syntax "#cffff3" 90 | syntax-theme = Github 91 | 92 | [delta "hoopoe"] 93 | # author: https://github.com/dandavison 94 | light = true 95 | pink = "#ffe0e0" 96 | dark-pink = "#ffc0c0" 97 | green = "#d0ffd0" 98 | dark-green = "#a0efa0" 99 | dark-green-2 = "#067a00" 100 | minus-style = normal hoopoe.pink 101 | minus-emph-style = normal hoopoe.dark-pink 102 | minus-non-emph-style = minus-style 103 | plus-style = syntax hoopoe.green 104 | plus-emph-style = syntax hoopoe.dark-green 105 | plus-non-emph-style = plus-style 106 | minus-empty-line-marker-style = minus-style 107 | plus-empty-line-marker-style = plus-style 108 | commit-decoration-style = blue ol 109 | commit-style = raw 110 | file-style = omit 111 | hunk-header-decoration-style = blue box 112 | hunk-header-file-style = red 113 | hunk-header-line-number-style = hoopoe.dark-green-2 114 | hunk-header-style = file line-number syntax 115 | syntax-theme = GitHub 116 | zero-style = syntax 117 | 118 | [delta "tangara-chilensis"] 119 | # author: https://github.com/clnoll 120 | commit-decoration-style = bold box ul "#34fd50" 121 | dark = true 122 | file-decoration-style = none 123 | file-style = omit 124 | hunk-header-decoration-style = "#00b494" box ul 125 | hunk-header-file-style = "#999999" 126 | hunk-header-line-number-style = bold "#03a4ff" 127 | hunk-header-style = file line-number syntax 128 | line-numbers = true 129 | line-numbers-left-style = black 130 | line-numbers-minus-style = "#B10036" 131 | line-numbers-plus-style = "#03a4ff" 132 | line-numbers-right-style = black 133 | line-numbers-zero-style = "#999999" 134 | minus-emph-style = normal "#de004e" 135 | minus-style = normal "#990017" 136 | plus-emph-style = syntax "#03a4ff" 137 | plus-style = syntax "#450eff" 138 | side-by-side = true 139 | syntax-theme = Vibrant Sunburst 140 | 141 | [delta "villsau"] 142 | # author: https://github.com/torarnv 143 | dark = true 144 | file-style = omit 145 | hunk-header-decoration-style = omit 146 | hunk-header-file-style = magenta 147 | hunk-header-line-number-style = dim magenta 148 | hunk-header-style = file line-number syntax 149 | line-numbers = false 150 | minus-emph-style = bold red 52 151 | minus-empty-line-marker-style = normal "#3f0001" 152 | minus-non-emph-style = dim red 153 | minus-style = bold red 154 | plus-emph-style = bold green 22 155 | plus-empty-line-marker-style = normal "#002800" 156 | plus-non-emph-style = dim green 157 | plus-style = bold green 158 | syntax-theme = OneHalfDark 159 | whitespace-error-style = reverse red 160 | zero-style = dim syntax 161 | 162 | [delta "woolly-mammoth"] 163 | # author: https://github.com/Kr1ss-XD 164 | commit-decoration-style = 232 130 box 165 | commit-style = 232 bold italic 130 166 | dark = true 167 | file-added-label = [+] 168 | file-copied-label = [C] 169 | file-decoration-style = "#606018" overline 170 | file-modified-label = [M] 171 | file-removed-label = [-] 172 | file-renamed-label = [R] 173 | file-style = 232 bold 184 174 | hunk-header-decoration-style = none 175 | hunk-header-style = syntax bold italic 237 176 | line-numbers = true 177 | line-numbers-left-format = "{nm:>1}┊" 178 | line-numbers-left-style = red 179 | line-numbers-minus-style = red italic black 180 | line-numbers-plus-style = green italic black 181 | line-numbers-right-format = "{np:>1}┊" 182 | line-numbers-right-style = green 183 | line-numbers-zero-style = "#545474" italic 184 | minus-emph-style = syntax bold "#780000" 185 | minus-style = syntax "#400000" 186 | plus-emph-style = syntax bold "#007800" 187 | plus-style = syntax "#004000" 188 | syntax-theme = Vibrant Sunburst 189 | whitespace-error-style = "#280050" reverse 190 | zero-style = syntax 191 | blame-format = "{author:<18} ({commit:>7}) ┊{timestamp:^16}┊ " 192 | blame-palette = "#101010 #200020 #002800 #000028 #202000 #280000 #002020 #002800 #202020" 193 | 194 | [delta "calochortus-lyallii"] 195 | # author: https://github.com/manojkarthick 196 | commit-decoration-style = none 197 | dark = true 198 | file-added-label = [+] 199 | file-copied-label = [C] 200 | file-decoration-style = none 201 | file-modified-label = [M] 202 | file-removed-label = [-] 203 | file-renamed-label = [R] 204 | file-style = 232 bold 184 205 | hunk-header-decoration-style = none 206 | hunk-header-file-style = "#999999" 207 | hunk-header-line-number-style = bold "#03a4ff" 208 | hunk-header-style = file line-number syntax 209 | line-numbers = true 210 | line-numbers-left-style = black 211 | line-numbers-minus-style = "#B10036" 212 | line-numbers-plus-style = "#03a4ff" 213 | line-numbers-right-style = black 214 | line-numbers-zero-style = "#999999" 215 | minus-emph-style = syntax bold "#780000" 216 | minus-style = syntax "#400000" 217 | plus-emph-style = syntax bold "#007800" 218 | plus-style = syntax "#004000" 219 | whitespace-error-style = "#280050" reverse 220 | zero-style = syntax 221 | syntax-theme = Nord 222 | 223 | [delta "mantis-shrimp"] 224 | #author: https://github.com/2kabhishek 225 | dark = true 226 | side-by-side = true 227 | navigate = true 228 | keep-plus-minus-markers = true 229 | hyperlinks = true 230 | file-added-label = [+] 231 | file-copied-label = [==] 232 | file-modified-label = [*] 233 | file-removed-label = [-] 234 | file-renamed-label = [->] 235 | file-style = omit 236 | zero-style = syntax 237 | syntax-theme = Monokai Extended 238 | commit-decoration-style ="#11ce16" box 239 | commit-style = "#ffd21a" bold italic 240 | hunk-header-decoration-style = "#1688f0" box ul 241 | hunk-header-file-style = "#c63bee" ul bold 242 | hunk-header-line-number-style = "#ffd21a" box bold 243 | hunk-header-style = file line-number syntax bold italic 244 | line-numbers = true 245 | line-numbers-left-format = "{nm:>1}|" 246 | line-numbers-left-style = "#1688f0" 247 | line-numbers-minus-style = "#ff0051" bold 248 | line-numbers-plus-style = "#03e57f" bold 249 | line-numbers-right-format = "{np:>1}|" 250 | line-numbers-right-style = "#1688f0" 251 | line-numbers-zero-style = "#aaaaaa" italic 252 | minus-emph-style = syntax bold "#b80000" 253 | minus-style = syntax "#5d001e" 254 | plus-emph-style = syntax bold "#007800" 255 | plus-style = syntax "#004433" 256 | whitespace-error-style = "#280050" 257 | 258 | [delta "mantis-shrimp-lite"] 259 | #author: https://github.com/2kabhishek 260 | dark = true 261 | side-by-side = true 262 | navigate = true 263 | keep-plus-minus-markers = true 264 | file-added-label = [+] 265 | file-copied-label = [==] 266 | file-modified-label = [*] 267 | file-removed-label = [-] 268 | file-renamed-label = [->] 269 | file-style = omit 270 | zero-style = syntax 271 | syntax-theme = Monokai Extended 272 | commit-decoration-style = green box 273 | commit-style = yellow bold italic 274 | hunk-header-decoration-style = blue box ul 275 | hunk-header-file-style = purple ul bold 276 | hunk-header-line-number-style = yellow box bold 277 | hunk-header-style = file line-number syntax bold italic 278 | line-numbers = true 279 | line-numbers-left-format = "{nm:>1}|" 280 | line-numbers-left-style = blue 281 | line-numbers-minus-style = red bold 282 | line-numbers-plus-style = green bold 283 | line-numbers-right-format = "{np:>1}|" 284 | line-numbers-right-style = blue 285 | line-numbers-zero-style = white italic 286 | minus-emph-style = syntax bold red 287 | plus-emph-style = syntax bold green 288 | whitespace-error-style = purple bold 289 | 290 | [delta "zebra-dark"] 291 | minus-style = syntax "#330f0f" 292 | minus-emph-style = syntax "#4f1917" 293 | plus-style = syntax "#0e2f19" 294 | plus-emph-style = syntax "#174525" 295 | map-styles = \ 296 | bold purple => syntax "#330f29", \ 297 | bold blue => syntax "#271344", \ 298 | bold cyan => syntax "#0d3531", \ 299 | bold yellow => syntax "#222f14" 300 | zero-style = syntax 301 | whitespace-error-style = "#aaaaaa" 302 | 303 | [delta "zebra-light"] 304 | minus-style = syntax "#fbdada" 305 | minus-emph-style = syntax "#f6b6b6" 306 | plus-style = syntax "#d6ffd6" 307 | plus-emph-style = syntax "#adffad" 308 | map-styles = \ 309 | bold purple => syntax "#feecf7", \ 310 | bold blue => syntax "#e5dff6", \ 311 | bold cyan => syntax "#d8fdf6", \ 312 | bold yellow => syntax "#f4ffe0" 313 | zero-style = syntax 314 | whitespace-error-style = "#aaaaaa" 315 | 316 | [delta "chameleon"] 317 | #author: https://github.com/AirOnSkin 318 | dark = true 319 | line-numbers = true 320 | side-by-side = true 321 | keep-plus-minus-markers = true 322 | syntax-theme = Nord 323 | file-style = "#434C5E" bold 324 | file-decoration-style = "#434C5E" ul 325 | file-added-label = [+] 326 | file-copied-label = [==] 327 | file-modified-label = [*] 328 | file-removed-label = [-] 329 | file-renamed-label = [->] 330 | hunk-header-style = omit 331 | line-numbers-left-format = " {nm:>1} │" 332 | line-numbers-left-style = red 333 | line-numbers-right-format = " {np:>1} │" 334 | line-numbers-right-style = green 335 | line-numbers-minus-style = red italic black 336 | line-numbers-plus-style = green italic black 337 | line-numbers-zero-style = "#434C5E" italic 338 | minus-style = bold red 339 | minus-emph-style = bold red 340 | plus-style = bold green 341 | plus-emph-style = bold green 342 | zero-style = syntax 343 | blame-code-style = syntax 344 | blame-format = "{author:<18} ({commit:>7}) {timestamp:^12} " 345 | blame-palette = "#2E3440" "#3B4252" "#434C5E" "#4C566A" 346 | -------------------------------------------------------------------------------- /dot_golangci.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Options for analysis running. 3 | run: 4 | timeout: 10s 5 | allow-parallel-runners: true 6 | -------------------------------------------------------------------------------- /dot_prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 2, 3 | "useTabs": false, 4 | "arrowParens": "always", 5 | "bracketSameLine": true, 6 | "printWidth": 80, 7 | "trailingComma": "all", 8 | "proseWrap": "always" 9 | } 10 | -------------------------------------------------------------------------------- /dot_tmux.conf.settings: -------------------------------------------------------------------------------- 1 | # : << EOF 2 | # https://github.com/gpakosz/.tmux 3 | # (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license, 4 | # without any warranty. 5 | # Copyright 2012— Gregory Pakosz (@gpakosz). 6 | 7 | 8 | # -- navigation ---------------------------------------------------------------- 9 | 10 | # if you're running tmux within iTerm2 11 | # - and tmux is 1.9 or 1.9a 12 | # - and iTerm2 is configured to let option key act as +Esc 13 | # - and iTerm2 is configured to send [1;9A -> [1;9D for option + arrow keys 14 | # then uncomment the following line to make Meta + arrow keys mapping work 15 | #set -ga terminal-overrides "*:kUP3=\e[1;9A,*:kDN3=\e[1;9B,*:kRIT3=\e[1;9C,*:kLFT3=\e[1;9D" 16 | 17 | 18 | # -- windows & pane creation --------------------------------------------------- 19 | 20 | # new window retains current path, possible values are: 21 | # - true 22 | # - false (default) 23 | tmux_conf_new_window_retain_current_path=false 24 | 25 | # new pane retains current path, possible values are: 26 | # - true (default) 27 | # - false 28 | tmux_conf_new_pane_retain_current_path=true 29 | 30 | # new pane tries to reconnect ssh sessions (experimental), possible values are: 31 | # - true 32 | # - false (default) 33 | tmux_conf_new_pane_reconnect_ssh=false 34 | 35 | # prompt for session name when creating a new session, possible values are: 36 | # - true 37 | # - false (default) 38 | tmux_conf_new_session_prompt=true 39 | 40 | 41 | # -- display ------------------------------------------------------------------- 42 | 43 | # RGB 24-bit colour support (tmux >= 2.2), possible values are: 44 | # - true 45 | # - false (default) 46 | tmux_conf_24b_colour=true 47 | 48 | # onedark 49 | # custom_black="#1e2127" 50 | # custom_white="#abb2bf" 51 | # custom_red="#be5046" 52 | # custom_green="#98c379" 53 | # custom_yellow="#e5c07b" 54 | # custom_orange="#d19a66" 55 | # custom_blue="#61afef" 56 | # custom_cyan="#56b6c2" 57 | # custom_purple="#c678dd" 58 | # custom_visual_grey="#3e4452" 59 | # custom_comment_grey="#5c6370" 60 | 61 | # gruvbox -- mapping onedark's normal colors 62 | custom_black="#1d2021" # 63 | custom_white="#ebdbb2" # 64 | custom_red="#fb4934" # 65 | custom_green="#fabd2f" # 66 | custom_yellow="#d79921" # 67 | custom_orange="#b8bb26" # 68 | custom_blue="#fe8019" # 69 | custom_cyan="#8ec07c" # 70 | custom_purple="#d3869b" # 71 | custom_visual_grey="#282828" # 72 | custom_comment_grey="#928374" 73 | 74 | 75 | # material 76 | # custom_black="#2A3236" 77 | # custom_red="#FF5252" 78 | # custom_green="#5CF19E" 79 | # custom_yellow="#FFD740" 80 | # custom_blue="#A7DAF8" 81 | # custom_orange="#F2CD86" 82 | # custom_cyan="#64FCDA" 83 | # custom_white="#EDEFF1" 84 | # custom_visual_grey="#4B5962" 85 | # custom_comment_grey="#546E7A" 86 | 87 | # window style 88 | tmux_conf_theme_window_fg="default" 89 | tmux_conf_theme_window_bg="default" 90 | 91 | # highlight focused pane (tmux >= 2.1), possible values are: 92 | # - true 93 | # - false (default) 94 | tmux_conf_theme_highlight_focused_pane=false 95 | 96 | # focused pane colours: 97 | tmux_conf_theme_focused_pane_bg="$custom_visual_grey" 98 | 99 | # pane border style, possible values are: 100 | # - thin (default) 101 | # - fat 102 | tmux_conf_theme_pane_border_style=thin 103 | 104 | # pane borders colours: 105 | tmux_conf_theme_pane_border=$custom_visual_grey 106 | tmux_conf_theme_pane_active_border=$custom_blue 107 | 108 | 109 | # pane indicator colours (when you hit + q) 110 | tmux_conf_theme_pane_indicator=$custom_orange 111 | tmux_conf_theme_pane_active_indicator=$custom_orange 112 | 113 | # status line style 114 | tmux_conf_theme_message_fg=$custom_black 115 | tmux_conf_theme_message_bg=$custom_orange 116 | tmux_conf_theme_message_attr="bold" 117 | 118 | # status line command style ( : Escape) 119 | tmux_conf_theme_message_command_fg=$custom_orange 120 | tmux_conf_theme_message_command_bg=$custom_visual_grey 121 | tmux_conf_theme_message_command_attr="bold" 122 | 123 | # window modes style 124 | tmux_conf_theme_mode_fg=$custom_black 125 | tmux_conf_theme_mode_bg=$custom_blue 126 | tmux_conf_theme_mode_attr="bold" 127 | 128 | # status line style 129 | tmux_conf_theme_status_fg=$custom_comment_grey 130 | tmux_conf_theme_status_bg=$custom_black 131 | tmux_conf_theme_status_attr="none" 132 | 133 | # terminal title 134 | # - built-in variables are: 135 | # - #{circled_window_index} 136 | # - #{circled_session_name} 137 | # - #{hostname} 138 | # - #{hostname_ssh} 139 | # - #{hostname_full} 140 | # - #{hostname_full_ssh} 141 | # - #{username} 142 | # - #{username_ssh} 143 | tmux_conf_theme_terminal_title="#h ❐ #S ● #I #W" 144 | 145 | # window status style 146 | # - built-in variables are: 147 | # - #{circled_window_index} 148 | # - #{circled_session_name} 149 | # - #{hostname} 150 | # - #{hostname_ssh} 151 | # - #{hostname_full} 152 | # - #{hostname_full_ssh} 153 | # - #{username} 154 | # - #{username_ssh} 155 | tmux_conf_theme_window_status_fg=$custom_comment_grey 156 | tmux_conf_theme_window_status_bg=$custom_black 157 | tmux_conf_theme_window_status_attr="none" 158 | #tmux_conf_theme_window_status_format="#I #W" 159 | #tmux_conf_theme_window_status_format="#{circled_window_index} #W" 160 | tmux_conf_theme_window_status_format="#I #W#{?window_bell_flag, 󰂚 ,}#{?window_zoomed_flag, 󰍉 ,}" 161 | 162 | # window current status style 163 | # - built-in variables are: 164 | # - #{circled_window_index} 165 | # - #{circled_session_name} 166 | # - #{hostname} 167 | # - #{hostname_ssh} 168 | # - #{hostname_full} 169 | # - #{hostname_full_ssh} 170 | # - #{username} 171 | # - #{username_ssh} 172 | tmux_conf_theme_window_status_current_fg=$custom_black 173 | tmux_conf_theme_window_status_current_bg=$custom_blue 174 | tmux_conf_theme_window_status_current_attr="bold" 175 | #tmux_conf_theme_window_status_current_format="#I #W" 176 | #tmux_conf_theme_window_status_current_format="#{circled_window_index} #W" 177 | tmux_conf_theme_window_status_current_format="#I #W#{?window_zoomed_flag, 󰍉 ,}" 178 | 179 | # window activity status style 180 | tmux_conf_theme_window_status_activity_fg="default" 181 | tmux_conf_theme_window_status_activity_bg="default" 182 | tmux_conf_theme_window_status_activity_attr="underscore" 183 | 184 | # window bell status style 185 | tmux_conf_theme_window_status_bell_fg=$custom_blue 186 | tmux_conf_theme_window_status_bell_bg="default" 187 | tmux_conf_theme_window_status_bell_attr="blink,bold" 188 | 189 | # window last status style 190 | tmux_conf_theme_window_status_last_fg=$custom_blue 191 | tmux_conf_theme_window_status_last_bg='default' 192 | tmux_conf_theme_window_status_last_attr="none" 193 | 194 | # status left/right sections separators 195 | tmux_conf_theme_left_separator_main="" 196 | tmux_conf_theme_left_separator_sub="|" 197 | tmux_conf_theme_right_separator_main="" 198 | tmux_conf_theme_right_separator_sub="|" 199 | #tmux_conf_theme_left_separator_main='\uE0B0' # /!\ you don't need to install Powerline 200 | #tmux_conf_theme_left_separator_sub='\uE0B1' # you only need fonts patched with 201 | #tmux_conf_theme_right_separator_main='\uE0B2' # Powerline symbols or the standalone 202 | #tmux_conf_theme_right_separator_sub='\uE0B3' # PowerlineSymbols.otf font, see README.md 203 | 204 | # status left/right content: 205 | # - separate main sections with "|" 206 | # - separate subsections with "," 207 | # - built-in variables are: 208 | # - #{battery_bar} 209 | # - #{battery_hbar} 210 | # - #{battery_percentage} 211 | # - #{battery_status} 212 | # - #{battery_vbar} 213 | # - #{circled_session_name} 214 | # - #{hostname_ssh} 215 | # - #{hostname} 216 | # - #{hostname_full} 217 | # - #{hostname_full_ssh} 218 | # - #{loadavg} 219 | # - #{mouse} 220 | # - #{pairing} 221 | # - #{prefix} 222 | # - #{root} 223 | # - #{synchronized} 224 | # - #{uptime_y} 225 | # - #{uptime_d} (modulo 365 when #{uptime_y} is used) 226 | # - #{uptime_h} 227 | # - #{uptime_m} 228 | # - #{uptime_s} 229 | # - #{username} 230 | # - #{username_ssh} 231 | tmux_conf_theme_status_left=" ❐ #S | ⏻#{?uptime_y, #{uptime_y}y,}#{?uptime_d, #{uptime_d}d,}#{?uptime_h, #{uptime_h}h,}#{?uptime_m, #{uptime_m}m,} " 232 | #tmux_conf_theme_status_right=" #{prefix}#{mouse}#{pairing}#{synchronized}#{?battery_status,#{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} , %R , %d %b | #{username}#{root} | #{hostname} " 233 | tmux_conf_theme_status_right=" #{prefix}#{mouse}#{pairing}#{synchronized}|#[fg=$custom_green]#{tmux_cpu_mem} #{?battery_status,#{battery_status},}#{?battery_bar, #{battery_bar},}#{?battery_percentage, #{battery_percentage},} | #{username}#{root} | #{hostname} #{online} |#{pomodoro_status}#{tmux_mode_indicator}" 234 | 235 | # status left style 236 | tmux_conf_theme_status_left_fg=$custom_black','$custom_green','$custom_white 237 | tmux_conf_theme_status_left_bg=$custom_green','$custom_visual_grey','$custom_blue 238 | tmux_conf_theme_status_left_attr="bold,none,none" 239 | 240 | # status right style 241 | tmux_conf_theme_status_right_fg=$custom_comment_grey','$custom_white','$custom_black 242 | tmux_conf_theme_status_right_bg=$custom_black','$custom_visual_grey','$custom_white 243 | tmux_conf_theme_status_right_attr="none,none,bold" 244 | 245 | # pairing indicator 246 | tmux_conf_theme_pairing="⚇" # U+2687 247 | tmux_conf_theme_pairing_fg="none" 248 | tmux_conf_theme_pairing_bg="none" 249 | tmux_conf_theme_pairing_attr="none" 250 | 251 | # prefix indicator 252 | tmux_conf_theme_prefix="⌨" # U+2328 253 | tmux_conf_theme_prefix_fg="none" 254 | tmux_conf_theme_prefix_bg="none" 255 | tmux_conf_theme_prefix_attr="none" 256 | 257 | # mouse indicator 258 | tmux_conf_theme_mouse="" 259 | tmux_conf_theme_mouse_fg="none" 260 | tmux_conf_theme_mouse_bg="none" 261 | tmux_conf_theme_mouse_attr="none" 262 | 263 | # root indicator 264 | tmux_conf_theme_root="!" 265 | tmux_conf_theme_root_fg="none" 266 | tmux_conf_theme_root_bg="none" 267 | tmux_conf_theme_root_attr="bold,blink" 268 | 269 | # synchronized indicator 270 | tmux_conf_theme_synchronized="⚏" # U+268F 271 | tmux_conf_theme_synchronized_fg="none" 272 | tmux_conf_theme_synchronized_bg="none" 273 | tmux_conf_theme_synchronized_attr="none" 274 | 275 | # battery bar symbols 276 | tmux_conf_battery_bar_symbol_full="◼" 277 | tmux_conf_battery_bar_symbol_empty="◻" 278 | 279 | # battery bar length (in number of symbols), possible values are: 280 | # - auto 281 | # - a number, e.g. 5 282 | tmux_conf_battery_bar_length="auto" 283 | 284 | # battery bar palette, possible values are: 285 | # - gradient (default) 286 | # - heat 287 | # - "colour_full_fg,colour_empty_fg,colour_bg" 288 | tmux_conf_battery_bar_palette="heat" 289 | #tmux_conf_battery_bar_palette="#d70000,#e4e4e4,#000000" # red, white, black 290 | 291 | # battery hbar palette, possible values are: 292 | # - gradient (default) 293 | # - heat 294 | # - "colour_low,colour_half,colour_full" 295 | tmux_conf_battery_hbar_palette="gradient" 296 | #tmux_conf_battery_hbar_palette="#d70000,#ff5f00,#5fff00" # red, orange, green 297 | 298 | # battery vbar palette, possible values are: 299 | # - gradient (default) 300 | # - heat 301 | # - "colour_low,colour_half,colour_full" 302 | tmux_conf_battery_vbar_palette="gradient" 303 | #tmux_conf_battery_vbar_palette="#d70000,#ff5f00,#5fff00" # red, orange, green 304 | 305 | # symbols used to indicate whether battery is charging or discharging 306 | tmux_conf_battery_status_charging="󰂄" 307 | tmux_conf_battery_status_discharging="󰁹" 308 | 309 | # clock style (when you hit + t) 310 | # you may want to use %I:%M %p in place of %R in tmux_conf_theme_status_right 311 | tmux_conf_theme_clock_colour=$custom_blue 312 | tmux_conf_theme_clock_style="24" 313 | 314 | 315 | # -- clipboard ----------------------------------------------------------------- 316 | 317 | # in copy mode, copying selection also copies to the OS clipboard 318 | # - true 319 | # - false (default) 320 | # on macOS, this requires installing reattach-to-user-namespace, see README.md 321 | # on Linux, this requires xsel or xclip 322 | tmux_conf_copy_to_os_clipboard=true 323 | 324 | 325 | # -- user customizations ------------------------------------------------------- 326 | # this is the place to override or undo settings 327 | 328 | # increase history size 329 | set -g history-limit 100000 330 | 331 | # start with mouse mode enabled 332 | set -g mouse on 333 | 334 | # force Vi mode 335 | # really you should export VISUAL or EDITOR environment variable, see manual 336 | set -g status-keys vi 337 | set -g mode-keys vi 338 | 339 | # replace C-b by C-a instead of using both prefixes 340 | # set -gu prefix2 341 | # unbind C-a 342 | # unbind C-b 343 | # set -g prefix C-a 344 | # bind C-a send-prefix 345 | 346 | # move status line to top 347 | #set -g status-position top 348 | 349 | # bind C-w to choose a window from the list (in addition to binding w) 350 | bind C-w choose-session 351 | 352 | set -g pane-border-status top 353 | set -g pane-border-format "#{pane_index} #{?pane_title, | #{pane_title},}" 354 | 355 | set-hook -g 'client-attached[0]' 'run "tmux setenv -u tmux_cpu_status_init"' 356 | set-hook -g 'client-detached[0]' 'run "tmux setenv -u tmux_cpu_status_init"' 357 | 358 | set-hook -g 'client-attached[1]' 'display-message "CodeRabbit tmux: Welcome back ${USER}."' 359 | set-hook -g 'session-created[0]' 'display-message "CodeRabbit tmux: Welcome ${USER}."' 360 | 361 | # Use run-shell to run uuidgen command and store result in uuid variable 362 | run-shell "tmux setenv -g TMUX_UUID $(uuidgen)" 363 | 364 | set -g update-environment "DISPLAY SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERMINAL SET_TERMINAL_COLORS ITERM_SESSION_ID TERM_SESSION_ID" 365 | 366 | # -- tpm ----------------------------------------------------------------------- 367 | 368 | # while I don't use tpm myself, many people requested official support so here 369 | # is a seamless integration that automatically installs plugins in parallel 370 | 371 | # whenever a plugin introduces a variable to be used in 'status-left' or 372 | # 'status-right', you can use it in 'tmux_conf_theme_status_left' and 373 | # 'tmux_conf_theme_status_right' variables. 374 | 375 | # by default, launching tmux will update tpm and all plugins 376 | # - true (default) 377 | # - false 378 | tmux_conf_update_plugins_on_launch=true 379 | 380 | # by default, reloading the configuration will update tpm and all plugins 381 | # - true (default) 382 | # - false 383 | tmux_conf_update_plugins_on_reload=true 384 | 385 | # by default, reloading the configuration will uninstall tpm and plugins when no 386 | # plugins are enabled 387 | # - true (default) 388 | # - false 389 | tmux_conf_uninstall_plugins_on_reload=true 390 | 391 | # /!\ the tpm bindings differ slightly from upstream: 392 | # - installing plugins: + I 393 | # - uninstalling plugins: + Alt + u 394 | # - updating plugins: + u 395 | 396 | # /!\ do not add set -g @plugin 'tmux-plugins/tpm' 397 | # /!\ do not add run '~/.tmux/plugins/tpm/tpm' 398 | 399 | # to enable a plugin, use the 'set -g @plugin' syntax: 400 | # visit https://github.com/tmux-plugins for available plugins 401 | 402 | # this is not working 403 | # set -g @plugin 'ofirgall/tmux-window-name' 404 | # set -g @tmux_window_name_shells "['zsh', 'bash', 'sh']" 405 | # set -g @tmux_window_dir_programs "['nvim', 'vim', 'vi', 'git']" 406 | # set -g @tmux_window_max_name_len "20" 407 | 408 | set -g @plugin 'tmux-plugins/tmux-yank' 409 | set -g @plugin 'tmux-plugins/tmux-sensible' 410 | 411 | set -g @plugin 'tmux-plugins/tmux-resurrect' 412 | set -g @resurrect-capture-pane-contents 'on' 413 | set -g @resurrect-strategy-vim 'session' 414 | set -g @resurrect-strategy-nvim 'session' 415 | 416 | 417 | # set -g @plugin 'tmux-plugins/tmux-continuum' 418 | # set -g @continuum-restore 'on' 419 | # set -g @continuum-save-interval '5' 420 | # set -g @continuum-boot 'on' 421 | # if-shell "uname | grep -q Darwin" "set -g @continuum-boot-options 'iterm'" 422 | 423 | set -g @plugin 'jaclu/tmux-menus' 424 | set -g @menus_trigger 'F12' 425 | set -g @menus_without_prefix 1 426 | 427 | set -g @plugin 'MunifTanjim/tmux-suspend' 428 | set -g @suspend_key 'F1' 429 | 430 | set -g @plugin 'MunifTanjim/tmux-mode-indicator' 431 | # style values for prefix prompt 432 | set -g @mode_indicator_prefix_mode_style "bg=$custom_blue,fg=$custom_black" 433 | # style values for copy prompt 434 | set -g @mode_indicator_copy_mode_style "bg=$custom_yellow,fg=$custom_black" 435 | # style values for sync prompt 436 | set -g @mode_indicator_sync_mode_style "bg=$custom_red,fg=$custom_black" 437 | # style values for empty prompt 438 | set -g @mode_indicator_empty_mode_style "bg=$custom_cyan,fg=$custom_black" 439 | 440 | set -g @plugin 'sainnhe/tmux-fzf' 441 | TMUX_FZF_LAUNCH_KEY="C-Space" 442 | TMUX_FZF_OPTIONS="-p 66%,66%" 443 | TMUX_FZF_ORDER="menu|session|window|pane|command|keybinding|clipboard|process" 444 | 445 | set -g @plugin 'roosta/tmux-fuzzback' 446 | set -g @fuzzback-bind C-_ 447 | set -g @fuzzback-popup 1 448 | set -g @fuzzback-popup-size '90%' 449 | 450 | set -g @plugin 'olimorris/tmux-pomodoro-plus' 451 | # Options 452 | set -g @pomodoro_start 't' # Start a Pomodoro with tmux-prefix + t 453 | set -g @pomodoro_cancel 'T' # Cancel a Pomodoro with tmux-prefix key + T 454 | set -g @pomodoro_mins 25 # The duration of the pomodoro 455 | set -g @pomodoro_break_mins 5 # The duration of the break after the pomodoro 456 | set -g @pomodoro_on "#[fg=$custom_red,bg=$custom_black] " # The formatted output when the pomodoro is running 457 | set -g @pomodoro_complete "#[fg=$custom_cyan,bg=$custom_black,blink] " # The formatted output when the break is running 458 | set -g @pomodoro_notifications 'on' # Turn on/off desktop notifications 459 | set -g @pomodoro_sound 'Pop' # Sound for desktop notifications (Run `ls /System/Library/Sounds` for a list of sounds to use) 460 | 461 | set -g @plugin 'wfxr/tmux-fzf-url' 462 | set -g @fzf-url-history-limit '20000' 463 | # open tmux-fzf-url in a tmux v3.2+ popup 464 | set -g @fzf-url-fzf-options '-w 80% -h 80% --multi -0 --no-preview --no-border' 465 | 466 | # -- tmux-menu ----------------------------------------------------------------- 467 | 468 | TMUX_FZF_MENU=\ 469 | " Pomodoro Timer\n~/.tmux/plugins/tmux-pomodoro-plus/scripts/pomodoro.sh toggle\n"\ 470 | " Git Add\nwin_split 'forgit::add'\n"\ 471 | " Git Reset Head\nwin_split 'forgit::reset::head'\n"\ 472 | " Git Log\nwin_split 'forgit::log'\n"\ 473 | " Git Diff\nwin_split 'forgit::diff'\n"\ 474 | " Git Checkout File\nwin_split 'forgit::checkout::file'\n"\ 475 | " Git Checkout Branch\nwin_split 'forgit::checkout::branch'\n"\ 476 | " Git Checkout Commit\nwin_split 'forgit::checkout::commit'\n"\ 477 | " Git Branch Delete\nwin_split 'forgit::branch::delete'\n"\ 478 | " Git Revert Commit\nwin_split 'forgit::revert::commit'\n"\ 479 | " Git Checkout Tag\nwin_split 'forgit::checkout::tag'\n"\ 480 | " Git Clean\nwin_split 'forgit::clean'\n"\ 481 | " Git Stash Show\nwin_split 'forgit::stash::show'\n"\ 482 | " Git Cherry Pick\nwin_split 'forgit::cherry::pick::from::branch'\n"\ 483 | " Git Rebase\nwin_split 'forgit::rebase'\n"\ 484 | " Git Fixup\nwin_split 'forgit::fixup'\n"\ 485 | " Git Repo Statistics & Summary (onefetch)\n\"win_split -a -h 'spinner -c onefetch --no-bots --number-of-authors=10'\"\n"\ 486 | "󱓞 Git Ship: Add -> Commit(retry) -> Pull -> Push\n\"win_split -a -h 'git_ship'\"\n"\ 487 | " Sync CodeRabbit Repos\n\"win_split -a 'sync_coderabbitai.sh'\"\n"\ 488 | " Sync FluxNinja Repos\n\"win_split -a 'sync_fluxninja.sh'\"\n"\ 489 | "󰊤 GitHub Status\n\"win_split -a 'gh status --org coderabbitai'\"\n"\ 490 | "󰊤 GitHub Dashboard\n\"win_split -a 'gh dash'\"\n"\ 491 | " Docker TUI (lazydocker)\nwin_split 'lazydocker'\n"\ 492 | " Kubernetes TUI (k9s)\nwin_split 'k9s'\n"\ 493 | " Directory Navigator (broot)\nwin_split -b -h 'br'\n"\ 494 | "󰋖 Cheatsheets Browser (navi)\nwin_split 'navi'\n"\ 495 | "󰋖 Man Pages Browser (batman)\nwin_split 'batman'\n"\ 496 | "ﮮ Autoupdate Dotfiles Environment\nwin_split -a 'autoupdate.zsh --force'\n"\ 497 | "󱂬 Start Personal Dotfiles Editing Session (join in a new terminal)\nsmug start dotfiles-personal\n"\ 498 | "󱂬 Start CodeRabbit Dotfiles Editing Session (join in a new terminal)\nsmug start dotfiles\n"\ 499 | "󰖙 Weather\nwin_split 'spinner -w 600 -c wttr.sh'\n"\ 500 | " San Francisco (SF) Clock\n\"win_split -t 'San Francisco' 'TZ=America/Los_Angeles tty-clock -s -t'\"\n"\ 501 | " India Clock\n\"win_split -t 'India' 'TZ=Asia/Calcutta tty-clock -s -t'\"\n"\ 502 | " What is my IP address? (ifconfig.es)\n\"win_split 'curlie -sL ifconfig.es/all | bat --paging=always --color=always --language=yaml'\"\n"\ 503 | "󰓅 Internet Speedtest\n\"win_split -a 'speedtest'\"\n"\ 504 | " Activity Monitor\nwin_split 'btm'\n"\ 505 | "󰋊 Disk Free\nwin_split -a 'spinner -c dust'\n"\ 506 | "󰋊 Disk Usage\nwin_split -a 'spinner -c duf'\n"\ 507 | " Show Color Palette\nwin_split -h -a 'msgcat --color=test'\n"\ 508 | " Zsh History Stats\nwin_split -h -a 'zsh_stats'\n"\ 509 | " Explain Prompt\nwin_split -h -a 'explain_prompt'\n"\ 510 | " tmux Useful Bindings\nwin_split -h -a 'tmux_bindings'\n"\ 511 | " Zsh Completions List\nwin_split -a 'zinit completions'\n"\ 512 | " System Information (neofetch)\nwin_split -h -a 'neofetch'\n" 513 | 514 | # user defined overrides 515 | source -q ~/.tmux.conf_local 516 | 517 | # -- custom variables ---------------------------------------------------------- 518 | 519 | # to define a custom #{foo} variable, define a POSIX shell function between the 520 | # '# EOF' and the '# "$@"' lines. Please note that the opening brace { character 521 | # must be on the same line as the function name otherwise the parse won't detect 522 | # it. 523 | # 524 | # then, use #{foo} in e.g. the 'tmux_conf_theme_status_left' or the 525 | # 'tmux_conf_theme_status_right' variables. 526 | 527 | # # /!\ do not remove the following line 528 | # EOF 529 | # 530 | # # /!\ do not "uncomment" the functions: the leading "# " characters are needed 531 | # 532 | # weather() { 533 | # curl -m 1 wttr.in?format=3 2>/dev/null 534 | # sleep 900 # sleep for 15 minutes, throttle network requests whatever the value of status-interval 535 | # } 536 | # 537 | # online() { 538 | # ping -c 1 1.1.1.1 >/dev/null 2>&1 && printf '' || printf '' 539 | # } 540 | # 541 | # tmux_cpu_mem() { 542 | # # check the output of the command "tmux showenv -s tmux_cpu_status_init" 543 | # # if it is empty then set first_run to false otherwise set it to true and run "tmux setenv tmux_cpu_status_init 1" 544 | # out=$(tmux showenv -s tmux_cpu_status_init 2>/dev/null) 545 | # if [ -z "$out" ]; then 546 | # tmux setenv tmux_cpu_status_init 1 547 | # first_run=true 548 | # else 549 | # first_run=false 550 | # fi 551 | # cmd="tmux-mem-cpu-load -a 0 -v -m 2 --interval 5" 552 | # if [ "$first_run" = true ]; then 553 | # spinner -s -q $cmd 554 | # else 555 | # $cmd 556 | # fi 557 | # } 558 | # 559 | # "$@" 560 | # # /!\ do not remove the previous line 561 | -------------------------------------------------------------------------------- /dot_urlview: -------------------------------------------------------------------------------- 1 | COMMAND xdg-open 2 | -------------------------------------------------------------------------------- /dot_vim/after/autoload/coc/ui.vim: -------------------------------------------------------------------------------- 1 | scriptencoding utf-8 2 | 3 | if has("nvim") 4 | " overwrite coc#ui#echo_messages function to use notify 5 | function! coc#ui#echo_messages(hl, msgs) 6 | if a:hl !~# 'Error' && (mode() !~# '\v^(i|n)$') 7 | return 8 | endif 9 | let msgs = filter(copy(a:msgs), '!empty(v:val)') 10 | if empty(msgs) 11 | return 12 | endif 13 | " map a:hl highlight groups to notify levels 14 | " if hl matches Error then level is error 15 | " if hl matches Warning then level is warn 16 | " otherwise level is info 17 | let level = 'info' 18 | if a:hl =~# 'Error' 19 | let level = 'error' 20 | elseif a:hl =~# 'Warning' 21 | let level = 'warn' 22 | endif 23 | let msg = join(msgs, '\n') 24 | call v:lua.notify('LSP Message', msg, level) 25 | endfunction 26 | 27 | function! coc#ui#echo_lines(lines) 28 | let msg = join(a:lines, "\n") 29 | call v:lua.notify('LSP Message', msg, 'info') 30 | endfunction 31 | 32 | endif 33 | -------------------------------------------------------------------------------- /dot_zprofile: -------------------------------------------------------------------------------- 1 | # check if $HOME/homebrew exists, if it does then export environment 2 | if [ -d "$HOME/homebrew" ]; then 3 | eval "$($HOME/homebrew/bin/brew shellenv)" 4 | else 5 | if [[ $OSTYPE == 'darwin'* ]]; then 6 | test -d /opt/homebrew && eval "$(/opt/homebrew/bin/brew shellenv)" 7 | test -f /usr/local/bin/brew && eval "$(/usr/local/bin/brew shellenv)" 8 | else 9 | test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" 10 | fi 11 | fi 12 | 13 | # add python symlinks 14 | export PATH=$HOME/sw/bin:$HOME/go/bin:$HOME/.cargo/bin:$(brew --prefix)/opt/python/libexec/bin:$HOME/.local/bin:$PATH:$HOME/.docker/bin:$HOME/.orbstack/bin 15 | export JDK_HOME=$HOMEBREW_PREFIX/opt/openjdk@17 16 | export JAVA_HOME=$HOMEBREW_PREFIX/opt/openjdk@17 17 | 18 | # export a variable marking zprofile as sourced 19 | export ZPROFILE_SOURCED=1 20 | -------------------------------------------------------------------------------- /dot_zshrc: -------------------------------------------------------------------------------- 1 | # source ~/.zprofile if ZPROFILE_SOURCED is not set 2 | if [[ -z "$ZPROFILE_SOURCED" ]]; then 3 | source ~/.zprofile 4 | fi 5 | 6 | export LS_COLORS="$(vivid generate gruvbox-dark)" 7 | 8 | export BAT_THEME="gruvbox-dark" 9 | 10 | # FZF theme -- See https://github.com/fnune/base16-fzf 11 | source $HOME/sw/assets/base16-gruvbox-dark-medium.config 12 | 13 | export LESSOPEN="|$(brew --prefix)/bin/lesspipe.sh %s" 14 | export LESSCOLORIZER="bat --color=always" 15 | export LESS="-R" 16 | 17 | export MANPAGER="sh -c 'col -bx | bat -l man -p'" 18 | 19 | export EDITOR=nvim 20 | export SET_TERMINAL_COLORS=true 21 | 22 | function set_terminal { 23 | if [[ -z "${TERMINAL:-}" ]]; then 24 | 25 | # | 26 | # | Check for the terminal name (depening on os) 27 | # | =========================================== 28 | OS="$(uname)" 29 | if [[ "$OS" = "Darwin" ]]; then 30 | export TERMINAL=$TERM_PROGRAM 31 | # test whether ~/.iterm2_profile_check_v2 doesn't exist 32 | if [[ ! -e "${HOME}/.iterm2_profile_check_v2" ]]; then 33 | rm -f "${HOME}/.iterm2_profile_check" 34 | if gum confirm "Do you want to use CodeRabbit's bundled iTerm2 colors/font profile?"; then 35 | # install iterm2 profile 36 | cp ~/sw/assets/iterm2_gruvbox.json ~/Library/Application\ Support/iTerm2/DynamicProfiles/ 37 | # execute the script 38 | pip3 install iterm2 && python3 ~/sw/assets/iterm2_default.py && touch "${HOME}/.iterm2_profile_check_v2" || (echo; echo; echo "Failed to install iTerm2 profile. You might need to enable Python API within iTerm2 preferences (under Magic tab). Press Enter to continue." && read) 39 | # ask about wallpaper 40 | if gum confirm "Do you want to use matching wallpaper?"; then 41 | # set the wallpaper to ~/sw/assets/apple_gruvbox.heic 42 | osascript -e "tell application \"Finder\" to set desktop picture to POSIX file \"$HOME/sw/assets/apple_gruvbox.heic\"" 43 | fi 44 | else 45 | echo "no" > "${HOME}/.iterm2_profile_check_v2" 46 | fi 47 | fi 48 | return 49 | fi 50 | 51 | # Other OS'es 52 | if [[ "${OS#CYGWIN}" != "${OS}" ]]; then 53 | export TERMINAL="mintty" 54 | elif [[ "$TERM" = "xterm-kitty" ]]; then 55 | export TERMINAL="kitty" 56 | else 57 | # | 58 | # | Depending on how the script was invoked, we need 59 | # | to loop until pid is no longer a subshell 60 | # | =========================================== 61 | pid="$$" 62 | export TERMINAL="$(ps -h -o comm -p $pid)" 63 | while [[ "${TERMINAL:(-2)}" == "sh" ]]; do 64 | pid="$(ps -h -o ppid -p $pid)" 65 | export TERMINAL="$(ps -h -o comm -p $pid)" 66 | done 67 | fi 68 | fi 69 | } 70 | 71 | 72 | if [[ -z "$START_TMUX" ]]; then 73 | export START_TMUX=true 74 | fi 75 | 76 | # check whether tmux command exists 77 | if [[ -x "$(command -v tmux)" ]]; then 78 | if $START_TMUX; then 79 | export START_TMUX=false 80 | set_terminal 81 | DETACHED_SESSIONS=$(tmux ls 2&>/dev/null | grep -v attached) 82 | # check whether tmux has sessions that are in detached state 83 | if [[ -n "$DETACHED_SESSIONS" ]]; then 84 | # get the list of detached sessions 85 | DETACHED_SESSIONS=$(tmux ls | grep -v attached) 86 | # Add "New Session" to the list of detached sessions 87 | DETACHED_SESSIONS="New Session\n$DETACHED_SESSIONS" 88 | #local PREVIEW="TOKEN={} && echo 'token: $TOKEN'" 89 | # use fzf to select a session 90 | SESSION_NAME=$(echo "$DETACHED_SESSIONS" | \ 91 | fzf --header="== Attach to a detached session ==" \ 92 | --ansi --color="dark" \ 93 | --preview="$HOME/sw/assets/.session_preview {}") 94 | # if the user selected a session, attach to it 95 | # otherwise, create a new session 96 | if [[ $SESSION_NAME == "New Session" ]]; then 97 | tmux -u new-session 98 | else 99 | # extract session name 100 | SESSION_NAME=$(echo "$SESSION_NAME" | cut -d':' -f1) 101 | tmux -u attach -t $SESSION_NAME 102 | fi 103 | else 104 | tmux -u new-session 105 | fi 106 | exit 107 | fi 108 | fi 109 | 110 | # Check for Homebrew to be present, install if it's missing 111 | if ! command -v brew &> /dev/null; then 112 | echo "Installing homebrew..." 113 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 114 | # source ~/.zprofile to update PATH 115 | source ~/.zprofile 116 | ~/sw/bin/autoupdate.zsh --force 117 | fi 118 | 119 | figlet -w 80 CodeRabbit Zsh && echo "" 2&>/dev/null 120 | 121 | source ~/sw/assets/utils.zsh 122 | 123 | # See https://unix.stackexchange.com/q/150649/126543 124 | function expand-command-aliases() { 125 | cmd="$1" 126 | functions[expandaliasestmp]="${cmd}" 127 | print -rn -- "${functions[expandaliasestmp]#$'\t'}" 128 | unset 'functions[expandaliasestmp]' 129 | } 130 | 131 | _brew_completion_update=false 132 | 133 | func preexec() { 134 | export LAST_COMMAND="$(expand-command-aliases "$1")" 135 | # Do nothing at all if we are not in tmux, second test is needed in 136 | # case of an ssh session being run from within tmux, which could result 137 | # in $TMUX from the parent session being set without tmux being 138 | # connected. 139 | if [ -n "$TMUX" ] && tmux ls >/dev/null 2>/dev/null; then 140 | eval "$(tmux show-environment -s | grep -v "^unset")" 141 | local uuid="$(tmux show-environment -g TMUX_UUID 2>/dev/null)" 142 | # check whether $LAST_TMUX_UUID is set 143 | if [[ -z "$LAST_TMUX_UUID" ]]; then 144 | export LAST_TMUX_UUID="$uuid" 145 | else 146 | # check whether $LAST_TMUX_UUID is the same as $uuid 147 | if [ "$LAST_TMUX_UUID" != "$uuid" ]; then 148 | export LAST_TMUX_UUID="$uuid" 149 | echo -e "${BLUE_BRIGHT} == Autoupdate detected | Zsh reloading == ${RESET}" 150 | # tmux respawn pane and new login shell to reload zsh 151 | # cd to the current directory 152 | # run the LAST_COMMAND 153 | tmux respawn-pane -k -t "$TMUX_PANE" "cd \"$PWD\" && $LAST_COMMAND && zsh --login" 154 | echo 155 | echo -e "${BLUE_BRIGHT} == Zsh reloaded == ${RESET}" 156 | echo 157 | fi 158 | fi 159 | fi 160 | 161 | # if last command contained "brew install" or "brew upgrade" or "brew uninstall" or "brew reinstall" the set _brew_completion_update=1 162 | if [[ "$LAST_COMMAND" =~ "brew install" ]] || [[ "$LAST_COMMAND" =~ "brew upgrade" ]] || [[ "$LAST_COMMAND" =~ "brew uninstall" ]] || [[ "$LAST_COMMAND" =~ "brew reinstall" ]]; then 163 | 164 | _brew_completion_update=true 165 | fi 166 | } 167 | 168 | function precmd() { 169 | # if _brew_completion_update is set to true, run "zinit update brew-completions" 170 | if $_brew_completion_update; then 171 | zinit update brew-completions 172 | _brew_completion_update=false 173 | fi 174 | } 175 | 176 | func zshexit() { 177 | #remove gh status 178 | rm /tmp/gh_$$ &>/dev/null 179 | # remove watch on home directory 180 | watchman watch-del $HOME >/dev/null 181 | figlet -w 80 CodeRabbit zsh 182 | cowsay -d "zsh exiting... see you later..." 183 | sleep 0.5 184 | } 185 | 186 | # configure zsh to show hidden files in auto-completion 187 | setopt globdots 188 | setopt interactivecomments 189 | 190 | eval $(thefuck --alias) 191 | 192 | if [[ $OSTYPE == 'darwin'* ]]; then 193 | source "$(brew --prefix)/share/google-cloud-sdk/path.zsh.inc" 194 | source "$(brew --prefix)/share/google-cloud-sdk/completion.zsh.inc" 195 | fi 196 | 197 | PS1="$(pwd) > " 198 | PROMPT_LAYOUT='[] ' 199 | 200 | if [[ -z "$ITERM2_INTEGRATION_DETECTED" ]]; then 201 | ITERM2_INTEGRATION_DETECTED=false 202 | fi 203 | 204 | if [[ $OSTYPE == 'darwin'* ]]; then 205 | # check whether $TERMINAL is iTerm.app 206 | if [[ $TERMINAL == "iTerm.app" ]]; then 207 | export ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX=true 208 | # iterm2 prompt mark doesn't work under tmux for some reason 209 | test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh" && \ 210 | ITERM2_INTEGRATION_DETECTED=true && PROMPT_LAYOUT="%{$(iterm2_prompt_mark)%} $PROMPT_LAYOUT%{$(iterm2_prompt_end)%}" 211 | # read $HOME/.iterm2_profile_check_v2 file and check if it contains "no" 212 | if [[ $(cat "${HOME}/.iterm2_profile_check_v2") == "no" ]]; then 213 | SET_TERMINAL_COLORS=true 214 | else 215 | SET_TERMINAL_COLORS=false 216 | fi 217 | ## if the terminal is ghostty don't set terminal colors 218 | elif [[ $TERMINAL == "ghostty" ]]; then 219 | SET_TERMINAL_COLORS=false 220 | fi 221 | fi 222 | 223 | periodic() { silent_background timeout 2 $HOME/sw/bin/gh_checks_status.sh > /tmp/gh_$$ } 224 | PERIOD=10 225 | 226 | function @yazpt_segment_nl() { 227 | # check whether $last_yazpt_vcs is not equal to $yazpt_state[vcs] 228 | #if [[ "$last_yazpt_vcs" != "$yazpt_state[vcs]" ]]; then 229 | # spinner -q -s "timeout 2 $HOME/sw/bin/gh_checks_status.sh > /tmp/gh_$$" 230 | #fi 231 | last_yazpt_vcs="$yazpt_state[vcs]" 232 | yazpt_state[nl]="" 233 | # read from /tmp/gh_"$$" if it exists 234 | if [[ -e "/tmp/gh_$$" ]]; then 235 | local check="$(cat /tmp/gh_$$)" 236 | # check whether check is empty 237 | if [ -n "$check" ]; then 238 | if [ -n "$yazpt_state[vcs]" ]; then 239 | yazpt_state[nl]+=" | " 240 | fi 241 | yazpt_state[nl]+=" GitHub checks $check" 242 | fi 243 | fi 244 | 245 | local hour=$(date +%H) 246 | if (( 23 <= $hour || $hour <= 6 )); then 247 | if [ -n "$yazpt_state[nl]" ] || [ -n "$yazpt_state[vcs]" ]; then 248 | yazpt_state[nl]+=" | " 249 | fi 250 | yazpt_state[nl]+="%F{$YAZPT_CWD_COLOR}it's late, yo - get some sleep!%f" 251 | fi 252 | # check whether $yazpt_state[nl] or $yazpt_state[vcs] is not empty and add a new line if it is not empty 253 | if [ -n "$yazpt_state[nl]" ] || [ -n "$yazpt_state[vcs]" ]; then 254 | yazpt_state[nl]+=$'\n' 255 | fi 256 | } 257 | 258 | function @yazpt_segment_excuse() { 259 | # check whether exit code of last command was not 0 or 127 or 130 260 | local code="$yazpt_state[exit_code]" 261 | local excuse_msg='' 262 | if [[ $code -ne 0 && $code -ne 127 && "$yazpt_state[exit_code]" -ne 130 ]] && $INSULTS_ENABLED; then 263 | local excuse_msg='💥uh-ho💥 ' 264 | excuse_msg+="$(excuse)" 265 | excuse_msg+=$'\n' 266 | fi 267 | yazpt_state[excuse]=$excuse_msg 268 | } 269 | 270 | APP_CHEERS_PATTERNS=( 271 | "git push" 272 | "git_ship" 273 | ) 274 | 275 | function @yazpt_segment_cheers() { 276 | local do_cheers=false 277 | local cheers_msg='' 278 | # check whether exit code of last command was 0 279 | if $CHEERS_ENABLED && [ "$yazpt_state[exit_code]" -eq 0 ] ; then 280 | # check whether $LAST_COMMAND contained any of the APP_CHEERS_PATTERNS 281 | for pattern in "${APP_CHEERS_PATTERNS[@]}"; do 282 | if [[ "$LAST_COMMAND" == *"$pattern"* ]]; then 283 | do_cheers=true 284 | break 285 | fi 286 | done 287 | fi 288 | if $do_cheers; then 289 | cheers_msg=' 🍻🎉🍻 ' 290 | cheers_msg+="$(compliment)" 291 | cheers_msg+=$'\n' 292 | if [[ $OSTYPE == 'darwin'* ]]; then 293 | # call fireworks if $ITERM2_INTEGRATION_DETECTED is true 294 | if $ITERM2_INTEGRATION_DETECTED; then 295 | $HOME/.iterm2/it2attention fireworks 296 | fi 297 | fi 298 | fi 299 | yazpt_state[cheers]=$cheers_msg 300 | } 301 | 302 | function configure_yazpt { 303 | YAZPT_LAYOUT=$PROMPT_LAYOUT 304 | YAZPT_CWD_COLOR=6 # cyan 305 | YAZPT_EXECTIME_MIN_SECONDS=1 306 | } 307 | 308 | zinit ice wait'!0' atload'source "$yazpt_default_preset_file"; \ 309 | configure_yazpt;yazpt_precmd' nocd lucid 310 | zinit light jakshin/yazpt 311 | 312 | # install git-extras via zinit instead of brew 313 | zinit lucid wait'0a' for \ 314 | as"program" pick"$ZPFX/bin/git-*" src"etc/git-extras-completion.zsh" make"PREFIX=$ZPFX" tj/git-extras 315 | 316 | 317 | # install direnv via zinit instead of brew 318 | zinit from"gh-r" as"program" mv"direnv* -> direnv" \ 319 | atclone'./direnv hook zsh > zhook.zsh' atpull'%atclone' \ 320 | pick"direnv" src="zhook.zsh" for \ 321 | direnv/direnv 322 | 323 | # zinit light zdharma-continuum/zui 324 | # zinit light zdharma-continuum/zbrowse # use '^B' to open zbrowse 325 | # zinit wait lucid for zdharma-continuum/zinit-console 326 | 327 | zinit snippet OMZ::lib/key-bindings.zsh 328 | 329 | zinit light MichaelAquilina/zsh-you-should-use 330 | 331 | # install brew's completions except for git 332 | zinit id-as='brew-completions' wait as='completion' lucid \ 333 | atclone='print Installing Brew completions...; \ 334 | rm -rf $ZPFX/brew_comps_others 2>/dev/null; \ 335 | mkdir -p $ZPFX/brew_comps_others; \ 336 | rm -rf $ZPFX/brew_comps_zsh 2>/dev/null; \ 337 | mkdir -p $ZPFX/brew_comps_zsh; \ 338 | command cp -f $(brew --prefix)/share/zsh/site-functions/^_* $ZPFX/brew_comps_others; \ 339 | command cp -f $(brew --prefix)/share/zsh/site-functions/_* $ZPFX/brew_comps_zsh; \ 340 | command rm $ZPFX/brew_comps_zsh/_git; \ 341 | zinit creinstall -q $ZPFX/brew_comps_zsh; \ 342 | zinit cclear; \ 343 | enable-fzf-tab' \ 344 | atload='fpath=( ${(u)fpath[@]:#$(brew --prefix)/share/zsh/site-functions/*} ); \ 345 | fpath+=( $ZPFX/brew_comps_others )' \ 346 | atpull='%atclone' nocompile run-atpull for \ 347 | zdharma-continuum/null 348 | 349 | zinit id-as='system-completions' wait as='completion' lucid \ 350 | atclone='print Installing system completions...; \ 351 | mkdir -p $ZPFX/zsh_comps; \ 352 | command cp -f $(brew --prefix)/share/zsh/functions/^_* $ZPFX/zsh_comps; \ 353 | zinit creinstall -q $(brew --prefix)/share/zsh/functions; \ 354 | zinit cclear; \ 355 | enable-fzf-tab' \ 356 | atload='fpath=( ${(u)fpath[@]:#$(brew --prefix)/share/zsh/functions/*} ); \ 357 | fpath+=( $ZPFX/zsh_comps )' \ 358 | atpull="%atclone" nocompile run-atpull for \ 359 | zdharma-continuum/null 360 | 361 | zinit id-as='fn-completions' wait as='completion' lucid \ 362 | atclone='print Installing FN completions...; \ 363 | zinit creinstall -q $HOME/.completions; \ 364 | zinit cclear; \ 365 | enable-fzf-tab' \ 366 | atload='fpath=( ${(u)fpath[@]:#$HOME/.completions/*} )' \ 367 | atpull="%atclone" nocompile run-atpull for \ 368 | zdharma-continuum/null 369 | 370 | 371 | zinit ice wait as'completion' lucid 372 | zinit snippet https://github.com/sainnhe/zsh-completions/blob/master/src/custom/_fzf 373 | 374 | #zinit ice wait'0' lucid 375 | #zinit light sainnhe/zsh-completions 376 | 377 | zinit ice wait blockf atpull'zinit creinstall -q .' lucid 378 | zinit light zsh-users/zsh-completions 379 | 380 | zvm_config() { 381 | # always identify as xterm-256color to zsh-vi-mode plugin 382 | ZVM_TERM=xterm-256color 383 | ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BEAM 384 | ZVM_NORMAL_MODE_CURSOR=$ZVM_CURSOR_BLOCK 385 | ZVM_OPPEND_MODE_CURSOR=$ZVM_CURSOR_UNDERLINE 386 | } 387 | 388 | # See - https://github.com/jeffreytse/zsh-vi-mode#execute-extra-commands 389 | zvm_after_init() { 390 | zicompinit 391 | 392 | [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh 393 | 394 | # zoxide 395 | zinit wait lucid atinit'eval "$(zoxide init zsh --cmd cd)"' nocd for /dev/null 396 | 397 | zicdreplay 398 | 399 | # fzf-tab needs to be loaded after compinit, but before fast-syntax-highlighting 400 | zinit light Aloxaf/fzf-tab 401 | # use tmux popups in case we are in tmux 402 | if [ -n "$TMUX" ]; then 403 | zstyle ':fzf-tab:*' fzf-command ftb-tmux-popup 404 | fi 405 | 406 | ### NOTE: In order to generate previews, context is needed. The trick to find the context is to type the commmand to the point where completion is needed and press "C-x h". You will need to call "enable-fzf-tab" after this to reenable fzf-tab. 407 | 408 | # preview git -- these don't work with homebrew completions so we make a copy of zsh's version at ~/.completions/_git 409 | # zsh version - https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_git 410 | zstyle ':fzf-tab:complete:git-(add|diff|restore):*' fzf-preview \ 411 | 'git diff $word | delta' 412 | zstyle ':fzf-tab:complete:git-(add|diff|restore):*' fzf-flags --preview-window=right:70%:wrap 413 | zstyle ':fzf-tab:complete:git-(add|diff|restore):*' popup-pad 50 50 414 | 415 | zstyle ':fzf-tab:complete:git-log:*' fzf-preview \ 416 | 'git log --color=always $word' 417 | zstyle ':fzf-tab:complete:git-log:*' fzf-flags --preview-window=right:70%:wrap 418 | zstyle ':fzf-tab:complete:git-log:*' popup-pad 50 50 419 | 420 | zstyle ':fzf-tab:complete:git-help:*' fzf-preview \ 421 | 'git help $word | bat -plman --color=always' 422 | zstyle ':fzf-tab:complete::*' fzf-flags --preview-window=right:70%:wrap 423 | zstyle ':fzf-tab:complete::*' popup-pad 50 50 424 | 425 | zstyle ':fzf-tab:complete:git-show:*' fzf-preview \ 426 | 'case "$group" in 427 | "commit tag") git show --color=always $word ;; 428 | *) git show --color=always $word | delta ;; 429 | esac' 430 | zstyle ':fzf-tab:complete:git-show:*' fzf-flags --preview-window=right:70%:wrap 431 | zstyle ':fzf-tab:complete:git-show:*' popup-pad 50 50 432 | 433 | zstyle ':fzf-tab:complete:git-checkout:*' fzf-preview \ 434 | 'case "$group" in 435 | "modified file") git diff $word | delta ;; 436 | "recent commit object name") git show --color=always $word | delta ;; 437 | *) git log --color=always $word ;; 438 | esac' 439 | zstyle ':fzf-tab:complete:git-checkout:*' fzf-flags --preview-window=right:70%:wrap 440 | zstyle ':fzf-tab:complete:git-checkout:*' popup-pad 50 50 441 | 442 | # ignore some patterns 443 | zstyle ':completion::complete:*:*:files' ignored-patterns '.DS_Store' 'Icon?' 444 | zstyle ':completion::complete:*:*:globbed-files' ignored-patterns '.DS_Store' 'Icon?' 445 | zstyle ':completion::complete:rm:*:globbed-files' ignored-patterns 446 | 447 | # disable sort when completing `git checkout` 448 | zstyle ':completion:*:git-checkout:*' sort false 449 | # set descriptions format to enable group support 450 | zstyle ':completion:*:descriptions' format '[%d]' 451 | # set list-colors to enable filename colorizing 452 | zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} 453 | # switch group using `,` and `.` 454 | zstyle ':fzf-tab:*' switch-group 'F1' 'F2' 455 | # give a preview of commandline arguments when completing `kill` 456 | zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w" 457 | zstyle ':fzf-tab:complete:(kill|ps):argument-rest' fzf-preview \ 458 | '[[ $group == "[process ID]" ]] && ps --pid=$word -o cmd --no-headers -w -w' 459 | zstyle ':fzf-tab:complete:(kill|ps):argument-rest' fzf-flags --preview-window=down:3:wrap 460 | zstyle ':fzf-tab:complete:(kill|ps):*' popup-pad 0 3 461 | 462 | # preview environment variables 463 | zstyle ':fzf-tab:complete:(-parameter-|-brace-parameter-|export|unset|expand):*' \ 464 | fzf-preview 'echo ${(P)word}' 465 | zstyle ':fzf-tab:complete:(-parameter-|-brace-parameter-|export|unset|expand):*' popup-pad 0 1 466 | zstyle ':fzf-tab:complete:(-parameter-|-brace-parameter-|export|unset|expand):*' fzf-flags --preview-window=down:1:wrap 467 | 468 | # use eza for previewing commands that work at directory/path level 469 | zstyle ':fzf-tab:complete:(cd|eza|ls|fd|find|cp|mv|rm):argument-rest' fzf-preview 'eza --git -a -1 --color=always --icons $realpath' 470 | zstyle ':fzf-tab:complete:(cd|eza|ls|fd|find|cp|mv|rm):argument-rest' fzf-flags --preview-window=right:70%:wrap 471 | zstyle ':fzf-tab:complete:(cd|eza|ls|fd|find|cp|mv|rm):argument-rest' popup-pad 50 50 472 | 473 | # use lessfilter to preview content files, directories etc. 474 | zstyle ':fzf-tab:complete:(cat|bat|vim|nvim|vimr|nvim-qt):argument-rest' fzf-preview 'LESSOPEN="|~/sw/assets/lessfilter %s" less ${(Q)realpath}' 475 | zstyle ':fzf-tab:complete:(cat|bat|vim|nvim|vimr|nvim-qt):argument-rest' fzf-flags --preview-window=right:70%:wrap 476 | zstyle ':fzf-tab:complete:(cat|bat|vim|nvim|vimr|nvim-qt):argument-rest' popup-pad 50 50 477 | 478 | if [[ $OSTYPE == 'linux'* ]]; then 479 | zstyle ':fzf-tab:complete:systemctl-*:*' fzf-preview 'SYSTEMD_COLORS=1 systemctl status $word' 480 | zstyle ':fzf-tab:complete:systemctl-*:*' popup-pad 50 50 481 | fi 482 | 483 | zstyle ':fzf-tab:complete:tldr:argument-1' fzf-preview 'tldr --color always $word' 484 | zstyle ':fzf-tab:complete:tldr:argument-1' fzf-flags --preview-window=right:70%:wrap 485 | zstyle ':fzf-tab:complete:tldr:argument-1' popup-pad 50 50 486 | 487 | zstyle ':fzf-tab:complete:man:' fzf-preview 'batman --color=always $word' 488 | zstyle ':fzf-tab:complete:man:' fzf-flags --preview-window=right:70%:wrap 489 | zstyle ':fzf-tab:complete:man:' popup-pad 50 50 490 | 491 | zstyle ':fzf-tab:complete:-command-:*' fzf-preview \ 492 | '(out=$(tldr --color always "$word") 2>/dev/null && echo $out) || (out=$(batman --color=always "$word") 2>/dev/null && echo $out) || (out=$(source ~/.zprofile && which "$word") && echo $out) || echo "${(P)word}"' 493 | zstyle ':fzf-tab:complete:-command-:*' fzf-flags --preview-window=right:70%:wrap 494 | zstyle ':fzf-tab:complete:-command-:*' popup-pad 50 50 495 | 496 | 497 | zstyle ':fzf-tab:complete:brew-(install|uninstall|search|info):*-argument-rest' fzf-preview 'brew info $word' 498 | zstyle ':fzf-tab:complete:brew-(install|uninstall|search|info):*-argument-rest' fzf-flags --preview-window=right:70%:wrap 499 | zstyle ':fzf-tab:complete:brew-(install|uninstall|search|info):*-argument-rest' popup-pad 50 50 500 | 501 | # these should be the last zinit plugins 502 | FAST_WORK_DIR=~/.config/fsh 503 | zinit wait lucid light-mode for \ 504 | zdharma-continuum/fast-syntax-highlighting \ 505 | atload"_zsh_autosuggest_start" \ 506 | zsh-users/zsh-autosuggestions 507 | } # end zvm_after_init 508 | 509 | zinit ice depth=1 510 | zinit light jeffreytse/zsh-vi-mode 511 | 512 | # Set LANGTOOL env to empty values 513 | export LANGTOOL_USERNAME="" 514 | export LANGTOOL_API_KEY="" 515 | export LANGTOOL_HTTP_URI="" 516 | 517 | # FluxNinja Aperture Tilt Env Vars 518 | export TILT_APERTURE_SSH_KEY_PUB=$HOME/.ssh/id_ed25519.pub 519 | export TILT_GRAFANA_REPO=$HOME/Work/fluxninja/grafana 520 | 521 | if [[ $OSTYPE == 'linux'* ]]; then 522 | export QT_QPA_FONTDIR=~/.local/share/fonts 523 | fi 524 | 525 | # source .zshrc_local if it exists 526 | if [ -f ~/.zshrc_local ]; then 527 | source ~/.zshrc_local 528 | fi 529 | 530 | if [ -z "$CHEERS_ENABLED" ]; then 531 | CHEERS_ENABLED=true 532 | fi 533 | 534 | if [ -z "$INSULTS_ENABLED" ]; then 535 | INSULTS_ENABLED=true 536 | fi 537 | 538 | if [ -z "$INSULTS_OFFENSIVE_ENABLED" ]; then 539 | INSULTS_OFFENSIVE_ENABLED=false 540 | fi 541 | 542 | if $INSULTS_ENABLED; then 543 | source $HOME/sw/assets/insults.zsh 544 | fi 545 | 546 | if [ -z "$CNF_TF_ENABLED" ]; then 547 | CNF_TF_ENABLED=true 548 | fi 549 | 550 | if $CNF_TF_ENABLED; then 551 | source $HOME/sw/assets/zsh_cnf.zsh 552 | fi 553 | 554 | if [ -z "$ASCII_WELCOME_ENABLED" ]; then 555 | ASCII_WELCOME_ENABLED=true 556 | fi 557 | 558 | if [ -z "$ASCII_WELCOME_SNOOZE" ]; then 559 | ASCII_WELCOME_SNOOZE=43200 560 | fi 561 | 562 | if [ -z "$AUTO_CLEAR_CACHES" ]; then 563 | AUTO_CLEAR_CACHES=true 564 | fi 565 | 566 | if [ -z "$AUTO_CLEAR_CACHES_SECONDS" ]; then 567 | AUTO_CLEAR_CACHES_SECONDS=7890000 568 | fi 569 | 570 | if $AUTO_CLEAR_CACHES; then 571 | if [ -f "$HOME/.auto_clear_caches" ]; then 572 | if [ "$(($(date +%s) - $(cat $HOME/.auto_clear_caches)))" -lt "$AUTO_CLEAR_CACHES_SECONDS" ]; then 573 | AUTO_CLEAR_CACHES=false 574 | else 575 | echo $(date +%s) > $HOME/.auto_clear_caches 576 | fi 577 | else 578 | echo $(date +%s) > $HOME/.auto_clear_caches 579 | fi 580 | fi 581 | 582 | if $AUTO_CLEAR_CACHES; then 583 | # ask the user if they want to clear go installation as it bloats over time 584 | printf "Go installation grows over time and it's recommended to clear it periodically.\n" 585 | if gum confirm "Do you want to clear the go installation?"; then 586 | echo "Clearing go installation..." 587 | sudo rm -rf $HOME/go 588 | echo "Go installation cleared." 589 | echo "Sync FluxNinja repos..." 590 | $HOME/sw/bin/sync_fluxninja.sh 591 | fi 592 | if gum confirm "Do you want to prune docker builder cache?"; then 593 | echo "Pruning docker builder cache..." 594 | docker builder prune -f -a 595 | echo "Docker builder cache pruned." 596 | echo "Pruning docker system..." 597 | docker system prune -f -a 598 | echo "Docker system pruned." 599 | fi 600 | fi 601 | 602 | # check timestamp when welcome was last displayed and if it's less than ASCII_WELCOME_SNOOZE then disable ascii art. Also update the timestamp if ascii art is going to be displayed. 603 | if $ASCII_WELCOME_ENABLED; then 604 | if [ -f "$HOME/.ascii_welcome_last_displayed" ]; then 605 | if [ "$(($(date +%s) - $(cat $HOME/.ascii_welcome_last_displayed)))" -lt "$ASCII_WELCOME_SNOOZE" ]; then 606 | ASCII_WELCOME_ENABLED=false 607 | else 608 | echo $(date +%s) > $HOME/.ascii_welcome_last_displayed 609 | fi 610 | else 611 | echo $(date +%s) > $HOME/.ascii_welcome_last_displayed 612 | fi 613 | fi 614 | 615 | # check whether ascii art is enabled 616 | if $ASCII_WELCOME_ENABLED; then 617 | # print a random cowsay using fortune using only *.cow files located at $(brew --prefix)/share/cows 618 | fortune | cowsay -f $(find $(brew --prefix)/share/cowsay/cows/ -name "*.cow" | shuf -n 1) 619 | (timeout 2 WTTR_PARAMS="1" ~/sw/bin/wttr.sh ;\ 620 | echo; echo -e "${CYAN_BRIGHT} ==================================  GitHub Status ================================== ${RESET}"; echo; 621 | timeout 2 gh status --org coderabbitai) 2&>/dev/null 622 | fi 623 | 624 | unset ASCII_WELCOME_ENABLED 625 | unset ASCII_WELCOME_SNOOZE 626 | unset CNF_TF_ENABLED 627 | 628 | # run $HOME/sw/bin/autoupdate.zsh by eval it's content 629 | eval "$(cat $HOME/sw/bin/autoupdate.zsh)" 630 | 631 | source $HOME/.aliases 632 | 633 | if [[ $TERM == *"tmux"* || $TERM == *"screen"* || -n $TMUX ]]; then 634 | echo -e "${YELLOW_BRIGHT} Welcome to ${CYAN_BRIGHT}tmux${RESET}" 635 | echo -e "${YELLOW_BRIGHT} Press ${CYAN_BRIGHT}${YELLOW_BRIGHT} for fuzzy menu - look for additional commands under ${CYAN_BRIGHT}menu${YELLOW_BRIGHT} selection${RESET}" 636 | echo -e "${YELLOW_BRIGHT} Press ${CYAN_BRIGHT}F12${YELLOW_BRIGHT} for tmux menu${RESET}" 637 | else 638 | sessions=$(tmux list-sessions 2&> /dev/null | cut -d ":" -f1) 639 | # check whether $sessions is not empty 640 | if [ -n "$sessions" ]; then 641 | echo -e "\n${BOLD}${CYAN_BRIGHT} == Active tmux Sessions ==${RESET}"; 642 | for i in $sessions ; do 643 | echo -e "${BOLD}${YELLOW_BRIGHT} [*] $i" 644 | done; 645 | fi 646 | echo -e "${CYAN_BRIGHT} == Run tms to create and select tmux sessions == ${RESET}" 647 | echo -e "${RESET}" 648 | fi 649 | 650 | echo -e "${YELLOW_BRIGHT} Press ${CYAN_BRIGHT}${YELLOW_BRIGHT} to invoke auto-complete menu for commands, arguments and options${RESET}" 651 | echo 652 | 653 | # override terminal profile colors using escape codes 654 | if $SET_TERMINAL_COLORS; then 655 | $HOME/sw/assets/set_colors.zsh 656 | fi 657 | -------------------------------------------------------------------------------- /notes/dot_vale.ini: -------------------------------------------------------------------------------- 1 | StylesPath = ./styles 2 | 3 | # MinAlertLevel = suggestion 4 | 5 | Packages = RedHat, proselint 6 | Vocab = FluxNinja 7 | 8 | IgnoredScopes = dt, code, tt, codeblock, a 9 | 10 | [*.md] 11 | BasedOnStyles = Vale, RedHat, proselint 12 | 13 | # TokenIgnores explicit anchors e.g. {#anchor} 14 | TokenIgnores = \{#[^}]+\} 15 | 16 | [formats] 17 | mdx = md 18 | -------------------------------------------------------------------------------- /notes/styles/Vocab/symlink_FluxNinja: -------------------------------------------------------------------------------- 1 | /Users/gillh/Work/fluxninja/aperture/.github/styles/Vocab/FluxNinja 2 | -------------------------------------------------------------------------------- /sw/assets/apple_gruvbox.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderabbitai/dotfiles/edbc8ca0a88d14f2a4f134eb3baf2d61917a143b/sw/assets/apple_gruvbox.heic -------------------------------------------------------------------------------- /sw/assets/base16-gruvbox-dark-medium.config: -------------------------------------------------------------------------------- 1 | # Base16 Gruvbox dark, medium 2 | # Author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox) 3 | 4 | _gen_fzf_default_opts() { 5 | 6 | local color00='#282828' 7 | local color01='#3c3836' 8 | local color02='#504945' 9 | local color03='#665c54' 10 | local color04='#bdae93' 11 | local color05='#d5c4a1' 12 | local color06='#ebdbb2' 13 | local color07='#fbf1c7' 14 | local color08='#fb4934' 15 | local color09='#fe8019' 16 | local color0A='#fabd2f' 17 | local color0B='#b8bb26' 18 | local color0C='#8ec07c' 19 | local color0D='#83a598' 20 | local color0E='#d3869b' 21 | local color0F='#d65d0e' 22 | 23 | export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS"\ 24 | " --color=bg+:$color01,bg:$color00,spinner:$color0C,hl:$color0D"\ 25 | " --color=fg:$color04,header:$color0D,info:$color0A,pointer:$color0C"\ 26 | " --color=marker:$color0C,fg+:$color06,prompt:$color0A,hl+:$color0D" 27 | 28 | } 29 | 30 | _gen_fzf_default_opts 31 | -------------------------------------------------------------------------------- /sw/assets/executable_dot_session_preview: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # assign argument of function to variable TOKEN 4 | TOKEN="$1" 5 | # if TOKEN is contains "New Session", return 6 | if [[ "$TOKEN" == "New Session" ]]; then 7 | echo "Start a new tmux session" 8 | exit 9 | fi 10 | # extract session name from token 11 | SESSION_NAME="$(echo "$TOKEN" | cut -d' ' -f1)" 12 | # if SESSION_NAME is empty, return 13 | if [[ -z "$SESSION_NAME" ]]; then 14 | echo "Invalid session name" 15 | exit 16 | fi 17 | # return tmux capture-pane results 18 | tmux capture-pane -ep -t "$SESSION_NAME" 19 | -------------------------------------------------------------------------------- /sw/assets/executable_dotfiles-edit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # shell script to open dotfiles editor in nvim 4 | 5 | # the script takes an argument which can be either empty or "personal" 6 | # if the argument is empty, it will open the global dotfiles 7 | # if the argument is "personal", it will open the personal dotfiles 8 | cd $HOME 9 | 10 | if [ "$1" = "personal" ]; then 11 | nvim -p .gitconfig_local .vimrc_local .vimrc_plugins .autoupdate_local.zsh .tmux.conf_local .brew_local 12 | else 13 | nvim -p .vimrc .config/nvim/init.vim .config/nvim/coc-settings.json .zshrc .gitconfig .gitignore .zprofile .tmux.conf .tmux.conf.settings ~/sw/bin/autoupdate.zsh ~/sw/bin/sync_brews.sh 14 | fi 15 | -------------------------------------------------------------------------------- /sw/assets/executable_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # installer for dotfiles 4 | function brew_shellenv() { 5 | if [ -d "$HOME/homebrew" ]; then 6 | eval "$("$HOME"/homebrew/bin/brew shellenv)" 7 | else 8 | if [[ $OSTYPE == 'darwin'* ]]; then 9 | test -d /opt/homebrew && eval "$(/opt/homebrew/bin/brew shellenv)" 10 | test -f /usr/local/bin/brew && eval "$(/usr/local/bin/brew shellenv)" 11 | else 12 | test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" 13 | fi 14 | fi 15 | } 16 | 17 | cd "$HOME" || exit 18 | 19 | # ask the user whether they want to use system's homebrew or use a local install 20 | echo "Do you want to use the system's homebrew? (recommended) [Y/n]" 21 | read -r answer 22 | if [ "$answer" = "n" ]; then 23 | echo "Installing local homebrew..." 24 | mkdir homebrew 25 | curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew 26 | else 27 | # delete local homebrew if it exists 28 | rm -rf ~/homebrew 29 | echo "Installing system homebrew..." 30 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 31 | fi 32 | 33 | brew_shellenv 34 | 35 | # install github cli 36 | brew install gh 37 | # install chezmoi 38 | brew install chezmoi 39 | # install zsh 40 | brew install zsh 41 | # install gum 42 | brew install gum 43 | # add $(which zsh) to the list of shells if it doesn't exist 44 | if ! grep -q $(which zsh) /etc/shells; then 45 | echo "Adding $(which zsh) to /etc/shells" 46 | sudo sh -c "echo $(which zsh) >> /etc/shells" 47 | fi 48 | chsh -s $(which zsh) 49 | 50 | echo "Authenticating with GitHub. Please make sure to choose ssh option for authentication." 51 | 52 | # authenticate with github 53 | gh auth login -p ssh 54 | 55 | # check if $HOME/.git exists and back it up if it does 56 | if [ -d "$HOME"/.git ]; then 57 | echo "Backing up $HOME/.git to $HOME/.git.bak" 58 | mv "$HOME"/.git "$HOME"/.git.bak 59 | fi 60 | 61 | echo "Setting up .gitconfig_local" 62 | # ask the user to input email address 63 | email=$(gum input --placeholder "Please enter your CodeRabbit email address") 64 | 65 | # ask the user to input their name 66 | name=$(gum input --placeholder "Please enter your name") 67 | 68 | # create .gitconfig_local 69 | # File contents: 70 | # [user] 71 | # name = $name 72 | # email = $email 73 | echo "[user]" >"$HOME"/.gitconfig_local 74 | echo " name = $name" >>"$HOME"/.gitconfig_local 75 | echo " email = $email" >>"$HOME"/.gitconfig_local 76 | 77 | chezmoi init git@github.com:coderabbitai/dotfiles.git 78 | chezmoi apply -v 79 | 80 | # run autoupdate script 81 | echo "Running autoupdate script..." 82 | ~/sw/bin/autoupdate.zsh --force 83 | # if autoupdate failed, exit 84 | if [ $? -ne 0 ]; then 85 | echo "Failed to run autoupdate script" 86 | exit 1 87 | fi 88 | 89 | # reboot computer 90 | echo "Restarting computer..." 91 | sudo reboot 92 | -------------------------------------------------------------------------------- /sw/assets/executable_install_gruvbox.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ====================CONFIG THIS =============================== # 4 | export COLOR_01="#282828" # HOST 5 | export COLOR_02="#cc241d" # SYNTAX_STRING 6 | export COLOR_03="#98971a" # COMMAND 7 | export COLOR_04="#d79921" # COMMAND_COLOR2 8 | export COLOR_05="#458588" # PATH 9 | export COLOR_06="#b16286" # SYNTAX_VAR 10 | export COLOR_07="#689d6a" # PROMP 11 | export COLOR_08="#a89984" # 12 | 13 | export COLOR_09="#928374" # 14 | export COLOR_10="#fb4934" # COMMAND_ERROR 15 | export COLOR_11="#b8bb26" # EXEC 16 | export COLOR_12="#fabd2f" # 17 | export COLOR_13="#83a598" # FOLDER 18 | export COLOR_14="#d3869b" # 19 | export COLOR_15="#8ec07c" # 20 | export COLOR_16="#ebdbb2" # 21 | 22 | export BACKGROUND_COLOR="#282828" # Background Color 23 | export FOREGROUND_COLOR="#ebdbb2" # Text 24 | export CURSOR_COLOR="$FOREGROUND_COLOR" # Cursor 25 | export PROFILE_NAME="Gruvbox Dark" 26 | # =============================================================== # 27 | 28 | # =============================================================== # 29 | # | Apply Colors 30 | # ===============================================================|# 31 | SCRIPT_PATH="${SCRIPT_PATH:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}" 32 | PARENT_PATH="$(dirname "${SCRIPT_PATH}")" 33 | 34 | # Allow developer to change url to forked url for easier testing 35 | # IMPORTANT: Make sure you export this variable if your main shell is not bash 36 | BASE_URL=${BASE_URL:-"https://raw.githubusercontent.com/Gogh-Co/Gogh/master"} 37 | 38 | if [[ -e "${PARENT_PATH}/apply-colors.sh" ]]; then 39 | bash "${PARENT_PATH}/apply-colors.sh" 40 | else 41 | if [[ "$(uname)" = "Darwin" ]]; then 42 | # OSX ships with curl and ancient bash 43 | bash -c "$(curl -so- "${BASE_URL}/apply-colors.sh")" 44 | else 45 | # Linux ships with wget 46 | bash -c "$(wget -qO- "${BASE_URL}/apply-colors.sh")" 47 | fi 48 | fi 49 | -------------------------------------------------------------------------------- /sw/assets/executable_iterm2_default.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import iterm2 4 | 5 | async def main(connection): 6 | app = await iterm2.async_get_app(connection) 7 | all_profiles = await iterm2.PartialProfile.async_query(connection) 8 | for profile in all_profiles: 9 | if profile.name == "GruvboxDark": 10 | await profile.async_make_default() 11 | # set current profile 12 | full = await profile.async_get_full_profile() 13 | await app.current_terminal_window.current_tab.current_session.async_set_profile(full) 14 | return 15 | 16 | iterm2.run_until_complete(main) 17 | -------------------------------------------------------------------------------- /sw/assets/executable_lessfilter: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # this is a example of .lessfilter, you can change it 3 | mime=$(file -bL --mime-type "$1") 4 | category=${mime%%/*} 5 | kind=${mime##*/} 6 | if [ -d "$1" ]; then 7 | eza --git -a -1 --color=always --icons "$1" 8 | elif [ "$category" = image ]; then 9 | chafa "$1" 10 | exiftool "$1" 11 | elif [ "$kind" = vnd.openxmlformats-officedocument.spreadsheetml.sheet ] || 12 | [ "$kind" = vnd.ms-excel ]; then 13 | in2csv "$1" | xsv table | bat -ltsv --color=always 14 | elif [ "$category" = text ]; then 15 | bat --color=always "$1" 16 | else 17 | lesspipe.sh "$1" | bat --color=always 18 | fi 19 | # lesspipe.sh don't use eza, bat and chafa, it use ls and exiftool. so we create a lessfilter. 20 | -------------------------------------------------------------------------------- /sw/assets/executable_set_colors.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Inspired by https://github.com/m-ou-se/config/blob/master/shellrc. 4 | 5 | # Set a color in the terminal palette. 6 | # \param 1 The index in the pallete. 7 | # \param 2 is a hexadecimal RGB color code. 8 | function set_color { 9 | if [ "$TERM" = "linux" ]; then 10 | [ $1 -lt 16 ] && printf $'\e]P%X%s' "$1" "$2" 11 | else 12 | printf $'\e]4;%s;#%s\e\\' "$1" "$2" 13 | fi 14 | } 15 | 16 | local black=353535 17 | local white=efe1bf 18 | 19 | # Set default foreground / background colors for terminals that support it. 20 | printf "\e]10;#$white" 21 | printf "\e]11;#$black" 22 | 23 | # Set terminal colors. 24 | set_color 0 $black # black 25 | set_color 1 d73925 # red 26 | set_color 2 a8a521 # green 27 | set_color 3 dfa82a # yellow 28 | set_color 4 549699 # blue 29 | set_color 5 bf7897 # magenta 30 | set_color 6 79aa7d # cyan 31 | set_color 7 b7a996 # white 32 | set_color 8 a39586 # bright black 33 | set_color 9 fe6142 # bright red 34 | set_color 10 c4c431 # bright green 35 | set_color 11 fcc73c # bright yellow 36 | set_color 12 94b3a8 # bright blue 37 | set_color 13 dc9aab # bright magenta 38 | set_color 14 9dc98e # bright cyan 39 | set_color 15 fffefe # bright white 40 | # Set colors for 256 41 | set_color 17 076678 # dark blue 42 | set_color 22 79740e # dark green 43 | set_color 52 9d0006 # dark red 44 | set_color 53 8f3f71 # dark magenta 45 | -------------------------------------------------------------------------------- /sw/assets/executable_utils.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | RESET="\e[0m" 4 | BOLD="\e[1m" 5 | 6 | BLACK="\e[30m" 7 | RED="\e[31m" 8 | GREEN="\e[32m" 9 | YELLOW="\e[33m" 10 | BLUE="\e[34m" 11 | MAGENTA="\e[35m" 12 | CYAN="\e[36m" 13 | WHITE="\e[37m" 14 | 15 | BLACK_BRIGHT="\e[90m" 16 | RED_BRIGHT="\e[91m" 17 | GREEN_BRIGHT="\e[92m" 18 | YELLOW_BRIGHT="\e[93m" 19 | BLUE_BRIGHT="\e[94m" 20 | MAGENTA_BRIGHT="\e[95m" 21 | CYAN_BRIGHT="\e[96m" 22 | WHITE_BRIGHT="\e[97m" 23 | 24 | function silent_background() { 25 | set +m && { "$@" 2>&3 & disown; pid=$!; } 3>&2 2>/dev/null && set -m 26 | } 27 | 28 | function zsh_stats() { 29 | echo -e "${CYAN_BRIGHT} == Zsh history statistics == ${RESET}" 30 | HISTFILE=~/.zsh_history fc -R 31 | fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " "\033[33m"CMD[a]/count*100 "% " "\033[36m"a"\033[0m";}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n25 32 | } 33 | 34 | # This script was automatically generated by the broot program 35 | # More information can be found in https://github.com/Canop/broot 36 | # This function starts broot and executes the command 37 | # it produces, if any. 38 | # It's needed because some shell commands, like `cd`, 39 | # have no useful effect if executed in a subshell. 40 | function br { 41 | local cmd cmd_file code 42 | cmd_file=$(mktemp) 43 | if broot --outcmd "$cmd_file" "$@"; then 44 | cmd=$(<"$cmd_file") 45 | rm -f "$cmd_file" 46 | eval "$cmd" 47 | else 48 | code=$? 49 | rm -f "$cmd_file" 50 | return "$code" 51 | fi 52 | } 53 | 54 | # define a function to display bindings 55 | function tmux_bindings { 56 | tput sgr0 57 | echo -e "${BOLD}${RED}tmux bindings:${RESET}" 58 | local BINDINGS=( 59 | "${YELLOW} Local Sessions :${RESET} C-a or C-b (default tmux binding)" 60 | "${YELLOW} C-Space:${RESET} fuzzy menu" 61 | "${YELLOW} F12:${RESET} menu" 62 | "${YELLOW} C-l:${RESET} clear screen and tmux history" 63 | "${YELLOW} Nested Sessions (e.g. ssh) :${RESET} Repeat local , i.e. C-a C-a ... or C-b C-b ...${RESET}" 64 | "${YELLOW} F1:${RESET} suspend local tmux so as to work on remote tmux session. Only default bindings (C-b prefix) are suspended." 65 | "${YELLOW} d:${RESET} detaches current client" 66 | "${YELLOW} C-w or w:${RESET} select sessions or windows/panes" 67 | "${YELLOW} C-/:${RESET} fuzzy search scrollback buffer" 68 | "${YELLOW} C-c:${RESET} creates new session" 69 | "${YELLOW} C-s:${RESET} save environment" 70 | "${YELLOW} C-r:${RESET} restore environment" 71 | "${YELLOW} Tab:${RESET} last active window" 72 | "${YELLOW} C-h and C-l:${RESET} navigate windows" 73 | "${YELLOW} :${RESET} goto window by number" 74 | "${YELLOW} -:${RESET} split current pane vertically" 75 | "${YELLOW} _:${RESET} split current pane horizontally" 76 | "${YELLOW} Space:${RESET} cycle layouts" 77 | "${YELLOW} or :${RESET} navigate panes" 78 | "${YELLOW} :${RESET} resize panes" 79 | "${YELLOW} < or >:${RESET} swap left or right" 80 | "${YELLOW} +:${RESET} maximizes current pane to a new window" 81 | "${YELLOW} m:${RESET} toggles mouse on/off" 82 | "${YELLOW} P:${RESET} choose the paste-buffer to paste from" 83 | "${YELLOW} F:${RESET} launch Facebook PathPicker" 84 | "${YELLOW} u:${RESET} launch Fzf Url Picker" 85 | "${YELLOW} U:${RESET} launch Urlview" 86 | "${YELLOW} r:${RESET} reload config" 87 | "${YELLOW} /:${RESET} describe key binding for a key" 88 | "${YELLOW} ?:${RESET} show all bindings" 89 | "${YELLOW} == vi copy-mode == ${RESET}" 90 | "${YELLOW} Enter:${RESET} enter vi-style copy mode" 91 | "${YELLOW} v:${RESET} begin selection / visual mode" 92 | "${YELLOW} y:${RESET} copies the selection to the paste-buffer" 93 | "${YELLOW} C-v:${RESET} toggles between blockwise visual mode and visual mode") 94 | for i in "${BINDINGS[@]}"; do 95 | echo "$i" 96 | done 97 | tput sgr0 98 | } 99 | 100 | # source zinit and it's minimum setup to allow usage in win_split 101 | 102 | if [ -z "$ZINIT_TURBO" ]; then 103 | ZINIT_TURBO=true 104 | fi 105 | 106 | source $HOME/.local/share/zinit/zinit.git/zinit.zsh 107 | 108 | zinit light marzocchi/zsh-notify 109 | zstyle ':notify:*' error-icon "$HOME/sw/assets/lose.png" 110 | zstyle ':notify:*' error-title "wow such #fail" 111 | zstyle ':notify:*' success-icon "$HOME/sw/assets/win.png" 112 | zstyle ':notify:*' success-title "very #success. wow" 113 | # aggressively notify when commands complete as we use a whitelist 114 | zstyle ':notify:*' command-complete-timeout 1 115 | zstyle ':notify:*' always-check-active-window yes 116 | zstyle ':notify:*' enable-on-ssh yes 117 | zstyle ':notify:*' notifier term-notify 118 | zstyle ':notify:*' blacklist-regex 'vim|nvim|less|more|man|top|htop|btm|ssh' 119 | 120 | if [[ $OSTYPE == 'linux'* ]]; then 121 | # linux 122 | zstyle ':notify:*' app-name sh 123 | zstyle ':notify:*' expire-time 5000 124 | zstyle ':notify:*' error-sound "$HOME/sw/assets/lose.ogg" 125 | zstyle ':notify:*' success-sound "$HOME/sw/assets/win.ogg" 126 | fi 127 | 128 | if [[ $OSTYPE == 'darwin'* ]]; then 129 | zstyle ':notify:*' error-sound "Sonumi" 130 | zstyle ':notify:*' success-sound "Breeze" 131 | fi 132 | 133 | APP_ATTN_PATTERNS=( 134 | 'autoupdate.zsh' 135 | 'sync_brews.sh' 136 | 'sync_coderabbitai.sh' 137 | 'sync_fluxninja.sh' 138 | 'brew' 139 | 'git commit' 140 | 'make' 141 | 'go build' 142 | 'go test' 143 | 'gotestsum' 144 | 'git_ship' 145 | 'speedtest' 146 | 'pnpm' 147 | ) 148 | 149 | function term-notify() { 150 | local notification_type="$1" 151 | local cmd=$(<&0) 152 | local attention='none' 153 | # check whether last command contained any of the APP_ATTN_PATTERNS 154 | for pattern in "${APP_ATTN_PATTERNS[@]}"; do 155 | if [[ $cmd =~ $pattern ]]; then 156 | if [[ $notification_type == 'success' ]]; then 157 | attention='once' 158 | else 159 | attention='start' 160 | fi 161 | fi 162 | done 163 | 164 | # check whether $attention is not 'none' 165 | if [[ $attention != 'none' ]]; then 166 | if [[ $OSTYPE == 'darwin'* ]] && [[ "$TERM_PROGRAM" == 'iTerm.app' ]]; then 167 | if $ITERM2_INTEGRATION_DETECTED; then 168 | $HOME/.iterm2/it2attention $attention 169 | fi 170 | fi 171 | # ring the bell 172 | tput bel 173 | # pass-through 174 | zsh-notify $1 $2 <<<"$cmd" 175 | fi 176 | } 177 | 178 | # check if $ZINIT_TURBO is true 179 | if $ZINIT_TURBO; then 180 | zinit ice wait'0' lucid atload'export PATH="$PATH:$(dirname $FORGIT)"' 181 | zinit light wfxr/forgit 182 | else 183 | zinit light wfxr/forgit 184 | export PATH="$PATH:$(dirname $FORGIT)" 185 | fi 186 | 187 | if [[ $OSTYPE == 'linux'* ]]; then 188 | export FORGIT_COPY_CMD='xclip -selection clipboard' 189 | fi 190 | 191 | zinit snippet OMZ::lib/history.zsh 192 | -------------------------------------------------------------------------------- /sw/assets/fuzzymenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderabbitai/dotfiles/edbc8ca0a88d14f2a4f134eb3baf2d61917a143b/sw/assets/fuzzymenu.png -------------------------------------------------------------------------------- /sw/assets/iterm2_gruvbox.json: -------------------------------------------------------------------------------- 1 | { 2 | "Profiles": [ 3 | { 4 | "Right Option Key Sends": 0, 5 | "Tags": [], 6 | "Ansi 12 Color": { 7 | "Green Component": 0.6470588235294118, 8 | "Blue Component": 0.59607843137254901, 9 | "Red Component": 0.51372549019607838 10 | }, 11 | "Use Non-ASCII Font": false, 12 | "Draw Powerline Glyphs": true, 13 | "Bold Color": { 14 | "Red Component": 1, 15 | "Color Space": "sRGB", 16 | "Blue Component": 0.99999994039535522, 17 | "Alpha Component": 1, 18 | "Green Component": 0.99999994039535522 19 | }, 20 | "Ansi 0 Color": { 21 | "Green Component": 0.15686274509803921, 22 | "Blue Component": 0.15686274509803921, 23 | "Red Component": 0.15686274509803921 24 | }, 25 | "Normal Font": "FiraCodeNF-Reg 15", 26 | "Ansi 1 Color": { 27 | "Green Component": 0.14117647058823529, 28 | "Blue Component": 0.11372549019607843, 29 | "Red Component": 0.80000000000000004 30 | }, 31 | "Rows": 60, 32 | "Default Bookmark": "No", 33 | "Horizontal Spacing": 1, 34 | "Ansi 3 Color": { 35 | "Green Component": 0.59999999999999998, 36 | "Blue Component": 0.12941176470588237, 37 | "Red Component": 0.84313725490196079 38 | }, 39 | "Cursor Guide Color": { 40 | "Red Component": 0.70214027166366577, 41 | "Color Space": "sRGB", 42 | "Blue Component": 1, 43 | "Alpha Component": 0.25, 44 | "Green Component": 0.92681378126144409 45 | }, 46 | "Non-ASCII Anti Aliased": true, 47 | "Use Bright Bold": true, 48 | "Ansi 10 Color": { 49 | "Green Component": 0.73333333333333328, 50 | "Blue Component": 0.14901960784313725, 51 | "Red Component": 0.72156862745098038 52 | }, 53 | "Ambiguous Double Width": false, 54 | "Jobs to Ignore": ["rlogin", "ssh", "slogin", "telnet"], 55 | "Show Status Bar": false, 56 | "Ansi 15 Color": { 57 | "Red Component": 1, 58 | "Color Space": "sRGB", 59 | "Blue Component": 0.99999994039535522, 60 | "Alpha Component": 1, 61 | "Green Component": 0.99999994039535522 62 | }, 63 | "Foreground Color": { 64 | "Green Component": 0.85882352941176465, 65 | "Blue Component": 0.69803921568627447, 66 | "Red Component": 0.92156862745098034 67 | }, 68 | "Working Directory": "~", 69 | "Blinking Cursor": true, 70 | "Disable Window Resizing": true, 71 | "Sync Title": false, 72 | "Prompt Before Closing 2": false, 73 | "BM Growl": true, 74 | "Mouse Reporting": true, 75 | "Command": "", 76 | "Description": "Default", 77 | "Smart Cursor Color": false, 78 | "Screen": -1, 79 | "Selection Color": { 80 | "Red Component": 0.75743561983108521, 81 | "Color Space": "sRGB", 82 | "Blue Component": 1, 83 | "Alpha Component": 1, 84 | "Green Component": 0.86943882703781128 85 | }, 86 | "Columns": 125, 87 | "Idle Code": 0, 88 | "Ansi 13 Color": { 89 | "Green Component": 0.52549019607843139, 90 | "Blue Component": 0.60784313725490191, 91 | "Red Component": 0.82745098039215681 92 | }, 93 | "Custom Command": "No", 94 | "ASCII Anti Aliased": true, 95 | "Non Ascii Font": "Monaco 12", 96 | "Vertical Spacing": 1, 97 | "Use Bold Font": true, 98 | "Option Key Sends": 2, 99 | "Selected Text Color": { 100 | "Red Component": 0, 101 | "Color Space": "sRGB", 102 | "Blue Component": 0, 103 | "Alpha Component": 1, 104 | "Green Component": 0 105 | }, 106 | "Background Color": { 107 | "Green Component": 0.15686274509803921, 108 | "Blue Component": 0.15686274509803921, 109 | "Red Component": 0.15686274509803921 110 | }, 111 | "Character Encoding": 4, 112 | "Ansi 11 Color": { 113 | "Green Component": 0.74117647058823533, 114 | "Blue Component": 0.18431372549019609, 115 | "Red Component": 0.98039215686274506 116 | }, 117 | "Use Italic Font": true, 118 | "Unlimited Scrollback": true, 119 | "Keyboard Map": { 120 | "0xf712-0x40000": { 121 | "Action": 10, 122 | "Text": "[28;5~" 123 | }, 124 | "0xf70b-0x40000": { 125 | "Action": 10, 126 | "Text": "[19;5~" 127 | }, 128 | "0xf70d-0x20000": { 129 | "Action": 10, 130 | "Text": "[21;2~" 131 | }, 132 | "0xf706-0x40000": { 133 | "Action": 10, 134 | "Text": "[1;5R" 135 | }, 136 | "0xf708-0x20000": { 137 | "Action": 10, 138 | "Text": "[15;2~" 139 | }, 140 | "0x33-0x40000": { 141 | "Action": 11, 142 | "Text": "0x1b" 143 | }, 144 | "0xf703-0x260000": { 145 | "Action": 10, 146 | "Text": "[1;6C" 147 | }, 148 | "0xf729-0x20000": { 149 | "Action": 10, 150 | "Text": "[1;2H" 151 | }, 152 | "0xf70f-0x40000": { 153 | "Action": 10, 154 | "Text": "[24;5~" 155 | }, 156 | "0xf702-0x260000": { 157 | "Action": 10, 158 | "Text": "[1;6D" 159 | }, 160 | "0xf711-0x40000": { 161 | "Action": 10, 162 | "Text": "[26;5~" 163 | }, 164 | "0x38-0x40000": { 165 | "Action": 11, 166 | "Text": "0x7f" 167 | }, 168 | "0xf70a-0x40000": { 169 | "Action": 10, 170 | "Text": "[18;5~" 171 | }, 172 | "0xf72b-0x40000": { 173 | "Action": 10, 174 | "Text": "[1;5F" 175 | }, 176 | "0xf70c-0x20000": { 177 | "Action": 10, 178 | "Text": "[20;2~" 179 | }, 180 | "0xf705-0x40000": { 181 | "Action": 10, 182 | "Text": "[1;5Q" 183 | }, 184 | "0xf701-0x260000": { 185 | "Action": 10, 186 | "Text": "[1;6B" 187 | }, 188 | "0x32-0x40000": { 189 | "Action": 11, 190 | "Text": "0x00" 191 | }, 192 | "0xf707-0x20000": { 193 | "Action": 10, 194 | "Text": "[1;2S" 195 | }, 196 | "0xf703-0x240000": { 197 | "Action": 10, 198 | "Text": "[1;5C" 199 | }, 200 | "0xf700-0x260000": { 201 | "Action": 10, 202 | "Text": "[1;6A" 203 | }, 204 | "0xf702-0x240000": { 205 | "Action": 10, 206 | "Text": "[1;5D" 207 | }, 208 | "0x37-0x40000": { 209 | "Action": 11, 210 | "Text": "0x1f" 211 | }, 212 | "0xf70e-0x40000": { 213 | "Action": 10, 214 | "Text": "[23;5~" 215 | }, 216 | "0xf710-0x40000": { 217 | "Action": 10, 218 | "Text": "[25;5~" 219 | }, 220 | "0x3-0x200000": { 221 | "Action": 11, 222 | "Text": "0xd" 223 | }, 224 | "0xf709-0x40000": { 225 | "Action": 10, 226 | "Text": "[17;5~" 227 | }, 228 | "0xf701-0x240000": { 229 | "Action": 10, 230 | "Text": "[1;5B" 231 | }, 232 | "0xf70b-0x20000": { 233 | "Action": 10, 234 | "Text": "[19;2~" 235 | }, 236 | "0xf703-0x220000": { 237 | "Action": 10, 238 | "Text": "[1;2C" 239 | }, 240 | "0xf704-0x40000": { 241 | "Action": 10, 242 | "Text": "[1;5P" 243 | }, 244 | "0xf739-0x0": { 245 | "Action": 13, 246 | "Text": "" 247 | }, 248 | "0xf706-0x20000": { 249 | "Action": 10, 250 | "Text": "[1;2R" 251 | }, 252 | "0xf700-0x240000": { 253 | "Action": 10, 254 | "Text": "[1;5A" 255 | }, 256 | "0xf702-0x220000": { 257 | "Action": 10, 258 | "Text": "[1;2D" 259 | }, 260 | "0x36-0x40000": { 261 | "Action": 11, 262 | "Text": "0x1e" 263 | }, 264 | "0xf70d-0x40000": { 265 | "Action": 10, 266 | "Text": "[21;5~" 267 | }, 268 | "0xf70f-0x20000": { 269 | "Action": 10, 270 | "Text": "[24;2~" 271 | }, 272 | "0xf701-0x220000": { 273 | "Action": 10, 274 | "Text": "[1;2B" 275 | }, 276 | "0xf708-0x40000": { 277 | "Action": 10, 278 | "Text": "[15;5~" 279 | }, 280 | "0xf70a-0x20000": { 281 | "Action": 10, 282 | "Text": "[18;2~" 283 | }, 284 | "0xf729-0x40000": { 285 | "Action": 10, 286 | "Text": "[1;5H" 287 | }, 288 | "0xf72b-0x20000": { 289 | "Action": 10, 290 | "Text": "[1;2F" 291 | }, 292 | "0xf700-0x220000": { 293 | "Action": 10, 294 | "Text": "[1;2A" 295 | }, 296 | "0x30-0x200000": { 297 | "Action": 12, 298 | "Text": "0" 299 | }, 300 | "0xf705-0x20000": { 301 | "Action": 10, 302 | "Text": "[1;2Q" 303 | }, 304 | "0x31-0x200000": { 305 | "Action": 12, 306 | "Text": "1" 307 | }, 308 | "0x33-0x200000": { 309 | "Action": 12, 310 | "Text": "3" 311 | }, 312 | "0x35-0x40000": { 313 | "Action": 11, 314 | "Text": "0x1d" 315 | }, 316 | "0x34-0x200000": { 317 | "Action": 12, 318 | "Text": "4" 319 | }, 320 | "0x32-0x200000": { 321 | "Action": 12, 322 | "Text": "2" 323 | }, 324 | "0x35-0x200000": { 325 | "Action": 12, 326 | "Text": "5" 327 | }, 328 | "0x36-0x200000": { 329 | "Action": 12, 330 | "Text": "6" 331 | }, 332 | "0xf70c-0x40000": { 333 | "Action": 10, 334 | "Text": "[20;5~" 335 | }, 336 | "0x37-0x200000": { 337 | "Action": 12, 338 | "Text": "7" 339 | }, 340 | "0x2d-0x40000": { 341 | "Action": 11, 342 | "Text": "0x1f" 343 | }, 344 | "0x38-0x200000": { 345 | "Action": 12, 346 | "Text": "8" 347 | }, 348 | "0x2a-0x200000": { 349 | "Action": 12, 350 | "Text": "*" 351 | }, 352 | "0x39-0x200000": { 353 | "Action": 12, 354 | "Text": "9" 355 | }, 356 | "0x2b-0x200000": { 357 | "Action": 12, 358 | "Text": "+" 359 | }, 360 | "0xf70e-0x20000": { 361 | "Action": 10, 362 | "Text": "[23;2~" 363 | }, 364 | "0xf707-0x40000": { 365 | "Action": 10, 366 | "Text": "[1;5S" 367 | }, 368 | "0x2e-0x200000": { 369 | "Action": 12, 370 | "Text": "." 371 | }, 372 | "0x2d-0x200000": { 373 | "Action": 12, 374 | "Text": "-" 375 | }, 376 | "0xf709-0x20000": { 377 | "Action": 10, 378 | "Text": "[17;2~" 379 | }, 380 | "0x2f-0x200000": { 381 | "Action": 12, 382 | "Text": "/" 383 | }, 384 | "0xf704-0x20000": { 385 | "Action": 10, 386 | "Text": "[1;2P" 387 | }, 388 | "0x34-0x40000": { 389 | "Action": 11, 390 | "Text": "0x1c" 391 | } 392 | }, 393 | "Window Type": 0, 394 | "Blink Allowed": true, 395 | "Background Image Location": "", 396 | "Blur": false, 397 | "Badge Color": { 398 | "Red Component": 1, 399 | "Color Space": "sRGB", 400 | "Blue Component": 0, 401 | "Alpha Component": 0.5, 402 | "Green Component": 0.14910027384757996 403 | }, 404 | "Scrollback Lines": 0, 405 | "Send Code When Idle": false, 406 | "Close Sessions On End": true, 407 | "Terminal Type": "xterm-256color", 408 | "Visual Bell": true, 409 | "Flashing Bell": false, 410 | "Status Bar Layout": { 411 | "components": [], 412 | "advanced configuration": { 413 | "remove empty components": false, 414 | "font": ".AppleSystemUIFont 12", 415 | "algorithm": 0, 416 | "auto-rainbow style": 2 417 | } 418 | }, 419 | "Show Timestamps": 0, 420 | "Silence Bell": false, 421 | "Ansi 14 Color": { 422 | "Green Component": 0.75294117647058822, 423 | "Blue Component": 0.48627450980392156, 424 | "Red Component": 0.55686274509803924 425 | }, 426 | "Unicode Version": 9, 427 | "ASCII Ligatures": false, 428 | "Name": "GruvboxDark", 429 | "Cursor Text Color": { 430 | "Red Component": 1, 431 | "Color Space": "sRGB", 432 | "Blue Component": 0.99999994039535522, 433 | "Alpha Component": 1, 434 | "Green Component": 0.99999994039535522 435 | }, 436 | "Shortcut": "", 437 | "Cursor Color": { 438 | "Red Component": 0.7807578444480896, 439 | "Color Space": "sRGB", 440 | "Blue Component": 0.7807578444480896, 441 | "Alpha Component": 1, 442 | "Green Component": 0.78075778484344482 443 | }, 444 | "Transparency": 0.050000000000000017, 445 | "Guid": "FEEF9982-D999-41A3-BFE2-967FA999B348", 446 | "Custom Directory": "No", 447 | "Ansi 2 Color": { 448 | "Green Component": 0.59215686274509804, 449 | "Blue Component": 0.10196078431372549, 450 | "Red Component": 0.59607843137254901 451 | }, 452 | "Ansi 4 Color": { 453 | "Green Component": 0.52156862745098043, 454 | "Blue Component": 0.53333333333333333, 455 | "Red Component": 0.27058823529411763 456 | }, 457 | "Ansi 5 Color": { 458 | "Green Component": 0.3843137254901961, 459 | "Blue Component": 0.52549019607843139, 460 | "Red Component": 0.69411764705882351 461 | }, 462 | "Ansi 6 Color": { 463 | "Green Component": 0.61568627450980395, 464 | "Blue Component": 0.41568627450980394, 465 | "Red Component": 0.40784313725490196 466 | }, 467 | "Ansi 7 Color": { 468 | "Green Component": 0.59999999999999998, 469 | "Blue Component": 0.51764705882352946, 470 | "Red Component": 0.6588235294117647 471 | }, 472 | "Ansi 8 Color": { 473 | "Green Component": 0.51372549019607838, 474 | "Blue Component": 0.45490196078431372, 475 | "Red Component": 0.5725490196078431 476 | }, 477 | "Ansi 9 Color": { 478 | "Green Component": 0.28627450980392155, 479 | "Blue Component": 0.20392156862745098, 480 | "Red Component": 0.98431372549019602 481 | }, 482 | "Link Color": { 483 | "Red Component": 0, 484 | "Color Space": "sRGB", 485 | "Blue Component": 0.73422712087631226, 486 | "Alpha Component": 1, 487 | "Green Component": 0.35915297269821167 488 | }, 489 | "Allow Title Reporting": false 490 | } 491 | ] 492 | } 493 | -------------------------------------------------------------------------------- /sw/assets/lose.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderabbitai/dotfiles/edbc8ca0a88d14f2a4f134eb3baf2d61917a143b/sw/assets/lose.ogg -------------------------------------------------------------------------------- /sw/assets/lose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderabbitai/dotfiles/edbc8ca0a88d14f2a4f134eb3baf2d61917a143b/sw/assets/lose.png -------------------------------------------------------------------------------- /sw/assets/tmux-fzf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderabbitai/dotfiles/edbc8ca0a88d14f2a4f134eb3baf2d61917a143b/sw/assets/tmux-fzf.png -------------------------------------------------------------------------------- /sw/assets/tmux-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderabbitai/dotfiles/edbc8ca0a88d14f2a4f134eb3baf2d61917a143b/sw/assets/tmux-menu.png -------------------------------------------------------------------------------- /sw/assets/vim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderabbitai/dotfiles/edbc8ca0a88d14f2a4f134eb3baf2d61917a143b/sw/assets/vim.png -------------------------------------------------------------------------------- /sw/assets/vim_ide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderabbitai/dotfiles/edbc8ca0a88d14f2a4f134eb3baf2d61917a143b/sw/assets/vim_ide.png -------------------------------------------------------------------------------- /sw/assets/win.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderabbitai/dotfiles/edbc8ca0a88d14f2a4f134eb3baf2d61917a143b/sw/assets/win.ogg -------------------------------------------------------------------------------- /sw/assets/win.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderabbitai/dotfiles/edbc8ca0a88d14f2a4f134eb3baf2d61917a143b/sw/assets/win.png -------------------------------------------------------------------------------- /sw/assets/zsh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderabbitai/dotfiles/edbc8ca0a88d14f2a4f134eb3baf2d61917a143b/sw/assets/zsh.png -------------------------------------------------------------------------------- /sw/assets/zsh_cnf.zsh: -------------------------------------------------------------------------------- 1 | command_not_found_handler() { 2 | local CMD="$@" 3 | if $INSULTS_ENABLED; then 4 | insult 5 | echo "" 6 | fi 7 | # run thefuck 8 | TF_SHELL_ALIASES=$(alias) 9 | TF_CMD=$( 10 | export TF_SHELL_ALIASES 11 | export TF_SHELL=zsh 12 | export TF_ALIAS=fuck 13 | export TF_HISTORY="$CMD" 14 | export PYTHONIOENCODING=utf-8 15 | thefuck THEFUCK_ARGUMENT_PLACEHOLDER 16 | ) && eval $TF_CMD 17 | test -n "$TF_CMD" && print -s $TF_CMD 18 | # Return the exit code normally returned on invalid command 19 | return 127 20 | } 21 | -------------------------------------------------------------------------------- /sw/bin/executable_autoupdate.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # check whether this script is being eval'ed 4 | [[ $0 =~ "autoupdate.zsh" ]] && sourced=0 || sourced=1 5 | 6 | # Track errors from various update commands in an array and show the result before exiting 7 | function update_error() { 8 | error_cmd=$1 9 | error_code=$2 10 | if [ $error_code -ne 0 ]; then 11 | # add the error to the array 12 | update_errors+=("$error_cmd: $error_code") 13 | fi 14 | } 15 | 16 | tp='success' 17 | 18 | function show_errors() { 19 | if [ ${#update_errors[@]} -ne 0 ]; then 20 | tp='error' 21 | echo "Errors occurred during update:" 22 | for error in "${update_errors[@]}"; do 23 | echo " $error" 24 | done 25 | fi 26 | # $sourced is 1, use term-notify to send notifications 27 | if [ $sourced -eq 1 ]; then 28 | term-notify $tp $interval <<<"autoupdate.zsh" 29 | else 30 | if [ $tp = 'success' ]; then 31 | exit 0 32 | else 33 | exit 1 34 | fi 35 | fi 36 | } 37 | 38 | function check_interval() { 39 | now=$(date +%s) 40 | if [ -f ~/${1} ]; then 41 | last_update=$(cat ~/${1}) 42 | else 43 | last_update=0 44 | fi 45 | interval=$(expr ${now} - ${last_update}) 46 | echo ${interval} 47 | } 48 | 49 | function revolver_stop() { 50 | revolver stop 51 | tput cnorm 52 | } 53 | 54 | if [ -z "$SYSTEM_UPDATE_DAYS" ]; then 55 | SYSTEM_UPDATE_DAYS=7 56 | fi 57 | 58 | if [ -z "$SYSTEM_RECEIPT_F" ]; then 59 | SYSTEM_RECEIPT_F='.system_lastupdate' 60 | fi 61 | 62 | # check whether force update option was provided 63 | if [ "$1" = "--force" ]; then 64 | force_update=1 65 | else 66 | force_update=0 67 | fi 68 | 69 | day_seconds=86400 70 | system_seconds=$(expr ${day_seconds} \* ${SYSTEM_UPDATE_DAYS}) 71 | 72 | last_system=$(check_interval ${SYSTEM_RECEIPT_F}) 73 | 74 | if [ ${last_system} -gt ${system_seconds} ] || [ $force_update -eq 1 ]; then 75 | # get current time 76 | start_time=$(date +%s) 77 | 78 | $(date +%s >~/${SYSTEM_RECEIPT_F}) 79 | echo "It has been $(expr ${last_system} / $day_seconds) days since system was updated" 80 | echo "Updating system... Please open a new terminal to continue your work in parallel..." 81 | 82 | # check if revolver command exists 83 | if command -v revolver >/dev/null 2>&1; then 84 | tput civis 85 | revolver --style 'dots2' start 'Pulling latest dotfiles...' 86 | fi 87 | 88 | cd ~ && chezmoi --force update -v 89 | update_error dotfiles $? 90 | 91 | revolver update "Running personal autoupdates..." 92 | # run ~/.autoupdate_local.zsh if it exists 93 | if [ -f ~/.autoupdate_local.zsh ]; then 94 | # run ~/.autoupdate_local.zsh by eval it's content 95 | eval "$(cat ~/.autoupdate_local.zsh)" 96 | update_error ~/.autoupdate_local.zsh $? 97 | fi 98 | 99 | if command -v revolver >/dev/null 2>&1; then 100 | revolver_stop 101 | fi 102 | ~/sw/bin/sync_brews.sh 103 | update_error sync_brews $? 104 | 105 | revolver --style 'dots2' start 'Updating zinit... (Press q or Enter if this is taking too long)' 106 | source $HOME/.local/share/zinit/zinit.git/zinit.zsh && zinit self-update && zinit update --quiet --parallel 8 && zinit cclear 107 | update_error zinit $? 108 | 109 | revolver update "Updating nvim... (Press Spaces if this is taking too long)" 110 | nvim +PlugUpgrade +PlugClean! +PlugUpdate +PlugInstall +CocUpdateSync +TSUpdateSync +qall 111 | update_error nvim $? 112 | 113 | revolver update "Updating npm packages..." 114 | npm update && npm upgrade && npm audit fix --force && npm prune --production --force 115 | update_error npm $? 116 | 117 | revolver update "Updating pip packages..." 118 | # upgrade pip and pip packages 119 | pip3 install --quiet --upgrade pip setuptools wheel && pip3 freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install --quiet --upgrade 120 | update_error pip $? 121 | 122 | 123 | revolver update "Updating tldr cache..." 124 | # update tldr 125 | tldr --update 126 | 127 | revolver update "Syncing styles in $HOME/notes" 128 | pushd $HOME/notes && vale sync && popd 129 | 130 | revolver_stop 131 | 132 | $HOME/sw/bin/sync_coderabbitai.sh 133 | $HOME/sw/bin/sync_fluxninja.sh 134 | 135 | if [[ $TERM == *"tmux"* || $TERM == *"screen"* || -n $TMUX ]]; then 136 | tmux source-file $HOME/.tmux.conf 137 | fi 138 | 139 | stop_time=$(date +%s) 140 | interval=$(expr ${stop_time} - ${start_time}) 141 | echo "It took $interval seconds to update the system." 142 | show_errors 143 | fi 144 | 145 | unset SYSTEM_RECEIPT_F 146 | unset SYSTEM_UPDATE_DAYS 147 | unset day_seconds 148 | unset last_system 149 | unset system_seconds 150 | unset start_time 151 | unset stop_time 152 | unset interval 153 | unset force_update 154 | unset update_errors 155 | unset check_interval 156 | unset error_code 157 | unset error_cmd 158 | unset tp 159 | unset -f update_error 160 | unset -f check_interval 161 | unset -f show_errors 162 | unset -f revolver_stop 163 | -------------------------------------------------------------------------------- /sw/bin/executable_explain_prompt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | source ~/.local/share/zinit/plugins/jakshin---yazpt/yazpt.zsh-theme && yazpt_explain_git 3 | -------------------------------------------------------------------------------- /sw/bin/executable_gh_checks_status.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | RESET="\e[0m" 4 | RED_BRIGHT="\e[91m" 5 | YELLOW_BRIGHT="\e[93m" 6 | GREEN_BRIGHT="\e[92m" 7 | 8 | CUT="cut" 9 | # check whether gcut command exists 10 | if command -v gcut >/dev/null 2>&1; then 11 | CUT="gcut" 12 | fi 13 | 14 | # check whether it's a git repo and remote is github 15 | if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then 16 | exit 0 17 | fi 18 | 19 | if ! git remote -v | grep -q "github.com"; then 20 | exit 0 21 | fi 22 | 23 | gh_checks="$(gh pr checks 2>/dev/null | $CUT --fields=2)" 24 | gh_status_mark="" 25 | # extract the number of fail checks 26 | gh_fail_checks="$(echo "$gh_checks" | grep -c fail)" 27 | # extract the number of pass checks 28 | gh_pass_checks="$(echo "$gh_checks" | grep -c pass)" 29 | # extract the number of pending checks 30 | gh_pending_checks="$(echo "$gh_checks" | grep -c pending)" 31 | if [[ $gh_pending_checks -gt 0 ]]; then 32 | gh_status_mark+="$(echo -e "${YELLOW_BRIGHT}⧖ ${gh_pending_checks} ${RESET}")" 33 | fi 34 | if [[ $gh_fail_checks -gt 0 ]]; then 35 | gh_status_mark+="$(echo -e "${RED_BRIGHT}✘ ${gh_fail_checks} ${RESET}")" 36 | fi 37 | if [[ $gh_pass_checks -gt 0 ]]; then 38 | gh_status_mark+="$(echo -e "${GREEN_BRIGHT}✔ ${gh_pass_checks} ${RESET}")" 39 | fi 40 | echo -e "$gh_status_mark" 41 | -------------------------------------------------------------------------------- /sw/bin/executable_gh_clone_all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Accept 2 arguments 4 | if [ $# -ne 2 ]; then 5 | echo "Usage: $0 " 6 | exit 1 7 | fi 8 | 9 | echo "Cloning..." 10 | 11 | tput civis 12 | revolver --style 'dots2' start "Fetching $1 repos list from GitHub..." 13 | repolist=$(gh repo list "$1" --limit 99999 --json nameWithOwner,sshUrl --jq '.[]|[.nameWithOwner,.sshUrl]|@tsv') 14 | revolver stop 15 | tput cnorm 16 | 17 | parallel --no-notice --bar --eta --colsep '\t' "[ ! -d '$2/{1}' ] && git clone --quiet '{2}' '$2/{1}'" :::: <(echo "$repolist") 18 | code=$? 19 | 20 | echo "Finished cloning" 21 | 22 | exit $code 23 | -------------------------------------------------------------------------------- /sw/bin/executable_git_ship: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function revolver_stop() { 4 | revolver stop 5 | tput cnorm 6 | } 7 | 8 | # Check for --no-verify option 9 | no_verify="" 10 | if [ "$1" == "--no-verify" ]; then 11 | no_verify="--no-verify" 12 | shift 13 | fi 14 | 15 | # Check if the branch is in merging state 16 | if git status | grep -q 'You have unmerged paths'; then 17 | echo "Branch is in merging state. Please resolve conflicts and commit the changes manually." 18 | exit 1 19 | fi 20 | 21 | # show the list of modified git files that will be committed 22 | echo " == Modified files == " 23 | git status --short --untracked-files=no 24 | 25 | # empty line 26 | echo "" 27 | 28 | # list only the untracked files and exclude all tracked files from the list 29 | echo " == Untracked files == " 30 | git ls-files --others --exclude-standard 31 | 32 | if ! gum confirm "Commit and push these changes?"; then 33 | echo "Aborting" 34 | exit 1 35 | fi 36 | 37 | # Save the last commit message in a temporary file based on repository 38 | last_commit_file="/tmp/last_commit_message_$(basename "$(git rev-parse --show-toplevel)")" 39 | 40 | # Use the commit message provided in argument, if given 41 | if [ $# -eq 1 ]; then 42 | commit_message=$1 43 | else 44 | # Check if the last commit message file exists and ask the user if they want to repeat the last commit message 45 | if [ -f "$last_commit_file" ]; then 46 | last_commit_message=$(cat "$last_commit_file") 47 | if gum confirm "Repeat the last commit message: \"$last_commit_message\"?"; then 48 | commit_message="$last_commit_message" 49 | fi 50 | fi 51 | 52 | # If the user didn't choose to repeat the last commit message, ask for a new one 53 | if [ -z "$commit_message" ]; then 54 | type=$(gum choose "fix" "feat" "docs" "style" "refactor" "test" "chore" "revert") 55 | commit_message=$(gum input --value "$type: " --placeholder "Commit message") 56 | fi 57 | fi 58 | 59 | # Save the current commit message to the temporary file 60 | echo "$commit_message" >"$last_commit_file" 61 | 62 | tput civis 63 | revolver --style 'dots2' start 'Committing changes...' 64 | 65 | # Iteration counter 66 | i=0 67 | # Try committing periodically until it works. Time the commit command. Break if it fails instantly 68 | while true; do 69 | # Increment iteration counter 70 | i=$((i + 1)) 71 | 72 | revolver update "Committing... Try #$i" 73 | 74 | START=$(date +%s) 75 | git commit -a -m "$commit_message" $no_verify 76 | exit_code=$? 77 | END=$(date +%s) 78 | DIFF=$((END - START)) 79 | 80 | if [ $exit_code -eq 0 ]; then 81 | echo "Current iteration took $DIFF seconds" 82 | break 83 | fi 84 | 85 | echo "Failed attempt took $DIFF seconds" 86 | if [ $DIFF -lt 4 ]; then 87 | echo "Commit failed instantly, aborting" 88 | revolver_stop 89 | exit 1 90 | fi 91 | # break after 3 attempts 92 | if [ $i -eq 3 ]; then 93 | echo "Commit failed after 3 attempts, aborting" 94 | revolver_stop 95 | exit 1 96 | fi 97 | 98 | echo "Commit failed, retrying" 99 | done 100 | 101 | revolver update "Pulling changes..." 102 | git pull --rebase -q origin "$(git rev-parse --abbrev-ref HEAD)" 103 | 104 | revolver update "Pushing changes..." 105 | git push -u -q origin "$(git rev-parse --abbrev-ref HEAD)" 106 | 107 | revolver_stop 108 | -------------------------------------------------------------------------------- /sw/bin/executable_pull_all.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # accept only 1 argument 4 | if [ $# -ne 1 ]; then 5 | echo "Usage: $0 " 6 | exit 1 7 | fi 8 | 9 | echo "Pulling..." 10 | 11 | # iterate directories contained within the directory provided in the first argument in parallel and cd into each to run git pull 12 | parallel --no-notice --bar --eta --colsep '\n' "cd {} && git pull --quiet --rebase" ::: "$(find "$1" -maxdepth 1 -mindepth 1 -type d)" 13 | code=$? 14 | 15 | echo "Finished pull" 16 | 17 | exit $code 18 | -------------------------------------------------------------------------------- /sw/bin/executable_spinner: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | quiet=false 4 | spinner=false 5 | colors=false 6 | watch_interval=0 7 | # take -q (quiet=true) and -c (colors=true) as flags 8 | while getopts sqcw: opt; do 9 | case $opt in 10 | s) 11 | spinner=true 12 | ;; 13 | q) 14 | quiet=true 15 | ;; 16 | c) 17 | colors=true 18 | ;; 19 | w) 20 | watch_interval=$OPTARG 21 | ;; 22 | \?) 23 | echo "Invalid option: -$OPTARG" >&2 24 | exit 1 25 | ;; 26 | esac 27 | done 28 | 29 | # shift 30 | shift "$((OPTIND - 1))" 31 | 32 | # if arguments = 0 then display help 33 | if [ $# -eq 0 ]; then 34 | echo "Runs a command in background, waits for completion and shows spinner while waiting." 35 | echo "Usage: $0 [-s] [-c] [-w] [-q] []" 36 | echo "Warning: do not use for any command that needs user input" 37 | fi 38 | 39 | if [ "$quiet" = true ]; then 40 | message="" 41 | else 42 | message="Running: [$*]" 43 | fi 44 | 45 | cmd_str="$*" 46 | 47 | function run_command() { 48 | if ! $spinner; then 49 | tput civis 50 | revolver --style 'dots2' start "$message" 51 | fi 52 | 53 | # take the command and it's parameters provided as arguments to this script and run it in background. save the output of the command to a temp file on disk created by mktemp 54 | temppout=$(mktemp) 55 | 56 | # run the command in background by redirecting stdout to tempout, stderr to temperr and capture it's exit code in $code 57 | 58 | # check if $colors is true 59 | if [ "$colors" = true ]; then 60 | if [[ $OSTYPE == 'darwin'* ]]; then 61 | script -q $temppout $cmd_str >/dev/null 2>&1 & 62 | else 63 | script -q -c "$cmd_str" $temppout >/dev/null 2>&1 & 64 | fi 65 | else 66 | eval "$cmd_str" >"$temppout" 2>&1 & 67 | fi 68 | 69 | pid=$! 70 | 71 | if $spinner; then 72 | spin=("⣾" "⣽" "⣻" "⢿" "⡿" "⣟" "⣯" "⣷") 73 | 74 | i=0 75 | while kill -0 $pid 2>/dev/null; do 76 | i=$(((i + 1) % 8)) 77 | printf "\r$message%s" "${spin[$i]}" 78 | sleep 0.1 79 | done 80 | fi 81 | 82 | # get exit code of the command 83 | wait $pid 84 | code=$? 85 | 86 | # if $message is not empty 87 | if [ "$message" != "" ]; then 88 | # clear previous line 89 | printf "\r\033[K" 90 | else 91 | printf "\r" 92 | fi 93 | 94 | if [ -f $temppout ]; then 95 | cat $temppout 96 | # clean up 97 | rm $temppout 98 | fi 99 | 100 | if ! $spinner; then 101 | revolver stop 102 | tput cnorm 103 | fi 104 | } 105 | 106 | # if watch_interval is 0 then run the tmux command once otherwise run it continuously every $watch_interval seconds 107 | if [ "$watch_interval" -eq 0 ]; then 108 | run_command 109 | else 110 | while true; do 111 | printf "\033c" # clear screen 112 | run_command 113 | echo "Sleeping for $watch_interval seconds..." 114 | sleep "$watch_interval" 115 | done 116 | fi 117 | 118 | # exit with the exit code of the command 119 | exit $code 120 | -------------------------------------------------------------------------------- /sw/bin/executable_sync_brews.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | brew tap molovo/revolver 4 | brew install --quiet revolver 5 | 6 | tput civis 7 | revolver --style 'dots2' start 'Syncing local brews...' 8 | 9 | # source ~/.brew_local 10 | if [ -f ~/.brew_local ]; then 11 | source ~/.brew_local 12 | fi 13 | 14 | brew tap ejoffe/homebrew-tap 15 | brew tap claui/whence 16 | brew tap bufbuild/buf 17 | brew tap tilt-dev/tap 18 | brew tap noahgorstein/tap 19 | brew tap fluxninja/aperture 20 | 21 | revolver stop 22 | 23 | # Update homebrew recipes 24 | brew update && brew upgrade && brew cleanup && brew doctor 25 | 26 | revolver --style 'dots2' start 'Installing parallel tool...' 27 | brew install --quiet parallel 28 | 29 | # check whether ~/.local/share/zinit/zinit.git exists, if not then invoke installation script 30 | if [ ! -d ~/.local/share/zinit/zinit.git ]; then 31 | revolver update 'Installing zinit...' 32 | bash -c "NO_INPUT=1 NO_EDIT=1; $(curl --fail --show-error --silent --location https://raw.githubusercontent.com/zdharma-continuum/zinit/HEAD/scripts/install.sh)" 33 | fi 34 | 35 | PACKAGES+=( 36 | chezmoi 37 | zsh 38 | eza 39 | dust 40 | ncdu 41 | duf 42 | fd 43 | git 44 | spr 45 | go 46 | gopls 47 | gotests 48 | gops 49 | delve 50 | typescript 51 | universal-ctags 52 | thefuck 53 | tmux 54 | tmux-mem-cpu-load 55 | node 56 | python 57 | autopep8 58 | rust 59 | tilt 60 | ctlptl 61 | bottom 62 | helm 63 | helmfile 64 | go-jsonnet 65 | jsonnet-bundler 66 | tanka 67 | sops 68 | terraform 69 | terragrunt 70 | tflint 71 | kubernetes-cli 72 | jq 73 | yq 74 | gh 75 | kind 76 | neovim 77 | asdf 78 | bat 79 | bat-extras 80 | git-delta 81 | ctop 82 | kubectx 83 | fzf 84 | subversion 85 | tealdeer 86 | navi 87 | watch 88 | zoxide 89 | figlet 90 | ripgrep 91 | curlie 92 | vcsh 93 | vint 94 | shellcheck 95 | markdownlint-cli 96 | markdownlint-cli2 97 | yamllint 98 | languagetool 99 | pylint 100 | eslint 101 | cppcheck 102 | jsonlint 103 | shfmt 104 | rustfmt 105 | golangci-lint 106 | watchman 107 | cowsay 108 | fortune 109 | vivid 110 | hyperfine 111 | sd 112 | dog 113 | procs 114 | broot 115 | chafa 116 | exiftool 117 | pdftohtml 118 | lesspipe 119 | mosh 120 | bats-core 121 | fpp 122 | pstree 123 | smug 124 | onefetch 125 | neofetch 126 | speedtest-cli 127 | gping 128 | tty-clock 129 | lazydocker 130 | k9s 131 | kustomize 132 | kubebuilder 133 | buf 134 | grpcurl 135 | mockery 136 | urlview 137 | tree-sitter 138 | cmake 139 | hasura-cli 140 | circleci 141 | graphviz 142 | jqp 143 | openjdk 144 | openjdk@17 145 | gradle 146 | socat 147 | gum 148 | aperturectl 149 | vale 150 | poetry 151 | pnpm 152 | yarn 153 | pipx 154 | ) 155 | 156 | if [[ $OSTYPE == 'darwin'* ]]; then 157 | PACKAGES+=( 158 | coreutils 159 | findutils 160 | gnu-sed 161 | grep 162 | gawk 163 | bash 164 | wget 165 | duti 166 | terminal-notifier 167 | reattach-to-user-namespace 168 | ) 169 | else 170 | # override default editor to nvim 171 | xdg-mime default nvim.desktop text/plain 172 | PACKAGES+=( 173 | xclip 174 | xdotool 175 | wmctrl 176 | libnotify 177 | gcc 178 | ) 179 | revolver update 'Installing fonts...' 180 | # declare a map of font urls to font file names (e.g. "FiraCode" to "Fira Code Regular") 181 | nerd_font='https://github.com/ryanoasis/nerd-fonts/releases/download/v2.3.3' 182 | declare -A fonts=( 183 | "${nerd_font}/DejaVuSansMono.zip" "DejaVu Sans Mono Nerd Font Complete.ttf" 184 | "${nerd_font}/DroidSansMono.zip" "Droid Sans Mono Nerd Font Complete.otf" 185 | "${nerd_font}/Go-Mono.zip" "Go Mono Nerd Font Complete.ttf" 186 | "${nerd_font}/Hack.zip" "Hack Regular Nerd Font Complete Mono.ttf" 187 | "${nerd_font}/FiraCode.zip" "Fira Code Regular Nerd Font Complete Mono.ttf" 188 | "${nerd_font}/JetBrainsMono.zip" "JetBrains Mono Regular Nerd Font Complete Mono.ttf" 189 | "${nerd_font}/Meslo.zip" "Meslo LG S Regular Nerd Font Complete Mono.ttf" 190 | "${nerd_font}/SourceCodePro.zip" "Sauce Code Pro Nerd Font Complete Mono.ttf" 191 | "https://github.com/googlefonts/noto-emoji/raw/main/fonts/NotoColorEmoji.ttf" "NotoColorEmoji.ttf" 192 | ) 193 | fonts_dir="${HOME}/.local/share/fonts" 194 | if [[ ! -d "$fonts_dir" ]]; then 195 | mkdir -p "$fonts_dir" 196 | fi 197 | install_fonts=() 198 | # search for font patterns (values in $fonts map) in $fonts_dir and add font urls (keys in $fonts map) to $install_fonts list 199 | for font_url in "${(@k)fonts}"; do 200 | if [[ -z "$(find "$fonts_dir" -name "${fonts[$font_url]}" -print -quit)" ]]; then 201 | install_fonts+=("$font_url") 202 | fi 203 | done 204 | 205 | # print the list of fonts to install if $installs_fonts is not an empty array 206 | if [[ ${#install_fonts[@]} -gt 0 ]]; then 207 | echo "The following fonts will be installed:" 208 | for font_url in "${install_fonts[@]}"; do 209 | echo " ${fonts[$font_url]}" 210 | done 211 | for font_url in "${install_fonts[@]}"; do 212 | echo "Downloading $font_url" 213 | # $font_file is the base name of $font_url 214 | font_file=$(basename "${font_url}") 215 | wget "$font_url" 216 | # check whether $font_file has a zip extension 217 | if [[ "$font_file" == *".zip" ]]; then 218 | unzip -o "$font_file" -d "$fonts_dir" 219 | rm "$font_file" 220 | else 221 | # if not, assume it's a ttf file 222 | mv "$font_file" "$fonts_dir" 223 | fi 224 | done 225 | find "$fonts_dir" -name '*Windows Compatible*' -delete 226 | fc-cache -fv 227 | fi 228 | fi 229 | 230 | revolver stop 231 | 232 | # get list of currently installed packages and remove them from the list of packages to install 233 | installed_packages=($(brew list)) 234 | for installed_package in $installed_packages; do 235 | PACKAGES=("${(@)PACKAGES:#$installed_package}") 236 | done 237 | 238 | revolver --style 'dots2' start 'Installing brew packages...' 239 | 240 | # get number of elements in the array $PACKAGES 241 | num_packages=${#PACKAGES[@]} 242 | 243 | # check if there are any packages to install 244 | if [[ num_packages -gt 0 ]]; then 245 | echo "Fetching packages..." 246 | parallel --no-notice --bar --eta "brew fetch --quiet --formula {1} > /dev/null" ::: ${PACKAGES[@]} 247 | 248 | i=0 249 | # Loop through Packages and install them 250 | for package in ${PACKAGES[@]}; do 251 | ((i++)) 252 | revolver update "Installing package $package ($i of $num_packages)..." 253 | brew install --quiet --formula $package 254 | done 255 | fi 256 | 257 | if [[ $OSTYPE == 'darwin'* ]]; then 258 | 259 | # check whether /Library/Java/JavaVirtualMachines/openjdk.jdk exists 260 | if [[ ! -d "/Library/Java/JavaVirtualMachines/openjdk.jdk" ]]; then 261 | sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk 262 | fi 263 | 264 | revolver update 'Installing iterm2 shell integration...' 265 | curl -L https://iterm2.com/shell_integration/install_shell_integration_and_utilities.sh | bash 266 | CASKS+=( 267 | font-dejavu 268 | font-dejavu-sans-mono-nerd-font 269 | font-fira-code-nerd-font 270 | font-droid-sans-mono-nerd-font 271 | font-go-mono-nerd-font 272 | font-hack-nerd-font 273 | font-jetbrains-mono-nerd-font 274 | font-meslo-lg-nerd-font 275 | font-victor-mono-nerd-font 276 | font-monoid-nerd-font 277 | font-sauce-code-pro-nerd-font 278 | font-figtree 279 | iterm2 280 | ghostty 281 | adobe-acrobat-reader 282 | docker 283 | orbstack 284 | figma 285 | github 286 | google-cloud-sdk 287 | google-drive 288 | google-chrome 289 | notion 290 | slack 291 | discord 292 | stats 293 | zoom 294 | twingate 295 | chatgpt 296 | visual-studio-code 297 | swiftdefaultappsprefpane # for setting several macOS properties such as default app for opening plaintext files 298 | # copyq removed as it likely has memory leak on Apple Silicon 299 | ) 300 | revolver stop 301 | 302 | # check the list of installed casks and remove them from the list of casks to install 303 | installed_casks=($(brew list --cask)) 304 | for installed_cask in $installed_casks; do 305 | CASKS=("${(@)CASKS:#$installed_cask}") 306 | done 307 | 308 | revolver --style 'dots2' start 'Installing cask packages...' 309 | 310 | # check if there are any casks to install 311 | if [[ ${#CASKS[@]} -gt 0 ]]; then 312 | echo "Fetching casks..." 313 | parallel --no-notice --bar --eta "brew fetch --quiet --cask {1} > /dev/null" ::: ${CASKS[@]} 314 | 315 | num_casks=${#CASKS[@]} 316 | i=0 317 | # Loop through Casks and install them 318 | for cask in ${CASKS[@]}; do 319 | ((i++)) 320 | revolver update "Installing cask $cask ($i of $num_casks)..." 321 | brew install --quiet --cask $cask 322 | done 323 | fi 324 | 325 | revolver update 'Updating defaults...' 326 | # set default terminal to iterm2 327 | duti -s com.googlecode.iterm2 com.apple.terminal.shell-script shell 328 | duti -s com.googlecode.iterm2 term 329 | fi 330 | 331 | revolver update 'Setting up fzf...' 332 | # setup fzf 333 | yes | $(brew --prefix)/opt/fzf/install 334 | 335 | revolver update 'Updating tldr...' 336 | # update tldr 337 | tldr --update 338 | 339 | revolver update 'Updating navi cheats...' 340 | old_pwd=$(pwd) 341 | # check whether $(navi info cheats-path)/denisidoro__cheats directory exists 342 | if [ ! -d "$(navi info cheats-path)/denisidoro__cheats" ]; then 343 | git clone "https://github.com/denisidoro/cheats" "$(navi info cheats-path)/denisidoro__cheats" 344 | else 345 | cd "$(navi info cheats-path)/denisidoro__cheats" && git pull -q origin master 346 | fi 347 | 348 | # if [ ! -d "$(navi info cheats-path)/denisidoro__navi-tldr-pages" ]; then 349 | # git clone "https://github.com/denisidoro/navi-tldr-pages" "$(navi info cheats-path)/denisidoro__navi-tldr-pages" 350 | # else 351 | # cd "$(navi info cheats-path)/denisidoro__navi-tldr-pages" && git pull -q origin master 352 | # fi 353 | cd $old_pwd 354 | 355 | 356 | revolver update 'Installing go packages...' 357 | # go stuff 358 | go install github.com/josharian/impl@latest 359 | go install honnef.co/go/tools/cmd/keyify@latest 360 | go install github.com/koron/iferr@latest 361 | go install github.com/davidrjenni/reftools/cmd/fillstruct@master 362 | go install github.com/orlangure/gocovsh@latest 363 | go install github.com/bufbuild/buf-language-server/cmd/bufls@latest 364 | go install github.com/grafana/jsonnet-language-server@latest 365 | 366 | # on linux use system's gcc as cgo compiler as gcc@5 has some linking issues 367 | if [[ $OSTYPE == 'linux'* ]]; then 368 | go env -w CC=gcc CXX="g++" 369 | fi 370 | 371 | revolver update 'Installing npm packages...' 372 | # npm stuff 373 | npm i -q -g turbo 374 | npm i -q -g bash-language-server 375 | npm i -q -g dockerfile-language-server-nodejs 376 | npm i -q -g graphql-language-service-cli 377 | 378 | revolver update 'Installing python packages...' 379 | #python stuff 380 | pip3 install --quiet --upgrade pip 381 | pip3 install --quiet --upgrade setuptools 382 | # fluxninja 383 | pip3 install --quiet --upgrade pre-commit 384 | # required for nvim mundo 385 | pip3 install --quiet pynvim 386 | pip3 install --quiet libtmux 387 | pip3 install --quiet tiktoken 388 | 389 | revolver update 'Installing gh extensions...' 390 | # gh extensions 391 | gh extension install dlvhdr/gh-dash 392 | gh extension install github/gh-copilot 393 | 394 | revolver stop 395 | tput cnorm 396 | 397 | # use openjdk@17 398 | brew link --overwrite openjdk@17 399 | 400 | echo -e " == Brews Sync'ed == " 401 | -------------------------------------------------------------------------------- /sw/bin/executable_sync_coderabbitai.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | gh_clone_all.sh coderabbitai ~/Work 4 | pull_all.sh ~/Work/coderabbitai 5 | 6 | # go through all the directories in ~/Work/coderabbitai 7 | # look for package.json files in the subdirectories 8 | # and run pnpm install in those directories 9 | find ~/Work/coderabbitai -depth 2 -name package.json -exec dirname {} \; | while read dir; do 10 | # if the directory contains a pnpm-lock.yaml file use pnpm 11 | # otherwise look for a yarn.lock file and use yarn 12 | # otherwise look for a package-lock.json file and use npm 13 | if [ -f "$dir/pnpm-lock.yaml" ]; then 14 | echo "Running pnpm install in $dir" 15 | (cd $dir && pnpm install) 16 | elif [ -f "$dir/yarn.lock" ]; then 17 | echo "Running yarn install in $dir" 18 | (cd $dir && yarn install) 19 | elif [ -f "$dir/package-lock.json" ]; then 20 | echo "Running npm install in $dir" 21 | (cd $dir && npm install) 22 | fi 23 | done 24 | -------------------------------------------------------------------------------- /sw/bin/executable_sync_fluxninja.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | gh_clone_all.sh fluxninja ~/Work 4 | pull_all.sh ~/Work/fluxninja 5 | 6 | # symlink aperture in cloud 7 | if [ ! -d ~/Work/fluxninja/cloud/services/aperture ]; then 8 | ln -s ~/Work/fluxninja/aperture ~/Work/fluxninja/cloud/services/aperture 9 | fi 10 | 11 | if [ ! -d ~/Work/fluxninja/aperture-tech-docs/local ]; then 12 | ln -s ~/Work/fluxninja/aperture/docs/content ~/Work/fluxninja/aperture-tech-docs/local 13 | fi 14 | 15 | PRECOMMIT_DIRS=( 16 | ~/Work/fluxninja/cloud 17 | ~/Work/fluxninja/aperture 18 | ~/Work/fluxninja/aperture-tech-docs 19 | ) 20 | 21 | for dir in "${PRECOMMIT_DIRS[@]}"; do 22 | if [ -d "$dir" ]; then 23 | echo "Installing precommit hooks in $dir" 24 | pushd "$dir" >/dev/null || continue 25 | pre-commit install --hook-type={pre-commit,commit-msg,prepare-commit-msg} 26 | pre-commit install-hooks 27 | popd >/dev/null || continue 28 | fi 29 | done 30 | 31 | pushd ~/Work/fluxninja/aperture >/dev/null || exit 1 32 | make install-go-tools 33 | make install-python-tools 34 | vale sync 35 | popd >/dev/null || exit 1 36 | 37 | pushd ~/Work/fluxninja/aperture-tech-docs >/dev/null || exit 1 38 | yarn install 39 | vale sync 40 | popd >/dev/null || exit 1 41 | 42 | pushd ~/Work/fluxninja/fluxninja-website >/dev/null || exit 1 43 | yarn install 44 | popd >/dev/null || exit 1 45 | 46 | pushd ~/Work/fluxninja/cloud/ops/apps/opsninja >/dev/null || exit 1 47 | pip3 install . 48 | popd >/dev/null || exit 1 49 | -------------------------------------------------------------------------------- /sw/bin/executable_win_split: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | flags="" 4 | title_name="" 5 | ask_quit=false 6 | # flags are: -h for horizontal split, -b for create pane on left side, -t for Title as string argument 7 | while getopts ahbt: opt; do 8 | case $opt in 9 | a) 10 | ask_quit=true 11 | ;; 12 | h) 13 | # append to flags 14 | flags="$flags -h" 15 | ;; 16 | b) 17 | flags="$flags -b" 18 | ;; 19 | t) 20 | # title is the argument provided to the -t flag 21 | title_name=$OPTARG 22 | ;; 23 | \?) 24 | echo "Invalid option: -$OPTARG" >&2 25 | exit 1 26 | ;; 27 | esac 28 | done 29 | 30 | shift "$((OPTIND - 1))" 31 | 32 | cmd="export ZINIT_TURBO=false;source ~/sw/assets/utils.zsh;\ 33 | command -v zsh-notify-before-command >/dev/null 2>&1 && zsh-notify-before-command '$*';\ 34 | $*;\ 35 | command -v zsh-notify-after-command >/dev/null 2>&1 && zsh-notify-after-command" 36 | 37 | title="printf '\033]2;$title_name\033\\';" 38 | 39 | if $ask_quit; then 40 | cmd="$cmd; echo; echo Press Enter to exit ; read" 41 | fi 42 | tmux splitw $flags -c "#{pane_current_path}" "$title$cmd" & 43 | -------------------------------------------------------------------------------- /sw/bin/executable_wttr.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # If you source this file, it will set WTTR_PARAMS as well as show weather. 3 | 4 | # WTTR_PARAMS is space-separated URL parameters, many of which are single characters that can be 5 | # lumped together. For example, "F q m" behaves the same as "Fqm". 6 | if [[ -z "$WTTR_PARAMS" ]]; then 7 | # Form localized URL parameters for curl 8 | if [[ -t 1 ]] && [[ "$(tput cols)" -lt 125 ]]; then 9 | WTTR_PARAMS+='n' 10 | fi 2>/dev/null 11 | for _token in $(locale LC_MEASUREMENT); do 12 | case $_token in 13 | 1) WTTR_PARAMS+='m' ;; 14 | 2) WTTR_PARAMS+='u' ;; 15 | esac 16 | done 2>/dev/null 17 | unset _token 18 | export WTTR_PARAMS 19 | fi 20 | 21 | wttr() { 22 | local location="${1// /+}" 23 | command shift 24 | local args="" 25 | for p in $WTTR_PARAMS "$@"; do 26 | args+=" --data-urlencode $p " 27 | done 28 | # save the output of curl to a file 29 | tempfile=$(mktemp) 30 | curl -fGsS -H "Accept-Language: ${LANG%_*}" $args --compressed "wttr.in/${location}" >"$tempfile" 31 | # check whether the file is not empty 32 | if [[ -s "$tempfile" ]]; then 33 | # remove last line of the file on linux and macos 34 | if [[ "$OSTYPE" == "linux"* ]]; then 35 | sed -i '$d' "$tempfile" 36 | elif [[ "$OSTYPE" == "darwin"* ]]; then 37 | sed -i '' -e '$ d' "$tempfile" 38 | fi 39 | else 40 | weather --hide-icon >"$tempfile" 41 | fi 42 | # show current date and time 43 | echo -e "Weather on $(date +"%A, %d %B %Y %H:%M")" 44 | cat "$tempfile" 45 | # remove the file 46 | rm "$tempfile" 47 | } 48 | 49 | wttr "$@" 50 | --------------------------------------------------------------------------------