├── nvim ├── .gitignore ├── stylua.toml ├── lua │ ├── plugins │ │ ├── avante.lua │ │ ├── gitsigns.lua │ │ ├── gitlinker.lua │ │ ├── which-key.lua │ │ ├── noice.lua │ │ ├── todo-comments.lua │ │ ├── luasnip.lua │ │ ├── colorscheme.lua │ │ ├── fzf-lua.lua │ │ ├── neogit.lua │ │ ├── smear-cursor.lua │ │ ├── flash.lua │ │ ├── blink.lua │ │ ├── nvim-ufo.lua │ │ ├── lualine.lua │ │ ├── neo-tree.lua │ │ ├── mini-ai.lua │ │ ├── harpoon.lua │ │ ├── claudecode.lua │ │ ├── core.lua │ │ ├── lspconfig.lua │ │ ├── conform.lua │ │ ├── dashboard-nvim.lua │ │ └── example.lua │ └── config │ │ ├── autocmds.lua │ │ ├── eslint_warmup.lua │ │ ├── options.lua │ │ ├── lazy.lua │ │ ├── keymaps.lua │ │ └── eslint_daemon.lua ├── init.lua ├── README.md ├── .claude │ └── settings.local.json ├── lazyvim.json └── LICENSE ├── git ├── .gitignore_global ├── .gitconfig └── .gitalias.txt ├── .gitignore ├── fish ├── conf.d │ ├── rustup.fish │ ├── 00_fig_pre.fish │ ├── 99_fig_post.fish │ ├── reload.fish │ ├── rbenv.fish │ └── nvm.fish ├── functions │ ├── bi.fish │ ├── bash.fish │ ├── ls.fish │ ├── api-edge.fish │ ├── hf.fish │ ├── ping.fish │ ├── t.fish │ ├── _nvm_version_activate.fish │ ├── bb.fish │ ├── dbm.fish │ ├── ll.fish │ ├── nclean.fish │ ├── _nvm_version_deactivate.fish │ ├── llt.fish │ ├── bclean.fish │ ├── _nvm_list.fish │ ├── _nvm_index_update.fish │ ├── bass.fish │ ├── rbenv.fish │ ├── reload.fish │ ├── __bass.py │ ├── nvm.fish │ └── fisher.fish ├── fish_plugins ├── themes │ └── poimandres_storm.theme ├── completions │ ├── fisher.fish │ ├── rbenv.fish │ ├── nvm.fish │ └── bun.fish ├── config.fish └── fish_variables ├── cht.sh └── cht.sh.conf ├── fig └── settings.json ├── tmux ├── tmux-cht-languages ├── tmux-cht-commands └── .tmux.conf ├── .gitmodules ├── gh └── config.yml ├── ghostty └── config ├── wezterm └── .wezterm.lua ├── starship └── starship.toml ├── hammerspoon └── init.lua ├── yabai └── yabairc ├── skhd └── skhdrc └── glow └── nord.json /nvim/.gitignore: -------------------------------------------------------------------------------- 1 | colors/ 2 | -------------------------------------------------------------------------------- /git/.gitignore_global: -------------------------------------------------------------------------------- 1 | **/.DS_Store 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | nvim/lazy-lock.json 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /fish/conf.d/rustup.fish: -------------------------------------------------------------------------------- 1 | source "$HOME/.cargo/env.fish" 2 | -------------------------------------------------------------------------------- /cht.sh/cht.sh.conf: -------------------------------------------------------------------------------- 1 | CHTSH_QUERY_OPTIONS="style=monokai" 2 | 3 | -------------------------------------------------------------------------------- /fish/functions/bi.fish: -------------------------------------------------------------------------------- 1 | function bi 2 | bundle install 3 | end 4 | -------------------------------------------------------------------------------- /fish/fish_plugins: -------------------------------------------------------------------------------- 1 | kenji-miyake/reload.fish 2 | jorgebucaran/nvm.fish 3 | -------------------------------------------------------------------------------- /nvim/stylua.toml: -------------------------------------------------------------------------------- 1 | indent_type = "Spaces" 2 | indent_width = 2 3 | column_width = 120 -------------------------------------------------------------------------------- /fish/functions/bash.fish: -------------------------------------------------------------------------------- 1 | function bash 2 | env -u SHELL FISH_VERSION="$FISH_VERSION" bash 3 | end 4 | -------------------------------------------------------------------------------- /fish/functions/ls.fish: -------------------------------------------------------------------------------- 1 | function ls --wraps=eza --description 'alias ls=eza' 2 | eza $argv 3 | 4 | end 5 | -------------------------------------------------------------------------------- /fish/conf.d/00_fig_pre.fish: -------------------------------------------------------------------------------- 1 | test -x ~/.local/bin/fig; and eval (~/.local/bin/fig init fish pre --rcfile 00_fig_pre | string split0) -------------------------------------------------------------------------------- /fish/conf.d/99_fig_post.fish: -------------------------------------------------------------------------------- 1 | test -x ~/.local/bin/fig; and eval (~/.local/bin/fig init fish post --rcfile 99_fig_post | string split0) -------------------------------------------------------------------------------- /fish/functions/api-edge.fish: -------------------------------------------------------------------------------- 1 | begin 2 | set -lx USE_LOCAL_EDGE 1 3 | set -lx METRICS_PORT 8181 4 | script/server 5 | end 6 | -------------------------------------------------------------------------------- /nvim/lua/plugins/avante.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "yetone/avante.nvim", 3 | 4 | opts = { 5 | provider = "claude", 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /nvim/lua/plugins/gitsigns.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "lewis6991/gitsigns.nvim", 3 | opts = { 4 | current_line_blame = true, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /nvim/lua/plugins/gitlinker.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "linrongbin16/gitlinker.nvim", 3 | config = function() 4 | require("gitlinker").setup() 5 | end, 6 | } 7 | -------------------------------------------------------------------------------- /fish/functions/hf.fish: -------------------------------------------------------------------------------- 1 | # Defined via `source` 2 | function hf --wraps='history | fzf' --description 'alias hf=history | fzf' 3 | history | fzf $argv; 4 | end 5 | -------------------------------------------------------------------------------- /nvim/lua/plugins/which-key.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/which-key.nvim", 3 | opts = { 4 | defaults = { 5 | ["w"] = nil, 6 | }, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /nvim/lua/plugins/noice.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "folke/noice.nvim", 4 | opts = function(_, opts) 5 | opts.presets.lsp_doc_border = true 6 | end, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /fish/functions/ping.fish: -------------------------------------------------------------------------------- 1 | # Defined via `source` 2 | function ping --wraps='prettyping --nolegend ' --description 'alias ping=prettyping --nolegend ' 3 | prettyping --nolegend $argv; 4 | end 5 | -------------------------------------------------------------------------------- /nvim/init.lua: -------------------------------------------------------------------------------- 1 | -- bootstrap lazy.nvim, LazyVim and your plugins 2 | require("config.lazy") 3 | -- Load eslint configuration 4 | require("config.eslint_daemon") 5 | require("config.eslint_warmup") 6 | -------------------------------------------------------------------------------- /fish/functions/t.fish: -------------------------------------------------------------------------------- 1 | # Defined via `source` 2 | function t --wraps='npm run lint && npm run tsc' --description 'alias t=npm run lint && npm run tsc' 3 | npm run lint && npm run tsc $argv; 4 | end 5 | -------------------------------------------------------------------------------- /nvim/README.md: -------------------------------------------------------------------------------- 1 | # 💤 LazyVim 2 | 3 | A starter template for [LazyVim](https://github.com/LazyVim/LazyVim). 4 | Refer to the [documentation](https://lazyvim.github.io/installation) to get started. 5 | -------------------------------------------------------------------------------- /fish/functions/_nvm_version_activate.fish: -------------------------------------------------------------------------------- 1 | function _nvm_version_activate --argument-names ver 2 | set --global --export nvm_current_version $ver 3 | set --prepend PATH $nvm_data/$ver/bin 4 | end 5 | -------------------------------------------------------------------------------- /fish/functions/bb.fish: -------------------------------------------------------------------------------- 1 | # Defined via `source` 2 | function bb --wraps='brew update; brew upgrade' --description 'alias bb=brew update; brew upgrade' 3 | brew update; brew upgrade; brew cleanup $argv; 4 | end 5 | -------------------------------------------------------------------------------- /fig/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "autocomplete.disable" : false, 3 | "autocomplete.fontFamily" : "Source Code Pro", 4 | "autocomplete.fontSize" : 13, 5 | "autocomplete.fuzzySearch" : true, 6 | "autocomplete.theme" : "nord" 7 | } -------------------------------------------------------------------------------- /fish/functions/dbm.fish: -------------------------------------------------------------------------------- 1 | # Defined via `source` 2 | function dbm --wraps='bin/rake db:migrate; git co -- db/schema.rb' --description 'alias dbm=bin/rake db:migrate; git co -- db/schema.rb' 3 | bin/rake db:migrate && git co -- db/schema.rb 4 | end 5 | -------------------------------------------------------------------------------- /tmux/tmux-cht-languages: -------------------------------------------------------------------------------- 1 | bash 2 | c 3 | cpp 4 | css 5 | gdb 6 | golang 7 | haskell 8 | html 9 | javascript 10 | lua 11 | nodejs 12 | php 13 | python 14 | rust 15 | solidity 16 | tmux 17 | typescript 18 | zsh 19 | vim 20 | elisp 21 | markdown 22 | -------------------------------------------------------------------------------- /fish/functions/ll.fish: -------------------------------------------------------------------------------- 1 | function ll --wraps='eza -l --no-permissions --no-user --group-directories-first' --description 'alias ll=eza -l --no-permissions --no-user --group-directories-first' 2 | eza -l --no-permissions --no-user --group-directories-first $argv 3 | 4 | end 5 | -------------------------------------------------------------------------------- /fish/functions/nclean.fish: -------------------------------------------------------------------------------- 1 | # Defined via `source` 2 | function nclean --wraps='rm -rf node_modules/; rm package-lock.json; npm i' --description 'alias nclean=rm -rf node_modules/; rm package-lock.json; npm i' 3 | rm -rf node_modules/; rm package-lock.json; npm i $argv; 4 | end 5 | -------------------------------------------------------------------------------- /nvim/lua/plugins/todo-comments.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/todo-comments.nvim", 3 | keys = { 4 | { "xt", "TodoTrouble keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme (Trouble)" }, 5 | { "xT", "TodoTrouble", desc = "Todo (Trouble)" }, 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /fish/functions/_nvm_version_deactivate.fish: -------------------------------------------------------------------------------- 1 | function _nvm_version_deactivate --argument-names ver 2 | test "$nvm_current_version" = "$ver" && set --erase nvm_current_version 3 | set --local index (contains --index -- $nvm_data/$ver/bin $PATH) && 4 | set --erase PATH[$index] 5 | end 6 | -------------------------------------------------------------------------------- /nvim/lua/plugins/luasnip.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "L3MON4D3/LuaSnip", 3 | config = function() 4 | require("luasnip").filetype_extend("javascriptreact", { "html" }) 5 | require("luasnip").filetype_extend("typescriptreact", { "html" }) 6 | require("luasnip.loaders.from_vscode").lazy_load() 7 | end, 8 | } 9 | -------------------------------------------------------------------------------- /fish/functions/llt.fish: -------------------------------------------------------------------------------- 1 | function llt --wraps='eza -l --tree --level=2 --no-permissions --no-user --group-directories-first' --description 'alias llt=eza -l --tree --level=2 --no-permissions --no-user --group-directories-first' 2 | eza -l --tree --level=2 --no-permissions --no-user --group-directories-first $argv 3 | 4 | end 5 | -------------------------------------------------------------------------------- /nvim/lua/plugins/colorscheme.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | -- "jasonlong/poimandres.nvim", 4 | name = "poimandres", 5 | dir = "~/dev/poimandres.nvim", 6 | -- dir = "~/dev/dotfiles/nvim/colors/poimandres.nvim", 7 | lazy = false, 8 | opts = { 9 | style = "storm", 10 | transparent = true, 11 | }, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /fish/conf.d/reload.fish: -------------------------------------------------------------------------------- 1 | set -g RELOAD_PROTECTED_ENV_VARS \ 2 | COLORTERM \ 3 | DISPLAY \ 4 | HOME \ 5 | PWD \ 6 | SHELL \ 7 | SSH_AGENT_PID \ 8 | SSH_AUTH_SOCK \ 9 | TERM \ 10 | VSCODE_GIT_IPC_HANDLE \ 11 | VTE_VERSION \ 12 | XAUTHORITY \ 13 | XDG_RUNTIME_DIR \ 14 | ZELLIJ \ 15 | ZELLIJ_SESSION_NAME 16 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "hammerspoon/hammerspoon/Spoons/ControlEscape.spoon"] 2 | path = hammerspoon/hammerspoon/Spoons/ControlEscape.spoon 3 | url = https://github.com/jasonrudolph/ControlEscape.spoon 4 | [submodule "hammerspoon/Spoons/ControlEscape.spoon"] 5 | path = hammerspoon/Spoons/ControlEscape.spoon 6 | url = https://github.com/jasonrudolph/ControlEscape.spoon 7 | -------------------------------------------------------------------------------- /fish/functions/bclean.fish: -------------------------------------------------------------------------------- 1 | # Defined via `source` 2 | function bclean --wraps=git\ branch\ --merged\ \|\ egrep\ -v\ \"\(\^\\\*\|master\|main\)\"\ \|\ xargs\ git\ branch\ -d --description alias\ bclean=git\ branch\ --merged\ \|\ egrep\ -v\ \"\(\^\\\*\|master\|main\)\"\ \|\ xargs\ git\ branch\ -d 3 | git branch --merged | egrep -v "(^\*|master|main)" | xargs git branch -d $argv; 4 | end 5 | -------------------------------------------------------------------------------- /nvim/lua/config/autocmds.lua: -------------------------------------------------------------------------------- 1 | -- Autocmds are automatically loaded on the VeryLazy event 2 | -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua 3 | -- Add any additional autocmds here 4 | vim.filetype.add({ 5 | extension = { 6 | mdx = "markdown.mdx", 7 | }, 8 | filename = {}, 9 | pattern = {}, 10 | }) 11 | -------------------------------------------------------------------------------- /nvim/lua/plugins/fzf-lua.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "ibhagwan/fzf-lua", 3 | opts = { 4 | winopts = { 5 | -- height = 0.85, 6 | -- width = 0.80, 7 | -- row = 0.35, 8 | -- col = 0.50, 9 | border = "rounded", 10 | }, 11 | fzf_opts = { 12 | ["--layout"] = "reverse-list", 13 | ["--preview-window"] = "up:50%", 14 | }, 15 | }, 16 | } 17 | 18 | -------------------------------------------------------------------------------- /nvim/lua/plugins/neogit.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "NeogitOrg/neogit", 3 | dependencies = { 4 | "nvim-lua/plenary.nvim", -- required 5 | "sindrets/diffview.nvim", -- optional - Diff integration 6 | 7 | -- Only one of these is needed, not both. 8 | -- "nvim-telescope/telescope.nvim", -- optional 9 | "ibhagwan/fzf-lua", -- optional 10 | }, 11 | config = true, 12 | } 13 | -------------------------------------------------------------------------------- /tmux/tmux-cht-commands: -------------------------------------------------------------------------------- 1 | awk 2 | cargo 3 | cat 4 | chmod 5 | chown 6 | cp 7 | cp 8 | docker 9 | docker-compose 10 | find 11 | git 12 | git-commit 13 | git-rebase 14 | git-status 15 | git-worktree 16 | grep 17 | head 18 | jq 19 | kill 20 | less 21 | ls 22 | lsof 23 | make 24 | man 25 | mv 26 | ps 27 | rename 28 | rg 29 | rm 30 | sed 31 | ssh 32 | stow 33 | tail 34 | tar 35 | tldr 36 | tr 37 | xargs 38 | -------------------------------------------------------------------------------- /nvim/.claude/settings.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "permissions": { 3 | "allow": [ 4 | "Bash(find:*)", 5 | "Bash(grep:*)", 6 | "WebFetch(domain:github.com)", 7 | "Bash(nvim:*)", 8 | "WebSearch", 9 | "Read(//Users/jason/.local/share/nvim/lazy/avante.nvim/**)", 10 | "WebFetch(domain:www.lazyvim.org)" 11 | ] 12 | }, 13 | "enableAllProjectMcpServers": false 14 | } 15 | -------------------------------------------------------------------------------- /nvim/lua/plugins/smear-cursor.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "sphamba/smear-cursor.nvim", 3 | 4 | opts = { 5 | smear_between_buffers = false, 6 | smear_between_neighbor_lines = false, 7 | legacy_computing_symbols_support = true, 8 | stiffness = 0.8, 9 | trailing_stiffness = 0.6, 10 | trailing_exponent = 0, 11 | distance_stop_animating = 0.5, 12 | hide_target_hack = false, 13 | cursor_color = "#868cad", 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /nvim/lua/plugins/flash.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "folke/flash.nvim", 4 | opts = { 5 | modes = { 6 | char = { 7 | enabled = true, 8 | highlight = { 9 | backdrop = false, 10 | groups = { 11 | label = "FlashMatch", -- :hi for f/F 12 | match = "FlashMatch", -- :hi for t/T 13 | }, 14 | }, 15 | }, 16 | }, 17 | }, 18 | }, 19 | } 20 | -------------------------------------------------------------------------------- /nvim/lua/plugins/blink.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "saghen/blink.cmp", 3 | dependencies = { 4 | "fang2hou/blink-copilot", 5 | }, 6 | opts = { 7 | sources = { 8 | default = { "lsp", "snippets", "copilot", "path", "buffer" }, 9 | providers = { 10 | copilot = { 11 | name = "copilot", 12 | module = "blink-copilot", 13 | score_offset = -10, 14 | async = true, 15 | }, 16 | }, 17 | }, 18 | }, 19 | } 20 | -------------------------------------------------------------------------------- /fish/functions/_nvm_list.fish: -------------------------------------------------------------------------------- 1 | function _nvm_list 2 | set --local versions $nvm_data/* 3 | 4 | set --query versions[1] && 5 | string match --entire --regex -- ( 6 | string replace --all -- $nvm_data/ "" $versions | 7 | string match --regex -- "v\d.+" | 8 | string escape --style=regex | 9 | string join "|" 10 | ) <$nvm_data/.index 11 | 12 | command --all node | 13 | string match --quiet --invert --regex -- "^$nvm_data" && echo system 14 | end 15 | -------------------------------------------------------------------------------- /fish/conf.d/rbenv.fish: -------------------------------------------------------------------------------- 1 | if not command -s rbenv > /dev/null 2 | echo "rbenv: command not found. See https://github.com/rbenv/rbenv" 3 | exit 1 4 | end 5 | 6 | set -l rbenv_root '' 7 | if test -z "$RBENV_ROOT" 8 | set rbenv_root "$HOME/.rbenv" 9 | set -x RBENV_ROOT "$HOME/.rbenv" 10 | else 11 | set rbenv_root "$RBENV_ROOT" 12 | end 13 | 14 | set -x PATH $rbenv_root/shims $PATH 15 | set -x RBENV_SHELL fish 16 | if test ! -d "$rbenv_root/shims"; or test ! -d "$rbenv_root/versions" 17 | command mkdir -p $rbenv_root/{shims,versions} 18 | end 19 | -------------------------------------------------------------------------------- /gh/config.yml: -------------------------------------------------------------------------------- 1 | # What protocol to use when performing git operations. Supported values: ssh, https 2 | git_protocol: https 3 | # What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment. 4 | editor: !!null nvim 5 | # When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled 6 | prompt: enabled 7 | # A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager. 8 | pager: 9 | # Aliases allow you to create nicknames for gh commands 10 | aliases: 11 | co: pr checkout 12 | version: "1" 13 | -------------------------------------------------------------------------------- /fish/functions/_nvm_index_update.fish: -------------------------------------------------------------------------------- 1 | function _nvm_index_update 2 | test ! -d $nvm_data && command mkdir -p $nvm_data 3 | 4 | set --local index $nvm_data/.index 5 | 6 | if not command curl -q --location --silent $nvm_mirror/index.tab >$index.temp 7 | command rm -f $index.temp 8 | echo "nvm: Can't update index, host unavailable: \"$nvm_mirror\"" >&2 9 | return 1 10 | end 11 | 12 | command awk -v OFS=\t ' 13 | /v0.9.12/ { exit } # Unsupported 14 | NR > 1 { 15 | print $1 (NR == 2 ? " latest" : $10 != "-" ? " lts/" tolower($10) : "") 16 | } 17 | ' $index.temp >$index 18 | 19 | command rm -f $index.temp 20 | end 21 | -------------------------------------------------------------------------------- /fish/functions/bass.fish: -------------------------------------------------------------------------------- 1 | function bass 2 | set -l bash_args $argv 3 | set -l bass_debug 4 | if test "$bash_args[1]_" = '-d_' 5 | set bass_debug true 6 | set -e bash_args[1] 7 | end 8 | 9 | set -l script_file (mktemp) 10 | if command -v python3 >/dev/null 2>&1 11 | command python3 (dirname (status -f))/__bass.py $bash_args 3>$script_file 12 | else 13 | command python (dirname (status -f))/__bass.py $bash_args 3>$script_file 14 | end 15 | set -l bass_status $status 16 | if test $bass_status -ne 0 17 | return $bass_status 18 | end 19 | 20 | if test -n "$bass_debug" 21 | cat $script_file 22 | end 23 | source $script_file 24 | command rm $script_file 25 | end 26 | 27 | function __bass_usage 28 | echo "Usage: bass [-d] " 29 | end 30 | -------------------------------------------------------------------------------- /fish/themes/poimandres_storm.theme: -------------------------------------------------------------------------------- 1 | # name: 'Poimandres Storm' 2 | 3 | # Syntax Highlighting Colors 4 | fish_color_normal a6accd 5 | fish_color_command 5fb3a1 6 | fish_color_keyword ffffff 7 | fish_color_quote 5de4c7 8 | fish_color_redirection 5fb3a1 9 | fish_color_end ff966c 10 | fish_color_error d0679d 11 | 12 | fish_color_param e4f0fb 13 | fish_color_comment 868cad 14 | fish_color_selection --background=3654a7 15 | fish_color_search_match --background=3654a7 16 | fish_color_operator c3e88d 17 | fish_color_escape c099ff 18 | fish_color_autosuggestion 868cad 19 | 20 | # Completion Pager Colors 21 | fish_pager_color_progress 636da6 22 | fish_pager_color_prefix 86e1fc 23 | fish_pager_color_completion c8d3f5 24 | fish_pager_color_description 636da6 25 | fish_pager_color_selected_background --background=3654a7 26 | -------------------------------------------------------------------------------- /nvim/lazyvim.json: -------------------------------------------------------------------------------- 1 | { 2 | "extras": [ 3 | "lazyvim.plugins.extras.ai.claudecode", 4 | "lazyvim.plugins.extras.ai.copilot", 5 | "lazyvim.plugins.extras.coding.blink", 6 | "lazyvim.plugins.extras.coding.mini-surround", 7 | "lazyvim.plugins.extras.coding.yanky", 8 | "lazyvim.plugins.extras.editor.dial", 9 | "lazyvim.plugins.extras.editor.harpoon2", 10 | "lazyvim.plugins.extras.editor.snacks_picker", 11 | "lazyvim.plugins.extras.formatting.prettier", 12 | "lazyvim.plugins.extras.lang.astro", 13 | "lazyvim.plugins.extras.lang.json", 14 | "lazyvim.plugins.extras.lang.tailwind", 15 | "lazyvim.plugins.extras.linting.eslint", 16 | "lazyvim.plugins.extras.ui.smear-cursor" 17 | ], 18 | "install_version": 7, 19 | "news": { 20 | "NEWS.md": "11866" 21 | }, 22 | "version": 8 23 | } -------------------------------------------------------------------------------- /nvim/lua/plugins/nvim-ufo.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "kevinhwang91/nvim-ufo", 3 | dependencies = { "kevinhwang91/promise-async" }, 4 | event = "BufRead", 5 | keys = { 6 | { 7 | "zR", 8 | function() 9 | require("ufo").openAllFolds() 10 | end, 11 | }, 12 | { 13 | "zM", 14 | function() 15 | require("ufo").closeAllFolds() 16 | end, 17 | }, 18 | { 19 | "K", 20 | function() 21 | local winid = require("ufo").peekFoldedLinesUnderCursor() 22 | if not winid then 23 | vim.lsp.buf.hover() 24 | end 25 | end, 26 | }, 27 | }, 28 | config = function() 29 | vim.o.foldcolumn = "1" 30 | vim.o.foldlevel = 99 31 | vim.o.foldlevelstart = 99 32 | vim.o.foldenable = true 33 | require("ufo").setup() 34 | end, 35 | } 36 | -------------------------------------------------------------------------------- /fish/completions/fisher.fish: -------------------------------------------------------------------------------- 1 | complete --command fisher --exclusive --long help --description "Print help" 2 | complete --command fisher --exclusive --long version --description "Print version" 3 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins" 4 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins" 5 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins" 6 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex" 7 | complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)" 8 | -------------------------------------------------------------------------------- /nvim/lua/plugins/lualine.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-lualine/lualine.nvim", 3 | dependencies = { "nvim-tree/nvim-web-devicons", opt = true }, 4 | config = function() 5 | require("lualine").setup({ 6 | options = { 7 | component_separators = { left = "·" }, 8 | }, 9 | sections = { 10 | lualine_a = { "mode" }, 11 | lualine_b = { "branch", "diff", "diagnostics" }, 12 | lualine_c = { { "filename", path = 1 } }, 13 | lualine_x = { "filetype" }, 14 | lualine_y = { "progress" }, 15 | lualine_z = { "location" }, 16 | }, 17 | inactive_sections = { 18 | lualine_a = {}, 19 | lualine_b = {}, 20 | lualine_c = { { "filename", path = 1 } }, 21 | lualine_x = { "location" }, 22 | lualine_y = {}, 23 | lualine_z = {}, 24 | }, 25 | }) 26 | end, 27 | } 28 | -------------------------------------------------------------------------------- /fish/config.fish: -------------------------------------------------------------------------------- 1 | fish_vi_key_bindings 2 | 3 | alias g='git' 4 | alias ss='script/server' 5 | alias rc='rails console' 6 | alias api='cd ~/dev/api-bb/' 7 | alias app='cd ~/dev/app-bb/' 8 | alias v='nvim' 9 | alias lg='lazygit' 10 | alias t='tmux-sessionizer' 11 | alias h='cht.sh' 12 | 13 | set fish_greeting 14 | status --is-interactive; and source (rbenv init -|psub) 15 | 16 | direnv hook fish | source 17 | zoxide init fish | source 18 | starship init fish | source 19 | 20 | # Atuin 21 | set -gx ATUIN_NOBIND true 22 | atuin init fish | source 23 | bind \cr _atuin_search 24 | bind -M insert \cr _atuin_search 25 | 26 | # Bun 27 | set -Ux BUN_INSTALL "/Users/jason/.bun" 28 | set -px --path PATH "/Users/jason/.bun/bin" 29 | 30 | set -x PATH "/Library/Frameworks/Python.framework/Versions/3.11/bin" "$PATH" 31 | fish_add_path "/Users/jason/.local/share/bob/nvim-bin" 32 | 33 | # thefuck 34 | thefuck --alias | source 35 | alias claude="/Users/jason/.claude/local/claude" 36 | fish_add_path $HOME/.local/bin 37 | direnv hook fish | source 38 | -------------------------------------------------------------------------------- /nvim/lua/plugins/neo-tree.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-neo-tree/neo-tree.nvim", 3 | config = function() 4 | require("neo-tree").setup({ 5 | close_if_last_window = true, 6 | filesystem = { 7 | follow_current_file = { 8 | enabled = true, 9 | }, 10 | }, 11 | default_component_configs = { 12 | git_status = { 13 | symbols = { 14 | -- Change type 15 | added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name 16 | modified = "", -- or "", but this is redundant info if you use git_status_colors on the name 17 | deleted = "✖", -- this can only be used in the git_status source 18 | renamed = "󰁕", -- this can only be used in the git_status source 19 | -- Status type 20 | untracked = "", 21 | ignored = "", 22 | unstaged = "", 23 | staged = "", 24 | conflict = "", 25 | }, 26 | }, 27 | }, 28 | }) 29 | end, 30 | } 31 | -------------------------------------------------------------------------------- /nvim/lua/plugins/mini-ai.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-mini/mini.ai", 3 | opts = function() 4 | local ai = require("mini.ai") 5 | 6 | return { 7 | n_lines = 500, 8 | custom_textobjects = { 9 | o = ai.gen_spec.treesitter({ -- code block 10 | a = { "@block.outer", "@conditional.outer", "@loop.outer" }, 11 | i = { "@block.inner", "@conditional.inner", "@loop.inner" }, 12 | }), 13 | f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }), -- function 14 | c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }), -- class 15 | t = false, 16 | d = { "%f[%d]%d+" }, -- digits 17 | e = { -- Word with case 18 | { "%u[%l%d]+%f[^%l%d]", "%f[%S][%l%d]+%f[^%l%d]", "%f[%P][%l%d]+%f[^%l%d]", "^[%l%d]+%f[^%l%d]" }, 19 | "^().*()$", 20 | }, 21 | g = LazyVim.mini.ai_buffer, -- buffer 22 | u = ai.gen_spec.function_call(), -- u for "Usage" 23 | U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name 24 | }, 25 | } 26 | end, 27 | } 28 | -------------------------------------------------------------------------------- /git/.gitconfig: -------------------------------------------------------------------------------- 1 | [user] 2 | name = Jason Long 3 | email = jason@jasonlong.me 4 | signingkey = 16A6ADCE72646D7B 5 | [include] 6 | path = /Users/jason/.gitalias.txt 7 | [push] 8 | default = current 9 | autoSetupRemote = true 10 | [core] 11 | pager = delta 12 | excludesfile = /Users/jason/.gitignore_global 13 | editor = nvim 14 | [interactive] 15 | diffFilter = delta --color-only 16 | [delta] 17 | navigate = true # use n and N to move between diff sections 18 | syntax-theme = Nord 19 | light = false 20 | [merge] 21 | conflictstyle = zdiff3 22 | [diff] 23 | colorMoved = default 24 | algorithm = histogram 25 | [pull] 26 | rebase = true 27 | [commit] 28 | gpgsign = true 29 | [credential "https://github.com"] 30 | helper = 31 | helper = !/opt/homebrew/bin/gh auth git-credential 32 | [credential "https://gist.github.com"] 33 | helper = 34 | helper = !/opt/homebrew/bin/gh auth git-credential 35 | [init] 36 | defaultBranch = main 37 | [column] 38 | ui = auto 39 | [branch] 40 | sort = -committerdate 41 | ; [fetch] 42 | ; prune = true 43 | ; pruneTags = true 44 | ; all = true 45 | [help] 46 | autocorrect = prompt 47 | -------------------------------------------------------------------------------- /nvim/lua/plugins/harpoon.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "ThePrimeagen/harpoon", 3 | branch = "harpoon2", 4 | keys = { 5 | { 6 | "h", 7 | function() 8 | require("harpoon"):list():add() 9 | end, 10 | desc = "Harpoon file", 11 | }, 12 | { 13 | "gh", 14 | function() 15 | local harpoon = require("harpoon") 16 | harpoon.ui:toggle_quick_menu(harpoon:list()) 17 | end, 18 | desc = "Harpoon quick menu", 19 | }, 20 | { 21 | "gj", 22 | function() 23 | require("harpoon"):list():select(1) 24 | end, 25 | desc = "Harpoon to file 1", 26 | }, 27 | { 28 | "gk", 29 | function() 30 | require("harpoon"):list():select(2) 31 | end, 32 | desc = "Harpoon to file 2", 33 | }, 34 | { 35 | "gl", 36 | function() 37 | require("harpoon"):list():select(3) 38 | end, 39 | desc = "Harpoon to file 3", 40 | }, 41 | { 42 | "g;", 43 | function() 44 | require("harpoon"):list():select(4) 45 | end, 46 | desc = "Harpoon to file 4", 47 | }, 48 | }, 49 | } 50 | -------------------------------------------------------------------------------- /nvim/lua/plugins/claudecode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- "coder/claudecode.nvim", 3 | -- dependencies = { "folke/snacks.nvim" }, 4 | -- config = true, 5 | -- keys = { 6 | -- { "a", nil, desc = "AI/Claude Code" }, 7 | -- { "ac", "ClaudeCode", desc = "Toggle Claude" }, 8 | -- { "af", "ClaudeCodeFocus", desc = "Focus Claude" }, 9 | -- { "ar", "ClaudeCode --resume", desc = "Resume Claude" }, 10 | -- { "aC", "ClaudeCode --continue", desc = "Continue Claude" }, 11 | -- { "am", "ClaudeCodeSelectModel", desc = "Select Claude model" }, 12 | -- { "ab", "ClaudeCodeAdd %", desc = "Add current buffer" }, 13 | -- { "as", "ClaudeCodeSend", mode = "v", desc = "Send to Claude" }, 14 | -- { 15 | -- "as", 16 | -- "ClaudeCodeTreeAdd", 17 | -- desc = "Add file", 18 | -- ft = { "NvimTree", "neo-tree", "oil", "minifiles" }, 19 | -- }, 20 | -- -- Diff management 21 | -- { "aa", "ClaudeCodeDiffAccept", desc = "Accept diff" }, 22 | -- { "ad", "ClaudeCodeDiffDeny", desc = "Deny diff" }, 23 | -- }, 24 | } 25 | -------------------------------------------------------------------------------- /ghostty/config: -------------------------------------------------------------------------------- 1 | font-family = TX-02 2 | font-style = Regular 3 | font-size = 14 4 | 5 | # Leading 6 | adjust-cell-height = 15% 7 | 8 | macos-option-as-alt = true 9 | window-colorspace = display-p3 10 | window-padding-x = 12 11 | window-padding-y = 2 12 | 13 | cursor-color = #607487 14 | background = #252b37 15 | background-opacity = 0.97 16 | background-blur-radius = 20 17 | 18 | mouse-hide-while-typing = true 19 | mouse-shift-capture = true 20 | 21 | # Cursor style 22 | cursor-style = block 23 | cursor-style-blink = false 24 | 25 | # Clipboard settings 26 | clipboard-read = allow 27 | clipboard-write = allow 28 | copy-on-select = clipboard 29 | clipboard-trim-trailing-spaces = true 30 | 31 | # Poimandres Storm theme 32 | # black 33 | palette = 0=#1B1E28 34 | palette = 8=#506477 35 | # red 36 | palette = 1=#D0679D 37 | palette = 9=#D0679D 38 | # green 39 | palette = 2=#5DE4C7 40 | palette = 10=#5DE4C7 41 | # yellow 42 | palette = 3=#FFFAC2 43 | palette = 11=#FFFAC2 44 | # blue 45 | palette = 4=#89DDFF 46 | palette = 12=#ADD7FF 47 | # purple 48 | palette = 5=#FCC5E9 49 | palette = 13=#FCC5E9 50 | # aqua 51 | palette = 6=#89DDFF 52 | palette = 14=#ADD7FF 53 | # white 54 | palette = 7=#ffffff 55 | palette = 15=#ffffff 56 | keybind = shift+enter=text:\n 57 | -------------------------------------------------------------------------------- /fish/conf.d/nvm.fish: -------------------------------------------------------------------------------- 1 | set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share 2 | set --query nvm_mirror || set --global nvm_mirror https://nodejs.org/dist 3 | set --query nvm_data || set --global nvm_data $XDG_DATA_HOME/nvm 4 | 5 | function _nvm_install --on-event nvm_install 6 | test ! -d $nvm_data && command mkdir -p $nvm_data 7 | echo "Downloading the Node distribution index..." 2>/dev/null 8 | _nvm_index_update 9 | end 10 | 11 | function _nvm_update --on-event nvm_update 12 | set --query --universal nvm_data && set --erase --universal nvm_data 13 | set --query --universal nvm_mirror && set --erase --universal nvm_mirror 14 | set --query nvm_mirror || set --global nvm_mirror https://nodejs.org/dist 15 | end 16 | 17 | function _nvm_uninstall --on-event nvm_uninstall 18 | command rm -rf $nvm_data 19 | 20 | set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version 21 | 22 | set --names | string replace --filter --regex -- "^nvm" "set --erase nvm" | source 23 | functions --erase (functions --all | string match --entire --regex -- "^_nvm_") 24 | end 25 | 26 | if status is-interactive && set --query nvm_default_version && ! set --query nvm_current_version 27 | nvm use --silent $nvm_default_version 28 | end 29 | -------------------------------------------------------------------------------- /fish/functions/rbenv.fish: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Sam Stephenson 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining 4 | # a copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be 12 | # included in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | function rbenv 23 | set command $argv[1] 24 | set -e argv[1] 25 | 26 | switch "$command" 27 | case rehash shell 28 | source (rbenv "sh-$command" $argv|psub) 29 | case '*' 30 | command rbenv "$command" $argv 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /wezterm/.wezterm.lua: -------------------------------------------------------------------------------- 1 | local wezterm = require("wezterm") 2 | 3 | local config = {} 4 | 5 | if wezterm.config_builder then 6 | config = wezterm.config_builder() 7 | end 8 | 9 | config.color_scheme = "Poimandres Storm" 10 | 11 | config.colors = { 12 | background = "#252b37", 13 | cursor_bg = "#607487", 14 | cursor_border = "#607487", 15 | } 16 | 17 | config.font = wezterm.font_with_fallback({ 18 | { family = "Berkeley Mono", italic = false }, 19 | { family = "Symbols Nerd Font Mono", scale = 0.75 }, 20 | }) 21 | config.font_size = 14.0 22 | config.line_height = 1.15 23 | config.font_rules = { 24 | { 25 | intensity = "Normal", 26 | italic = true, 27 | font = wezterm.font_with_fallback({ 28 | { family = "Berkeley Mono", style = "Normal" }, 29 | }), 30 | }, 31 | { 32 | intensity = "Bold", 33 | italic = true, 34 | font = wezterm.font_with_fallback({ 35 | { family = "Berkeley Mono", italic = false }, 36 | }), 37 | }, 38 | } 39 | 40 | config.use_fancy_tab_bar = false 41 | config.hide_tab_bar_if_only_one_tab = true 42 | config.window_decorations = "INTEGRATED_BUTTONS|RESIZE" 43 | config.macos_window_background_blur = 100 44 | config.window_background_opacity = 0.9 45 | config.window_close_confirmation = "NeverPrompt" 46 | 47 | config.window_padding = { 48 | left = "24px", 49 | right = "24px", 50 | top = "1.5cell", 51 | bottom = "0.5cell", 52 | } 53 | 54 | config.keys = { 55 | { 56 | key = "Enter", 57 | mods = "ALT", 58 | action = wezterm.action.DisableDefaultAssignment, 59 | }, 60 | } 61 | 62 | return config 63 | -------------------------------------------------------------------------------- /fish/functions/reload.fish: -------------------------------------------------------------------------------- 1 | function reload 2 | # Help 3 | function __help -d "show help" 4 | printf "usage: reload [-h] [-c command] [-e 'env1=value1'] [-e 'env2=value2']\n\n" 5 | 6 | printf "positional arguments:\n" 7 | printf "\n" 8 | 9 | printf "optional arguments:\n" 10 | printf " -h, --help show this help message and exit\n" 11 | printf " -c, --command command to be executed before reloading\n" 12 | printf " -e, --env environment variable to be set before reloading\n" 13 | printf "\n" 14 | 15 | return 0 16 | end 17 | 18 | # Parse arguments 19 | set -l options h/help "c/command=" "e/env=+" 20 | argparse $options -- $argv || return 1 21 | 22 | # Show help 23 | set -q _flag_help && __help && return 0 24 | 25 | # Create unset options 26 | for env_var in (env) 27 | set key (string split = "$env_var")[1] 28 | if not contains "$key" $RELOAD_PROTECTED_ENV_VARS 29 | set unset_options $unset_options -u $key 30 | end 31 | end 32 | 33 | # Execute command 34 | set -q _flag_command && eval $_flag_command >/dev/null 2>&1 35 | 36 | # Evaluate env 37 | for env_var in $_flag_env 38 | set key (string split = "$env_var")[1] 39 | set value (string split = "$env_var")[2] 40 | 41 | set re_evaluated (fish -c "echo $value") 42 | set -a envs "$key=$re_evaluated" 43 | end 44 | 45 | # Reload shell 46 | exec env $unset_options /usr/bin/env $envs bash -i -c "exec fish" 47 | end 48 | -------------------------------------------------------------------------------- /starship/starship.toml: -------------------------------------------------------------------------------- 1 | palette = "poimandres-storm" 2 | 3 | format = """ 4 | [](bright-mint)\ 5 | [ ](bg:bright-mint fg:bg)\ 6 | [](bg:lower-mint fg:bright-mint)\ 7 | $directory\ 8 | [](bg:blueish-green fg:lower-mint)\ 9 | $git_branch\ 10 | [](bg:focus fg:blueish-green)\ 11 | $git_metrics\ 12 | [ ](fg:focus)\n$character 13 | """ 14 | 15 | [palettes.poimandres-storm] 16 | bright-yellow = "#fffac2" 17 | bright-mint = "#5de4c7" 18 | lower-mint = "#5fb3a1" 19 | blueish-green = "#42675a" 20 | lower-blue = "#89ddff" 21 | light-blue = "#add7ff" 22 | desaturated-blue = "#91b4d5" 23 | bluishGray-brighter = "#7390aa" 24 | hot-red = "#d0679d" 25 | pink = "#f087bd" 26 | gray = "#a6accd" 27 | white = "#ffffff" 28 | off-white = "#e4f0fb" 29 | darker-gray = "#868cad" 30 | bluish-gray = "#607487" 31 | selection = "#33394a" 32 | focus = "#404350" 33 | bg = "#252b37" 34 | black = "#101010" 35 | 36 | [character] 37 | success_symbol = "[❯](bold bright-mint)" 38 | error_symbol = "[❯](bold hot-red)" 39 | vicmd_symbol = "[↔](bold bright-yellow)" 40 | 41 | [battery] 42 | disabled = true 43 | 44 | [cmd_duration] 45 | format = "[$duration](gray)" 46 | 47 | [directory] 48 | format = "[ $path ](bg:lower-mint fg:black)" 49 | 50 | [git_branch] 51 | disabled = false 52 | format = "[ $branch ](bg:blueish-green fg:off-white)" 53 | 54 | [git_metrics] 55 | disabled = false 56 | format = "([ +$added ](bg:focus fg:bright-mint))([ -$deleted ](bg:focus fg:hot-red))" 57 | 58 | [nodejs] 59 | disabled = true 60 | 61 | [package] 62 | disabled = true 63 | 64 | [ruby] 65 | disabled = true 66 | 67 | [lua] 68 | disabled = true 69 | 70 | -------------------------------------------------------------------------------- /nvim/lua/config/eslint_warmup.lua: -------------------------------------------------------------------------------- 1 | -- Warmup eslint_d by running a no-op lint command when a relevant file is opened 2 | -- This triggers eslint_d to parse the project's ESLint config before the first save 3 | 4 | local function warmup_eslint_d() 5 | -- Get the full path of the current buffer 6 | local filepath = vim.fn.expand("%:p") 7 | if not filepath or filepath == "" then 8 | return 9 | end 10 | 11 | -- Find the project root (where package.json is) 12 | local project_root = vim.fn.finddir("node_modules/..", filepath .. ";") 13 | if not project_root or project_root == "" then 14 | return 15 | end 16 | 17 | -- Run eslint_d in a background job to warm it up 18 | -- The --fix-dry-run flag makes this a no-op that still forces eslint_d to parse the config 19 | vim.fn.jobstart({ "eslint_d", "--fix-dry-run", filepath }, { 20 | detach = true, 21 | cwd = project_root, 22 | on_exit = function(_, exit_code) 23 | if exit_code == 0 then 24 | vim.schedule(function() 25 | vim.notify("eslint_d warmed up for " .. project_root, vim.log.levels.DEBUG) 26 | end) 27 | end 28 | end, 29 | }) 30 | end 31 | 32 | -- Run the warmup when a relevant file is opened 33 | vim.api.nvim_create_autocmd({ "BufReadPost" }, { 34 | pattern = { "*.js", "*.ts", "*.jsx", "*.tsx", "*.vue", "*.svelte" }, 35 | callback = function() 36 | -- Use defer_fn to run this slightly after the file is opened 37 | vim.defer_fn(function() 38 | warmup_eslint_d() 39 | end, 300) -- 300ms delay to avoid blocking the UI 40 | end, 41 | desc = "Warm up eslint_d on file open", 42 | }) -------------------------------------------------------------------------------- /nvim/lua/plugins/core.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- disable some plugins 3 | { "RRethy/vim-illuminate", enabled = false }, 4 | { "lukas-reineke/indent-blankline.nvim", enabled = false }, 5 | { "akinsho/bufferline.nvim", enabled = false }, 6 | { "nvim-treesitter/nvim-treesitter-context", enabled = false }, 7 | { "kdheepak/lazygit.nvim", enabled = false }, 8 | -- mini.ai is nice, but is very broken for tag text objects 9 | { "mini-nvim/mini.ai", enabled = true }, 10 | 11 | { 12 | "LazyVim/LazyVim", 13 | opts = { 14 | colorscheme = "poimandres", 15 | }, 16 | }, 17 | { 18 | "nvim-mini/mini.surround", 19 | opts = { 20 | mappings = { 21 | add = "gsa", 22 | delete = "gsd", 23 | find = "gsf", 24 | find_left = "gsF", 25 | highlight = "gsh", 26 | replace = "gsr", 27 | update_n_lines = "gsn", 28 | }, 29 | }, 30 | }, 31 | { 32 | "nvim-treesitter/nvim-treesitter", 33 | opts = { 34 | ensure_installed = { 35 | "astro", 36 | "html", 37 | "css", 38 | "markdown", 39 | "markdown_inline", 40 | "javascript", 41 | "typescript", 42 | "json", 43 | "lua", 44 | "prisma", 45 | "regex", 46 | "ruby", 47 | "rust", 48 | "svelte", 49 | "tsx", 50 | "typescript", 51 | "vim", 52 | "yaml", 53 | }, 54 | }, 55 | }, 56 | { 57 | "rcarriga/nvim-notify", 58 | opts = { 59 | -- level = 3, 60 | -- render = "minimal", 61 | stages = "static", 62 | }, 63 | }, 64 | } 65 | -------------------------------------------------------------------------------- /nvim/lua/config/options.lua: -------------------------------------------------------------------------------- 1 | -- Options are automatically loaded before lazy.nvim startup 2 | -- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua 3 | -- Add any additional options here 4 | -- 5 | local opt = vim.opt 6 | opt.number = true 7 | opt.tabstop = 2 8 | opt.swapfile = false 9 | opt.updatetime = 0 10 | opt.encoding = "utf-8" 11 | opt.fileencoding = "utf-8" 12 | opt.smartindent = true 13 | opt.autoindent = true 14 | opt.iskeyword:append("-") 15 | opt.clipboard = "unnamedplus" 16 | opt.smarttab = true 17 | opt.tabstop = 2 18 | opt.softtabstop = 2 19 | opt.shiftwidth = 2 20 | opt.expandtab = true 21 | opt.incsearch = true 22 | opt.number = true 23 | opt.cmdheight = 1 24 | opt.signcolumn = "yes" 25 | 26 | -- vim.cmd([[let $NVIM_TUI_ENABLE_TRUE_COLOR=1]]) 27 | 28 | vim.cmd([[set termguicolors]]) 29 | vim.cmd([[set nocompatible]]) 30 | vim.cmd([[set breakindent]]) 31 | vim.cmd([[set nobackup]]) 32 | vim.cmd([[set nowritebackup]]) 33 | vim.cmd([[set lbr]]) 34 | vim.cmd([[set ignorecase]]) 35 | vim.cmd([[set smartcase]]) 36 | vim.cmd([[set wrap]]) 37 | vim.cmd([[set magic]]) 38 | vim.cmd([[set noerrorbells]]) 39 | vim.cmd([[set complete+=kspell]]) 40 | vim.cmd([[set completeopt=menu,menuone,noselect]]) 41 | vim.cmd([[set mouse=a]]) 42 | vim.cmd([[set pumblend=5]]) -- Transpareny of the popup menus 43 | vim.cmd([[lcd $PWD]]) 44 | 45 | -- Override LazyVim default options 46 | opt.confirm = false 47 | opt.list = false 48 | opt.conceallevel = 0 49 | opt.relativenumber = false 50 | 51 | vim.g.lazyvim_eslint_auto_format = true 52 | vim.g.lazyvim_prettier_needs_config = false 53 | -------------------------------------------------------------------------------- /nvim/lua/plugins/lspconfig.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "neovim/nvim-lspconfig", 3 | 4 | opts = { 5 | inlay_hints = { enabled = false }, 6 | setup = { 7 | eslint = function() 8 | Snacks.util.lsp.on({ name = "eslint" }, function(_, client) 9 | client.server_capabilities.documentFormattingProvider = true 10 | end) 11 | Snacks.util.lsp.on({ name = "tsserver" }, function(_, client) 12 | client.server_capabilities.documentFormattingProvider = false 13 | end) 14 | end, 15 | }, 16 | servers = { 17 | -- eslint = {}, 18 | tailwindcss = { 19 | settings = { 20 | tailwindCSS = { 21 | lint = { 22 | invalidApply = false, 23 | }, 24 | }, 25 | }, 26 | }, 27 | emmet_language_server = { 28 | filetypes = { "html", "typescriptreact", "javascriptreact" }, 29 | init_options = { 30 | syntaxProfiles = { 31 | html = { 32 | attr_quotes = "single", 33 | }, 34 | typescriptreact = { 35 | attr_quotes = "single", 36 | }, 37 | }, 38 | }, 39 | }, 40 | cssls = { 41 | settings = { 42 | css = { 43 | validate = true, 44 | lint = { 45 | unknownAtRules = "ignore", 46 | }, 47 | }, 48 | scss = { 49 | validate = true, 50 | lint = { 51 | unknownAtRules = "ignore", 52 | }, 53 | }, 54 | }, 55 | }, 56 | }, 57 | }, 58 | } 59 | -------------------------------------------------------------------------------- /nvim/lua/config/lazy.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 | if not vim.loop.fs_stat(lazypath) then 3 | -- bootstrap lazy.nvim 4 | -- stylua: ignore 5 | vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) 6 | end 7 | vim.opt.rtp:prepend(vim.env.LAZY or lazypath) 8 | 9 | require("lazy").setup({ 10 | spec = { 11 | { "LazyVim/LazyVim", import = "lazyvim.plugins" }, 12 | { import = "lazyvim.plugins.extras.lang.typescript" }, 13 | -- { import = "lazyvim.plugins.extras.linting.eslint" }, 14 | -- { import = "lazyvim.plugins.extras.formatting.prettier" }, 15 | { import = "plugins" }, 16 | }, 17 | defaults = { 18 | -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. 19 | -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. 20 | lazy = false, 21 | -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, 22 | -- have outdated releases, which may break your Neovim install. 23 | version = false, -- always use the latest git commit 24 | -- version = "*", -- try installing the latest stable version for plugins that support semver 25 | }, 26 | checker = { enabled = true }, -- automatically check for plugin updates 27 | performance = { 28 | rtp = { 29 | disabled_plugins = { 30 | "gzip", 31 | "tarPlugin", 32 | "tohtml", 33 | "tutor", 34 | "zipPlugin", 35 | }, 36 | }, 37 | }, 38 | }) 39 | -------------------------------------------------------------------------------- /nvim/lua/plugins/conform.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "stevearc/conform.nvim", 3 | event = { "BufReadPre" }, -- replaces LazyVim's default lazy load timing 4 | opts = { 5 | formatters_by_ft = { 6 | javascript = { "prettierd", "eslint_d" }, 7 | typescript = { "prettierd", "eslint_d" }, 8 | javascriptreact = { "prettierd", "eslint_d" }, 9 | typescriptreact = { "prettierd", "eslint_d" }, 10 | markdown = {}, 11 | }, 12 | -- format_on_save = { 13 | -- -- Recommended: increase timeout if first save is slow and you aren't pre-starting 14 | -- timeout_ms = 500, -- Default is 500, maybe increase? But pre-starting is better. 15 | -- lsp_fallback = true, -- Or false, depending on your preference 16 | -- }, 17 | -- formatters = { 18 | -- eslint_d = { 19 | -- command = "eslint_d", 20 | -- args = { 21 | -- "--stdin", 22 | -- "--stdin-filename", 23 | -- "$FILENAME", 24 | -- "--fix-to-stdout", 25 | -- }, 26 | -- stdin = true, 27 | -- condition = function(ctx) 28 | -- local found = vim.fs.find({ 29 | -- ".eslintrc", 30 | -- ".eslintrc.js", 31 | -- ".eslintrc.cjs", 32 | -- ".eslintrc.json", 33 | -- ".eslintrc.yaml", 34 | -- ".eslintrc.yml", 35 | -- "eslint.config.js", 36 | -- "eslint.config.mjs", 37 | -- }, { upward = true, path = ctx.dirname }) 38 | -- return #found > 0 39 | -- end, 40 | -- }, 41 | -- prettierd = { 42 | -- command = "prettierd", 43 | -- args = { "$FILENAME" }, 44 | -- stdin = true, 45 | -- }, 46 | -- }, 47 | }, 48 | } 49 | -------------------------------------------------------------------------------- /hammerspoon/init.lua: -------------------------------------------------------------------------------- 1 | hs.loadSpoon("ControlEscape"):start() -- Load Hammerspoon bits from https://github.com/jasonrudolph/ControlEscape.spoon 2 | 3 | -- Use control + hjkl to move around 4 | local function pressFn(mods, key) 5 | if key == nil then 6 | key = mods 7 | mods = {} 8 | end 9 | 10 | return function() 11 | hs.eventtap.keyStroke(mods, key, 1000) 12 | end 13 | end 14 | 15 | local function remap(mods, key, pressFn) 16 | hs.hotkey.bind(mods, key, pressFn, nil, pressFn) 17 | end 18 | 19 | local function enableHotkeyForApp(appName, hotkey) 20 | local filter = hs.window.filter.new(appName) 21 | filter:subscribe(hs.window.filter.windowFocused, function() 22 | hotkey:enable() 23 | end) 24 | filter:subscribe(hs.window.filter.windowUnfocused, function() 25 | hotkey:disable() 26 | end) 27 | end 28 | 29 | remap({ "ctrl" }, "h", pressFn("left")) 30 | remap({ "ctrl" }, "j", pressFn("down")) 31 | remap({ "ctrl" }, "k", pressFn("up")) 32 | remap({ "ctrl" }, "l", pressFn("right")) 33 | 34 | -- local ghosttyHotkey1 = hs.hotkey.new({ "cmd" }, "j", function() 35 | -- hs.eventtap.keyStroke({ "alt" }, "6", 1000) 36 | -- end) 37 | -- local ghosttyHotkey2 = hs.hotkey.new({ "cmd" }, "k", function() 38 | -- hs.eventtap.keyStroke({ "alt" }, "7", 1000) 39 | -- end) 40 | -- local ghosttyHotkey3 = hs.hotkey.new({ "cmd" }, "l", function() 41 | -- hs.eventtap.keyStroke({ "alt" }, "8", 1000) 42 | -- end) 43 | -- local ghosttyHotkey4 = hs.hotkey.new({ "cmd" }, ";", function() 44 | -- hs.eventtap.keyStroke({ "alt" }, "9", 1000) 45 | -- end) 46 | -- 47 | -- enableHotkeyForApp("Ghostty", ghosttyHotkey1) 48 | -- enableHotkeyForApp("Ghostty", ghosttyHotkey2) 49 | -- enableHotkeyForApp("Ghostty", ghosttyHotkey3) 50 | -- enableHotkeyForApp("Ghostty", ghosttyHotkey4) 51 | -------------------------------------------------------------------------------- /fish/completions/rbenv.fish: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2013 Sam Stephenson 2 | # 3 | # Permission is hereby granted, free of charge, to any person obtaining 4 | # a copy of this software and associated documentation files (the 5 | # "Software"), to deal in the Software without restriction, including 6 | # without limitation the rights to use, copy, modify, merge, publish, 7 | # distribute, sublicense, and/or sell copies of the Software, and to 8 | # permit persons to whom the Software is furnished to do so, subject to 9 | # the following conditions: 10 | # 11 | # The above copyright notice and this permission notice shall be 12 | # included in all copies or substantial portions of the Software. 13 | # 14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | function __fish_rbenv_needs_command 23 | set cmd (commandline -opc) 24 | if [ (count $cmd) -eq 1 -a $cmd[1] = 'rbenv' ] 25 | return 0 26 | end 27 | return 1 28 | end 29 | 30 | function __fish_rbenv_using_command 31 | set cmd (commandline -opc) 32 | if [ (count $cmd) -gt 1 ] 33 | if [ $argv[1] = $cmd[2] ] 34 | return 0 35 | end 36 | end 37 | return 1 38 | end 39 | 40 | complete -f -c rbenv -n '__fish_rbenv_needs_command' -a '(rbenv commands)' 41 | for cmd in (rbenv commands) 42 | complete -f -c rbenv -n "__fish_rbenv_using_command $cmd" -a \ 43 | "(rbenv completions (commandline -opc)[2..-1])" 44 | end 45 | -------------------------------------------------------------------------------- /fish/completions/nvm.fish: -------------------------------------------------------------------------------- 1 | complete --command nvm --exclusive 2 | complete --command nvm --exclusive --long version --description "Print version" 3 | complete --command nvm --exclusive --long help --description "Print help" 4 | complete --command nvm --long silent --description "Suppress standard output" 5 | 6 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version" 7 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate the specified Node version in the current shell" 8 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed Node versions" 9 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List available Node versions to install" 10 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active Node version" 11 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "( 12 | test -e $nvm_data && string split ' ' <$nvm_data/.index 13 | )" 14 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')" 15 | complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall the specified Node version" 16 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "( 17 | _nvm_list | string split ' ' | string replace system '' 18 | )" 19 | complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use uninstall" --arguments "( 20 | set --query nvm_default_version && echo default 21 | )" 22 | -------------------------------------------------------------------------------- /yabai/yabairc: -------------------------------------------------------------------------------- 1 | yabai -m config layout bsp 2 | yabai -m config window_placement second_child 3 | 4 | yabai -m config top_padding 10 5 | yabai -m config bottom_padding 10 6 | yabai -m config left_padding 10 7 | yabai -m config right_padding 10 8 | yabai -m config window_gap 10 9 | 10 | # center mouse on window with focus 11 | # yabai -m config mouse_follows_focus on 12 | 13 | # modifier for clicking and dragging with mouse 14 | yabai -m config mouse_modifier ctrl 15 | 16 | # set modifier + left-click drag to move window 17 | yabai -m config mouse_action1 move 18 | 19 | # set modifier + right-click drag to resize window 20 | yabai -m config mouse_action2 resize 21 | 22 | # when window is dropped in center of another window, swap them (on edges it will split it) 23 | yabai -m mouse_drop_action swap 24 | 25 | yabai -m rule --add app="^System Settings$" manage=off 26 | yabai -m rule --add app="^Activity Monitor$" manage=off 27 | yabai -m rule --add app="^zoom.us$" manage=off 28 | yabai -m rule --add app="^1Password$" manage=off 29 | yabai -m rule --add app="^Dash$" manage=off 30 | yabai -m rule --add app="^Hello Weather$" manage=off 31 | yabai -m rule --add app="^CleanMyMac X$" manage=off 32 | yabai -m rule --add app="^CleanShot X$" manage=off 33 | yabai -m rule --add app="^Transmission$" manage=off 34 | yabai -m rule --add app="^Parcel$" manage=off 35 | yabai -m rule --add app="^Copilot$" manage=off 36 | yabai -m rule --add app="^Insta360 Link Controller$" manage=off 37 | yabai -m rule --add app="^Kap$" manage=off 38 | yabai -m rule --add app="^Fig$" manage=off 39 | yabai -m rule --add app="^Sip$" manage=off 40 | yabai -m rule --add app="^Finder$" manage=off 41 | 42 | yabai -m rule --add app="^iTerm 2$" space=2 43 | yabai -m rule --add app="^Figma$" space=3 44 | 45 | # Fix ghostty tabs not taking up a slot in yabai layout 46 | yabai -m signal --add app='^Ghostty$' event=window_created action='yabai -m space --layout bsp' 47 | yabai -m signal --add app='^Ghostty$' event=window_destroyed action='yabai -m space --layout bsp' 48 | 49 | -------------------------------------------------------------------------------- /skhd/skhdrc: -------------------------------------------------------------------------------- 1 | # -- Changing Window Focus -- 2 | 3 | # change window focus within space 4 | alt - j : yabai -m window --focus south 5 | alt - k : yabai -m window --focus north 6 | alt - h : yabai -m window --focus west 7 | alt - l : yabai -m window --focus east 8 | 9 | # -- Modifying the Layout -- 10 | 11 | # rotate layout clockwise 12 | ctrl + alt - r : yabai -m space --rotate 270 13 | 14 | # flip along y-axis 15 | ctrl + alt - y : yabai -m space --mirror y-axis 16 | 17 | # flip along x-axis 18 | ctrl + alt - x : yabai -m space --mirror x-axis 19 | 20 | # toggle split type 21 | ctrl + alt - s : yabai -m window --toggle split 22 | 23 | # toggle window float 24 | ctrl + alt - t : yabai -m window --toggle float --grid 4:4:1:1:2:2 25 | 26 | # -- Modifying Window Size -- 27 | 28 | # maximize a window 29 | ctrl + alt - m : yabai -m window --toggle zoom-fullscreen 30 | 31 | # balance out tree of windows (resize to occupy same area) 32 | ctrl + alt - e : yabai -m space --balance 33 | 34 | # -- Moving Windows Around -- 35 | 36 | # swap windows 37 | ctrl + alt - j : yabai -m window --swap south 38 | ctrl + alt - k : yabai -m window --swap north 39 | ctrl + alt - h : yabai -m window --swap west 40 | ctrl + alt - l : yabai -m window --swap east 41 | 42 | # move window and split 43 | shift + alt - j : yabai -m window --warp south 44 | shift + alt - k : yabai -m window --warp north 45 | shift + alt - h : yabai -m window --warp west 46 | shift + alt - l : yabai -m window --warp east 47 | 48 | # move window to prev and next space 49 | shift + alt - p : yabai -m window --space prev; 50 | shift + alt - n : yabai -m window --space next; 51 | 52 | # move window to space # 53 | shift + alt - 1 : yabai -m window --space 1; 54 | shift + alt - 2 : yabai -m window --space 2; 55 | shift + alt - 3 : yabai -m window --space 3; 56 | shift + alt - 4 : yabai -m window --space 4; 57 | shift + alt - 5 : yabai -m window --space 5; 58 | 59 | # -- Starting/Stopping/Restarting Yabai -- 60 | 61 | # stop/start/restart yabai 62 | # shift + alt - q : brew services stop yabai 63 | # shift + alt - s : brew services start yabai 64 | # shift + alt - r : brew services restart yabai 65 | shift + alt - q : yabai --stop-service 66 | shift + alt - s : yabai --start-service 67 | shift + alt - r : yabai --restart-service 68 | -------------------------------------------------------------------------------- /nvim/lua/config/keymaps.lua: -------------------------------------------------------------------------------- 1 | -- Keymaps are automatically loaded on the VeryLazy event 2 | -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua 3 | -- Add any additional keymaps here 4 | 5 | -- Unmap keymaps that move lines 6 | vim.keymap.del("n", "") 7 | vim.keymap.del("n", "") 8 | vim.keymap.del("i", "") 9 | vim.keymap.del("i", "") 10 | vim.keymap.del("v", "") 11 | vim.keymap.del("v", "") 12 | 13 | -- Unmap window moving keymaps 14 | vim.keymap.del("n", "") 15 | vim.keymap.del("n", "") 16 | vim.keymap.del("n", "") 17 | vim.keymap.del("n", "") 18 | 19 | vim.keymap.set("n", "", "m .+1==", { desc = "Move down" }) 20 | vim.keymap.set("n", "", "m .-2==", { desc = "Move up" }) 21 | vim.keymap.set("i", "", "m .+1==gi", { desc = "Move down" }) 22 | vim.keymap.set("i", "", "m .-2==gi", { desc = "Move up" }) 23 | vim.keymap.set("v", "", ":m '>+1gv=gv", { desc = "Move down" }) 24 | vim.keymap.set("v", "", ":m '<-2gv=gv", { desc = "Move up" }) 25 | 26 | -- Unmap keymaps that manage splits 27 | -- vim.keymap.del("n", "w-") 28 | -- vim.keymap.del("n", "w|") 29 | -- vim.keymap.del("n", "wd") 30 | -- vim.keymap.del("n", "ww") 31 | -- vim.keymap.del("n", "wm") 32 | 33 | -- quicker saving 34 | vim.keymap.set("n", "ww", ":w", { desc = "Write buffer" }) 35 | vim.keymap.set("n", "W", ":wall", { desc = "Write all buffers" }) 36 | 37 | local neogit = require("neogit") 38 | 39 | vim.keymap.set("n", "gg", neogit.open, { desc = "Open Neogit" }) 40 | 41 | -- todo-comments 42 | vim.keymap.del("n", "xt") 43 | vim.keymap.del("n", "xT") 44 | 45 | -- gitlinker 46 | vim.keymap.set({ "n", "v" }, "gl", "GitLink! current_branch", { desc = "Open current branch" }) 47 | vim.keymap.set({ "n", "v" }, "gL", "GitLink! default_branch", { desc = "Open default branch" }) 48 | 49 | -- codecompanion 50 | -- vim.keymap.set({ "n", "v" }, "ai", "CodeCompanionActions", { noremap = true, silent = true }) 51 | -- vim.keymap.set({ "n", "v" }, "aa", "CodeCompanionChat Toggle", { noremap = true, silent = true }) 52 | 53 | -- require("which-key").register({ 54 | -- { "a", group = "CodeCompanion" }, 55 | -- { "a_", hidden = true }, 56 | -- }) 57 | -------------------------------------------------------------------------------- /tmux/.tmux.conf: -------------------------------------------------------------------------------- 1 | set -g default-terminal "screen-256color" 2 | set -ga terminal-overrides ",xterm-256color*:Tc" 3 | 4 | # Set prefix key 5 | unbind C-b 6 | set-option -g prefix C-a 7 | bind-key C-a send-prefix 8 | 9 | # Reduce esc key delay 10 | set -sg escape-time 10 11 | 12 | # Start numbering at 1 instead of 0 13 | set -g base-index 1 14 | setw -g pane-base-index 1 15 | 16 | set -g set-titles on 17 | set -g set-titles-string "#W #{command} #T #{session_path}" 18 | set -g escape-time 10 19 | set -g focus-events on 20 | set -g set-clipboard on 21 | 22 | # History limit 23 | set -g history-limit 5000 24 | 25 | # Mouse on 26 | set -g mouse on 27 | 28 | set-option -g status-position bottom 29 | set-option -g status on 30 | set-option -g status-interval 1 31 | set-option -g automatic-rename on 32 | set-option -g automatic-rename-format '#{b:pane_current_path}' 33 | 34 | # Panes 35 | unbind % 36 | bind | split-window -h 37 | 38 | unbind '"' 39 | bind - split-window -v 40 | 41 | bind -r h select-pane -L 42 | bind -r j select-pane -D 43 | bind -r k select-pane -U 44 | bind -r l select-pane -R 45 | 46 | bind -r m resize-pane -Z 47 | 48 | # saving sessions 49 | set -g @continuum-restore 'on' 50 | 51 | # tmuxline 52 | set -g status "on" 53 | set -g status-justify "left" 54 | set -g status-style "none,bg=default" 55 | set -g status-left-style "none" 56 | set -g status-left-length "100" 57 | set -g status-right-style "none" 58 | set -g status-right-length "100" 59 | set -g pane-border-style "fg=#33394a,bg=default" 60 | set -g pane-active-border-style "fg=#404350,bg=default" 61 | set -g pane-border-status bottom 62 | set -g pane-border-format "" 63 | set -g message-style "fg=brightwhite,bg=default" 64 | set -g message-command-style "fg=brightwhite,bg=default" 65 | setw -g window-status-activity-style "none" 66 | setw -g window-status-separator "" 67 | setw -g window-status-style "none,fg=brightwhite,bg=default" 68 | set -g status-left "#[fg=#5de4c7,bg=default,bold]#S #[fg=brightwhite,bg=default,nobold,nounderscore,noitalics]" 69 | set -g status-right "#[fg=#868cad,bg=default]%I:%M%p #[fg=#868cad,bg=default] %m/%d/%Y " 70 | setw -g window-status-format "#[fg=#5fb3a1,bg=default] #I#[fg=#868cad,bg=default] #W " 71 | setw -g window-status-current-format "#[fg=#5de4c7,bg=default] #I#[fg=#ffffff,bg=default] #W " 72 | 73 | unbind r 74 | bind r source-file ~/.tmux.conf \; display "Reloaded!" 75 | 76 | set -g @plugin 'tmux-plugins/tpm' 77 | set -g @plugin 'tmux-plugins/tmux-sensible' 78 | set -g @plugin 'jaclu/tmux-menus' 79 | set -g @plugin 'tmux-plugins/tmux-yank' 80 | set -g @plugin 'tmux-plugins/tmux-resurrect' 81 | set -g @plugin 'tmux-plugins/tmux-continuum' 82 | 83 | # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) 84 | run '~/.tmux/plugins/tpm/tpm' 85 | 86 | -------------------------------------------------------------------------------- /nvim/lua/plugins/dashboard-nvim.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvimdev/dashboard-nvim", 3 | event = "VimEnter", 4 | opts = function() 5 | local logo = [[ 6 | +++++++++++++++ 7 | +++++++++++++++++++++ 8 | +++++++++++++++++++++++++++ 9 | +++++++++++++++++++++++++++++ 10 | ++++++++++++++++++++++++++++ 11 | +++++++++++++++++++++++++ 12 | +++++++++++++++ ++++++ ++ 13 | ++++++++++++ +++++ ++++ 14 | +++++++++ ++++++ ++++++ 15 | +++++ +++++ ++++++++ 16 | +++++ +++++++ 17 | ++ +++++++ 18 | ]] 19 | logo = string.rep("\n", 6) .. logo .. "\n\n" 20 | 21 | local opts = { 22 | theme = "doom", 23 | hide = { 24 | -- this is taken care of by lualine 25 | -- enabling this messes up the actual laststatus setting after loading a file 26 | statusline = false, 27 | }, 28 | config = { 29 | header = vim.split(logo, "\n"), 30 | -- stylua: ignore 31 | center = { 32 | { action = "Telescope find_files", desc = " Find file", icon = " ", key = "f" }, 33 | { action = "ene | startinsert", desc = " New file", icon = " ", key = "n" }, 34 | { action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" }, 35 | { action = "Telescope live_grep", desc = " Find text", icon = " ", key = "g" }, 36 | { action = "e $MYVIMRC", desc = " Config", icon = " ", key = "c" }, 37 | { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" }, 38 | { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "e" }, 39 | { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, 40 | { action = "qa", desc = " Quit", icon = " ", key = "q" }, 41 | }, 42 | footer = function() 43 | local stats = require("lazy").stats() 44 | local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) 45 | return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" } 46 | end, 47 | }, 48 | } 49 | 50 | for _, button in ipairs(opts.config.center) do 51 | button.desc = button.desc .. string.rep(" ", 43 - #button.desc) 52 | end 53 | 54 | -- close Lazy and re-open when the dashboard is ready 55 | if vim.o.filetype == "lazy" then 56 | vim.cmd.close() 57 | vim.api.nvim_create_autocmd("User", { 58 | pattern = "DashboardLoaded", 59 | callback = function() 60 | require("lazy").show() 61 | end, 62 | }) 63 | end 64 | 65 | return opts 66 | end, 67 | } 68 | -------------------------------------------------------------------------------- /glow/nord.json: -------------------------------------------------------------------------------- 1 | { 2 | "document": { 3 | "block_prefix": "\n", 4 | "block_suffix": "\n", 5 | "color": "#ECEFF4", 6 | "indent": 2 7 | }, 8 | "block_quote": { 9 | "indent": 1, 10 | "indent_token": "│ " 11 | }, 12 | "paragraph": {}, 13 | "list": { 14 | "level_indent": 2 15 | }, 16 | "heading": { 17 | "block_suffix": "\n", 18 | "color": "#81a1c1", 19 | "bold": true 20 | }, 21 | "h1": { 22 | "prefix": " ", 23 | "suffix": " ", 24 | "color": "#ECEFF4", 25 | "background_color": "#5E81AC", 26 | "bold": true 27 | }, 28 | "h2": { 29 | "prefix": "## " 30 | }, 31 | "h3": { 32 | "prefix": "### " 33 | }, 34 | "h4": { 35 | "prefix": "#### " 36 | }, 37 | "h5": { 38 | "prefix": "##### " 39 | }, 40 | "h6": { 41 | "prefix": "###### ", 42 | "color": "#A3BE8C", 43 | "bold": false 44 | }, 45 | "text": {}, 46 | "strikethrough": { 47 | "crossed_out": true 48 | }, 49 | "emph": { 50 | "italic": true 51 | }, 52 | "strong": { 53 | "bold": true 54 | }, 55 | "hr": { 56 | "color": "#4C566A", 57 | "format": "\n--------\n" 58 | }, 59 | "item": { 60 | "block_prefix": "• " 61 | }, 62 | "enumeration": { 63 | "block_prefix": ". " 64 | }, 65 | "task": { 66 | "ticked": "[✓] ", 67 | "unticked": "[ ] " 68 | }, 69 | "link": { 70 | "color": "#A3BE8C", 71 | "underline": true 72 | }, 73 | "link_text": { 74 | "color": "#88c0d0" 75 | }, 76 | "image": { 77 | "color": "#B48EAD", 78 | "underline": true 79 | }, 80 | "image_text": { 81 | "color": "#81A1C1", 82 | "format": "Image: {{.text}} →" 83 | }, 84 | "code": { 85 | "color": "#b48ead" 86 | }, 87 | "code_block": { 88 | "color": "#D8DEE9", 89 | "margin": 2, 90 | "chroma": { 91 | "text": { 92 | "color": "#D8DEE9" 93 | }, 94 | "error": { 95 | "color": "#E5E9F0", 96 | "background_color": "#BF616A" 97 | }, 98 | "comment": { 99 | "color": "#616E88" 100 | }, 101 | "comment_preproc": { 102 | "color": "#D08770" 103 | }, 104 | "keyword": { 105 | "color": "#5E81AC" 106 | }, 107 | "keyword_reserved": { 108 | "color": "#B48EAD" 109 | }, 110 | "keyword_namespace": { 111 | "color": "#BF616A" 112 | }, 113 | "keyword_type": { 114 | "color": "#81A1C1" 115 | }, 116 | "operator": { 117 | "color": "#BF616A" 118 | }, 119 | "punctuation": { 120 | "color": "#EBCB8B" 121 | }, 122 | "name": { 123 | "color": "#88C0D0" 124 | }, 125 | "name_builtin": { 126 | "color": "#B48EAD" 127 | }, 128 | "name_tag": { 129 | "color": "#B48EAD" 130 | }, 131 | "name_attribute": { 132 | "color": "#5E81AC" 133 | }, 134 | "name_class": { 135 | "color": "#E5E9F0", 136 | "underline": true, 137 | "bold": true 138 | }, 139 | "name_constant": {}, 140 | "name_decorator": { 141 | "color": "#EBCB8B" 142 | }, 143 | "name_exception": {}, 144 | "name_function": { 145 | "color": "#A3BE8C" 146 | }, 147 | "name_other": {}, 148 | "literal": {}, 149 | "literal_number": { 150 | "color": "#8FBCBB" 151 | }, 152 | "literal_date": {}, 153 | "literal_string": { 154 | "color": "#D08770" 155 | }, 156 | "literal_string_escape": { 157 | "color": "#8FBCBB" 158 | }, 159 | "generic_deleted": { 160 | "color": "#BF616A" 161 | }, 162 | "generic_emph": { 163 | "italic": true 164 | }, 165 | "generic_inserted": { 166 | "color": "#A3BE8C" 167 | }, 168 | "generic_strong": { 169 | "bold": true 170 | }, 171 | "generic_subheading": { 172 | "color": "#88C0D0" 173 | }, 174 | "background": { 175 | "background_color": "#88C0D0" 176 | } 177 | } 178 | }, 179 | "table": { 180 | "center_separator": "┼", 181 | "column_separator": "│", 182 | "row_separator": "─" 183 | }, 184 | "definition_list": {}, 185 | "definition_term": {}, 186 | "definition_description": { 187 | "block_prefix": "\n🠶 " 188 | }, 189 | "html_block": {}, 190 | "html_span": {} 191 | } 192 | -------------------------------------------------------------------------------- /nvim/lua/config/eslint_daemon.lua: -------------------------------------------------------------------------------- 1 | -- Start and maintain eslint_d daemon for JavaScript/TypeScript projects 2 | -- This ensures the daemon is running before any formatting operations and keeps it alive 3 | 4 | -- Keep track of where we tried starting eslint_d within this Neovim session 5 | local started_eslint_d_dirs = {} 6 | -- Store timer IDs for each project directory 7 | local keepalive_timers = {} 8 | 9 | -- Function to start eslint_d daemon for a project 10 | local function start_eslint_d(project_dir) 11 | if not started_eslint_d_dirs[project_dir] then 12 | vim.notify("Starting eslint_d daemon for project: " .. project_dir, vim.log.levels.INFO) 13 | vim.fn.jobstart({ "eslint_d", "start" }, { 14 | detach = true, 15 | cwd = project_dir, 16 | }) 17 | started_eslint_d_dirs[project_dir] = true 18 | end 19 | end 20 | 21 | -- Function to check if eslint_d is running and restart if needed 22 | local function check_and_restart_eslint_d(project_dir) 23 | -- Use the ping command to check if eslint_d is responsive 24 | vim.fn.jobstart({ "eslint_d", "status" }, { 25 | cwd = project_dir, 26 | stdout_buffered = true, 27 | on_stdout = function(_, data) 28 | if not data or #data == 0 or (data[1] == "" and #data == 1) then 29 | return 30 | end 31 | 32 | -- If we get a response, eslint_d is running 33 | -- Do nothing as it's already running 34 | end, 35 | on_exit = function(_, exit_code) 36 | -- If ping fails (non-zero exit code), restart the daemon 37 | if exit_code ~= 0 then 38 | vim.notify("eslint_d is not running for " .. project_dir .. ", restarting...", vim.log.levels.WARN) 39 | start_eslint_d(project_dir) 40 | end 41 | end, 42 | }) 43 | end 44 | 45 | -- Set up a keepalive timer for a project 46 | local function setup_keepalive(project_dir) 47 | -- Cancel any existing timer for this project 48 | if keepalive_timers[project_dir] then 49 | vim.fn.timer_stop(keepalive_timers[project_dir]) 50 | keepalive_timers[project_dir] = nil 51 | end 52 | 53 | -- Create a new timer that runs every 5 minutes (300000 ms) 54 | local timer_id = vim.fn.timer_start(300000, function() 55 | check_and_restart_eslint_d(project_dir) 56 | -- This is a repeating timer 57 | end, { ['repeat'] = -1 }) -- -1 means repeat indefinitely 58 | 59 | keepalive_timers[project_dir] = timer_id 60 | end 61 | 62 | -- Find and ensure eslint_d daemon is running when entering a JS/TS file 63 | vim.api.nvim_create_autocmd({ "BufEnter" }, { 64 | pattern = { "*.js", "*.ts", "*.jsx", "*.tsx", "*.vue", "*.svelte" }, 65 | callback = function() 66 | -- Get the directory of the current buffer 67 | local current_buf_dir = vim.fn.expand("%:p:h") 68 | if not current_buf_dir or current_buf_dir == "" then 69 | return 70 | end 71 | 72 | -- Find package.json to determine project root 73 | local proj_dir_marker = vim.fn.findfile("package.json", current_buf_dir .. ";") 74 | 75 | if proj_dir_marker and proj_dir_marker ~= "" then 76 | -- Get the directory containing package.json (the project root) 77 | local project_dir = vim.fn.fnamemodify(proj_dir_marker, ":h") 78 | 79 | -- Start the daemon if not already started 80 | start_eslint_d(project_dir) 81 | 82 | -- Set up keepalive timer 83 | setup_keepalive(project_dir) 84 | end 85 | end, 86 | desc = "Start eslint_d daemon and keep it alive for JS/TS projects", 87 | }) 88 | 89 | -- Clean up timers when Neovim exits 90 | vim.api.nvim_create_autocmd("VimLeavePre", { 91 | callback = function() 92 | for proj_dir, timer_id in pairs(keepalive_timers) do 93 | if timer_id then 94 | vim.fn.timer_stop(timer_id) 95 | keepalive_timers[proj_dir] = nil 96 | end 97 | end 98 | end, 99 | desc = "Clean up eslint_d keepalive timers on exit", 100 | }) 101 | 102 | -- Also check eslint_d status before saving to ensure it's running 103 | vim.api.nvim_create_autocmd("BufWritePre", { 104 | pattern = { "*.js", "*.ts", "*.jsx", "*.tsx", "*.vue", "*.svelte" }, 105 | callback = function() 106 | local current_buf_dir = vim.fn.expand("%:p:h") 107 | if not current_buf_dir or current_buf_dir == "" then 108 | return 109 | end 110 | 111 | local proj_dir_marker = vim.fn.findfile("package.json", current_buf_dir .. ";") 112 | 113 | if proj_dir_marker and proj_dir_marker ~= "" then 114 | local project_dir = vim.fn.fnamemodify(proj_dir_marker, ":h") 115 | check_and_restart_eslint_d(project_dir) 116 | end 117 | end, 118 | desc = "Check eslint_d status before saving", 119 | }) -------------------------------------------------------------------------------- /fish/functions/__bass.py: -------------------------------------------------------------------------------- 1 | """ 2 | To be used with a companion fish function like this: 3 | 4 | function refish 5 | set -l _x (python /tmp/bass.py source ~/.nvm/nvim.sh ';' nvm use iojs); source $_x; and rm -f $_x 6 | end 7 | 8 | """ 9 | 10 | from __future__ import print_function 11 | 12 | import json 13 | import os 14 | import signal 15 | import subprocess 16 | import sys 17 | import traceback 18 | 19 | 20 | BASH = 'bash' 21 | 22 | FISH_READONLY = [ 23 | 'PWD', 'SHLVL', 'history', 'pipestatus', 'status', 'version', 24 | 'FISH_VERSION', 'fish_pid', 'hostname', '_', 'fish_private_mode' 25 | ] 26 | 27 | IGNORED = [ 28 | 'PS1', 'XPC_SERVICE_NAME' 29 | ] 30 | 31 | def ignored(name): 32 | if name == 'PWD': # this is read only, but has special handling 33 | return False 34 | # ignore other read only variables 35 | if name in FISH_READONLY: 36 | return True 37 | if name in IGNORED or name.startswith("BASH_FUNC"): 38 | return True 39 | return False 40 | 41 | def escape(string): 42 | # use json.dumps to reliably escape quotes and backslashes 43 | return json.dumps(string).replace(r'$', r'\$') 44 | 45 | def escape_identifier(word): 46 | return escape(word.replace('?', '\\?')) 47 | 48 | def comment(string): 49 | return '\n'.join(['# ' + line for line in string.split('\n')]) 50 | 51 | def gen_script(): 52 | # Use the following instead of /usr/bin/env to read environment so we can 53 | # deal with multi-line environment variables (and other odd cases). 54 | env_reader = "%s -c 'import os,json; print(json.dumps({k:v for k,v in os.environ.items()}))'" % (sys.executable) 55 | args = [BASH, '-c', env_reader] 56 | output = subprocess.check_output(args, universal_newlines=True) 57 | old_env = output.strip() 58 | 59 | pipe_r, pipe_w = os.pipe() 60 | if sys.version_info >= (3, 4): 61 | os.set_inheritable(pipe_w, True) 62 | command = 'eval $1 && ({}; alias) >&{}'.format( 63 | env_reader, 64 | pipe_w 65 | ) 66 | args = [BASH, '-c', command, 'bass', ' '.join(sys.argv[1:])] 67 | p = subprocess.Popen(args, universal_newlines=True, close_fds=False) 68 | os.close(pipe_w) 69 | with os.fdopen(pipe_r) as f: 70 | new_env = f.readline() 71 | alias_str = f.read() 72 | if p.wait() != 0: 73 | raise subprocess.CalledProcessError( 74 | returncode=p.returncode, 75 | cmd=' '.join(sys.argv[1:]), 76 | output=new_env + alias_str 77 | ) 78 | new_env = new_env.strip() 79 | 80 | old_env = json.loads(old_env) 81 | new_env = json.loads(new_env) 82 | 83 | script_lines = [] 84 | 85 | for k, v in new_env.items(): 86 | if ignored(k): 87 | continue 88 | v1 = old_env.get(k) 89 | if not v1: 90 | script_lines.append(comment('adding %s=%s' % (k, v))) 91 | elif v1 != v: 92 | script_lines.append(comment('updating %s=%s -> %s' % (k, v1, v))) 93 | # process special variables 94 | if k == 'PWD': 95 | script_lines.append('cd %s' % escape(v)) 96 | continue 97 | else: 98 | continue 99 | if k == 'PATH': 100 | value = ' '.join([escape(directory) 101 | for directory in v.split(':')]) 102 | else: 103 | value = escape(v) 104 | script_lines.append('set -g -x %s %s' % (k, value)) 105 | 106 | for var in set(old_env.keys()) - set(new_env.keys()): 107 | script_lines.append(comment('removing %s' % var)) 108 | script_lines.append('set -e %s' % var) 109 | 110 | script = '\n'.join(script_lines) 111 | 112 | alias_lines = [] 113 | for line in alias_str.splitlines(): 114 | _, rest = line.split(None, 1) 115 | k, v = rest.split("=", 1) 116 | alias_lines.append("alias " + escape_identifier(k) + "=" + v) 117 | alias = '\n'.join(alias_lines) 118 | 119 | return script + '\n' + alias 120 | 121 | script_file = os.fdopen(3, 'w') 122 | 123 | if not sys.argv[1:]: 124 | print('__bass_usage', file=script_file, end='') 125 | sys.exit(0) 126 | 127 | try: 128 | script = gen_script() 129 | except subprocess.CalledProcessError as e: 130 | sys.exit(e.returncode) 131 | except Exception: 132 | print('Bass internal error!', file=sys.stderr) 133 | raise # traceback will output to stderr 134 | except KeyboardInterrupt: 135 | signal.signal(signal.SIGINT, signal.SIG_DFL) 136 | os.kill(os.getpid(), signal.SIGINT) 137 | else: 138 | script_file.write(script) 139 | -------------------------------------------------------------------------------- /fish/fish_variables: -------------------------------------------------------------------------------- 1 | # This file contains fish universal variable definitions. 2 | # VERSION: 3.0 3 | SETUVAR --export ANTHROPIC_API_KEY:sk\x2dant\x2dapi03\x2dCMWmGm0KJteSwNLACnowaZJ7oXk0pzK5J4urcR\x2dvWIxFZgQbI0Hpf75M_OUUoeBshogHlVEaRhBlyjcStqLzRw\x2dxizRHgAA 4 | SETUVAR --export AVANTE_ANTHROPIC_API_KEY:sk\x2dant\x2dapi03\x2deV3kHB1g3bGt1gKXvZilRREQu6InwXmH7vVUdSY0P2pk_paRC7osLUWZ8tc1PjtLzOGhJve0yspeITezzq6n7A\x2dtKXmygAA 5 | SETUVAR --export BAT_THEME:Nord 6 | SETUVAR --export BUN_INSTALL:/Users/jason/\x2ebun 7 | SETUVAR --export CHTSH_CONF:/Users/jason/\x2econfig/cht\x2esh/cht\x2esh\x2econf 8 | SETUVAR --export CHTSH_QUERY_OPTIONS:style\x3dnative 9 | SETUVAR --export EDITOR:nvim 10 | SETUVAR --export --path GOPATH:/Users/jason/go/bin 11 | SETUVAR --export HIGHLIGHT_STYLE:nord 12 | SETUVAR --export LESS:\x2dR 13 | SETUVAR --export NEXT_PUBLIC_ADMIN_URL:http\x3a//admin\x2eplanetscaledb\x2elocal\x3a3000/admin 14 | SETUVAR NVM_DIR:/Users/jason/\x2envm 15 | SETUVAR --export OPENAI_API_KEY:sk\x2dproj\x2daIq_91oIUG36wzf0p8hbfUmf4YaNliGmQlmNQmEI9QGbqkOrJmFSvaQP0dU3GMfuWoTScKBu5XT3BlbkFJl9XFfV\x2dGgsQHRKG5ndjEgBXajO4bJ47CPCVF1wfrnPVH_eYuhW5deYrkqqfVszaxw_XXSh2ccA 16 | SETUVAR --export --path PATH:/Library/Frameworks/Python\x2eframework/Versions/3\x2e11/bin\x1e/Users/jason/\x2ebun/bin\x1e/Users/jason/\x2erbenv/shims\x1e/Users/jason/\x2erbenv/shims\x1e/Users/jason/\x2elocal/share/nvm/v22\x2e12\x2e0/bin\x1e/opt/homebrew/opt/postgresql\x4017/bin\x1e/Users/jason/\x2eps\x2dtoolbox/bin\x1e/opt/homebrew/opt/mysql\x408\x2e0/bin\x1e/Users/jason/\x2elocal/share/bob/nvim\x2dbin\x1e/opt/homebrew/sbin\x1e/Users/jason/\x2ecargo/bin\x1e/opt/homebrew/bin\x1e/Applications/Visual\x20Studio\x20Code\x2eapp/Contents/Resources/app/bin\x1e/Users/jason/go/bin\x1e/Users/jason/\x2erbenv/bin\x1e/Users/jason/\x2efig/bin\x1e/Users/jason/\x2elocal/bin\x1e/usr/local/bin\x1e/System/Cryptexes/App/usr/bin\x1e/usr/bin\x1e/bin\x1e/usr/sbin\x1e/sbin\x1e/var/run/com\x2eapple\x2esecurity\x2ecryptexd/codex\x2esystem/bootstrap/usr/local/bin\x1e/var/run/com\x2eapple\x2esecurity\x2ecryptexd/codex\x2esystem/bootstrap/usr/bin\x1e/var/run/com\x2eapple\x2esecurity\x2ecryptexd/codex\x2esystem/bootstrap/usr/appleinternal/bin\x1e/Library/Apple/usr/bin\x1e/usr/local/MacGPG2/bin\x1e/Applications/Ghostty\x2eapp/Contents/MacOS\x1eUnknown\x20command\x1e\x20\x22bin\x22\x1e\x2e\x1eTo\x20see\x20a\x20list\x20of\x20supported\x20npm\x20commands\x2c\x20run\x1e\x2e\x1e\x20\x20npm\x20help 17 | SETUVAR VIRTUAL_ENV_DISABLE_PROMPT:true 18 | SETUVAR Z_DATA_DIR:/Users/jason/\x2elocal/share/z 19 | SETUVAR __fish_initialized:3800 20 | SETUVAR _fisher_edc_2F_bass_files:\x7e/\x2econfig/fish/functions/__bass\x2epy\x1e\x7e/\x2econfig/fish/functions/bass\x2efish 21 | SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish 22 | SETUVAR _fisher_jorgebucaran_2F_nvm_2E_fish_files:\x7e/\x2econfig/fish/functions/_nvm_index_update\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_list\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_activate\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_deactivate\x2efish\x1e\x7e/\x2econfig/fish/functions/nvm\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/nvm\x2efish\x1e\x7e/\x2econfig/fish/completions/nvm\x2efish 23 | SETUVAR _fisher_kenji_2D_miyake_2F_reload_2E_fish_files:\x7e/\x2econfig/fish/functions/bash\x2efish\x1e\x7e/\x2econfig/fish/functions/reload\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/reload\x2efish 24 | SETUVAR _fisher_plugins:kenji\x2dmiyake/reload\x2efish\x1ejorgebucaran/nvm\x2efish 25 | SETUVAR _fisher_rbenv_2F_fish_2D_rbenv_files:\x7e/\x2econfig/fish/functions/rbenv\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/rbenv\x2efish\x1e\x7e/\x2econfig/fish/completions/rbenv\x2efish 26 | SETUVAR _fisher_upgraded_to_4_4:\x1d 27 | SETUVAR fish_color_autosuggestion:868cad 28 | SETUVAR fish_color_cancel:\x1d 29 | SETUVAR fish_color_command:5fb3a1 30 | SETUVAR fish_color_comment:868cad 31 | SETUVAR fish_color_cwd:\x1d 32 | SETUVAR fish_color_cwd_root:red 33 | SETUVAR fish_color_end:ff966c 34 | SETUVAR fish_color_error:d0679d 35 | SETUVAR fish_color_escape:c099ff 36 | SETUVAR fish_color_history_current:\x2d\x2dbold 37 | SETUVAR fish_color_host:\x1d 38 | SETUVAR fish_color_host_remote:\x1d 39 | SETUVAR fish_color_keyword:ffffff 40 | SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue 41 | SETUVAR fish_color_normal:a6accd 42 | SETUVAR fish_color_operator:c3e88d 43 | SETUVAR fish_color_option:\x1d 44 | SETUVAR fish_color_param:e4f0fb 45 | SETUVAR fish_color_quote:5de4c7 46 | SETUVAR fish_color_redirection:5fb3a1 47 | SETUVAR fish_color_search_match:\x2d\x2dbackground\x3d3654a7 48 | SETUVAR fish_color_selection:\x2d\x2dbackground\x3d3654a7 49 | SETUVAR fish_color_user:\x1d 50 | SETUVAR fish_color_valid_path:\x2d\x2dunderline 51 | SETUVAR fish_key_bindings:fish_vi_key_bindings 52 | SETUVAR fish_pager_color_background:\x1d 53 | SETUVAR fish_pager_color_completion:c8d3f5 54 | SETUVAR fish_pager_color_description:636da6 55 | SETUVAR fish_pager_color_prefix:86e1fc 56 | SETUVAR fish_pager_color_progress:636da6 57 | SETUVAR fish_pager_color_secondary_background:\x1d 58 | SETUVAR fish_pager_color_secondary_completion:\x1d 59 | SETUVAR fish_pager_color_secondary_description:\x1d 60 | SETUVAR fish_pager_color_secondary_prefix:\x1d 61 | SETUVAR fish_pager_color_selected_background:\x2d\x2dbackground\x3d3654a7 62 | SETUVAR fish_pager_color_selected_completion:\x1d 63 | SETUVAR fish_pager_color_selected_description:\x1d 64 | SETUVAR fish_pager_color_selected_prefix:\x1d 65 | SETUVAR --export fish_user_paths:/opt/homebrew/opt/postgresql\x4017/bin\x1e/Users/jason/\x2eps\x2dtoolbox/bin\x1e/opt/homebrew/opt/mysql\x408\x2e0/bin\x1e/Users/jason/\x2elocal/share/bob/nvim\x2dbin\x1e/opt/homebrew/sbin\x1e/Users/jason/\x2ecargo/bin\x1e/opt/homebrew/bin\x1e/Applications/Visual\x20Studio\x20Code\x2eapp/Contents/Resources/app/bin\x1e/Users/jason/go/bin\x1e/Users/jason/\x2erbenv/bin\x1e/Users/jason/\x2efig/bin\x1e/Users/jason/\x2elocal/bin\x1e/Applications/Ghostty\x2eapp/Contents/MacOS 66 | SETUVAR nvm_default_version:v22\x2e12\x2e0 67 | -------------------------------------------------------------------------------- /nvim/lua/plugins/example.lua: -------------------------------------------------------------------------------- 1 | -- since this is just an example spec, don't actually load anything here and return an empty spec 2 | -- stylua: ignore 3 | if true then return {} end 4 | 5 | -- every spec file under config.plugins will be loaded automatically by lazy.nvim 6 | -- 7 | -- In your plugin files, you can: 8 | -- * add extra plugins 9 | -- * disable/enabled LazyVim plugins 10 | -- * override the configuration of LazyVim plugins 11 | return { 12 | -- add gruvbox 13 | { "ellisonleao/gruvbox.nvim" }, 14 | 15 | -- Configure LazyVim to load gruvbox 16 | { 17 | "LazyVim/LazyVim", 18 | opts = { 19 | colorscheme = "gruvbox", 20 | }, 21 | }, 22 | 23 | -- change trouble config 24 | { 25 | "folke/trouble.nvim", 26 | -- opts will be merged with the parent spec 27 | opts = { use_diagnostic_signs = true }, 28 | }, 29 | 30 | -- disable trouble 31 | { "folke/trouble.nvim", enabled = false }, 32 | 33 | -- add symbols-outline 34 | { 35 | "simrat39/symbols-outline.nvim", 36 | cmd = "SymbolsOutline", 37 | keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, 38 | config = true, 39 | }, 40 | 41 | -- override nvim-cmp and add cmp-emoji 42 | -- { 43 | -- "hrsh7th/nvim-cmp", 44 | -- dependencies = { "hrsh7th/cmp-emoji" }, 45 | -- ---@param opts cmp.ConfigSchema 46 | -- opts = function(_, opts) 47 | -- local cmp = require("cmp") 48 | -- opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } })) 49 | -- end, 50 | -- }, 51 | 52 | -- change some telescope options and a keymap to browse plugin files 53 | { 54 | "nvim-telescope/telescope.nvim", 55 | keys = { 56 | -- add a keymap to browse plugin files 57 | -- stylua: ignore 58 | { 59 | "fp", 60 | function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, 61 | desc = "Find Plugin File", 62 | }, 63 | }, 64 | -- change some options 65 | opts = { 66 | defaults = { 67 | layout_strategy = "horizontal", 68 | layout_config = { prompt_position = "top" }, 69 | sorting_strategy = "ascending", 70 | winblend = 0, 71 | }, 72 | }, 73 | }, 74 | 75 | -- add telescope-fzf-native 76 | { 77 | "telescope.nvim", 78 | dependencies = { 79 | "nvim-telescope/telescope-fzf-native.nvim", 80 | build = "make", 81 | config = function() 82 | require("telescope").load_extension("fzf") 83 | end, 84 | }, 85 | }, 86 | 87 | -- add pyright to lspconfig 88 | { 89 | "neovim/nvim-lspconfig", 90 | ---@class PluginLspOpts 91 | opts = { 92 | ---@type lspconfig.options 93 | servers = { 94 | -- pyright will be automatically installed with mason and loaded with lspconfig 95 | pyright = {}, 96 | }, 97 | }, 98 | }, 99 | 100 | -- add tsserver and setup with typescript.nvim instead of lspconfig 101 | { 102 | "neovim/nvim-lspconfig", 103 | dependencies = { 104 | "jose-elias-alvarez/typescript.nvim", 105 | init = function() 106 | require("lazyvim.util").on_attach(function(_, buffer) 107 | -- stylua: ignore 108 | vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) 109 | vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) 110 | end) 111 | end, 112 | }, 113 | ---@class PluginLspOpts 114 | opts = { 115 | ---@type lspconfig.options 116 | servers = { 117 | -- tsserver will be automatically installed with mason and loaded with lspconfig 118 | tsserver = {}, 119 | }, 120 | -- you can do any additional lsp server setup here 121 | -- return true if you don't want this server to be setup with lspconfig 122 | ---@type table 123 | setup = { 124 | -- example to setup with typescript.nvim 125 | tsserver = function(_, opts) 126 | require("typescript").setup({ server = opts }) 127 | return true 128 | end, 129 | -- Specify * to use this function as a fallback for any server 130 | -- ["*"] = function(server, opts) end, 131 | }, 132 | }, 133 | }, 134 | 135 | -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, 136 | -- treesitter, mason and typescript.nvim. So instead of the above, you can use: 137 | { import = "lazyvim.plugins.extras.lang.typescript" }, 138 | 139 | -- add more treesitter parsers 140 | { 141 | "nvim-treesitter/nvim-treesitter", 142 | opts = { 143 | ensure_installed = { 144 | "bash", 145 | "help", 146 | "html", 147 | "javascript", 148 | "json", 149 | "lua", 150 | "markdown", 151 | "markdown_inline", 152 | "python", 153 | "query", 154 | "regex", 155 | "tsx", 156 | "typescript", 157 | "vim", 158 | "yaml", 159 | }, 160 | }, 161 | }, 162 | 163 | -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above 164 | -- would overwrite `ensure_installed` with the new value. 165 | -- If you'd rather extend the default config, use the code below instead: 166 | -- { 167 | -- "nvim-treesitter/nvim-treesitter", 168 | -- opts = function(_, opts) 169 | -- -- add tsx and treesitter 170 | -- vim.list_extend(opts.ensure_installed, { 171 | -- "tsx", 172 | -- "typescript", 173 | -- }) 174 | -- end, 175 | -- }, 176 | 177 | -- the opts function can also be used to change the default opts: 178 | { 179 | "nvim-lualine/lualine.nvim", 180 | event = "VeryLazy", 181 | opts = function(_, opts) 182 | table.insert(opts.sections.lualine_x, "😄") 183 | end, 184 | }, 185 | 186 | -- or you can return new options to override all the defaults 187 | { 188 | "nvim-lualine/lualine.nvim", 189 | event = "VeryLazy", 190 | opts = function() 191 | return { 192 | --[[add your custom lualine config here]] 193 | } 194 | end, 195 | }, 196 | 197 | -- use mini.starter instead of alpha 198 | { import = "lazyvim.plugins.extras.ui.mini-starter" }, 199 | 200 | -- add jsonls and schemastore ans setup treesitter for json, json5 and jsonc 201 | { import = "lazyvim.plugins.extras.lang.json" }, 202 | 203 | -- add any tools you want to have installed below 204 | { 205 | "williamboman/mason.nvim", 206 | opts = { 207 | ensure_installed = { 208 | "stylua", 209 | "shellcheck", 210 | "shfmt", 211 | "flake8", 212 | }, 213 | }, 214 | }, 215 | 216 | -- Use for completion and snippets (supertab) 217 | -- first: disable default and behavior in LuaSnip 218 | { 219 | "L3MON4D3/LuaSnip", 220 | keys = function() 221 | return {} 222 | end, 223 | }, 224 | -- then: setup supertab in cmp 225 | { 226 | "hrsh7th/nvim-cmp", 227 | dependencies = { 228 | "hrsh7th/cmp-emoji", 229 | }, 230 | ---@param opts cmp.ConfigSchema 231 | opts = function(_, opts) 232 | local has_words_before = function() 233 | unpack = unpack or table.unpack 234 | local line, col = unpack(vim.api.nvim_win_get_cursor(0)) 235 | return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil 236 | end 237 | 238 | local luasnip = require("luasnip") 239 | local cmp = require("cmp") 240 | 241 | opts.mapping = vim.tbl_extend("force", opts.mapping, { 242 | [""] = cmp.mapping(function(fallback) 243 | if cmp.visible() then 244 | cmp.select_next_item() 245 | -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() 246 | -- they way you will only jump inside the snippet region 247 | elseif luasnip.expand_or_jumpable() then 248 | luasnip.expand_or_jump() 249 | elseif has_words_before() then 250 | cmp.complete() 251 | else 252 | fallback() 253 | end 254 | end, { "i", "s" }), 255 | [""] = cmp.mapping(function(fallback) 256 | if cmp.visible() then 257 | cmp.select_prev_item() 258 | elseif luasnip.jumpable(-1) then 259 | luasnip.jump(-1) 260 | else 261 | fallback() 262 | end 263 | end, { "i", "s" }), 264 | }) 265 | end, 266 | }, 267 | } 268 | -------------------------------------------------------------------------------- /fish/functions/nvm.fish: -------------------------------------------------------------------------------- 1 | function nvm --description "Node version manager" 2 | for silent in --silent -s 3 | if set --local index (contains --index -- $silent $argv) 4 | set --erase argv[$index] && break 5 | end 6 | set --erase silent 7 | end 8 | 9 | set --local cmd $argv[1] 10 | set --local ver $argv[2] 11 | 12 | if set --query silent && ! set --query cmd[1] 13 | echo "nvm: Version number not specified (see nvm -h for usage)" >&2 14 | return 1 15 | end 16 | 17 | if ! set --query ver[1] && contains -- "$cmd" install use 18 | for file in .nvmrc .node-version 19 | set file (_nvm_find_up $PWD $file) && read ver <$file && break 20 | end 21 | 22 | if ! set --query ver[1] 23 | echo "nvm: Invalid version or missing \".nvmrc\" file" >&2 24 | return 1 25 | end 26 | end 27 | 28 | set --local their_version $ver 29 | 30 | switch "$cmd" 31 | case -v --version 32 | echo "nvm, version 2.2.18" 33 | case "" -h --help 34 | echo "Usage: nvm install Download and activate the specified Node version" 35 | echo " nvm install Install the version specified in the nearest .nvmrc file" 36 | echo " nvm use Activate the specified Node version in the current shell" 37 | echo " nvm use Activate the version specified in the nearest .nvmrc file" 38 | echo " nvm list List installed Node versions" 39 | echo " nvm list-remote List available Node versions to install" 40 | echo " nvm list-remote List Node versions matching a given regex pattern" 41 | echo " nvm current Print the currently-active Node version" 42 | echo " nvm uninstall Uninstall the specified Node version" 43 | echo "Options:" 44 | echo " -s, --silent Suppress standard output" 45 | echo " -v, --version Print the version of nvm" 46 | echo " -h, --help Print this help message" 47 | echo "Variables:" 48 | echo " nvm_arch Override architecture, e.g. x64-musl" 49 | echo " nvm_mirror Use a mirror for downloading Node binaries" 50 | echo " nvm_default_version Set the default version for new shells" 51 | echo " nvm_default_packages Install a list of packages every time a Node version is installed" 52 | echo " nvm_data Set a custom directory for storing nvm data" 53 | echo "Examples:" 54 | echo " nvm install latest Install the latest version of Node" 55 | echo " nvm use 14.15.1 Use Node version 14.15.1" 56 | echo " nvm use system Activate the system's Node version" 57 | 58 | case install 59 | _nvm_index_update 60 | 61 | string match --entire --regex -- (_nvm_version_match $ver) <$nvm_data/.index | read ver alias 62 | 63 | if ! set --query ver[1] 64 | echo "nvm: Invalid version number or alias: \"$their_version\"" >&2 65 | return 1 66 | end 67 | 68 | if test ! -e $nvm_data/$ver 69 | set --local os (command uname -s | string lower) 70 | set --local ext tar.gz 71 | set --local arch (command uname -m) 72 | set --local tarcmd tar 73 | 74 | switch $os 75 | case aix 76 | set arch ppc64 77 | case sunos 78 | case linux 79 | case darwin 80 | case {msys_nt,mingw\*_nt}\* 81 | set os win 82 | set ext zip 83 | set tarcmd bsdtar 84 | case \* 85 | echo "nvm: Unsupported operating system: \"$os\"" >&2 86 | return 1 87 | end 88 | 89 | switch $arch 90 | case i\*86 91 | set arch x86 92 | case x86_64 93 | set arch x64 94 | case arm64 95 | string match --regex --quiet "v(?\d+)" $ver 96 | if test "$os" = darwin -a $major -lt 16 97 | set arch x64 98 | end 99 | case armv6 armv6l 100 | set arch armv6l 101 | case armv7 armv7l 102 | set arch armv7l 103 | case armv8 armv8l aarch64 104 | set arch arm64 105 | end 106 | 107 | set --query nvm_arch && set arch $nvm_arch 108 | 109 | set --local dir "node-$ver-$os-$arch" 110 | set --local url $nvm_mirror/$ver/$dir.$ext 111 | 112 | command mkdir -p $nvm_data/$ver 113 | 114 | if ! set --query silent 115 | echo -e "Installing Node \x1b[1m$ver\x1b[22m $alias" 116 | echo -e "Fetching \x1b[4m$url\x1b[24m\x1b[7m" 117 | end 118 | 119 | if ! command curl -q $silent --progress-bar --location $url | 120 | command $tarcmd --extract --gzip --directory $nvm_data/$ver 2>/dev/null 121 | command rm -rf $nvm_data/$ver 122 | echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2 123 | return 1 124 | end 125 | 126 | set --query silent || echo -en "\033[F\33[2K\x1b[0m" 127 | 128 | if test "$os" = win 129 | command mv $nvm_data/$ver/$dir $nvm_data/$ver/bin 130 | else 131 | command mv $nvm_data/$ver/$dir/* $nvm_data/$ver 132 | command rm -rf $nvm_data/$ver/$dir 133 | end 134 | end 135 | 136 | if test $ver != "$nvm_current_version" 137 | set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version 138 | _nvm_version_activate $ver 139 | 140 | set --query nvm_default_packages[1] && npm install --global $silent $nvm_default_packages 141 | end 142 | 143 | set --query silent || printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info) 144 | case use 145 | test $ver = default && set ver $nvm_default_version 146 | _nvm_list | string match --entire --regex -- (_nvm_version_match $ver) | read ver __ 147 | 148 | if ! set --query ver[1] 149 | echo "nvm: Can't use Node \"$their_version\", version must be installed first" >&2 150 | return 1 151 | end 152 | 153 | if test $ver != "$nvm_current_version" 154 | set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version 155 | test $ver != system && _nvm_version_activate $ver 156 | end 157 | 158 | set --query silent || printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info) 159 | case uninstall 160 | if test -z "$ver" 161 | echo "nvm: Not enough arguments for command: \"$cmd\"" >&2 162 | return 1 163 | end 164 | 165 | test $ver = default && test ! -z "$nvm_default_version" && set ver $nvm_default_version 166 | 167 | _nvm_list | string match --entire --regex -- (_nvm_version_match $ver) | read ver __ 168 | 169 | if ! set -q ver[1] 170 | echo "nvm: Node version not installed or invalid: \"$their_version\"" >&2 171 | return 1 172 | end 173 | 174 | set --query silent || printf "Uninstalling Node %s %s\n" $ver (string replace ~ \~ "$nvm_data/$ver/bin/node") 175 | 176 | _nvm_version_deactivate $ver 177 | 178 | command rm -rf $nvm_data/$ver 179 | case current 180 | _nvm_current 181 | case ls list 182 | _nvm_list | _nvm_list_format (_nvm_current) $argv[2] 183 | case lsr {ls,list}-remote 184 | _nvm_index_update || return 185 | _nvm_list | command awk ' 186 | FILENAME == "-" && (is_local[$1] = FNR == NR) { next } { 187 | print $0 (is_local[$1] ? " ✓" : "") 188 | } 189 | ' - $nvm_data/.index | _nvm_list_format (_nvm_current) $argv[2] 190 | case \* 191 | echo "nvm: Unknown command or option: \"$cmd\" (see nvm -h for usage)" >&2 192 | return 1 193 | end 194 | end 195 | 196 | function _nvm_find_up --argument-names path file 197 | test -e "$path/$file" && echo $path/$file || begin 198 | test ! -z "$path" || return 199 | _nvm_find_up (string replace --regex -- '/[^/]*$' "" $path) $file 200 | end 201 | end 202 | 203 | function _nvm_version_match --argument-names ver 204 | string replace --regex -- '^v?(\d+|\d+\.\d+)$' 'v$1.' $ver | 205 | string replace --filter --regex -- '^v?(\d+)' 'v$1' | 206 | string escape --style=regex || string lower '\b'$ver'(?:/\w+)?$' 207 | end 208 | 209 | function _nvm_list_format --argument-names current regex 210 | command awk -v current="$current" -v regex="$regex" ' 211 | $0 ~ regex { 212 | aliases[versions[i++] = $1] = $2 " " $3 213 | pad = (n = length($1)) > pad ? n : pad 214 | } 215 | END { 216 | if (!i) exit 1 217 | while (i--) 218 | printf((current == versions[i] ? " ▶ " : " ") "%"pad"s %s\n", 219 | versions[i], aliases[versions[i]]) 220 | } 221 | ' 222 | end 223 | 224 | function _nvm_current 225 | command --search --quiet node || return 226 | set --query nvm_current_version && echo $nvm_current_version || echo system 227 | end 228 | 229 | function _nvm_node_info 230 | set --local npm_path (string replace bin/npm-cli.js "" (realpath (command --search npm))) 231 | test -f $npm_path/package.json || set --local npm_version_default (command npm --version) 232 | command node --eval " 233 | console.log(process.version) 234 | console.log('$npm_version_default' ? '$npm_version_default': require('$npm_path/package.json').version) 235 | console.log(process.execPath) 236 | " | string replace -- ~ \~ 237 | end 238 | -------------------------------------------------------------------------------- /fish/completions/bun.fish: -------------------------------------------------------------------------------- 1 | # This is terribly complicated 2 | # It's because: 3 | # 1. bun run has to have dynamic completions 4 | # 2. there are global options 5 | # 3. bun {install add remove} gets special options 6 | # 4. I don't know how to write fish completions well 7 | # Contributions very welcome!! 8 | 9 | function __fish__get_bun_bins 10 | string split ' ' (bun getcompletes b) 11 | end 12 | 13 | function __fish__get_bun_scripts 14 | set -lx SHELL bash 15 | set -lx MAX_DESCRIPTION_LEN 40 16 | string trim (string split '\n' (string split '\t' (bun getcompletes z))) 17 | end 18 | 19 | function __fish__get_bun_packages 20 | if test (commandline -ct) != "" 21 | set -lx SHELL fish 22 | string split ' ' (bun getcompletes a (commandline -ct)) 23 | end 24 | end 25 | 26 | function __history_completions 27 | set -l tokens (commandline --current-process --tokenize) 28 | history --prefix (commandline) | string replace -r \^$tokens[1]\\s\* "" | string replace -r \^$tokens[2]\\s\* "" | string split ' ' 29 | end 30 | 31 | function __fish__get_bun_bun_js_files 32 | string split ' ' (bun getcompletes j) 33 | end 34 | 35 | function bun_fish_is_nth_token --description 'Test if current token is on Nth place' --argument-names n 36 | set -l tokens (commandline -poc) 37 | set -l tokens (string replace -r --filter '^([^-].*)' '$1' -- $tokens) 38 | test (count $tokens) -eq "$n" 39 | end 40 | 41 | function __bun_command_count --argument-names n 42 | set -l cmds (commandline -poc) 43 | 44 | test (count cmds) -eq "$n" 45 | end 46 | 47 | function __bun_last_cmd --argument-names n 48 | set -l cmds (commandline -poc) 49 | 50 | test "(cmds[-1])" = "$n" 51 | end 52 | 53 | set -l bun_install_boolean_flags yarn production optional development no-save dry-run force no-cache silent verbose global 54 | set -l bun_install_boolean_flags_descriptions "Write a yarn.lock file (yarn v1)" "Don't install devDependencies" "Add dependency to optionalDependencies" "Add dependency to devDependencies" "Don't install devDependencies" "Don't install anything" "Always request the latest versions from the registry & reinstall all dependenices" "Ignore manifest cache entirely" "Don't output anything" "Excessively verbose logging" "Use global folder" 55 | 56 | set -l bun_builtin_cmds dev create help bun upgrade discord run install remove add init link unlink pm x 57 | set -l bun_builtin_cmds_without_run dev create help bun upgrade discord install remove add init pm x 58 | set -l bun_builtin_cmds_without_bun dev create help upgrade run discord install remove add init pm x 59 | set -l bun_builtin_cmds_without_create dev help bun upgrade discord run install remove add init pm x 60 | set -l bun_builtin_cmds_without_install create dev help bun upgrade discord run remove add init pm x 61 | set -l bun_builtin_cmds_without_remove create dev help bun upgrade discord run install add init pm x 62 | set -l bun_builtin_cmds_without_add create dev help bun upgrade discord run remove install init pm x 63 | set -l bun_builtin_cmds_without_pm create dev help bun upgrade discord run init pm x 64 | 65 | # clear 66 | complete -e -c bun 67 | 68 | complete -c bun \ 69 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a '(__fish__get_bun_scripts)' -d 'script' 70 | complete -c bun \ 71 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run" -a '(__fish__get_bun_bins)' -d 'package bin' 72 | complete -c bun \ 73 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run" -a '(__fish__get_bun_scripts)' -d 'script' 74 | complete -c bun \ 75 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run" -a '(__fish__get_bun_bun_js_files)' -d 'Bun.js' 76 | complete -c bun \ 77 | -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __fish_use_subcommand" -a 'run' -f -d 'Run a script or bin' 78 | complete -c bun \ 79 | -n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'u' -l 'origin' -r -d 'Server URL. Rewrites import paths' 80 | complete -c bun \ 81 | -n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'p' -l 'port' -r -d 'Port number to start server from' 82 | complete -c bun \ 83 | -n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'd' -l 'define' -r -d 'Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:\"development\"' 84 | complete -c bun \ 85 | -n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'e' -l 'external' -r -d 'Exclude module from transpilation (can use * wildcards). ex: -e react' 86 | complete -c bun \ 87 | -n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -l 'use' -r -d 'Use a framework (ex: next)' 88 | complete -c bun \ 89 | -n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -l 'hot' -r -d 'Enable hot reloading in Bun\'s JavaScript runtime' 90 | 91 | complete -c bun \ 92 | -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __fish_use_subcommand" -a 'dev' -d 'Start dev server' 93 | complete -c bun \ 94 | -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'create' -f -d 'Create a new project from a template' 95 | 96 | complete -c bun \ 97 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_create next react; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from create;" -a 'next' -d 'new Next.js project' 98 | 99 | complete -c bun \ 100 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_create next react; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from create;" -a 'react' -d 'new React project' 101 | 102 | complete -c bun \ 103 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a 'upgrade' -d 'Upgrade bun to the latest version' -x 104 | complete -c bun \ 105 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a '--help' -d 'See all commands and flags' -x 106 | 107 | complete -c bun \ 108 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -l "version" -s "v" -a '--version' -d 'Bun\'s version' -x 109 | complete -c bun \ 110 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a 'discord' -d 'Open bun\'s Discord server' -x 111 | 112 | 113 | complete -c bun \ 114 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_bun; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); __fish_use_subcommand" -a 'bun' -d 'Generate a new bundle' 115 | 116 | 117 | complete -c bun \ 118 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_bun; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from bun" -F -d 'Bundle this' 119 | 120 | complete -c bun \ 121 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_create; and not __fish_seen_subcommand_from (__fish__get_bun_bins); and not __fish_seen_subcommand_from (__fish__get_bun_scripts); and __fish_seen_subcommand_from react; or __fish_seen_subcommand_from next" -F -d "Create in directory" 122 | 123 | 124 | complete -c bun \ 125 | -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'init' -F -d 'Start an empty Bun project' 126 | 127 | complete -c bun \ 128 | -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'install' -f -d 'Install packages from package.json' 129 | 130 | complete -c bun \ 131 | -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'add' -F -d 'Add a package to package.json' 132 | 133 | complete -c bun \ 134 | -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'remove' -F -d 'Remove a package from package.json' 135 | 136 | complete -c bun \ 137 | -n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand add remove" -F 138 | 139 | 140 | for i in (seq (count $bun_install_boolean_flags)) 141 | complete -c bun \ 142 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;" -l "$bun_install_boolean_flags[$i]" -d "$bun_install_boolean_flags_descriptions[$i]" 143 | end 144 | 145 | complete -c bun \ 146 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;" -l 'cwd' -d 'Change working directory' 147 | 148 | complete -c bun \ 149 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;" -l 'cache-dir' -d 'Choose a cache directory (default: $HOME/.bun/install/cache)' 150 | 151 | complete -c bun \ 152 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from add;" -d 'Popular' -a '(__fish__get_bun_packages)' 153 | 154 | complete -c bun \ 155 | -n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from add;" -d 'History' -a '(__history_completions)' 156 | 157 | complete -c bun \ 158 | -n "__fish_seen_subcommand_from pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) cache;" -a 'bin ls cache hash hash-print hash-string' -f 159 | 160 | complete -c bun \ 161 | -n "__fish_seen_subcommand_from pm; and __fish_seen_subcommand_from cache; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts);" -a 'rm' -f 162 | 163 | complete -c bun -n "not __fish_seen_subcommand_from $bun_builtin_cmds (__fish__get_bun_bins) (__fish__get_bun_scripts)" -a "$bun_builtin_cmds" -f -------------------------------------------------------------------------------- /nvim/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /fish/functions/fisher.fish: -------------------------------------------------------------------------------- 1 | function fisher --argument-names cmd --description "A plugin manager for Fish" 2 | set --query fisher_path || set --local fisher_path $__fish_config_dir 3 | set --local fisher_version 4.4.3 4 | set --local fish_plugins $__fish_config_dir/fish_plugins 5 | 6 | switch "$cmd" 7 | case -v --version 8 | echo "fisher, version $fisher_version" 9 | case "" -h --help 10 | echo "Usage: fisher install Install plugins" 11 | echo " fisher remove Remove installed plugins" 12 | echo " fisher update Update installed plugins" 13 | echo " fisher update Update all installed plugins" 14 | echo " fisher list [] List installed plugins matching regex" 15 | echo "Options:" 16 | echo " -v, --version Print version" 17 | echo " -h, --help Print this help message" 18 | echo "Variables:" 19 | echo " \$fisher_path Plugin installation path. Default: $__fish_config_dir" | string replace --regex -- $HOME \~ 20 | case ls list 21 | string match --entire --regex -- "$argv[2]" $_fisher_plugins 22 | case install update remove 23 | isatty || read --local --null --array stdin && set --append argv $stdin 24 | 25 | set --local install_plugins 26 | set --local update_plugins 27 | set --local remove_plugins 28 | set --local arg_plugins $argv[2..-1] 29 | set --local old_plugins $_fisher_plugins 30 | set --local new_plugins 31 | 32 | test -e $fish_plugins && set --local file_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins) 33 | 34 | if ! set --query argv[2] 35 | if test "$cmd" != update 36 | echo "fisher: Not enough arguments for command: \"$cmd\"" >&2 && return 1 37 | else if ! set --query file_plugins 38 | echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1 39 | end 40 | set arg_plugins $file_plugins 41 | end 42 | 43 | for plugin in $arg_plugins 44 | set plugin (test -e "$plugin" && realpath $plugin || string lower -- $plugin) 45 | contains -- "$plugin" $new_plugins || set --append new_plugins $plugin 46 | end 47 | 48 | if set --query argv[2] 49 | for plugin in $new_plugins 50 | if contains -- "$plugin" $old_plugins 51 | test "$cmd" = remove && 52 | set --append remove_plugins $plugin || 53 | set --append update_plugins $plugin 54 | else if test "$cmd" = install 55 | set --append install_plugins $plugin 56 | else 57 | echo "fisher: Plugin not installed: \"$plugin\"" >&2 && return 1 58 | end 59 | end 60 | else 61 | for plugin in $new_plugins 62 | contains -- "$plugin" $old_plugins && 63 | set --append update_plugins $plugin || 64 | set --append install_plugins $plugin 65 | end 66 | 67 | for plugin in $old_plugins 68 | contains -- "$plugin" $new_plugins || set --append remove_plugins $plugin 69 | end 70 | end 71 | 72 | set --local pid_list 73 | set --local source_plugins 74 | set --local fetch_plugins $update_plugins $install_plugins 75 | set --local fish_path (status fish-path) 76 | 77 | echo (set_color --bold)fisher $cmd version $fisher_version(set_color normal) 78 | 79 | for plugin in $fetch_plugins 80 | set --local source (command mktemp -d) 81 | set --append source_plugins $source 82 | 83 | command mkdir -p $source/{completions,conf.d,themes,functions} 84 | 85 | $fish_path --command " 86 | if test -e $plugin 87 | command cp -Rf $plugin/* $source 88 | else 89 | set temp (command mktemp -d) 90 | set repo (string split -- \@ $plugin) || set repo[2] HEAD 91 | 92 | if set path (string replace --regex -- '^(https://)?gitlab.com/' '' \$repo[1]) 93 | set name (string split -- / \$path)[-1] 94 | set url https://gitlab.com/\$path/-/archive/\$repo[2]/\$name-\$repo[2].tar.gz 95 | else 96 | set url https://api.github.com/repos/\$repo[1]/tarball/\$repo[2] 97 | end 98 | 99 | echo Fetching (set_color --underline)\$url(set_color normal) 100 | 101 | if command curl --silent -L \$url | command tar -xzC \$temp -f - 2>/dev/null 102 | command cp -Rf \$temp/*/* $source 103 | else 104 | echo fisher: Invalid plugin name or host unavailable: \\\"$plugin\\\" >&2 105 | command rm -rf $source 106 | end 107 | 108 | command rm -rf \$temp 109 | end 110 | 111 | set files $source/* && string match --quiet --regex -- .+\.fish\\\$ \$files 112 | " & 113 | 114 | set --append pid_list (jobs --last --pid) 115 | end 116 | 117 | wait $pid_list 2>/dev/null 118 | 119 | for plugin in $fetch_plugins 120 | if set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source 121 | if set --local index (contains --index -- "$plugin" $install_plugins) 122 | set --erase install_plugins[$index] 123 | else 124 | set --erase update_plugins[(contains --index -- "$plugin" $update_plugins)] 125 | end 126 | end 127 | end 128 | 129 | for plugin in $update_plugins $remove_plugins 130 | if set --local index (contains --index -- "$plugin" $_fisher_plugins) 131 | set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files 132 | 133 | if contains -- "$plugin" $remove_plugins 134 | for name in (string replace --filter --regex -- '.+/conf\.d/([^/]+)\.fish$' '$1' $$plugin_files_var) 135 | emit {$name}_uninstall 136 | end 137 | printf "%s\n" Removing\ (set_color red --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~ 138 | set --erase _fisher_plugins[$index] 139 | end 140 | 141 | command rm -rf (string replace -- \~ ~ $$plugin_files_var) 142 | 143 | functions --erase (string replace --filter --regex -- '.+/functions/([^/]+)\.fish$' '$1' $$plugin_files_var) 144 | 145 | for name in (string replace --filter --regex -- '.+/completions/([^/]+)\.fish$' '$1' $$plugin_files_var) 146 | complete --erase --command $name 147 | end 148 | 149 | set --erase $plugin_files_var 150 | end 151 | end 152 | 153 | if set --query update_plugins[1] || set --query install_plugins[1] 154 | command mkdir -p $fisher_path/{functions,themes,conf.d,completions} 155 | end 156 | 157 | for plugin in $update_plugins $install_plugins 158 | set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] 159 | set --local files $source/{functions,themes,conf.d,completions}/* 160 | 161 | if set --local index (contains --index -- $plugin $install_plugins) 162 | set --local user_files $fisher_path/{functions,themes,conf.d,completions}/* 163 | set --local conflict_files 164 | 165 | for file in (string replace -- $source/ $fisher_path/ $files) 166 | contains -- $file $user_files && set --append conflict_files $file 167 | end 168 | 169 | if set --query conflict_files[1] && set --erase install_plugins[$index] 170 | echo -s "fisher: Cannot install \"$plugin\": please remove or move conflicting files first:" \n" "$conflict_files >&2 171 | continue 172 | end 173 | end 174 | 175 | for file in (string replace -- $source/ "" $files) 176 | command cp -RLf $source/$file $fisher_path/$file 177 | end 178 | 179 | set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files 180 | 181 | set --query files[1] && set --universal $plugin_files_var (string replace -- $source $fisher_path $files | string replace -- ~ \~) 182 | 183 | contains -- $plugin $_fisher_plugins || set --universal --append _fisher_plugins $plugin 184 | contains -- $plugin $install_plugins && set --local event install || set --local event update 185 | 186 | printf "%s\n" Installing\ (set_color --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~ 187 | 188 | for file in (string match --regex -- '.+/[^/]+\.fish$' $$plugin_files_var | string replace -- \~ ~) 189 | source $file 190 | if set --local name (string replace --regex -- '.+conf\.d/([^/]+)\.fish$' '$1' $file) 191 | emit {$name}_$event 192 | end 193 | end 194 | end 195 | 196 | command rm -rf $source_plugins 197 | 198 | if set --query _fisher_plugins[1] 199 | set --local commit_plugins 200 | 201 | for plugin in $file_plugins 202 | contains -- (string lower -- $plugin) (string lower -- $_fisher_plugins) && set --append commit_plugins $plugin 203 | end 204 | 205 | for plugin in $_fisher_plugins 206 | contains -- (string lower -- $plugin) (string lower -- $commit_plugins) || set --append commit_plugins $plugin 207 | end 208 | 209 | printf "%s\n" $commit_plugins >$fish_plugins 210 | else 211 | set --erase _fisher_plugins 212 | command rm -f $fish_plugins 213 | end 214 | 215 | set --local total (count $install_plugins) (count $update_plugins) (count $remove_plugins) 216 | 217 | test "$total" != "0 0 0" && echo (string join ", " ( 218 | test $total[1] = 0 || echo "Installed $total[1]") ( 219 | test $total[2] = 0 || echo "Updated $total[2]") ( 220 | test $total[3] = 0 || echo "Removed $total[3]") 221 | ) plugin/s 222 | case \* 223 | echo "fisher: Unknown command: \"$cmd\"" >&2 && return 1 224 | end 225 | end 226 | 227 | if ! set --query _fisher_upgraded_to_4_4 228 | set --universal _fisher_upgraded_to_4_4 229 | if functions --query _fisher_list 230 | set --query XDG_DATA_HOME[1] || set --local XDG_DATA_HOME ~/.local/share 231 | command rm -rf $XDG_DATA_HOME/fisher 232 | functions --erase _fisher_{list,plugin_parse} 233 | fisher update >/dev/null 2>/dev/null 234 | else 235 | for var in (set --names | string match --entire --regex '^_fisher_.+_files$') 236 | set $var (string replace -- ~ \~ $$var) 237 | end 238 | functions --erase _fisher_fish_postexec 239 | end 240 | end 241 | -------------------------------------------------------------------------------- /git/.gitalias.txt: -------------------------------------------------------------------------------- 1 | [alias] 2 | 3 | ## 4 | # One letter alias for our most frequent commands. 5 | # 6 | # Guidelines: these aliases do not use options, because we want 7 | # these aliases to be easy to compose and use in many ways. 8 | ## 9 | 10 | a = add 11 | b = branch 12 | c = commit 13 | d = diff 14 | f = fetch 15 | g = grep 16 | l = log 17 | m = merge 18 | o = checkout 19 | p = pull 20 | r = remote 21 | s = status 22 | w = whatchanged 23 | 24 | ## 25 | # Short aliases for our frequent commands. 26 | # 27 | # Guidelines: 28 | # 29 | # * Generally speaking, the alias should be in the same 30 | # order as the command name followed by its options. 31 | # 32 | # * Right: fb = foo --bar 33 | # * Wrong: bf = foo --bar 34 | ## 35 | 36 | ### add ### 37 | 38 | # add all 39 | aa = add --all 40 | 41 | # add by patch - looks at each change, and asks if we want to put it in the repo. 42 | ap = add --patch 43 | 44 | # add just the files that are updated. 45 | au = add --update 46 | 47 | ### branch ### 48 | 49 | # branch and only list branches whose tips are reachable from the specified commit (HEAD if not specified). 50 | bm = branch --merged 51 | 52 | # branch and only list branches whose tips are not reachable from the specified commit (HEAD if not specified). 53 | bnm = branch --no-merged 54 | 55 | ### commit ### 56 | 57 | # commit - amend the tip of the current branch rather than creating a new commit. 58 | ca = commit --amend 59 | 60 | # commit - amend the tip of the current branch, and edit the message. 61 | cam = commit --amend --message 62 | 63 | # commit - amend the tip of the current branch, and do not edit the message. 64 | cane = commit --amend --no-edit 65 | 66 | # commit interactive 67 | ci = commit --interactive 68 | 69 | # commit with a message 70 | cm = commit --message 71 | 72 | ### checkout ### 73 | 74 | # checkout - update the working tree to match a branch or paths. [same as "o" for "out"] 75 | co = checkout 76 | 77 | ### cherry-pick ### 78 | 79 | # cherry-pick - apply the changes introduced by some existing commits; useful for moving small chunks of code between branches. 80 | cp = cherry-pick 81 | 82 | # cherry-pick - abort the picking process 83 | cpa = cherry-pick --abort 84 | 85 | # cherry-pick - continue the picking process 86 | cpc = cherry-pick --continue 87 | 88 | # cherry-pick without making a commit, and when when recording the commit, append a line that says "(cherry picked from commit ...)" 89 | cp-nx = cherry-pick --no-commit -x 90 | 91 | ### diff ### 92 | 93 | # diff - show changes not yet staged 94 | dc = diff --cached 95 | 96 | # diff - show changes about to be commited 97 | ds = diff --staged 98 | 99 | # diff - show changes but by word, not line 100 | dw = diff --word-diff 101 | 102 | # diff deep - show changes with our preferred options. Also aliased as `diff-deep`. 103 | dd = diff --check --dirstat --find-copies --find-renames --histogram --color 104 | 105 | ### clean ### 106 | 107 | # clean everything to be pristine 108 | cleanest = clean -ffdx 109 | 110 | ### grep ### 111 | 112 | # grep i.e. search for text 113 | g = grep 114 | 115 | # grep - show line number 116 | gl = grep --line-number 117 | 118 | # grep group - search with our preferred options. Also aliased as `grep-group`. 119 | gg = grep --break --heading --line-number --color 120 | 121 | ### log ### 122 | 123 | # log with a text-based graphical representation of the commit history. 124 | lg = log --graph 125 | 126 | # log with one line per item. 127 | lo = log --oneline 128 | 129 | # log with patch generation. 130 | lp = log --patch 131 | 132 | # log with first parent, useful for team branch that only accepts pull requests 133 | lfp = log --first-parent 134 | 135 | # log with items appearing in topological order, i.e. descendant commits are shown before their parents. 136 | lt = log --topo-order 137 | 138 | # log like - we like this summarization our key performance indicators. Also aliased as `log-like`. 139 | ll = log --graph --topo-order --date=short --abbrev-commit --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn]%Creset %Cblue%G?%Creset' 140 | 141 | # log like long - we like this summarization our key performance indicators. Also aliased as `log-like-long`. 142 | lll = log --graph --topo-order --date=iso8601-strict --no-abbrev-commit --abbrev=40 --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn <%ce>]%Creset %Cblue%G?%Creset' 143 | 144 | ## ls-files ## 145 | 146 | # ls-files - show information about files in the index and the working tree; like Unix "ls" command. 147 | ls = ls-files 148 | 149 | # ls-ignored - list files that git has ignored. 150 | ls-ignored = ls-files --others --i --exclude-standard 151 | 152 | ### merge ### 153 | 154 | # merge but without autocommit, and with a commit even if the merge resolved as a fast-forward. 155 | me = merge --no-commit --no-ff 156 | 157 | ### pull ### 158 | 159 | # pull if a merge can be resolved as a fast-forward, otherwise fail. 160 | pf = pull --ff-only 161 | 162 | # pull with rebase - to provide a cleaner, linear, bisectable history. 163 | # 164 | # To automatically do "pull --rebase" everywhere: 165 | # 166 | # git config --global pull.rebase true 167 | # 168 | # To automatically do "pull --rebase" for any branch based on master: 169 | # 170 | # git config branch.master.rebase true 171 | # 172 | # To automatically do "pull --rebase" for any newly-created branches: 173 | # 174 | # git config --global branch.autosetuprebase always 175 | # 176 | # To integrate changes between branches, you can merge or rebase. 177 | # 178 | # When we use "git pull", git does a fetch then a merge. 179 | # If we've made changes locally and someone else has pushed changes 180 | # to our git host then git will automatically merge these together 181 | # and create a merge commit that looks like this in the history: 182 | # 183 | # 12345678 - Merge branch 'foo' of bar into master 184 | # 185 | # When we use "git pull --rebase", git does a fetch then a rebase. 186 | # A rebase resets the HEAD of your local branch to be the same as 187 | # the remote HEAD, then replays your local commits back into repo. 188 | # This means you don't get any noisy merge messages in your history. 189 | # This gives us a linear history, and also helps with git bisect. 190 | # 191 | pr = pull --rebase 192 | 193 | # pp - pull with rebase preserve of merge commits 194 | # 195 | # See https://stackoverflow.com/questions/21364636/git-pull-rebase-preserve-merges 196 | # 197 | # You should only rebase if you know (in a sort of general sense) 198 | # what you are doing, and if you do know what you are doing, then you 199 | # would probably prefer a merge-preserving rebase as a general rule. 200 | # 201 | # Although by the time you've decided that rebasing is a good idea, 202 | # you will probably find that a history that has its own embedded 203 | # branch-and-merge-points is not necessarily the correct "final 204 | # rewritten history". 205 | # 206 | # That is, if it's appropriate to do a rebase at all, it's at least fairly 207 | # likely that the history to be rebased is itself linear, so that the 208 | # preserve-vs-flatten question is moot anyway. 209 | # 210 | # See https://stackoverflow.com/questions/38269092/is-it-possible-to-put-preserve-merges-in-the-gitconfig 211 | # 212 | # While preserving merges is probably generally superior, in at least a 213 | # few ways, to discarding them when rebasing, the fact is that rebase 214 | # cannot preserve them. The only thing it can do, once some commits 215 | # have been copied to new commits, is re-perform them. This can have new 216 | # and/or different merge conflicts, vs the last time the merge was done. 217 | # You should also pay close attention to the restrictions on merge 218 | # preservation in the git rebase documentation. 219 | # 220 | # Without getting into a lot of detail, it always seems to me that most 221 | # commit graph subsets that "should be" rebased, rarely have any 222 | # internal merges. If such a graph subset has a single final merge, you 223 | # can simply strip away that merge (with git reset) before rebasing, 224 | # and re-do that single merge manually at the end. (In fact, git rebase 225 | # normally drops merge commits entirely, so you don't have to run the git 226 | # reset itself in some cases. The one where you do have to run it is when 227 | # the merge is into the branch onto which you intend to rebase. This is 228 | # where git pull actually does the right thing when it uses 229 | # `git rebase -p`, except that it fails to check for, and warn about, 230 | # internal merges, which are sort of warning signs that rebasing might 231 | # not be a good idea. 232 | # 233 | pp = pull --rebase=preserve 234 | 235 | ### rebase ### 236 | 237 | # rebase - forward-port local commits to the updated upstream head. 238 | rb = rebase 239 | 240 | # rebase abort - cancel the rebasing process 241 | rba = rebase --abort 242 | 243 | # rebase - continue the rebasing process after resolving a conflict manually and updating the index with the resolution. 244 | rbc = rebase --continue 245 | 246 | # rebase - restart the rebasing process by skipping the current patch. 247 | rbs = rebase --skip 248 | 249 | # rbi - rebase interactive on our unpushed commits. 250 | # 251 | # Before we push our local changes, we may want to do some cleanup, 252 | # to improve our commit messages or squash related commits together. 253 | # 254 | # Let's say I've pushed two commits that are related to a new feature and 255 | # I have another where I made a spelling mistake in the commit message. 256 | # When I run "git rbi" I get dropped into my editor with this: 257 | # 258 | # pick 7f06d36 foo 259 | # pick ad544d0 goo 260 | # pick de3083a hoo 261 | # 262 | # Let's say I want to squash the "foo" and "goo" commits together, 263 | # and also change "hoo" to say "whatever". To do these, I change "pick" 264 | # to say "s" for squash; this tells git to squash the two together; 265 | # I also edit "hoo" to rename it to "whatever". I make the file look like: 266 | # 267 | # pick 7f06d36 foo 268 | # s ad544d0 goo 269 | # r de3083a whatever 270 | # 271 | # This gives me two new commit messages to edit, which I update. 272 | # Now when I push the remote repo host receives two commits 273 | # 274 | # 3400455 - foo 275 | # 5dae0a0 - whatever 276 | # 277 | rbi = rebase --interactive @{upstream} 278 | 279 | # See https://blog.filippo.io/git-fixup-amending-an-older-commit/ 280 | # This is a slightly modified version 281 | fixup = "!f() { TARGET=$(git rev-parse \"$1\"); git commit --fixup=$TARGET && GIT_EDITOR=true git rebase --interactive --autosquash $TARGET~; }; f" 282 | 283 | ### reflog ### 284 | 285 | # reflog - reference log that manages when tips of branches are updated. 286 | rl = reflog 287 | 288 | ### remote ### 289 | 290 | # remote - manage set of tracked repositories [same as "r"]. 291 | rr = remote 292 | 293 | # remote show - gives some information about the remote . 294 | rrs = remote show 295 | 296 | # remote update - fetch updates for a named set of remotes in the repository as defined by remotes. 297 | rru = remote update 298 | 299 | # remote prune - deletes all stale remote-tracking branches under . 300 | rrp = remote prune 301 | 302 | incoming = !git remote update --prune; git log ..@{upstream} 303 | outgoing = log @{upstream}.. 304 | 305 | # Push to all remotes 306 | push-to-all-remotes = !git remote | xargs -I% -n1 git push % 307 | 308 | ### revert ### 309 | 310 | # revert - undo the changes from some existing commits 311 | rv = revert 312 | 313 | # revert without autocommit; useful when you're reverting more than one commits' effect to your index in a row. 314 | rvnc = revert --no-commit 315 | 316 | ### show-branch ### 317 | 318 | # show-branch - print a list of branches and their commits. 319 | sb = show-branch 320 | 321 | ### submodule ### 322 | 323 | # submodule - enables foreign repositories to be embedded within a dedicated subdirectory of the source tree. 324 | sm = submodule 325 | 326 | # submodule init 327 | smi = submodule init 328 | 329 | # submodule add 330 | sma = submodule add 331 | 332 | # submodule sync 333 | sms = submodule sync 334 | 335 | # submodule update 336 | smu = submodule update 337 | 338 | # submodule update with initialize 339 | smui = submodule update --init 340 | 341 | # submodule update with initialize and recursive; this is useful to bring a submodule fully up to date. 342 | smuir = submodule update --init --recursive 343 | 344 | ### status ### 345 | 346 | # status with short format instead of full details 347 | ss = status --short 348 | 349 | # status with short format and showing branch and tracking info. 350 | ssb = status --short --branch 351 | 352 | ### ALIAS MANAGEMENT ### 353 | 354 | # Show our defined alias list 355 | aliases = "!git config --get-regexp '^alias\\.' | cut -c 7- | sed 's/ / = /'" 356 | 357 | add-alias = "!f() { [ $# = 3 ] && git config $1 alias.\"$2\" \"$3\" && return 0 || echo \"Usage: git add-(local|global)-alias \" >&2 && return 1; }; f" 358 | add-global-alias = "!git add-alias --global" 359 | add-local-alias = "!git add-alias --local" 360 | 361 | # Rename an alias 362 | rename-alias = "!f() { [ $# = 3 ] && [ $2 != $3 ] && [ ! -z \"$(git config $1 --get alias.$2)\" ] && [ -z \"$(git config $1 --get alias.$3)\" ] && git config $1 alias.$3 \"$(git config $1 --get alias.$2)\" && git config $1 --unset alias.$2 && return 0 || echo \"Usage: git rename-(local|global)-alias \nThe alias you are going to rename must exist and new name must not exist.\" >&2 && return 1; };f" 363 | rename-global-alias = "!git rename-alias --global" 364 | rename-local-alias = "!git rename-alias --local" 365 | 366 | # Last tag in the current branch 367 | lasttag = describe --tags --abbrev=0 368 | 369 | # Latest annotated tag in all branches 370 | lasttagged = !git describe --tags `git rev-list --tags --max-count=1` 371 | 372 | # From https://gist.github.com/492227 373 | head = log -n1 374 | heads = !"git log origin/master.. --format='%Cred%h%Creset;%C(yellow)%an%Creset;%H;%Cblue%f%Creset' | git name-rev --stdin --always --name-only | column -t -s';'" 375 | lost = !"git fsck | awk '/dangling commit/ {print $3}' | git show --format='SHA1: %C(yellow)%h%Creset %f' --stdin | awk '/SHA1/ {sub(\"SHA1: \", \"\"); print}'" 376 | 377 | ### diff-* ### 378 | 379 | diff-all = !"for name in $(git diff --name-only $1); do git difftool $1 $name & done" 380 | diff-changes = diff --name-status -r 381 | diff-stat = diff --stat --ignore-space-change -r 382 | diff-staged = diff --cached 383 | 384 | # Diff using our preferred options. A.k.a. `dd`. 385 | diff-deep = diff --check --dirstat --find-copies --find-renames --histogram --color 386 | 387 | ### grep-* ### 388 | 389 | # Find text in any commit ever. 390 | grep-all = !"f() { git rev-list --all | xargs git grep \"$@\"; }; f" 391 | 392 | # Find text and group the output lines. A.k.a. `gg`. 393 | grep-group = grep --break --heading --line-number --color 394 | 395 | # grep with ack-like formatting 396 | grep-ack = \ 397 | -c color.grep.linenumber=\"bold yellow\" \ 398 | -c color.grep.filename=\"bold green\" \ 399 | -c color.grep.match=\"reverse yellow\" \ 400 | grep --break --heading --line-number 401 | 402 | ### init ### 403 | 404 | # initalize a repo and immediate add an empty commit, which makes rebase easier. 405 | init-empty = !"f() { git init && git commit --allow-empty --allow-empty-message --message ''; }; f" 406 | 407 | ### merge-* ### 408 | 409 | # Given a merge commit, find the span of commits that exist(ed). 410 | # Not so useful in itself, but used by other aliases. 411 | # Thanks to Rob Miller for the merge-span-* aliaes. 412 | merge-span = !"f() { echo $(git log -1 $2 --merges --pretty=format:%P | cut -d' ' -f1)$1$(git log -1 $2 --merges --pretty=format:%P | cut -d' ' -f2); }; f" 413 | 414 | # Find the commits that were introduced by a merge 415 | merge-span-log = "!git log `git merge-span .. $1`" 416 | 417 | # Show the changes that were introduced by a merge 418 | merge-span-diff = !"git diff `git merge-span ... $1`" 419 | 420 | # Show the changes that were introduced by a merge, in your difftool 421 | merge-span-difftool = !"git difftool `git merge-span ... $1`" 422 | 423 | # Interactively rebase all the commits on the current branch 424 | rebase-branch = !"git rebase --interactive `git merge-base master HEAD`" 425 | 426 | # Sort by date for branches; can be useful for spring cleaning 427 | refs-by-date = for-each-ref --sort=-committerdate --format='%(committerdate:short) %(refname:short)' 428 | 429 | # Find all objects that aren't referenced by any other object (orphans). 430 | # To help an orphan, we create a new branch with the orphan's commit hash, 431 | # then merge it into our current branch: 432 | # 433 | # git branch foo 434 | # git merge foo 435 | # 436 | orphans = fsck --full 437 | 438 | # List all blobs by size in bytes. 439 | # By [CodeGnome](http://www.codegnome.com/) 440 | rev-list-all-objects-by-size = !"git rev-list --all --objects | awk '{print $1}'| git cat-file --batch-check | fgrep blob | sort -k3nr" 441 | 442 | # List all objects by size in bytes and file name. 443 | # By [raphinesse](https://stackoverflow.com/users/380229/raphinesse) 444 | rev-list-all-objects-by-size-and-name = !"git rev-list --all --objects | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | awk '/^blob/ {print substr($0,6)}' | sort --numeric-sort --key=2" 445 | 446 | ### LOG ALIASES ### 447 | 448 | # Show log of changes, most recent first 449 | log-changes = log --oneline --reverse 450 | 451 | # Show log of new commits after you fetched, with stats, excluding merges 452 | log-fresh = log ORIG_HEAD.. --stat --no-merges 453 | 454 | # Show log in our preferred format for our key performance indicators. A.k.a. `ll`. 455 | log-like = log --graph --topo-order --date=short --abbrev-commit --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn]%Creset %Cblue%G?%Creset' 456 | 457 | # Show log in our preferred format for our key performance indicators, with long items. A.k.a. `lll`. 458 | log-like-long = log --graph --topo-order --date=iso8601-strict --no-abbrev-commit --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn <%ce>]%Creset %Cblue%G?%Creset' 459 | 460 | # Show log with dates in our local timezone 461 | log-local = log --date=local 462 | 463 | # Show the log for my own commits by my own user email 464 | log-my = !git log --author $(git config user.email) 465 | 466 | # Show log as a graph 467 | log-graph = log --graph --all --oneline --decorate 468 | 469 | # Show the date of the earliest commit, in strict ISO 8601 format 470 | log-first-date = !"git log --date-order --format=%cI | tail -1" 471 | 472 | # Show the date of the latest commit, in strict ISO 8601 format 473 | log-latest-date = log -1 --date-order --format=%cI 474 | 475 | # Show the log of the recent hour, day, week, month, year 476 | log-hour = log --since=1-hour-ago 477 | log-day = log --since=1-day-ago 478 | log-week = log --since=1-week-ago 479 | log-month = log --since=1-month-ago 480 | log-year = log --since=1-year-ago 481 | 482 | # Show the log of my own recent hour, day, week, month, year 483 | log-my-hour = log --author $(git config user.email) --since=1-hour-ago 484 | log-my-day = log --author $(git config user.email) --since=1-day-ago 485 | log-my-week = log --author $(git config user.email) --since=1-week-ago 486 | log-my-month = log --author $(git config user.email) --since=1-month-ago 487 | log-my-year = log --author $(git config user.email) --since=1-year-ago 488 | 489 | # Show a specific format string and its number of log entries 490 | log-of-format-and-count = "!f() { format=\"$1\"; shift; git log $@ --format=oneline --format="$format" | awk '{a[$0]++}END{for(i in a){print i, a[i], int((a[i]/NR)*100) \"%\"}}' | sort; }; f" 491 | log-of-count-and-format = "!f() { format=\"$1\"; shift; git log $@ --format=oneline --format="$format" | awk '{a[$0]++}END{for(i in a){print a[i], int((a[i]/NR)*100) \"%\", i}}' | sort -nr; }; f" 492 | 493 | # Show the number of log entries by a specific format string and date format string 494 | log-of-format-and-count-with-date = "!f() { format=\"$1\"; shift; date_format=\"$1\"; shift; git log $@ --format=oneline --format=\"$format\" --date=format:\"$date_format\" | awk '{a[$0]++}END{for(i in a){print i, a[i], int((a[i]/NR)*100) \"%\"}}' | sort -r; }; f" 495 | log-of-count-and-format-with-date = "!f() { format=\"$1\"; shift; date_format=\"$1\"; shift; git log $@ --format=oneline --format=\"$format\" --date=format:\"$date_format\" | awk '{a[$0]++}END{for(i in a){print a[i], int((a[i]/NR)*100) \"%\", i}}' | sort -nr; }; f" 496 | 497 | # Show the number of log items by email 498 | log-of-email-and-count = "!f() { git log-of-format-and-count \"%aE\" $@; }; f" 499 | log-of-count-and-email = "!f() { git log-of-count-and-format \"%aE\" $@; }; f" 500 | 501 | # Show the number of log items by hour 502 | log-of-hour-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%Y-%m-%dT%H\" $@ ; }; f" 503 | log-of-count-and-hour = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%Y-%m-%dT%H\" $@ ; }; f" 504 | 505 | # Show the number of log items by day 506 | log-of-day-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%Y-%m-%d\" $@ ; }; f" 507 | log-of-count-and-day = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%Y-%m-%d\" $@ ; }; f" 508 | 509 | # Show the number of log items by week 510 | log-of-week-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%Y#%V\" $@; }; f" 511 | log-of-count-and-week = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%Y#%V\" $@; }; f" 512 | 513 | # Show the number of log items by month 514 | log-of-month-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%Y-%m\" $@ ; }; f" 515 | log-of-count-and-month = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%Y-%m\" $@ ; }; f" 516 | 517 | # Show the number of log items by year 518 | log-of-year-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%Y\" $@ ; }; f" 519 | log-of-count-and-year = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%Y\" $@ ; }; f" 520 | 521 | # Show the number of log items by hour of day 522 | log-of-hour-of-day-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%H\" $@; }; f" 523 | log-of-count-and-hour-of-day = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%H\" $@; }; f" 524 | 525 | # Show the number of log items by day of week 526 | log-of-day-of-week-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%u\" $@; }; f" 527 | log-of-count-and-day-of-week = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%u\" $@; }; f" 528 | 529 | # Show the number of log items by week of year 530 | log-of-week-of-year-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%V\" $@; }; f" 531 | log-of-count-and-week-of-year = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%V\" $@; }; f" 532 | 533 | # TODO 534 | log-refs = log --all --graph --decorate --oneline --simplify-by-decoration --no-merges 535 | log-timeline = log --format='%h %an %ar - %s' 536 | log-local = log --oneline origin..HEAD 537 | log-fetched = log --oneline HEAD..origin/master 538 | 539 | # chart: show a summary chart of activity per author. 540 | # 541 | # Example: 542 | # 543 | # $ git chart 544 | # ..X..........X...2..12 alice@example.com 545 | # ....2..2..13.......... bob@example.com 546 | # 2.....1....11......... carol@example.com 547 | # ..1............1..1... david@example.com 548 | # ....1.......1.3.3.22.2 eve@example.com 549 | # 550 | # The chart rows are the authors. 551 | # TODO: sort the rows meaningfully, 552 | # such as alphabetically, or by count. 553 | # 554 | # The chart columns are the days. 555 | # The chart column prints one character per day. 556 | # 557 | # * For 1-9 commits, show the number. 558 | # * For 10 or more commits, show "X" as a visual indicator. 559 | # * For no commits, show "." as a visual placeholder. 560 | # 561 | # The chart timeline adjusts the date range automatically: 562 | # 563 | # * The timeline starts with the date of the earliest commit. 564 | # * The timeline stops with the date of the latest commit. 565 | # * The intent is to show the most relevant information. 566 | # 567 | # The chart default is to look at the past 6 weeks; 568 | # this gives a good balance of recency and speed 569 | # for a team that's currently working on a repo, 570 | # and also gives a good balance of fitting within 571 | # one terminal window 80 character width. 572 | # 573 | # You can adjust how far back the chart looks, 574 | # by providing your own `--since` parameter. 575 | # For example if you want to chart an older repo, 576 | # that does not have any recent commits, then you 577 | # you must provide a longer `--since` parameter. 578 | # 579 | chart = "!f() { \ 580 | git log \ 581 | --format=oneline \ 582 | --format=\"%aE %at\" \ 583 | --since=6-weeks-ago \ 584 | $* | \ 585 | awk ' \ 586 | function time_to_slot(t) { return strftime(\"%Y-%m-%d\", t, true) } \ 587 | function count_to_char(i) { return (i > 0) ? ((i < 10) ? i : \"X\") : \".\" } \ 588 | BEGIN { \ 589 | time_min = systime(); time_max = 0; \ 590 | SECONDS_PER_DAY=86400; \ 591 | } \ 592 | { \ 593 | item = $1; \ 594 | time = 0 + $2; \ 595 | if (time > time_max){ time_max = time } else if (time < time_min){ time_min = time }; \ 596 | slot = time_to_slot(time); \ 597 | items[item]++; \ 598 | slots[slot]++; \ 599 | views[item, slot]++; \ 600 | } \ 601 | END{ \ 602 | printf(\"Chart time range %s to %s.\\n\", time_to_slot(time_min), time_to_slot(time_max)); \ 603 | time_max_add = time_max += SECONDS_PER_DAY; \ 604 | for(item in items){ \ 605 | row = \"\"; \ 606 | for(time = time_min; time < time_max_add; time += SECONDS_PER_DAY) { \ 607 | slot = time_to_slot(time); \ 608 | count = views[item, slot]; \ 609 | row = row count_to_char(count); \ 610 | } \ 611 | print row, item; \ 612 | } \ 613 | }'; \ 614 | }; f" 615 | 616 | # churn: show log of files that have many changes 617 | # 618 | # * Written by (Corey Haines)[http://coreyhaines.com/] 619 | # * Scriptified by Gary Bernhardt 620 | # * Obtained from https://github.com/garybernhardt/dotfiles/blob/master/bin/git-churn 621 | # * Edited for GitAlias.com repo by Joel Parker Henderson 622 | # * Comments by Mislav http://mislav.uniqpath.com/2014/02/hidden-documentation/ 623 | # 624 | # Show churn for whole repo: 625 | # 626 | # $ git churn 627 | # 628 | # Show churn for specific directories: 629 | # 630 | # $ git churn app lib 631 | # 632 | # Show churn for a time range: 633 | # 634 | # $ git churn --since=1-month-ago 635 | # 636 | # These are all standard arguments to `git log`. 637 | # 638 | # It's possible to get valuable insight from history of a project not only 639 | # by viewing individual commits, but by analyzing sets of changes as a whole. 640 | # For instance, `git churn` compiles stats about which files change the most. 641 | # 642 | # For example, to see where work on an app was focused on in the past month: 643 | # 644 | # $ git churn --since=1-month-ago app/ | tail 645 | # 646 | # This can also highlight potential problems with technical debt in a project. 647 | # A specific file changing too often is generally a red flag, since it probably 648 | # means the file either needed to be frequently fixed for bugs, or the file 649 | # holds too much responsibility and should be split into smaller units. 650 | # 651 | # Similar methods of history analysis can be employed to see which people were 652 | # responsible recently for development of a certain part of the codebase. 653 | # 654 | # For instance, to see who contributed most to the API part of an application: 655 | # 656 | # $ git log --format='%an' --since=1-month-ago app/controllers/api/ | \ 657 | # sort | uniq -c | sort -rn | head 658 | # 659 | # 109 Alice Anderson 660 | # 13 Bob Brown 661 | # 7 Carol Clark 662 | # 663 | churn = !"f() { git log --all --find-copies --find-renames --name-only --format='format:' \"$@\" | awk 'NF{a[$0]++}END{for(i in a){print a[i], i}}' | sort -rn;};f" 664 | 665 | # summary: print a helpful summary of some typical metrics 666 | summary = "!f() { \ 667 | printf \"Summary of this branch...\n\"; \ 668 | printf \"%s\n\" $(git rev-parse --abbrev-ref HEAD); \ 669 | printf \"%s first commit timestamp\n\" $(git log --date-order --format=%cI | tail -1); \ 670 | printf \"%s latest commit timestamp\n\" $(git log -1 --date-order --format=%cI); \ 671 | printf \"%d commit count\n\" $(git rev-list --count HEAD); \ 672 | printf \"%d date count\n\" $(git log --format=oneline --format=\"%ad\" --date=format:\"%Y-%m-%d\" | awk '{a[$0]=1}END{for(i in a){n++;} print n}'); \ 673 | printf \"%d tag count\n\" $(git tag | wc -l); \ 674 | printf \"%d author count\n\" $(git log --format=oneline --format=\"%aE\" | awk '{a[$0]=1}END{for(i in a){n++;} print n}'); \ 675 | printf \"%d committer count\n\" $(git log --format=oneline --format=\"%cE\" | awk '{a[$0]=1}END{for(i in a){n++;} print n}'); \ 676 | printf \"%d local branch count\n\" $(git branch | grep -v \" -> \" | wc -l); \ 677 | printf \"%d remote branch count\n\" $(git branch -r | grep -v \" -> \" | wc -l); \ 678 | printf \"\nSummary of this directory...\n\"; \ 679 | printf \"%s\n\" $(pwd); \ 680 | printf \"%d file count via git ls-files\n\" $(git ls-files | wc -l); \ 681 | printf \"%d file count via find command\n\" $(find . | wc -l); \ 682 | printf \"%d disk usage\n\" $(du -s | awk '{print $1}'); \ 683 | printf \"\nMost-active authors, with commit count and %%...\n\"; git log-of-count-and-email | head -7; \ 684 | printf \"\nMost-active dates, with commit count and %%...\n\"; git log-of-count-and-day | head -7; \ 685 | printf \"\nMost-active files, with churn count\n\"; git churn | head -7; \ 686 | }; f" 687 | 688 | ### REF ALIASES ### 689 | 690 | ref-recent = "!git for-each-ref --sort=-committerdate --format='%(committerdate:short) %(refname:short) %(objectname:short) %(contents:subject)' refs/heads/" 691 | 692 | ### LOOKUP ALIASES ### 693 | 694 | # whois: given a string for an author, try to figure out full name and email: 695 | whois = "!sh -c 'git log --regexp-ignore-case -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -" 696 | 697 | # Given any git object, try to show it briefly 698 | whatis = show --no-patch --pretty='tformat:%h (%s, %ad)' --date=short 699 | 700 | # Show who contributed with summarized changes 701 | who = shortlog --summary -- 702 | 703 | # Show who contributed, in descending order by number of commits 704 | whorank = shortlog --summary --numbered --no-merges 705 | 706 | # List all issues mentioned in commit messages between range of commits 707 | # 708 | # Replace `\\\"ISSUE-[0-9]\\+\\\"` regular expression with one matching your issue tracking system. 709 | # For Jira it should be as simple as putting your project name in place of `ISSUE`. 710 | # 711 | # Best used with tags: 712 | # $ git issues v1.0..v1.1 713 | # 714 | # But will work with any valid commit range: 715 | # $ git issues master..HEAD 716 | 717 | issues = !sh -c \"git log $1 --oneline | grep -o \\\"ISSUE-[0-9]\\+\\\" | sort -u\" 718 | 719 | # Show the commit's parents 720 | commit-parents = !"f(){ git cat-file -p \"${*:-HEAD}\" | sed -n '/0/,/^ *$/{/^parent /p}'; };f" 721 | 722 | # Is the commit a merge commit? If yes exit 0, else exit 1 723 | commit-is-merge = !"f(){ [ -n \"$(git commit-parents \"$*\" | sed '0,/^parent /d')\" ];};f" 724 | 725 | # Show the commit's keyword-marked lines. 726 | # 727 | # Show each line in the commit message that starts with zero or more blanks, 728 | # then a keyword (alphanum and dash characters), then a colon. 729 | # 730 | # Example commit: 731 | # 732 | # commit ce505d161fccdbc8d4bf12047846de7433ad6d04 733 | # Author: Joel Parker Henderson 734 | # Date: Tue May 28 11:53:47 2019 -0700 735 | # 736 | # Add feature foo 737 | # 738 | # This commit is to add feature foo. 739 | # 740 | # Time: 5 hours 741 | # Cost: 600 USD 742 | # 743 | # Command: 744 | # 745 | # $ git commit-message-key-lines ce505d161fccdbc8d4bf12047846de7433ad6d04 746 | # Commit: ce505d161fccdbc8d4bf12047846de7433ad6d04 747 | # Author: Joel Parker Henderson 748 | # Date: Tue May 28 11:53:47 2019 -0700 749 | # Time: 5 hours 750 | # Cost: 600 USD 751 | # 752 | # Normalize the output: 753 | # 754 | # * Start the output with "Commit: " 755 | # 756 | # * Omit leading blanks 757 | # 758 | # * After the colon, use one space (not tab, not multiple spaces, etc.) 759 | # 760 | # Known issues: 761 | # 762 | # * TODO: improve the keyword matcher so it requires the keyword to end 763 | # in an alphanum (not a dash), and also so the dash is a separator i.e. 764 | # the matcher does not accept a dash followed by another dash. 765 | # 766 | commit-message-key-lines = "!f(){ echo \"Commit: $1\"; git log \"$1\" --format=fuller | grep \"^[[:blank:]]*[[:alnum:]][-[:alnum:]]*:\" | sed \"s/^[[:blank:]]*//; s/:[[:blank:]]*/: /\"; }; f" 767 | 768 | 769 | ### WORKFLOW ALIASES ### 770 | 771 | # Clone a git repository including all submodules 772 | cloner = clone --recursive 773 | 774 | # Clone as lean as possible, for example to checkout just one subdiretory. 775 | # 776 | # This skips fetching unneeded objects from the server. 777 | # 778 | # Command breakdown: 779 | # 780 | # * --depth 1 does a shallow clone and implies --single-branches 781 | # 782 | # * --filter=blob:none skips all blobs, but fetches all tree objects 783 | # 784 | # * --filter=tree:0 skips unneeded trees 785 | # 786 | # * --filter=combine:FILTER1+FILTER2 is the syntax to use multiple 787 | # filters at once; trying to pass --filter multiple times fails 788 | # with: "multiple filter-specs cannot be combined". 789 | # 790 | # This uses --filter=tree:0 added in Git 2.20 and --filter=combine 791 | # composite filter added in Git 2.24. 792 | # 793 | # The server should be configured with: 794 | # 795 | # git config --local uploadpack.allowfilter 1 796 | # git config --local uploadpack.allowanysha1inwant 1 797 | # 798 | # An extension was made to the Git remote protocol to support this 799 | # feature in v2.19.0 and actually skip fetching unneeded objects. 800 | # There was server support then, but it can be locally tested. 801 | # 802 | # Credit: https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository/52269934#52269934 803 | # 804 | clone-lean = clone --depth 1 --filter=combine:blob:none+tree:0 --no-checkout 805 | 806 | # Stash aliases for push & pop 807 | # 808 | # Note that if you are using an older version of git, before 2.16.0, 809 | # then you can use the older "stash save" instead of the newer "stash push". 810 | save = stash push 811 | pop = stash pop 812 | 813 | # Stash snapshot - from http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/ 814 | # Take a snapshot of your current working tree without removing changes. 815 | # This is handy for refactoring where you can't quite fit what you've done 816 | # into a commit but daren't stray too far from now without a backup. 817 | # 818 | # Running this: 819 | # 820 | # $ git snapshot 821 | # 822 | # Creates this stash: 823 | # 824 | # stash@{0}: On feature/handy-git-tricks: snapshot: Mon Apr 8 12:39:06 BST 2013 825 | # 826 | # And seemingly no changes to your working tree. 827 | # 828 | snapshot = !git stash push "snapshot: $(date)" && git stash apply "stash@{0}" 829 | 830 | # When you're a little worried that the world is coming to an end 831 | panic = !tar cvf ../panic.tar * 832 | 833 | # Create an archive file of everything in the repo 834 | archive = !"f() { top=$(rev-parse --show-toplevel); cd $top; tar cvf $top.tar $top ; }; f" 835 | 836 | # Do everything we can to synchronize all changes for the current branch. 837 | # 838 | # * git get: fetch and prune, pull and rebase, then update submodules 839 | # * git put: commit all items, then push 840 | # 841 | # If you want to preserve merges, then we recommend you set this: 842 | # 843 | # git config pull.rebase preserve 844 | # 845 | # TODO: handle tags, delete superfluous branches, and add error handing. 846 | # 847 | get = !git fetch --prune && git pull --rebase && git submodule update --init --recursive 848 | put = !git commit --all && git push 849 | 850 | # Do everything we can to make the local repo like the master branch. 851 | # 852 | # TODO: handle tags, and delete superfluous branches, and add error handling. 853 | # 854 | mastery = !git checkout master && git fetch origin --prune && git reset --hard origin/master 855 | 856 | # Ignore all untracked files by appending them to .gitignore: 857 | ignore = "!git status | grep -P \"^\\t\" | grep -vF .gitignore | sed \"s/^\\t//\" >> .gitignore" 858 | 859 | # Do a push/pull for just one branch 860 | push1 = "!git push origin $(git branch-name)" 861 | pull1 = "!git pull origin $(git branch-name)" 862 | 863 | # Track and untrack, with default parameters, and with printing the command 864 | track = "!f(){ branch=$(git rev-parse --abbrev-ref HEAD); cmd=\"git branch $branch -u ${1:-origin}/${2:-$branch}\"; echo $cmd; $cmd; }; f" 865 | untrack = "!f(){ branch=$(git rev-parse --abbrev-ref HEAD); cmd=\"git branch --unset-upstream ${1:-$branch}\"; echo $cmd; $cmd; }; f" 866 | 867 | # Track all remote branches that aren't already being tracked; 868 | # this is a bit hacky because of the parsing, and we welcome 869 | # better code that works using more-specific git commands. 870 | track-all-remote-branches = !"f() { git branch -r | grep -v ' -> ' | sed 's/^ \\+origin\\///' ; }; f" 871 | 872 | ## 873 | # Reset & Undo 874 | ## 875 | 876 | # Reset and undo aliases are ways to move backwards on the commit chain. 877 | # We find that novices prefer the wording "undo"; experts prefer "reset". 878 | reset-commit = reset --soft HEAD~1 879 | reset-commit-hard = reset --hard HEAD~1 880 | reset-commit-clean = !git reset --hard HEAD~1 && git clean -fd 881 | reset-to-pristine = !git reset --hard && git clean -ffdx 882 | reset-to-upstream = !git reset --hard $(git upstream-name) 883 | 884 | # Undo is simply a synonym for "reset" because "undo" can help novices. 885 | undo-commit = reset --soft HEAD~1 886 | undo-commit-hard = reset --hard HEAD~1 887 | undo-commit-clean = !git reset --hard HEAD~1 && git clean -fd 888 | undo-to-pristine = !git reset --hard && git clean -ffdx 889 | undo-to-upstream = !git reset --hard $(git upstream-name) 890 | 891 | # Nicknames 892 | uncommit = reset --soft HEAD~1 893 | unadd = reset HEAD 894 | unstage = reset HEAD 895 | 896 | # Discard changes in a (list of) file(s) in working tree 897 | discard = checkout -- 898 | 899 | # Clean and discard changes and untracked files in working tree 900 | cleanout = !git clean -df && git checkout -- . 901 | 902 | # Expunge a file everywhere; this command is typically for a serious problem, 903 | # such as accidentally committing a file of sensitive data, such as passwords. 904 | # After you use command, you will likely need to force push everything. 905 | # See https://help.github.com/articles/removing-sensitive-data-from-a-repository/ 906 | expunge = !"f() { git filter-branch --force --index-filter \"git rm --cached --ignore-unmatch $1\" --prune-empty --tag-name-filter cat -- --all }; f" 907 | 908 | # Edit all files of the given type 909 | edit-cached = !"f() { git ls-files --cached | sort -u ; }; `git var GIT_EDITOR` `f`" 910 | edit-deleted = !"f() { git ls-files --deleted | sort -u ; }; `git var GIT_EDITOR` `f`" 911 | edit-others = !"f() { git ls-files --others | sort -u ; }; `git var GIT_EDITOR` `f`" 912 | edit-ignored = !"f() { git ls-files --ignored | sort -u ; }; `git var GIT_EDITOR` `f`" 913 | edit-killed = !"f() { git ls-files --killed | sort -u ; }; `git var GIT_EDITOR` `f`" 914 | edit-modified = !"f() { git ls-files --modified | sort -u ; }; `git var GIT_EDITOR` `f`" 915 | edit-stage = !"f() { git ls-files --stage | cut -f2 | sort -u ; }; `git var GIT_EDITOR` `f`" 916 | 917 | # Editing and adding conflicted files: when we get many merge conflicts 918 | # and want to quickly solve them using an editor, then add the files. 919 | edit-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; `git var GIT_EDITOR` `f`" 920 | add-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`" 921 | 922 | # Ours & Theirs - easy merging when you know which files you want 923 | # 924 | # Sometimes during a merge you want to take a file from one side wholesale. 925 | # 926 | # The following aliases expose the ours and theirs commands which let you 927 | # pick a file(s) from the current branch or the merged branch respectively. 928 | # 929 | # * ours: checkout our version of a file and add it 930 | # * theirs: checkout their version of a file and add it 931 | # 932 | # N.b. the function is there as hack to get $@ doing 933 | # what you would expect it to as a shell user. 934 | # 935 | ours = !"f() { git checkout --ours $@ && git add $@; }; f" 936 | theirs = !"f() { git checkout --theirs $@ && git add $@; }; f" 937 | 938 | # Work In Progress: from https://gist.github.com/492227 and VonC on stackoverflow. 939 | # This enables a quick way to add all new and modified files to the index, 940 | # while cleaning the index from the files removed from the working tree; 941 | # this cleaning will facilitate a rebase, because there won't be any conflict 942 | # due to an "unclean" working directory (not in sync with the index). 943 | # The unwip will restore the deleted files to the working tree. 944 | wip = !"git add --all; git ls-files --deleted -z | xargs -0 git rm; git commit --message=wip" 945 | unwip = !"git log -n 1 | grep -q -c wip && git reset HEAD~1" 946 | 947 | # Assume 948 | # 949 | # Sometimes we want to change a file in a repo, but never check in your edits. 950 | # We can't use .gitignore because the file is tracked. We use update-index. 951 | # 952 | # If you interact with big corporate projects, such as projects in Subversion, 953 | # then you might run into the need to ignore certain files which are under 954 | # Subversion control, yet you need to modify them but not commit. 955 | # The assume-unchanged flag comes to the rescue. 956 | # 957 | # Suppose we want to edit passwords.txt and for god's sake never check it in: 958 | # 959 | # $ git status 960 | # modified passwords.txt 961 | # modified foo.txt 962 | # 963 | # $ git assume passwords.txt 964 | # $ git status 965 | # modified foo.txt 966 | # 967 | # $ git assumed 968 | # passwords.txt 969 | # 970 | # $ git unassume passwords.txt 971 | # $ git status 972 | # modified passwords.txt 973 | # modified foo.txt 974 | # 975 | # Thanks to http://durdn.com/blog/2012/11/22/must-have-git-aliases-advanced-examples/ 976 | # Thanks to http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/ 977 | 978 | assume = update-index --assume-unchanged 979 | unassume = update-index --no-assume-unchanged 980 | assume-all = "!git st -s | awk {'print $2'} | xargs git assume" 981 | unassume-all = "!git assumed | xargs git update-index --no-assume-unchanged" 982 | assumed = !"git ls-files -v | grep ^h | cut -c 3-" 983 | 984 | # Delete all branches that have already been merged into the master branch. 985 | master-cleanse = !git master-cleanse-local; git master-cleanse-remote 986 | 987 | # Delete all local branches that have been merged into the local master branch. 988 | master-cleanse-local = "!git checkout master && git branch --merged | xargs git branch --delete" 989 | 990 | # Delete all remote branches that have been merged into the remote master branch. 991 | master-cleanse-remote = !"git branch --remotes --merged origin/master | sed 's# *origin/##' | grep -v '^master$' xargs -I% git push origin :% 2>&1 | grep --colour=never 'deleted'" 992 | 993 | # Publish the current branch by pushing it to the remote "origin", 994 | # and setting the current branch to track the upstream branch. 995 | publish = !"git push --set-upstream origin $(git branch-name)" 996 | 997 | # Unpublish the current branch by deleting the 998 | # remote version of the current branch. 999 | unpublish = !"git push origin :$(git branch-name)" 1000 | 1001 | # Delete a branch name, then create the same branch name based on master - 1002 | # useful if you have, for example, a development branch and master branch 1003 | # and they go out of sync, and you want to nuke the development branch. 1004 | # 1005 | # Calls the `publish` and `unpublish` aliases. 1006 | # 1007 | reincarnate = !"f() { [[ -n $@ ]] && git checkout \"$@\" && git unpublish && git checkout master && git branch -D \"$@\" && git checkout -b \"$@\" && git publish; }; f" 1008 | 1009 | # Friendly wording is easier to remember. 1010 | # Thanks to http://gggritso.com/human-git-aliases 1011 | branches = branch -a 1012 | tags = tag -n1 --list 1013 | stashes = stash list 1014 | 1015 | 1016 | ### SHELL SCRIPTING ALIASES ### 1017 | 1018 | # Get the top level directory name 1019 | top-name = rev-parse --show-toplevel 1020 | 1021 | # Get the current branch name 1022 | branch-name = rev-parse --abbrev-ref HEAD 1023 | 1024 | # Get the upstream branch name 1025 | upstream-name = !git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD) 1026 | 1027 | # Execute shell scripts. Git always runs scripts in the top directory. 1028 | # For example "git exec pwd" will always show you the top directory. 1029 | exec = ! exec 1030 | 1031 | 1032 | ### MAINTENANCE ALIASES ### 1033 | 1034 | # pruner: prune everything that is unreachable now. 1035 | # 1036 | # This command takes a long time to run, perhaps even overnight. 1037 | # 1038 | # This is useful for removing unreachable objects from all places. 1039 | # 1040 | # By [CodeGnome](http://www.codegnome.com/) 1041 | # 1042 | pruner = !"git prune --expire=now; git reflog expire --expire-unreachable=now --rewrite --all" 1043 | 1044 | # repacker: repack a repo the way Linus recommends. 1045 | # 1046 | # This command takes a long time to run, perhaps even overnight. 1047 | # 1048 | # It does the equivalent of "git gc --aggressive" 1049 | # but done *properly*, which is to do something like: 1050 | # 1051 | # git repack -a -d --depth=250 --window=250 1052 | # 1053 | # The depth setting is about how deep the delta chains can be; 1054 | # make them longer for old history - it's worth the space overhead. 1055 | # 1056 | # The window setting is about how big an object window we want 1057 | # each delta candidate to scan. 1058 | # 1059 | # And here, you might well want to add the "-f" flag (which is 1060 | # the "drop all old deltas", since you now are actually trying 1061 | # to make sure that this one actually finds good candidates. 1062 | # 1063 | # And then it's going to take forever and a day (ie a "do it overnight" 1064 | # thing). But the end result is that everybody downstream from that 1065 | # repository will get much better packs, without having to spend any effort 1066 | # on it themselves. 1067 | # 1068 | # http://metalinguist.wordpress.com/2007/12/06/the-woes-of-git-gc-aggressive-and-how-git-deltas-work/ 1069 | # 1070 | # We also add the --window-memory limit of 1 gig, which helps protect 1071 | # us from a window that has very large objects such as binary blobs. 1072 | # 1073 | repacker = repack -a -d -f --depth=300 --window=300 --window-memory=1g 1074 | 1075 | # Do everything we can to optimize the repository. 1076 | # 1077 | # This command takes a long time to run, perhaps even overnight. 1078 | # 1079 | # Currently, this command simply calls `git pruner` and `git repacker`. 1080 | # There's a step that may be unnecessarying, calling `git prune-pack`. 1081 | # 1082 | optimize = !git pruner; git repacker; git prune-packed 1083 | 1084 | 1085 | ### ADVANCED ALIASES ### 1086 | 1087 | # Search for a given string in all patches and print commit messages. 1088 | # Posted by Mikko Rantalainen on StackOverflow. 1089 | # 1090 | # Example: search for any commit that adds or removes string "foobar" 1091 | # git searchcommits foobar 1092 | # 1093 | # Example: search commits for string "foobar" in directory src/lib 1094 | # git searchcommits foobar src/lib 1095 | # 1096 | # Example: search commits for "foobar", print full diff of commit with 1 line context 1097 | # git searchcommits foobar --pickaxe-all -U1 src/lib 1098 | searchcommits = !"f() { query=\"$1\"; shift; git log -S\"$query\" \"$@\"; }; f \"$@\"" 1099 | 1100 | # A 'debug' alias to help debugging builtins: when debugging builtins, 1101 | # we use gdb to analyze the runtime state. However, we have to disable 1102 | # the pager, and often we have to call the program with arguments. 1103 | # If the program to debug is a builtin, we use this alias. 1104 | debug = !GIT_PAGER= gdb --args git 1105 | 1106 | # Getting the diff of only one function: when we want to see just the 1107 | # differences of one function in one file in two different commits, 1108 | # we create two temp files which contain only the function, then diff. 1109 | # Use this alias this way: git funcdiff 1110 | # diff-func = !sh -c "git show \"\$1:\$3\" | sed -n \"/^[^ \t].*\$4(/,/^}/p\" > .tmp1 && git show \"\$2:\$3\" | sed -n \"/^[^ \t].*\$4(/,/^}/p\" > .tmp2 && git diff --no-index .tmp1 .tmp2" - 1111 | 1112 | # Calling "interdiff" between commits: if upstream applied a 1113 | # slightly modified patch, and we want to see the modifications, 1114 | # we use the program interdiff of the patchutils package. 1115 | intercommit = !sh -c 'git show "$1" > .git/commit1 && git show "$2" > .git/commit2 && interdiff .git/commit[12] | less -FRS' - 1116 | 1117 | # Prune all your stale remote branches: there's no way to tell 1118 | # git remote update to prune stale branches, and git remote prune 1119 | # does not understand --all. So here is a shell command to do it. 1120 | prune-all = !git remote | xargs -n 1 git remote prune 1121 | 1122 | # Thanks to cody cutrer 1123 | cherry-pick-merge = !"sh -c 'git cherry-pick --no-commit --mainline 1 $0 && \ 1124 | git log -1 --pretty=%P $0 | cut -b 42- > .git/MERGE_HEAD && \ 1125 | git commit --verbose'" 1126 | 1127 | # Thanks to jtolds on stackoverflow 1128 | remote-ref = !"sh -c ' \ 1129 | local_ref=$(git symbolic-ref HEAD); \ 1130 | local_name=${local_ref##refs/heads/}; \ 1131 | remote=$(git config branch.\"#local_name\".remote || echo origin); \ 1132 | remote_ref=$(git config branch.\"$local_name\".merge); \ 1133 | remote_name=${remote_ref##refs/heads/}; \ 1134 | echo remotes/$remote/$remote_name'" 1135 | 1136 | # Thanks to jtolds on stackoverflow 1137 | rebase-recent = !git rebase --interactive $(git remote-ref) 1138 | 1139 | # Use graphviz for display. 1140 | # This produces output that can be displayed using dotty, for example: 1141 | # $ git graphviz HEAD~100..HEAD~60 | dotty /dev/stdin 1142 | # $ git graphviz --first-parent master | dotty /dev/stdin 1143 | graphviz = !"f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f" 1144 | 1145 | # Serve the local directory by starting a git server daemon, so others can pull/push from my machine 1146 | serve = "-c daemon.receivepack=true daemon --base-path=. --export-all --reuseaddr --verbose" 1147 | 1148 | ########################################################################## 1149 | 1150 | ## 1151 | # Git alias settings suitable for topic branches. 1152 | # 1153 | # These aliases are simple starting points for a simple topic flow. 1154 | # Lots of people have lots of ideas about how to do various git flows. 1155 | # 1156 | # Some people like to use a topic branch for a new feature, or a 1157 | # hotfix patch, or refactoring work, or some spike research, etc. 1158 | # 1159 | # Start work on a new topic branch, which creates your branch: 1160 | # 1161 | # $ git topic-start add-feature-foo 1162 | # 1163 | # Do some work then synchronize your changes, which integrates your branch: 1164 | # 1165 | # $ git topic-sync 1166 | # 1167 | # Stop work on a topic branch, which deletes your branch: 1168 | # 1169 | # $ git topic-stop 1170 | # 1171 | # If you want to move your branch a.k.a. rename it: 1172 | # 1173 | # $ git topic-rename 1174 | # 1175 | # Ideas for your own alias customizations: 1176 | # 1177 | # * Notify your team, such as by sending an email, posting to chat, etc. 1178 | # 1179 | # * Trigger testing of the new topic branch to ensure all tests succeed. 1180 | # 1181 | # * Update your project management software with the new topic name. 1182 | # 1183 | # Customize these aliases as you like for your own workflow. 1184 | ## 1185 | 1186 | ## 1187 | # Provide the name of the topic base branch, such as "main". 1188 | # 1189 | # When we create a new topic branch, we base it on the topic base branch. 1190 | # Many projects use the topic base branch name "main". Some projects use 1191 | # use "trunk", "develop", "deploy", "integrate", "release", "green", etc. 1192 | # 1193 | # The topic base branch name is "main" by default. You can customize 1194 | # the name for your local repo, or your own user's global configuration, 1195 | # or your system configuration, by using `git config` such as: 1196 | # 1197 | # $ git config --local gitalias.topic.base.branch.name "foo" 1198 | # 1199 | # $ git config --global gitalias.topic.base.branch.name "foo" 1200 | # 1201 | # $ git config --system gitalias.topic.base.branch.name "foo" 1202 | # 1203 | # Thanks to https://github.com/gwjo 1204 | ## 1205 | 1206 | topic-base-branch-name = "!f(){ \ 1207 | git config --get gitalias.topic.base.branch.name || printf '%s\n' main; \ 1208 | };f" 1209 | 1210 | ## 1211 | # Start a topic branch. 1212 | # 1213 | # Example: 1214 | # 1215 | # git topic-start add-feature-foo 1216 | # 1217 | # We use this alias to begin work on a new feature, 1218 | # new task, new fix, new refactor, new optimization, etc. 1219 | # 1220 | # Customize this alias as you like for your own workflow. 1221 | # 1222 | # Our workflow does these steps: 1223 | # 1224 | # 1. Update the base branch. 1225 | # 2. Create a new branch with your topic name, based on the base branch. 1226 | # 3. Push the topic branch, so our team members can see the new branch. 1227 | # 1228 | # If you use a sharing site such a GitHub, and use typical settings, 1229 | # then this implementation makes your branch visible to collaborators. 1230 | # 1231 | # Many teams share branches before they are fully ready, to help 1232 | # the team provide feedback on the work-in-progress, and also to 1233 | # run any automatic tests to verify the branch runs successfully. 1234 | ## 1235 | 1236 | topic-start = "!f(){ \ 1237 | topic_branch=\"$1\"; \ 1238 | base_branch=$(git topic-base-branch-name); \ 1239 | git checkout \"$base_branch\"; git pull; \ 1240 | git checkout -b \"$topic_branch\" \"$base_branch\"; \ 1241 | git push --set-upstream origin \"$topic_branch\"; \ 1242 | };f" 1243 | 1244 | ## 1245 | # Stop a topic branch; this must be the current branch. 1246 | # 1247 | # Example: 1248 | # 1249 | # git topic-stop 1250 | # 1251 | # We use this alias to complete work on a new feature, 1252 | # new task, new fix, new refactor, new optimization, etc. 1253 | # 1254 | # Customize this alias as you like for your own workflow. 1255 | # 1256 | # Our workflow does these steps: 1257 | # 1258 | # 1. Push the topic branch. 1259 | # 2. Delete the topic branch locally. 1260 | # 3. Delete the topic branch remotely. 1261 | # 1262 | # If you use a sharing site such a GitHub, and use typical settings, 1263 | # then this implementation deletes your branch for the site. 1264 | # 1265 | # Many teams choose to delete topic branches when they are finished, 1266 | # to keep the repositories clean and with a smaller number of branches. 1267 | # 1268 | # If git says "unable to push to unqualified destination" then it means 1269 | # that the remote branch doesn't exist, so git is unable to delete it. 1270 | # That's fine; it means someone else has already deleted the branch. 1271 | # To synchronize your branch list, use "git fetch --prune". 1272 | ## 1273 | 1274 | topic-stop = "!f(){ \ 1275 | topic_branch=$(git branch-name); \ 1276 | base_branch=$(git topic-base-branch-name); \ 1277 | if [ \"$topic_branch\" = \"$base_branch\" ]; then \ 1278 | printf \"You are asking to do git topic-stop,\n\"; \ 1279 | printf \"but you are not currently on a topic branch;\n\"; \ 1280 | printf \"you are on the base branch: $base_branch.\n\"; \ 1281 | printf \"Please checkout the topic branch that you want,\n\"; \ 1282 | printf \"then retry the git topic delete command.\n\"; \ 1283 | else \ 1284 | git push; \ 1285 | git checkout \"$base_branch\"; \ 1286 | git branch --delete \"$topic_branch\"; \ 1287 | git push origin \":$topic_branch\"; \ 1288 | fi; \ 1289 | };f" 1290 | 1291 | ## 1292 | # Update the current topic branch by synchronizing changes. 1293 | # 1294 | # Example: 1295 | # 1296 | # git topic-sync 1297 | # 1298 | # This implementation does these: 1299 | # 1300 | # 1. Pull any changes. 1301 | # 2. Push any changes. 1302 | # 1303 | # If you use any kind of testing framework, or test driven development, 1304 | # then it can be wise to test your topic immediately after running this, 1305 | # to ensure that any available updates are successfully integrated. 1306 | # 1307 | # Customize this alias as you like for your own workflow. 1308 | ## 1309 | 1310 | topic-sync = "!f(){ \ 1311 | topic_branch=$(git branch-name); \ 1312 | base_branch=$(git topic-base-branch-name); \ 1313 | if [ \"$topic_branch\" = \"$base_branch\" ]; then \ 1314 | printf \"You are asking to do git topic-sync,\n\"; \ 1315 | printf \"but you are not currently on a topic branch;\n\"; \ 1316 | printf \"you are on the base branch: $base_branch.\n\"; \ 1317 | printf \"Please checkout the topic branch that you want,\n\"; \ 1318 | printf \"then retry the git topic delete command.\n\"; \ 1319 | else \ 1320 | git pull; \ 1321 | git push; \ 1322 | fi; \ 1323 | };f" 1324 | 1325 | ## 1326 | # Move the current topic branch, a.k.a. rename it. 1327 | # 1328 | # Example: 1329 | # 1330 | # git topic-move hello 1331 | # 1332 | # This implementation does these: 1333 | # 1334 | # 1. Move the local branch. 1335 | # 2. Move the remote branch by pushing to origin. 1336 | # 1337 | # Customize this alias as you like for your own workflow. 1338 | ## 1339 | 1340 | topic-move = "!f(){ \ 1341 | new_branch=\"$1\"; \ 1342 | old_branch=$(git branch-name); \ 1343 | git branch --move \"$old_branch\" \"$new_branch\"; \ 1344 | git push origin \":$old_branch\" \"$new_branch\"; \ 1345 | };f" 1346 | 1347 | 1348 | ########################################################################## 1349 | 1350 | ## 1351 | # Git aliases suitable for particular software integrations and tooling, 1352 | # such as other version control system e.g. CVS, Subversion, etc. 1353 | ## 1354 | 1355 | ### CVS ALIAS ### 1356 | 1357 | cvs-i = cvsimport -k -a 1358 | cvs-e = cvsexportcommit -u -p 1359 | 1360 | ### GitK ### 1361 | 1362 | # show conflicting merge in gitk: 1363 | gitk-conflict = !gitk --left-right HEAD...MERGE_HEAD 1364 | 1365 | # show full history in gitk (including "deleted" branches and stashes) 1366 | gitk-history-all = !gitk --all $( git fsck | awk '/dangling commit/ {print $3}' ) 1367 | 1368 | ### Ruby on Rails ### 1369 | 1370 | # Do everything we can to synchronize all changes for a Ruby On Rails app. 1371 | # We like using rebase (instead of merge), bundle for gems, and rake db:migrate 1372 | rails-get = !"git pull --rebase; git submodule update --init --recursive; bundle check || bundle install; bundle exec rake db:migrate; bundle exec rake db:test:prepare" 1373 | 1374 | ### Subversion ### 1375 | 1376 | svn-b = svn branch 1377 | svn-m = merge --squash 1378 | svn-c = svn dcommit 1379 | svn-cp = !GIT_EDITOR='sed -i /^git-svn-id:/d' git cherry-pick --edit 1380 | 1381 | ########################################################################## 1382 | 1383 | ## 1384 | # Git aliases to correct common typing mistakes, which git built-in autocorrection 1385 | # does not handle 1386 | ## 1387 | 1388 | ### Use with shell alias `gitp = git` ### 1389 | 1390 | ull = pull 1391 | ush = push 1392 | --------------------------------------------------------------------------------