├── .gitattributes ├── .config ├── fish │ ├── conf.d │ │ ├── fnm.fish │ │ ├── 00-core.fish │ │ ├── 01-brew.fish │ │ ├── 03-alias.fish │ │ └── 02-profile.fish │ ├── config.fish │ ├── functions │ │ ├── reset-launchpad.fish │ │ ├── cat.fish │ │ ├── git.fish │ │ ├── vim.fish │ │ ├── cleanup-empty-dirs.fish │ │ ├── git-save-me.fish │ │ ├── dedupe-open-with-entries.fish │ │ ├── dataurl.fish │ │ ├── dequarantine.fish │ │ ├── brew-everything.fish │ │ └── node-update-globals.fish │ ├── fish_variables │ └── completions │ │ ├── bun.fish │ │ └── fish-lsp.fish └── macscreens │ ├── left-right.json │ ├── top-down.json │ ├── lefty-righty.json │ └── top-bottom.json ├── _redirects ├── .github └── FUNDING.yml ├── .ssh └── config ├── .gitignore ├── .lnk ├── vercel.json ├── ducky.txt ├── README.md ├── core.sh ├── fonts.sh ├── .gitconfig ├── extra.sh ├── Library └── Application Support │ ├── com.mitchellh.ghostty │ └── config │ └── Cursor │ └── User │ ├── keybindings.json │ └── settings.json ├── .profile ├── cursor.sh ├── Brewfile └── sysprefs.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | * merge=mergiraf 2 | -------------------------------------------------------------------------------- /.config/fish/conf.d/fnm.fish: -------------------------------------------------------------------------------- 1 | # noop 2 | -------------------------------------------------------------------------------- /_redirects: -------------------------------------------------------------------------------- 1 | / https://github.com/grikomsn/dotfiles 307 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: grikomsn 2 | ko_fi: grikomsn 3 | patreon: grikomsn 4 | -------------------------------------------------------------------------------- /.config/macscreens/left-right.json: -------------------------------------------------------------------------------- 1 | [{"PointX":0,"PointY":0,"DisplayID":2},{"PointX":0,"PointY":0,"DisplayID":2}] -------------------------------------------------------------------------------- /.config/macscreens/top-down.json: -------------------------------------------------------------------------------- 1 | [{"PointX":0,"PointY":0,"DisplayID":2},{"PointX":0,"PointY":0,"DisplayID":2}] -------------------------------------------------------------------------------- /.config/macscreens/lefty-righty.json: -------------------------------------------------------------------------------- 1 | [{"PointX":0,"PointY":0,"DisplayID":1},{"PointX":1512,"PointY":-98,"DisplayID":2}] -------------------------------------------------------------------------------- /.config/macscreens/top-bottom.json: -------------------------------------------------------------------------------- 1 | [{"PointX":0,"PointY":0,"DisplayID":1},{"PointX":-206,"PointY":-1080,"DisplayID":2}] -------------------------------------------------------------------------------- /.config/fish/config.fish: -------------------------------------------------------------------------------- 1 | if status is-interactive 2 | # Commands to run in interactive sessions can go here 3 | end 4 | -------------------------------------------------------------------------------- /.ssh/config: -------------------------------------------------------------------------------- 1 | Include ~/.orbstack/ssh/config 2 | 3 | Host * 4 | IdentityAgent '~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock' 5 | -------------------------------------------------------------------------------- /.config/fish/functions/reset-launchpad.fish: -------------------------------------------------------------------------------- 1 | function reset-launchpad --description 'reset launchpad' 2 | defaults write com.apple.dock ResetLaunchPad -bool true 3 | killall Dock 4 | end 5 | -------------------------------------------------------------------------------- /.config/fish/functions/cat.fish: -------------------------------------------------------------------------------- 1 | function cat --wraps=bat --description 'alias cat bat' 2 | if command -q hub 3 | bat $argv 4 | else 5 | command cat $argv 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /.config/fish/functions/git.fish: -------------------------------------------------------------------------------- 1 | function git --wraps=hub --description 'alias git hub' 2 | if command -q hub 3 | hub $argv 4 | else 5 | command git $argv 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /.config/fish/functions/vim.fish: -------------------------------------------------------------------------------- 1 | function vim --wraps=nvim --description 'alias vim nvim' 2 | if command -q nvim 3 | nvim $argv 4 | else 5 | command vim $argv 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /.config/fish/functions/cleanup-empty-dirs.fish: -------------------------------------------------------------------------------- 1 | function cleanup-empty-dirs --description 'remove all empty directories recursively' 2 | while find . -type d -empty -delete 2>/dev/null | read -l 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /.config/fish/functions/git-save-me.fish: -------------------------------------------------------------------------------- 1 | function git-save-me --description 'custom function to list dangling commits' 2 | git log --graph --oneline --decorate $(git fsck --no-reflog | awk '/dangling commit/ {print $3}') 3 | end 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | .config/fish/completions/docker.fish 3 | .config/fish/completions/kubectl.fish 4 | .config/fish/completions/orbctl.fish 5 | .DS_Store 6 | .turbo 7 | .vercel 8 | *.env* 9 | *.log* 10 | *.tsbuildinfo 11 | node_modules 12 | 13 | !.env.example 14 | -------------------------------------------------------------------------------- /.config/fish/functions/dedupe-open-with-entries.fish: -------------------------------------------------------------------------------- 1 | function dedupe-open-with-entries --description 'dedupe open with entries' 2 | /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user 3 | end 4 | -------------------------------------------------------------------------------- /.lnk: -------------------------------------------------------------------------------- 1 | .config/fish 2 | .config/macscreens 3 | .gitattributes 4 | .gitconfig 5 | .gitignore 6 | .profile 7 | .ssh/config 8 | Brewfile 9 | Library/Application Support/Cursor/User/keybindings.json 10 | Library/Application Support/Cursor/User/settings.json 11 | Library/Application Support/com.mitchellh.ghostty 12 | -------------------------------------------------------------------------------- /.config/fish/functions/dataurl.fish: -------------------------------------------------------------------------------- 1 | function dataurl --description 'convert a file to a data url' 2 | set -l mimeType (file -b --mime-type $argv[1]) 3 | if string match -q "text/*" $mimeType 4 | set mimeType "$mimeType;charset=utf-8" 5 | end 6 | echo "data:$mimeType;base64,"(openssl base64 -in $argv[1] | tr -d '\n') 7 | end 8 | -------------------------------------------------------------------------------- /.config/fish/functions/dequarantine.fish: -------------------------------------------------------------------------------- 1 | function dequarantine --description 'dequarantine files or directories' 2 | for item in $argv 3 | if test -d $item # if it's a directory 4 | xattr -rd com.apple.quarantine $item 5 | else # if it's a file 6 | xattr -c $item 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /.config/fish/conf.d/00-core.fish: -------------------------------------------------------------------------------- 1 | set -gx ADBLOCK 1 2 | set -gx CARGO_NET_GIT_FETCH_WITH_CLI true 3 | set -gx DISABLE_OPENCOLLECTIVE 1 4 | set -gx GPG_TTY $TTY # https://stackoverflow.com/a/57591830/4273667 5 | set -gx LANG "en_US.UTF-8" 6 | set -gx LC_ALL "en_US.UTF-8" 7 | set -gx PATH /usr/local/bin /usr/local/sbin $PATH 8 | set -gx PATH $HOME/.local/bin $PATH 9 | -------------------------------------------------------------------------------- /.config/fish/functions/brew-everything.fish: -------------------------------------------------------------------------------- 1 | function brew-everything --description 'upgrade bun deno fnm rustup brew etc.' 2 | bun upgrade 3 | deno upgrade 4 | fnm install --lts 5 | rustup upgrade 6 | brew update -vvv 7 | brew upgrade -vvv 8 | brew cleanup -vvv 9 | brew doctor -vvv 10 | brew autoremove -vvv 11 | end 12 | -------------------------------------------------------------------------------- /vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "github": { 3 | "autoJobCancelation": true 4 | }, 5 | "redirects": [ 6 | { 7 | "source": "/macos/:match*", 8 | "destination": "/:match*", 9 | "permanent": true 10 | }, 11 | { 12 | "source": "/zip", 13 | "destination": "https://github.com/grikomsn/dotfiles/archive/refs/heads/main.zip", 14 | "permanent": false 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /.config/fish/conf.d/01-brew.fish: -------------------------------------------------------------------------------- 1 | set -l ARCH_NAME (uname -m) 2 | if test $ARCH_NAME = arm64 3 | set -gx HOMEBREW_PREFIX /opt/homebrew 4 | else 5 | set -gx HOMEBREW_PREFIX /usr/local 6 | end 7 | 8 | # https://github.com/orgs/Homebrew/discussions/4412#discussioncomment-8651316 9 | if test -d $HOMEBREW_PREFIX 10 | $HOMEBREW_PREFIX/bin/brew shellenv | source 11 | 12 | # bin extras 13 | set -gx PATH $HOMEBREW_PREFIX/opt/curl/bin $PATH 14 | end 15 | -------------------------------------------------------------------------------- /.config/fish/conf.d/03-alias.fish: -------------------------------------------------------------------------------- 1 | # @fish-lsp-disable 2002 2 | 3 | # https://superuser.com/a/1688630 4 | # https://github.com/fish-shell/fish-shell/commit/320cb6857f2b8c44e2caf76553ae931a15e10e81 5 | abbr -a -- - 'cd -' 6 | 7 | alias cp='cp -i' 8 | alias grep='grep --color' 9 | alias h='history' 10 | alias l='ls -lah' 11 | alias la='ls -lAFh' 12 | alias ll='ls -lh' 13 | alias md='mkdir -p' 14 | alias mv='mv -i' 15 | alias rd='rmdir' 16 | alias rm='rm -i' 17 | -------------------------------------------------------------------------------- /.config/fish/functions/node-update-globals.fish: -------------------------------------------------------------------------------- 1 | function node-update-globals --description 'update node related package managers and global packages' 2 | npm -g i npm corepack 3 | corepack enable pnpm 4 | corepack enable yarn 5 | corepack prepare --activate pnpm@latest 6 | corepack prepare --activate yarn@1.22.19 7 | set -l NODE_GLOBAL_PACKAGES fish-lsp neovim prettier serve tsx vercel 8 | pnpm --global add $NODE_GLOBAL_PACKAGES 9 | end 10 | -------------------------------------------------------------------------------- /ducky.txt: -------------------------------------------------------------------------------- 1 | ID 05AC:0267 Magic Keyboard A1644 2 | REM https://devicehunt.com/view/type/usb/vendor/05AC/device/0267 3 | 4 | DELAY 1000 5 | GUI SPACE 6 | DELAY 500 7 | STRING terminal 8 | DELAY 500 9 | ENTER 10 | DELAY 1000 11 | 12 | DEFAULT_DELAY 50 13 | 14 | STRING sh -c "$(curl -fsSL https://dotfiles.nibras.co/sysprefs.sh)" 15 | STRING && zsh -c "$(curl -fsSL https://dotfiles.nibras.co/core.sh)" 16 | STRING && zsh -c "$(curl -fsSL https://dotfiles.nibras.co/extra.sh)" 17 | ENTER 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ~/.dotfiles 2 | 3 | Dotfiles for my workstations when I'm having a bad day (read: reinstalling from scratch) 🏖️ 4 | 5 | ## Install scripts 6 | 7 | ```sh 8 | sh -c "$(curl -fsSL https://dotfiles.nibras.co/sysprefs.sh)" 9 | ``` 10 | 11 | ```sh 12 | sh -c "$(curl -fsSL https://dotfiles.nibras.co/core.sh)" 13 | ``` 14 | 15 | ```sh 16 | zsh -c "$(curl -fsSL https://dotfiles.nibras.co/extra.sh)" 17 | ``` 18 | 19 | ```sh 20 | zsh -c "$(curl -fsSL https://dotfiles.nibras.co/neovim.sh)" 21 | ``` 22 | 23 | ```sh 24 | zsh -c "$(curl -fsSL https://dotfiles.nibras.co/vscode.sh)" 25 | ``` 26 | 27 | ## Extra steps 28 | 29 | - If `xcode-select --install` does not work, download manually at 30 | - Remember to `eval "$(ssh-agent -s)"` and `ssh-add -K` 31 | -------------------------------------------------------------------------------- /core.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sudo -v 4 | while true; do 5 | sudo -n true 6 | sleep 60 7 | kill -0 "$$" || exit 8 | done 2>/dev/null & 9 | 10 | DF_HOSTNAME="${DF_HOSTNAME:=dotfiles.nibras.co}" 11 | 12 | echo "Creating Projects, Temporary, and Workspace directory in home ..." 13 | mkdir -p ~/{Projects,Scripts,Temporary,Workspace} 14 | 15 | echo "Installing Xcode command line tools ..." 16 | xcode-select --install 17 | 18 | if [ "$(uname -m)" = "arm64" ]; then 19 | echo "Installing Rosetta ..." 20 | softwareupdate --install-rosetta --agree-to-license 21 | fi 22 | 23 | read -p "Press any key to install Homebrew ..." 24 | echo "Installing Homebrew ..." 25 | bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 26 | 27 | echo "Fetching Brewfile ..." 28 | curl -fsSL https://$DF_HOSTNAME/Brewfile >~/Brewfile 29 | 30 | echo "Brewing ..." 31 | brew bundle --global --force 32 | 33 | echo "Done! ✨" 34 | -------------------------------------------------------------------------------- /fonts.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sudo -v 4 | while true; do 5 | sudo -n true 6 | sleep 60 7 | kill -0 "$$" || exit 8 | done 2>/dev/null & 9 | 10 | # https://developer.apple.com/fonts 11 | echo "Downloading fonts for Apple platforms ..." 12 | cd ~/Downloads 13 | 14 | FONT_IMAGES=( 15 | "SF-Pro.dmg" 16 | "SF-Compact.dmg" 17 | "SF-Mono.dmg" 18 | "NY.dmg" 19 | ) 20 | for FONT_IMAGE in "${FONT_IMAGES[@]}"; do 21 | wget https://devimages-cdn.apple.com/design/resources/download/$FONT_IMAGE 22 | done 23 | 24 | echo "Mounting font disk images ..." 25 | for FONT_IMAGE in "${FONT_IMAGES[@]}"; do 26 | hdiutil attach $FONT_IMAGE 27 | done 28 | 29 | FONT_PKG_PATHS=( 30 | '/Volumes/NYFonts/NY Fonts.pkg' 31 | '/Volumes/SFCompactFonts/SF Compact Fonts.pkg' 32 | '/Volumes/SFMonoFonts/SF Mono Fonts.pkg' 33 | '/Volumes/SFProFonts/SF Pro Fonts.pkg' 34 | ) 35 | for FONT_PKG_PATH in "${FONT_PKG_PATHS[@]}"; do 36 | sudo installer -pkg "$FONT_PKG_PATH" -target /Library/Fonts 37 | done 38 | 39 | echo "Done! ✨" 40 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [commit] 2 | gpgsign = false 3 | 4 | [core] 5 | attributesfile = ~/.gitattributes 6 | 7 | [credential] 8 | helper = store 9 | 10 | [credential "https://github.com"] 11 | helper = 12 | helper = !/opt/homebrew/bin/gh auth git-credential 13 | 14 | [credential "https://gist.github.com"] 15 | helper = 16 | helper = !/opt/homebrew/bin/gh auth git-credential 17 | 18 | [diff "bun"] 19 | binary = true 20 | cachetextconv = true 21 | textconv = bun 22 | 23 | [gpg] 24 | program = /opt/homebrew/bin/gpg 25 | format = openpgp 26 | 27 | [gpg "ssh"] 28 | program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign 29 | 30 | [filter "lfs"] 31 | clean = git-lfs clean -- %f 32 | process = git-lfs filter-process 33 | required = true 34 | smudge = git-lfs smudge -- %f 35 | 36 | [init] 37 | defaultBranch = main 38 | 39 | [merge] 40 | conflictStyle = "diff3" 41 | 42 | [merge "mergiraf"] 43 | name = mergiraf 44 | driver = mergiraf merge --git %O %A %B -s %S -x %X -y %Y -p %P -l %L 45 | 46 | [mergetool] 47 | keepBackup = true 48 | 49 | [pull] 50 | rebase = false 51 | 52 | [tag] 53 | forceSignAnnotated = true 54 | 55 | [user] 56 | name = Griko Nibras 57 | email = griko@nibras.co 58 | signingkey = C8D144D7CBD8E183244969E1194CDB6C6785C7B3 59 | -------------------------------------------------------------------------------- /extra.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sudo -v 4 | while true; do 5 | sudo -n true 6 | sleep 60 7 | kill -0 "$$" || exit 8 | done 2>/dev/null & 9 | 10 | ARCH_NAME="$(uname -m)" 11 | if [ "${ARCH_NAME}" = "x86_64" ]; then 12 | HOMEBREW_PREFIX="/usr/local" 13 | elif [ "${ARCH_NAME}" = "arm64" ]; then 14 | HOMEBREW_PREFIX="/opt/homebrew" 15 | fi 16 | 17 | echo "Installing Bun ..." 18 | bash -c "$(curl -fsSL https://bun.sh/install)" 19 | 20 | echo "Installing Deno ..." 21 | bash -c "$(curl -fsSL https://deno.land/x/install/install.sh)" 22 | 23 | echo "Installing Rust ..." 24 | bash -c "$(curl -fsSL https://sh.rustup.rs)" 25 | 26 | echo "Installing Node.js runtimes via fnm ..." 27 | fnm install --lts 28 | fnm alias lts-latest default 29 | 30 | # echo "Installing npm, yarn, and various packages ..." 31 | # node-update-globals 32 | 33 | echo "Installing pip packages ..." 34 | pip3 install --upgrade pip 35 | pip3 install neovim watchdog 36 | 37 | echo "Setting up git lfs ..." 38 | sudo git lfs install --system 39 | 40 | echo "Setting up mkcert ..." 41 | mkcert -install 42 | 43 | # echo "Setting up openjdk ..." 44 | # sudo ln -sfn $HOMEBREW_PREFIX/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk 45 | 46 | echo "Setting up ssh agent ..." 47 | eval "$(ssh-agent -s)" 48 | 49 | echo "Done! ✨" 50 | -------------------------------------------------------------------------------- /.config/fish/conf.d/02-profile.fish: -------------------------------------------------------------------------------- 1 | # bun 2 | if test -d $HOME/.bun 3 | set -gx BUN_INSTALL $HOME/.bun 4 | set -gx PATH $BUN_INSTALL/bin $PATH 5 | end 6 | 7 | # chatwise 8 | if test -d /Applications/ChatWise.app 9 | set -gx CHATWISE_INSTALL /Applications/ChatWise.app/Contents/MacOS 10 | set -gx PATH $CHATWISE_INSTALL $PATH 11 | end 12 | 13 | # deno 14 | if test -d $HOME/.deno 15 | set -gx DENO_INSTALL $HOME/.deno 16 | set -gx PATH $DENO_INSTALL/bin $PATH 17 | end 18 | 19 | # fnm 20 | fnm env --use-on-cd | source 21 | 22 | # fzf 23 | fzf --fish | source 24 | 25 | # go 26 | if test -d $HOME/.go 27 | set -gx GOPATH $HOME/.go 28 | set -gx PATH $GOPATH/bin $PATH 29 | end 30 | 31 | # lmstudio 32 | if test -d $HOME/.lmstudio 33 | set -gx LM_STUDIO_INSTALL $HOME/.lmstudio 34 | set -gx PATH $LM_STUDIO_INSTALL/bin $PATH 35 | end 36 | 37 | # mkcert 38 | set -gx NODE_EXTRA_CA_CERTS "$(mkcert -CAROOT)/rootCA.pem" 39 | 40 | # orbstack 41 | if test -f $HOME/.orbstack/shell/init2.fish 42 | source $HOME/.orbstack/shell/init2.fish 2>/dev/null || : 43 | end 44 | 45 | # pnpm 46 | set -gx PNPM_HOME $HOME/Library/pnpm 47 | set -gx PATH $PNPM_HOME $PATH 48 | 49 | # rust 50 | if test -d $HOME/.cargo 51 | set -gx RUST_INSTALL $HOME/.cargo 52 | set -gx PATH $RUST_INSTALL/bin $PATH 53 | end 54 | 55 | # yarn 56 | set -gx PATH $HOME/.yarn/bin $PATH 57 | -------------------------------------------------------------------------------- /.config/fish/fish_variables: -------------------------------------------------------------------------------- 1 | # This file contains fish universal variable definitions. 2 | # VERSION: 3.0 3 | SETUVAR __fish_initialized:3800 4 | SETUVAR fish_color_autosuggestion:brblack 5 | SETUVAR fish_color_cancel:\x2dr 6 | SETUVAR fish_color_command:normal 7 | SETUVAR fish_color_comment:red 8 | SETUVAR fish_color_cwd:green 9 | SETUVAR fish_color_cwd_root:red 10 | SETUVAR fish_color_end:green 11 | SETUVAR fish_color_error:brred 12 | SETUVAR fish_color_escape:brcyan 13 | SETUVAR fish_color_history_current:\x2d\x2dbold 14 | SETUVAR fish_color_host:normal 15 | SETUVAR fish_color_host_remote:yellow 16 | SETUVAR fish_color_normal:normal 17 | SETUVAR fish_color_operator:brcyan 18 | SETUVAR fish_color_param:cyan 19 | SETUVAR fish_color_quote:yellow 20 | SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold 21 | SETUVAR fish_color_search_match:white\x1e\x2d\x2dbackground\x3dbrblack 22 | SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack 23 | SETUVAR fish_color_status:red 24 | SETUVAR fish_color_user:brgreen 25 | SETUVAR fish_color_valid_path:\x2d\x2dunderline 26 | SETUVAR fish_key_bindings:fish_default_key_bindings 27 | SETUVAR fish_pager_color_completion:normal 28 | SETUVAR fish_pager_color_description:yellow\x1e\x2di 29 | SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline 30 | SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan 31 | SETUVAR fish_pager_color_selected_background:\x2dr 32 | -------------------------------------------------------------------------------- /Library/Application Support/com.mitchellh.ghostty/config: -------------------------------------------------------------------------------- 1 | # This is the configuration file for Ghostty. 2 | # 3 | # This template file has been automatically created at the following 4 | # path since Ghostty couldn't find any existing config files on your system: 5 | # 6 | # /Users/griko/Library/Application Support/com.mitchellh.ghostty/config 7 | # 8 | # The template does not set any default options, since Ghostty ships 9 | # with sensible defaults for all options. Users should only need to set 10 | # options that they want to change from the default. 11 | # 12 | # Run `ghostty +show-config --default --docs` to view a list of 13 | # all available config options and their default values. 14 | # 15 | # Additionally, each config option is also explained in detail 16 | # on Ghostty's website, at https://ghostty.org/docs/config. 17 | 18 | # Config syntax crash course 19 | # ========================== 20 | # # The config file consists of simple key-value pairs, 21 | # # separated by equals signs. 22 | # font-family = Iosevka 23 | # window-padding-x = 2 24 | # 25 | # # Spacing around the equals sign does not matter. 26 | # # All of these are identical: 27 | # key=value 28 | # key= value 29 | # key =value 30 | # key = value 31 | # 32 | # # Any line beginning with a # is a comment. It's not possible to put 33 | # # a comment after a config option, since it would be interpreted as a 34 | # # part of the value. For example, this will have a value of "#123abc": 35 | # background = #123abc 36 | # 37 | # # Empty values are used to reset config keys to default. 38 | # key = 39 | # 40 | # # Some config options have unique syntaxes for their value, 41 | # # which is explained in the docs for that config option. 42 | # # Just for example: 43 | # resize-overlay-duration = 4s 200ms 44 | 45 | adjust-cell-height = 8 46 | confirm-close-surface = true 47 | font-family = "SF Mono Powerline" 48 | font-size = 12 49 | keybind = global:ctrl+shift+`=toggle_quick_terminal 50 | macos-secure-input-indication = false 51 | mouse-scroll-multiplier = 2 52 | selection-invert-fg-bg = true 53 | theme = light:Apple System Colors Light,dark:Apple System Colors 54 | window-colorspace = display-p3 55 | window-padding-x = 8 56 | window-padding-y = 8 57 | 58 | keybind = shift+enter=text:\n 59 | -------------------------------------------------------------------------------- /.profile: -------------------------------------------------------------------------------- 1 | # 00-core 2 | 3 | export ADBLOCK=1 4 | export CARGO_NET_GIT_FETCH_WITH_CLI=true 5 | export DISABLE_OPENCOLLECTIVE=1 6 | export GPG_TTY=$TTY # https://stackoverflow.com/a/57591830/4273667 7 | export LANG="en_US.UTF-8" 8 | export LC_ALL="en_US.UTF-8" 9 | export PATH=/usr/local/bin:/usr/local/sbin:$PATH 10 | export PATH=$HOME/.local/bin:$PATH 11 | 12 | # 01-brew 13 | 14 | ARCH_NAME="$(uname -m)" 15 | if [ "${ARCH_NAME}" = "arm64" ]; then 16 | BREW_PREFIX="/opt/homebrew" 17 | else 18 | BREW_PREFIX="/usr/local" 19 | fi 20 | 21 | # https://github.com/orgs/Homebrew/discussions/4412#discussioncomment-8651316 22 | if [ -d "${BREW_PREFIX}" ]; then 23 | export HOMEBREW_CELLAR="${BREW_PREFIX}/Cellar" 24 | export HOMEBREW_REPOSITORY="${BREW_PREFIX}/homebrew" 25 | export PATH="${BREW_PREFIX}/bin:${BREW_PREFIX}/sbin:$PATH" 26 | export MANPATH="${BREW_PREFIX}/share/man:$MANPATH" 27 | export INFOPATH="${BREW_PREFIX}/share/info:$INFOPATH" 28 | $HOMEBREW_PREFIX/bin/brew shellenv | source 29 | 30 | # bin extras 31 | export PATH="${BREW_PREFIX}/opt/curl/bin:$PATH" 32 | fi 33 | 34 | # 02-profile 35 | 36 | # bun 37 | if [ -d "$HOME/.bun" ]; then 38 | export BUN_INSTALL="$HOME/.bun" 39 | export PATH="$BUN_INSTALL/bin:$PATH" 40 | fi 41 | 42 | # chatwise 43 | if [ -d "/Applications/ChatWise.app" ]; then 44 | export CHATWISE_INSTALL="/Applications/ChatWise.app/Contents/MacOS" 45 | export PATH="$CHATWISE_INSTALL:$PATH" 46 | fi 47 | 48 | # deno 49 | if [ -d "$HOME/.deno" ]; then 50 | export DENO_INSTALL="$HOME/.deno" 51 | export PATH="$DENO_INSTALL/bin:$PATH" 52 | fi 53 | 54 | # fnm 55 | eval $(fnm env) 56 | 57 | # fzf 58 | eval $(fzf --fish) 59 | 60 | # go 61 | if [ -d "$HOME/.go" ]; then 62 | export GOPATH="$HOME/.go" 63 | export PATH="$GOPATH/bin:$PATH" 64 | fi 65 | 66 | # lmstudio 67 | if [ -d "$HOME/.lmstudio" ]; then 68 | export LM_STUDIO_INSTALL="$HOME/.lmstudio" 69 | export PATH="$LM_STUDIO_INSTALL/bin:$PATH" 70 | fi 71 | 72 | # mkcert 73 | export NODE_EXTRA_CA_CERTS="$(mkcert -CAROOT)/rootCA.pem" 74 | 75 | # orbstack 76 | if [ -f "$HOME/.orbstack/shell/init2.fish" ]; then 77 | source "$HOME/.orbstack/shell/init2.fish" 2>/dev/null || : 78 | fi 79 | 80 | # pnpm 81 | export PNPM_HOME="$HOME/Library/pnpm" 82 | export PATH="$PNPM_HOME:$PATH" 83 | 84 | # rust 85 | if [ -d "$HOME/.cargo" ]; then 86 | export RUST_INSTALL="$HOME/.cargo" 87 | export PATH="$RUST_INSTALL/bin:$PATH" 88 | fi 89 | 90 | # yarn 91 | export PATH="$HOME/.yarn/bin:$PATH" 92 | -------------------------------------------------------------------------------- /Library/Application Support/Cursor/User/keybindings.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "key": "shift+cmd+/", 4 | "command": "editor.action.blockComment", 5 | "when": "editorTextFocus && !editorReadonly" 6 | }, 7 | { 8 | "key": "ctrl+alt+cmd+f", 9 | "command": "editor.action.fixAll" 10 | }, 11 | { 12 | "key": "ctrl+alt+cmd+i", 13 | "command": "editor.action.organizeImports", 14 | "when": "textInputFocus && !editorReadonly && supportedCodeAction =~ /(\\s|^)source\\.organizeImports\\b/" 15 | }, 16 | { 17 | "key": "ctrl+shift+cmd+[", 18 | "command": "editor.action.selectToBracket", 19 | "when": "editorTextFocus" 20 | }, 21 | { 22 | "key": "ctrl+shift+cmd+]", 23 | "command": "editor.action.selectToBracket", 24 | "when": "editorTextFocus" 25 | }, 26 | { 27 | "key": "ctrl+shift+cmd+pagedown", 28 | "command": "editor.action.sortLinesAscending" 29 | }, 30 | { 31 | "key": "ctrl+shift+cmd+down", 32 | "command": "editor.action.sortLinesAscending" 33 | }, 34 | { 35 | "key": "ctrl+shift+cmd+pageup", 36 | "command": "editor.action.sortLinesDescending" 37 | }, 38 | { 39 | "key": "ctrl+shift+cmd+up", 40 | "command": "editor.action.sortLinesDescending" 41 | }, 42 | { 43 | "key": "alt+r", 44 | "command": "editor.emmet.action.updateTag" 45 | }, 46 | { 47 | "key": "ctrl+shift+cmd+w", 48 | "command": "editor.emmet.action.wrapWithAbbreviation" 49 | }, 50 | { 51 | "key": "cmd+k cmd+r", 52 | "command": "git.revertSelectedRanges", 53 | "when": "editorFocus || isInDiffEditor" 54 | }, 55 | { 56 | "key": "ctrl+alt+cmd+r", 57 | "command": "runCommands", 58 | "args": { 59 | "commands": ["eslint.restart", "typescript.restartTsServer"] 60 | } 61 | }, 62 | { 63 | "key": "ctrl+shift+cmd+backspace", 64 | "command": "runCommands", 65 | "args": { 66 | "commands": [ 67 | "javascript.removeUnusedImports", 68 | "typescript.removeUnusedImports" 69 | ] 70 | } 71 | }, 72 | { 73 | "key": "ctrl+alt+cmd+j", 74 | "command": "workbench.action.createTerminalEditor" 75 | }, 76 | { 77 | "key": "ctrl+alt+cmd+shift+r", 78 | "command": "workbench.action.reloadWindow" 79 | }, 80 | { 81 | "key": "ctrl+shift+cmd+r", 82 | "command": "workbench.action.restartExtensionHost" 83 | }, 84 | { 85 | "key": "ctrl+shift+cmd+.", 86 | "command": "javascriptBooster.extendSelection" 87 | }, 88 | { 89 | "key": "ctrl+shift+cmd+,", 90 | "command": "javascriptBooster.shrinkSelection" 91 | }, 92 | { 93 | "key": "cmd+right", 94 | "command": "-editor.action.inlineSuggest.acceptNextWord", 95 | "when": "cppSuggestion && !editorReadonly || inlineSuggestionVisible && !editorReadonly" 96 | }, 97 | { 98 | "key": "ctrl+shift+cmd+k", 99 | "command": "cursorai.action.generateInTerminal", 100 | "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalPromptBarVisible || terminalProcessSupported && terminalPromptBarVisible" 101 | }, 102 | { 103 | "key": "cmd+k", 104 | "command": "-cursorai.action.generateInTerminal", 105 | "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalPromptBarVisible || terminalProcessSupported && terminalPromptBarVisible" 106 | }, 107 | { 108 | "key": "ctrl+shift+cmd+k", 109 | "command": "aipopup.action.modal.generate", 110 | "when": "editorFocus && !composerBarIsVisible" 111 | }, 112 | { 113 | "key": "shift+cmd+k", 114 | "command": "-aipopup.action.modal.generate", 115 | "when": "editorFocus && !composerBarIsVisible" 116 | }, 117 | { 118 | "key": "shift+enter", 119 | "command": "workbench.action.terminal.sendSequence", 120 | "args": { 121 | "text": "\\\r\n" 122 | }, 123 | "when": "terminalFocus" 124 | } 125 | ] 126 | -------------------------------------------------------------------------------- /cursor.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | sudo -v 4 | while true; do 5 | sudo -n true 6 | sleep 60 7 | kill -0 "$$" || exit 8 | done 2>/dev/null & 9 | 10 | DF_HOSTNAME="${DF_HOSTNAME:=dotfiles.nibras.co}" 11 | 12 | CODE_USER_PATH="$HOME/Library/Application Support/Code/User" 13 | CURSOR_USER_PATH="$HOME/Library/Application Support/Cursor/User" 14 | 15 | cd $HOME 16 | 17 | MKDIR_PATHS=( 18 | ".cursor" 19 | "$CODE_USER_PATH/snippets" 20 | "$CURSOR_USER_PATH/snippets" 21 | ) 22 | for MKDIR_PATH in "${MKDIR_PATHS[@]}"; do 23 | echo "Creating '$MKDIR_PATH' directory ..." 24 | mkdir -p "$MKDIR_PATH" 25 | done 26 | 27 | SYMLINK_PATHS=( 28 | ".vscode-oss" 29 | ".vscode" 30 | ) 31 | 32 | echo "Setup symlinks ..." 33 | for SYMLINK_PATH in "${SYMLINK_PATHS[@]}"; do 34 | echo "Creating $SYMLINK_PATH symlink ..." 35 | ln -s "$HOME/.cursor" "$SYMLINK_PATH" 36 | done 37 | 38 | SYMLINK_PATHS=( 39 | "$CODE_USER_PATH" 40 | ) 41 | 42 | echo "Setup cross editor symlinks ..." 43 | for SYMLINK_PATH in "${SYMLINK_PATHS[@]}"; do 44 | cd $SYMLINK_PATH 45 | rm -rf "$SYMLINK_PATH/snippets" && ln -sf "$CURSOR_USER_PATH/snippets" 46 | rm -f "$SYMLINK_PATH/keybindings.json" && ln -sf "$CURSOR_USER_PATH/keybindings.json" 47 | rm -f "$SYMLINK_PATH/settings.json" && ln -sf "$CURSOR_USER_PATH/settings.json" 48 | done 49 | 50 | EXTENSIONS=( 51 | 1password.op-vscode 52 | aaron-bond.better-comments 53 | adpyke.vscode-userscript 54 | antfu.icons-carbon 55 | anthropic.claude-code 56 | anysphere.cursorpyright 57 | anysphere.remote-containers 58 | anysphere.remote-ssh 59 | bierner.comment-tagged-templates 60 | bierner.folder-source-actions 61 | bierner.github-markdown-preview 62 | bierner.markdown-checkbox 63 | bierner.markdown-emoji 64 | bierner.markdown-footnotes 65 | bierner.markdown-mermaid 66 | bierner.markdown-preview-github-styles 67 | bierner.markdown-yaml-preamble 68 | biomejs.biome 69 | bradlc.vscode-tailwindcss 70 | cardinal90.multi-cursor-case-preserve 71 | charliermarsh.ruff 72 | christian-kohler.path-intellisense 73 | codezombiech.gitignore 74 | dakara.transformer 75 | dbaeumer.vscode-eslint 76 | denoland.vscode-deno 77 | dnicolson.binary-plist 78 | drknoxy.eslint-disable-snippets 79 | eamodio.gitlens 80 | editorconfig.editorconfig 81 | esbenp.prettier-vscode 82 | foxundermoon.shell-format 83 | github.codespaces 84 | github.copilot 85 | github.copilot-chat 86 | github.github-vscode-theme 87 | github.remotehub 88 | github.vscode-github-actions 89 | github.vscode-pull-request-github 90 | golang.go 91 | jock.svg 92 | llvm-vs-code-extensions.vscode-clangd 93 | loriscro.super 94 | mikestead.dotenv 95 | mkhl.shfmt 96 | ms-azuretools.vscode-containers 97 | ms-python.debugpy 98 | ms-python.python 99 | ms-python.vscode-python-envs 100 | ms-vscode.cmake-tools 101 | ms-vscode.cpptools 102 | ms-vscode.makefile-tools 103 | ms-vscode.remote-repositories 104 | ms-vscode.remote-server 105 | ms-vscode.wasm-wasi-core 106 | ms-vsliveshare.vsliveshare 107 | mylesmurphy.prettify-ts 108 | ndonfris.fish-lsp 109 | orta.vscode-twoslash-queries 110 | oven.bun-vscode 111 | pustelto.bracketeer 112 | pveyes.aperture 113 | redhat.vscode-commons 114 | redhat.vscode-xml 115 | redhat.vscode-yaml 116 | rust-lang.rust-analyzer 117 | sburg.vscode-javascript-booster 118 | tamasfe.even-better-toml 119 | tldraw-org.tldraw-vscode 120 | twxs.cmake 121 | unifiedjs.vscode-mdx 122 | unifiedjs.vscode-remark 123 | vitest.explorer 124 | wallabyjs.quokka-vscode 125 | wmaurer.change-case 126 | yoavbls.pretty-ts-errors 127 | yunduo.color-highlight-css-color-4 128 | zachhardesty.convert-object-to-jsx-vscode 129 | zengxingxin.sort-js-object-keys 130 | ) 131 | 132 | if [ -z "${SKIP_EXTENSIONS}" ]; then 133 | echo "Installing extensions ..." 134 | for EXTENSION in $EXTENSIONS; do 135 | if [ -n "$USE_CODE" ]; then 136 | code --install-extension $EXTENSION --force 137 | else 138 | cursor --install-extension $EXTENSION --force 139 | fi 140 | done 141 | else 142 | echo "Skipping extensions installation ..." 143 | fi 144 | 145 | echo "Done! ✨" 146 | -------------------------------------------------------------------------------- /Brewfile: -------------------------------------------------------------------------------- 1 | tap "osx-cross/arm" 2 | tap "osx-cross/avr" 3 | tap "qmk/qmk" 4 | tap "sst/tap" 5 | tap "yarlson/lnk" 6 | brew "asciinema" 7 | brew "ncurses" 8 | brew "bash" 9 | brew "bat" 10 | brew "cmake" 11 | brew "curl" 12 | brew "ffmpeg" 13 | brew "fish" 14 | brew "fnm" 15 | brew "fzf" 16 | brew "gh" 17 | brew "git" 18 | brew "git-filter-repo" 19 | brew "git-lfs" 20 | brew "pinentry" 21 | brew "gnupg" 22 | brew "go" 23 | brew "gollama" 24 | brew "graphviz" 25 | brew "grep" 26 | brew "hub" 27 | brew "imagemagick" 28 | brew "jq" 29 | brew "mas" 30 | brew "mergiraf" 31 | brew "mkcert" 32 | brew "neovim" 33 | brew "ollama" 34 | brew "openssh" 35 | brew "pandoc" 36 | brew "pinentry-mac" 37 | brew "python@3.12" 38 | brew "ripgrep" 39 | brew "shfmt" 40 | brew "sops" 41 | brew "the_silver_searcher" 42 | brew "tree" 43 | brew "wget" 44 | brew "zsh" 45 | brew "qmk/qmk/qmk" 46 | brew "sst/tap/opencode" 47 | brew "yarlson/lnk/lnk" 48 | cask "1password" 49 | cask "1password-cli" 50 | cask "airbuddy" 51 | cask "balenaetcher" 52 | cask "betterdisplay" 53 | cask "chatwise" 54 | cask "claude" 55 | cask "claude-code" 56 | cask "cleanmymac" 57 | cask "cleanshot" 58 | cask "conductor" 59 | cask "cursor" 60 | cask "cursor-cli" 61 | cask "cyberduck" 62 | cask "dbngin" 63 | cask "discord" 64 | cask "figma" 65 | cask "font-sf-mono-for-powerline" 66 | cask "fork" 67 | cask "ghidra" 68 | cask "ghostty" 69 | cask "gpg-suite-no-mail" 70 | cask "homerow" 71 | cask "imageoptim" 72 | cask "keyboardcleantool" 73 | cask "lm-studio" 74 | cask "logi-options+" 75 | cask "loopback" 76 | cask "mac-mouse-fix" 77 | cask "macs-fan-control" 78 | cask "master-pdf-editor" 79 | cask "mist" 80 | cask "obs" 81 | cask "orbstack" 82 | cask "parallels" 83 | cask "proxyman" 84 | cask "qflipper" 85 | cask "qlstephen" 86 | cask "qmk-toolbox" 87 | cask "raycast" 88 | cask "repo-prompt" 89 | cask "rode-connect" 90 | cask "screen-studio" 91 | cask "slack" 92 | cask "tableplus" 93 | cask "tailscale-app" 94 | cask "tuxera-ntfs" 95 | cask "visual-studio-code" 96 | cask "vlc" 97 | cask "webtorrent" 98 | cask "whatsapp" 99 | cask "yaak" 100 | cask "zed" 101 | cask "zoom" 102 | mas "1Password for Safari", id: 1569813296 103 | mas "alto.computer", id: 6480425094 104 | mas "alto.index", id: 6746674846 105 | mas "alto.photos", id: 6737197282 106 | mas "Boxy SVG", id: 611658502 107 | mas "ColorSlurp", id: 1287239339 108 | mas "Cursor Pro", id: 1447043133 109 | mas "DaisyDisk", id: 411643860 110 | mas "Entity Pro", id: 1503988785 111 | mas "Equinox", id: 1591510203 112 | mas "iMovie", id: 408981434 113 | mas "Kagi for Safari", id: 1622835804 114 | mas "Keynote", id: 409183694 115 | mas "Klack", id: 6446206067 116 | mas "Lungo", id: 1263070803 117 | mas "Monodraw", id: 920404675 118 | mas "NextDNS", id: 1464122853 119 | mas "Noir", id: 1592917505 120 | mas "Numbers", id: 409203825 121 | mas "Pages", id: 409201541 122 | mas "Pixelmator Pro", id: 1289583905 123 | mas "Raycast Companion", id: 6738274497 124 | mas "Refined GitHub", id: 1519867270 125 | mas "Tampermonkey Classic", id: 1482490089 126 | mas "Telegram", id: 747648890 127 | mas "TestFlight", id: 899247664 128 | mas "The Unarchiver", id: 425424353 129 | mas "Velja", id: 1607635845 130 | mas "Xcode", id: 497799835 131 | vscode "1password.op-vscode" 132 | vscode "aaron-bond.better-comments" 133 | vscode "adpyke.vscode-userscript" 134 | vscode "antfu.icons-carbon" 135 | vscode "anthropic.claude-code" 136 | vscode "anysphere.cursorpyright" 137 | vscode "anysphere.remote-containers" 138 | vscode "anysphere.remote-ssh" 139 | vscode "bierner.comment-tagged-templates" 140 | vscode "bierner.folder-source-actions" 141 | vscode "bierner.github-markdown-preview" 142 | vscode "bierner.markdown-checkbox" 143 | vscode "bierner.markdown-emoji" 144 | vscode "bierner.markdown-footnotes" 145 | vscode "bierner.markdown-mermaid" 146 | vscode "bierner.markdown-preview-github-styles" 147 | vscode "bierner.markdown-yaml-preamble" 148 | vscode "biomejs.biome" 149 | vscode "bradlc.vscode-tailwindcss" 150 | vscode "cardinal90.multi-cursor-case-preserve" 151 | vscode "charliermarsh.ruff" 152 | vscode "christian-kohler.path-intellisense" 153 | vscode "codezombiech.gitignore" 154 | vscode "dakara.transformer" 155 | vscode "dbaeumer.vscode-eslint" 156 | vscode "denoland.vscode-deno" 157 | vscode "dnicolson.binary-plist" 158 | vscode "drknoxy.eslint-disable-snippets" 159 | vscode "eamodio.gitlens" 160 | vscode "editorconfig.editorconfig" 161 | vscode "esbenp.prettier-vscode" 162 | vscode "foxundermoon.shell-format" 163 | vscode "github.codespaces" 164 | vscode "github.copilot" 165 | vscode "github.copilot-chat" 166 | vscode "github.github-vscode-theme" 167 | vscode "github.remotehub" 168 | vscode "github.vscode-github-actions" 169 | vscode "github.vscode-pull-request-github" 170 | vscode "golang.go" 171 | vscode "jock.svg" 172 | vscode "llvm-vs-code-extensions.vscode-clangd" 173 | vscode "loriscro.super" 174 | vscode "mikestead.dotenv" 175 | vscode "mkhl.shfmt" 176 | vscode "ms-azuretools.vscode-containers" 177 | vscode "ms-python.debugpy" 178 | vscode "ms-python.python" 179 | vscode "ms-python.vscode-python-envs" 180 | vscode "ms-vscode.cmake-tools" 181 | vscode "ms-vscode.cpptools" 182 | vscode "ms-vscode.makefile-tools" 183 | vscode "ms-vscode.remote-repositories" 184 | vscode "ms-vscode.remote-server" 185 | vscode "ms-vscode.wasm-wasi-core" 186 | vscode "ms-vsliveshare.vsliveshare" 187 | vscode "mylesmurphy.prettify-ts" 188 | vscode "ndonfris.fish-lsp" 189 | vscode "orta.vscode-twoslash-queries" 190 | vscode "oven.bun-vscode" 191 | vscode "pustelto.bracketeer" 192 | vscode "pveyes.aperture" 193 | vscode "redhat.vscode-commons" 194 | vscode "redhat.vscode-xml" 195 | vscode "redhat.vscode-yaml" 196 | vscode "rust-lang.rust-analyzer" 197 | vscode "sburg.vscode-javascript-booster" 198 | vscode "sst-dev.opencode" 199 | vscode "tamasfe.even-better-toml" 200 | vscode "tldraw-org.tldraw-vscode" 201 | vscode "twxs.cmake" 202 | vscode "unifiedjs.vscode-mdx" 203 | vscode "unifiedjs.vscode-remark" 204 | vscode "vitest.explorer" 205 | vscode "wallabyjs.quokka-vscode" 206 | vscode "wmaurer.change-case" 207 | vscode "yoavbls.pretty-ts-errors" 208 | vscode "yunduo.color-highlight-css-color-4" 209 | vscode "zachhardesty.convert-object-to-jsx-vscode" 210 | vscode "zengxingxin.sort-js-object-keys" 211 | -------------------------------------------------------------------------------- /.config/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 | set -l bun_install_boolean_flags yarn production optional development no-save dry-run force no-cache silent verbose global 36 | 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 update package.json or save a lockfile" "Don't install anything" "Always request the latest versions from the registry & reinstall all dependencies" "Ignore manifest cache entirely" "Don't output anything" "Excessively verbose logging" "Use global folder" 37 | 38 | set -l bun_builtin_cmds_without_run dev create help bun upgrade discord install remove add init pm x 39 | set -l bun_builtin_cmds_accepting_flags create help bun upgrade discord run init link unlink pm x 40 | 41 | function __bun_complete_bins_scripts --inherit-variable bun_builtin_cmds_without_run -d "Emit bun completions for bins and scripts" 42 | # Do nothing if we already have a builtin subcommand, 43 | # or any subcommand other than "run". 44 | if __fish_seen_subcommand_from $bun_builtin_cmds_without_run 45 | or not __fish_use_subcommand && not __fish_seen_subcommand_from run 46 | return 47 | end 48 | # Do we already have a bin or script subcommand? 49 | set -l bins (__fish__get_bun_bins) 50 | if __fish_seen_subcommand_from $bins 51 | return 52 | end 53 | # Scripts have descriptions appended with a tab separator. 54 | # Strip off descriptions for the purposes of subcommand testing. 55 | set -l scripts (__fish__get_bun_scripts) 56 | if __fish_seen_subcommand_from (string split \t -f 1 -- $scripts) 57 | return 58 | end 59 | # Emit scripts. 60 | for script in $scripts 61 | echo $script 62 | end 63 | # Emit binaries and JS files (but only if we're doing `bun run`). 64 | if __fish_seen_subcommand_from run 65 | for bin in $bins 66 | echo "$bin"\t"package bin" 67 | end 68 | for file in (__fish__get_bun_bun_js_files) 69 | echo "$file"\t"Bun.js" 70 | end 71 | end 72 | end 73 | 74 | # Clear existing completions 75 | complete -e -c bun 76 | 77 | # Dynamically emit scripts and binaries 78 | complete -c bun -f -a "(__bun_complete_bins_scripts)" 79 | 80 | # Complete flags if we have no subcommand or a flag-friendly one. 81 | set -l flag_applies "__fish_use_subcommand; or __fish_seen_subcommand_from $bun_builtin_cmds_accepting_flags" 82 | complete -c bun \ 83 | -n $flag_applies --no-files -s u -l origin -r -d 'Server URL. Rewrites import paths' 84 | complete -c bun \ 85 | -n $flag_applies --no-files -s p -l port -r -d 'Port number to start server from' 86 | complete -c bun \ 87 | -n $flag_applies --no-files -s d -l define -r -d 'Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:\"development\"' 88 | complete -c bun \ 89 | -n $flag_applies --no-files -s e -l external -r -d 'Exclude module from transpilation (can use * wildcards). ex: -e react' 90 | complete -c bun \ 91 | -n $flag_applies --no-files -l use -r -d 'Use a framework (ex: next)' 92 | complete -c bun \ 93 | -n $flag_applies --no-files -l hot -r -d 'Enable hot reloading in Bun\'s JavaScript runtime' 94 | 95 | # Complete dev and create as first subcommand. 96 | complete -c bun \ 97 | -n __fish_use_subcommand -a dev -d 'Start dev server' 98 | complete -c bun \ 99 | -n __fish_use_subcommand -a create -f -d 'Create a new project from a template' 100 | 101 | # Complete "next" and "react" if we've seen "create". 102 | complete -c bun \ 103 | -n "__fish_seen_subcommand_from create" -a next -d 'new Next.js project' 104 | 105 | complete -c bun \ 106 | -n "__fish_seen_subcommand_from create" -a react -d 'new React project' 107 | 108 | # Complete "upgrade" as first subcommand. 109 | complete -c bun \ 110 | -n __fish_use_subcommand -a upgrade -d 'Upgrade bun to the latest version' -x 111 | # Complete "-h/--help" unconditionally. 112 | complete -c bun \ 113 | -s h -l help -d 'See all commands and flags' -x 114 | 115 | # Complete "-v/--version" if we have no subcommand. 116 | complete -c bun \ 117 | -n "not __fish_use_subcommand" -l version -s v -d 'Bun\'s version' -x 118 | 119 | # Complete additional subcommands. 120 | complete -c bun \ 121 | -n __fish_use_subcommand -a discord -d 'Open bun\'s Discord server' -x 122 | 123 | complete -c bun \ 124 | -n __fish_use_subcommand -a bun -d 'Generate a new bundle' 125 | 126 | complete -c bun \ 127 | -n "__fish_seen_subcommand_from bun" -F -d 'Bundle this' 128 | 129 | complete -c bun \ 130 | -n "__fish_seen_subcommand_from create; and __fish_seen_subcommand_from react next" -F -d "Create in directory" 131 | 132 | complete -c bun \ 133 | -n __fish_use_subcommand -a init -F -d 'Start an empty Bun project' 134 | 135 | complete -c bun \ 136 | -n __fish_use_subcommand -a install -f -d 'Install packages from package.json' 137 | 138 | complete -c bun \ 139 | -n __fish_use_subcommand -a add -F -d 'Add a package to package.json' 140 | 141 | complete -c bun \ 142 | -n __fish_use_subcommand -a remove -F -d 'Remove a package from package.json' 143 | 144 | for i in (seq (count $bun_install_boolean_flags)) 145 | complete -c bun \ 146 | -n "__fish_seen_subcommand_from install add remove" -l "$bun_install_boolean_flags[$i]" -d "$bun_install_boolean_flags_descriptions[$i]" 147 | end 148 | 149 | complete -c bun \ 150 | -n "__fish_seen_subcommand_from install add remove" -l cwd -d 'Change working directory' 151 | 152 | complete -c bun \ 153 | -n "__fish_seen_subcommand_from install add remove" -l cache-dir -d 'Choose a cache directory (default: $HOME/.bun/install/cache)' 154 | 155 | complete -c bun \ 156 | -n "__fish_seen_subcommand_from add" -d Popular -a '(__fish__get_bun_packages)' 157 | 158 | complete -c bun \ 159 | -n "__fish_seen_subcommand_from add" -d History -a '(__history_completions)' 160 | 161 | complete -c bun \ 162 | -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 163 | 164 | complete -c bun \ 165 | -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 166 | 167 | # Add built-in subcommands with descriptions. 168 | complete -c bun -n __fish_use_subcommand -a create -f -d "Create a new project from a template" 169 | complete -c bun -n __fish_use_subcommand -a "build bun" --require-parameter -F -d "Transpile and bundle one or more files" 170 | complete -c bun -n __fish_use_subcommand -a upgrade -d "Upgrade Bun" 171 | complete -c bun -n __fish_use_subcommand -a run -d "Run a script or package binary" 172 | complete -c bun -n __fish_use_subcommand -a install -d "Install dependencies from package.json" -f 173 | complete -c bun -n __fish_use_subcommand -a remove -d "Remove a dependency from package.json" -f 174 | complete -c bun -n __fish_use_subcommand -a add -d "Add a dependency to package.json" -f 175 | complete -c bun -n __fish_use_subcommand -a init -d "Initialize a Bun project in this directory" -f 176 | complete -c bun -n __fish_use_subcommand -a link -d "Register or link a local npm package" -f 177 | complete -c bun -n __fish_use_subcommand -a unlink -d "Unregister a local npm package" -f 178 | complete -c bun -n __fish_use_subcommand -a pm -d "Additional package management utilities" -f 179 | complete -c bun -n __fish_use_subcommand -a x -d "Execute a package binary, installing if needed" -f 180 | complete -c bun -n __fish_use_subcommand -a outdated -d "Display the latest versions of outdated dependencies" -f 181 | complete -c bun -n __fish_use_subcommand -a publish -d "Publish your package from local to npm" -f 182 | -------------------------------------------------------------------------------- /Library/Application Support/Cursor/User/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[css]": { 3 | "editor.defaultFormatter": "esbenp.prettier-vscode" 4 | }, 5 | "[dockercompose]": { 6 | "editor.defaultFormatter": "esbenp.prettier-vscode" 7 | }, 8 | "[dockerfile]": { 9 | "editor.defaultFormatter": "ms-azuretools.vscode-containers" 10 | }, 11 | "[dotenv]": { 12 | "editor.defaultFormatter": "foxundermoon.shell-format" 13 | }, 14 | "[graphql]": { 15 | "editor.defaultFormatter": "esbenp.prettier-vscode" 16 | }, 17 | "[html]": { 18 | "editor.defaultFormatter": "LorisCro.super" 19 | }, 20 | "[ignore]": { 21 | "editor.defaultFormatter": "foxundermoon.shell-format" 22 | }, 23 | "[javascript]": { 24 | "editor.defaultFormatter": "esbenp.prettier-vscode" 25 | }, 26 | "[javascriptreact]": { 27 | "editor.defaultFormatter": "esbenp.prettier-vscode" 28 | }, 29 | "[json]": { 30 | "editor.defaultFormatter": "esbenp.prettier-vscode" 31 | }, 32 | "[jsonc]": { 33 | "editor.defaultFormatter": "esbenp.prettier-vscode" 34 | }, 35 | "[markdown]": { 36 | "editor.defaultFormatter": "unifiedjs.vscode-remark" 37 | }, 38 | "[mdx]": { 39 | "editor.defaultFormatter": "unifiedjs.vscode-mdx" 40 | }, 41 | "[properties]": { 42 | "editor.defaultFormatter": "foxundermoon.shell-format" 43 | }, 44 | "[scss]": { 45 | "editor.defaultFormatter": "esbenp.prettier-vscode" 46 | }, 47 | "[snippets]": { 48 | "editor.defaultFormatter": "esbenp.prettier-vscode" 49 | }, 50 | "[svg]": { 51 | "editor.defaultFormatter": "jock.svg" 52 | }, 53 | "[typescript]": { 54 | "editor.defaultFormatter": "esbenp.prettier-vscode" 55 | }, 56 | "[typescriptreact]": { 57 | "editor.defaultFormatter": "esbenp.prettier-vscode" 58 | }, 59 | "[xml]": { 60 | "editor.defaultFormatter": "redhat.vscode-xml" 61 | }, 62 | "[yaml]": { 63 | "editor.defaultFormatter": "esbenp.prettier-vscode" 64 | }, 65 | "accessibility.signals.terminalBell": { 66 | "sound": "on" 67 | }, 68 | "better-comments.highlightPlainText": true, 69 | "chat.editor.fontFamily": "'SF Mono Powerline', 'SF Mono', Consolas, Monaco, monospace", 70 | "cmake.options.statusBarVisibility": "visible", 71 | "color-highlight.markRuler": false, 72 | "cursor.composer.collapsePaneInputBoxPills": true, 73 | "cursor.composer.shouldChimeAfterChatFinishes": true, 74 | "cursor.cpp.disabledLanguages": ["markdown", "plaintext", "untitled"], 75 | "cursor.cpp.enablePartialAccepts": true, 76 | "cursor.diffs.useCharacterLevelDiffs": true, 77 | "debug.console.fontFamily": "'SF Mono Powerline', 'SF Mono', Consolas, Monaco, monospace", 78 | "deno.enable": false, 79 | "diffEditor.experimental.showMoves": true, 80 | "diffEditor.hideUnchangedRegions.enabled": true, 81 | "diffEditor.ignoreTrimWhitespace": false, 82 | "editor.accessibilitySupport": "off", 83 | "editor.codeLensFontFamily": "'SF Mono Powerline', 'SF Mono', Consolas, Monaco, monospace", 84 | "editor.experimentalInlineEdit.fontFamily": "'SF Mono Powerline', 'SF Mono', Consolas, Monaco, monospace", 85 | "editor.fontFamily": "'SF Mono Powerline', 'SF Mono', Consolas, Monaco, monospace", 86 | "editor.fontLigatures": false, 87 | "editor.fontSize": 12, 88 | "editor.formatOnPaste": true, 89 | "editor.formatOnSave": true, 90 | "editor.formatOnType": true, 91 | "editor.inlineSuggest.enabled": true, 92 | "editor.inlineSuggest.fontFamily": "'SF Mono Powerline', 'SF Mono', Consolas, Monaco, monospace", 93 | "editor.inlineSuggest.suppressSuggestions": true, 94 | "editor.largeFileOptimizations": false, 95 | "editor.lineHeight": 1.75, 96 | "editor.linkedEditing": true, 97 | "editor.minimap.renderCharacters": false, 98 | "editor.quickSuggestions": { 99 | "strings": "on" 100 | }, 101 | "editor.snippetSuggestions": "inline", 102 | "editor.suggest.insertMode": "replace", 103 | "editor.suggest.selectionMode": "always", 104 | "editor.suggest.showStatusBar": true, 105 | "editor.tabSize": 2, 106 | "emmet.includeLanguages": { 107 | "astro": "html", 108 | "edge": "html", 109 | "javascript": "javascriptreact", 110 | "markdown": "javascriptreact", 111 | "mdx": "javascriptreact", 112 | "rescript": "javascriptreact" 113 | }, 114 | "emmet.triggerExpansionOnTab": false, 115 | "eslint.codeActionsOnSave.mode": "problems", 116 | "eslint.format.enable": true, 117 | "eslint.lintTask.enable": true, 118 | "eslint.onIgnoredFiles": "warn", 119 | "extensions.ignoreRecommendations": true, 120 | "files.associations": { 121 | "_redirects": "plaintext", 122 | "*.css": "tailwindcss", 123 | "*.mdoc": "markdown", 124 | "CODEOWNERS": "plaintext" 125 | }, 126 | "files.exclude": { 127 | "**/.git": false 128 | }, 129 | "files.insertFinalNewline": true, 130 | "files.trimFinalNewlines": true, 131 | "files.trimTrailingWhitespace": true, 132 | "git.allowForcePush": true, 133 | "git.allowNoVerifyCommit": true, 134 | "git.autofetch": true, 135 | "git.confirmSync": true, 136 | "git.enableCommitSigning": true, 137 | "git.replaceTagsWhenPull": true, 138 | "git.showPushSuccessNotification": true, 139 | "git.supportCancellation": true, 140 | "git.useCommitInputAsStashMessage": true, 141 | "github.copilot.chat.agent.thinkingTool": true, 142 | "github.copilot.chat.codesearch.enabled": true, 143 | "github.copilot.chat.completionContext.typescript.mode": "on", 144 | "github.copilot.chat.editor.temporalContext.enabled": true, 145 | "github.copilot.chat.edits.temporalContext.enabled": true, 146 | "github.copilot.chat.generateTests.codeLens": true, 147 | "github.copilot.chat.languageContext.fix.typescript.enabled": true, 148 | "github.copilot.chat.languageContext.inline.typescript.enabled": true, 149 | "github.copilot.chat.languageContext.typescript.enabled": true, 150 | "github.copilot.chat.newWorkspace.useContext7": true, 151 | "github.copilot.chat.scopeSelection": true, 152 | "github.copilot.nextEditSuggestions.enabled": true, 153 | "githubPullRequests.experimental.chat": true, 154 | "githubPullRequests.experimental.useQuickChat": true, 155 | "githubPullRequests.pullBranch": "never", 156 | "gitlens.advanced.messages": { 157 | "suppressIntegrationDisconnectedTooManyFailedRequestsWarning": true 158 | }, 159 | "gitlens.blame.fontFamily": "'SF Mono Powerline', 'SF Mono', Consolas, Monaco, monospace", 160 | "gitlens.currentLine.fontFamily": "'SF Mono Powerline', 'SF Mono', Consolas, Monaco, monospace", 161 | "gitlens.graph.layout": "editor", 162 | "gitlens.graph.minimap.additionalTypes": ["localBranches"], 163 | "gitlens.graph.minimap.enabled": false, 164 | "gitlens.graph.statusBar.enabled": false, 165 | "gitlens.home.preview.enabled": false, 166 | "gitlens.showWhatsNewAfterUpgrades": false, 167 | "gitlens.telemetry.enabled": false, 168 | "gitlens.views.branches.avatars": false, 169 | "gitlens.views.branches.files.layout": "list", 170 | "gitlens.views.commitDetails.files.layout": "tree", 171 | "gitlens.views.commits.avatars": false, 172 | "gitlens.views.commits.files.layout": "tree", 173 | "gitlens.views.commits.pullRequests.enabled": false, 174 | "gitlens.views.commits.pullRequests.showForBranches": false, 175 | "gitlens.views.commits.showBranchComparison": false, 176 | "gitlens.views.remotes.avatars": false, 177 | "gitlens.views.remotes.files.layout": "tree", 178 | "gitlens.views.remotes.pullRequests.enabled": false, 179 | "gitlens.views.remotes.pullRequests.showForBranches": false, 180 | "gitlens.views.scm.grouped.views": { 181 | "branches": false, 182 | "commits": false, 183 | "contributors": false, 184 | "launchpad": false, 185 | "remotes": false, 186 | "repositories": false, 187 | "searchAndCompare": false, 188 | "stashes": false, 189 | "tags": false, 190 | "worktrees": false 191 | }, 192 | "gitlens.views.stashes.files.layout": "tree", 193 | "gitlens.views.tags.avatars": false, 194 | "go.survey.prompt": false, 195 | "javascript.updateImportsOnFileMove.enabled": "always", 196 | "json.schemaDownload.enable": true, 197 | "makefile.configureOnOpen": true, 198 | "markdown.occurrencesHighlight.enabled": true, 199 | "markdown.preview.doubleClickToSwitchToEditor": false, 200 | "notebook.output.fontFamily": "'SF Mono Powerline', 'SF Mono', Consolas, Monaco, monospace", 201 | "prettier.enableDebugLogs": false, 202 | "prettify-ts.enabled": false, 203 | "redhat.telemetry.enabled": false, 204 | "remote.SSH.remotePlatform": { 205 | "orb": "linux" 206 | }, 207 | "scm.inputFontFamily": "'SF Mono Powerline', 'SF Mono', Consolas, Monaco, monospace", 208 | "search.quickOpen.includeSymbols": true, 209 | "search.showLineNumbers": true, 210 | "security.promptForLocalFileProtocolHandling": false, 211 | "shellformat.useEditorConfig": true, 212 | "svg.preview.mode": "img", 213 | "tailwindCSS.emmetCompletions": true, 214 | "telemetry.feedback.enabled": false, 215 | "telemetry.telemetryLevel": "off", 216 | "terminal.external.osxExec": "Ghostty.app", 217 | "terminal.integrated.confirmOnExit": "always", 218 | "terminal.integrated.cursorBlinking": true, 219 | "terminal.integrated.cursorStyle": "line", 220 | "terminal.integrated.enableVisualBell": true, 221 | "terminal.integrated.env.osx": {}, 222 | "terminal.integrated.fontFamily": "'SF Mono Powerline', 'SF Mono', Consolas, Monaco, monospace", 223 | "typescript.tsserver.maxTsServerMemory": 16384, 224 | "typescript.updateImportsOnFileMove.enabled": "always", 225 | "update.showReleaseNotes": false, 226 | "window.autoDetectColorScheme": true, 227 | "window.confirmBeforeClose": "always", 228 | "window.newWindowProfile": "Default", 229 | "workbench.iconTheme": "vs-seti", 230 | "workbench.preferredDarkColorTheme": "Large Aperture", 231 | "workbench.preferredLightColorTheme": "Small Aperture", 232 | "workbench.productIconTheme": "icons-carbon", 233 | "workbench.startupEditor": "none", 234 | "workbench.tree.indent": 12, 235 | "workbench.view.alwaysShowHeaderActions": true 236 | } 237 | -------------------------------------------------------------------------------- /sysprefs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # h/t https://github.com/mathiasbynens/dotfiles/blob/main/.macos 4 | 5 | # close any open system preferences panes, to prevent them from overriding settings we're about to change 6 | osascript -e 'tell application "System Preferences" to quit' 7 | osascript -e 'tell application "System Settings" to quit' 8 | 9 | # ask for the administrator password upfront and update existing `sudo` time stamp until `.macos` has finished 10 | sudo -v 11 | while true; do 12 | sudo -n true 13 | sleep 60 14 | kill -0 "$$" || exit 15 | done 2>/dev/null & 16 | 17 | echo "Updating computer name..." 18 | if [ -n "${CUSTOM_HOSTNAME}" ]; then 19 | sudo scutil --set ComputerName "${CUSTOM_HOSTNAME}" 20 | sudo scutil --set HostName "${CUSTOM_HOSTNAME}" 21 | sudo scutil --set LocalHostName "${CUSTOM_HOSTNAME}" 22 | sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string "${CUSTOM_HOSTNAME}" 23 | fi 24 | 25 | echo "Updating system configurations..." 26 | 27 | # disable the sound effects on boot 28 | sudo nvram SystemAudioVolume=" " 29 | 30 | # set sidebar icon size to medium 31 | defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2 32 | 33 | # always show scrollbars; possible values: `WhenScrolling`, `Automatic` and `Always` 34 | defaults write NSGlobalDomain AppleShowScrollBars -string "Always" 35 | 36 | # disable the over-the-top focus ring animation 37 | defaults write NSGlobalDomain NSUseAnimatedFocusRing -bool false 38 | 39 | # adjust toolbar title rollover delay 40 | defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 0 41 | 42 | # increase window resize speed for cocoa applications 43 | defaults write NSGlobalDomain NSWindowResizeTime -float 0.001 44 | 45 | # expand save and panel by default 46 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true 47 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true 48 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true 49 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true 50 | 51 | # automatically quit printer app once the print jobs complete 52 | defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true 53 | 54 | # disable the "are you sure you want to open this application?" dialog 55 | defaults write com.apple.LaunchServices LSQuarantine -bool false 56 | 57 | # display ascii control characters using caret notation in standard text views 58 | defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true 59 | 60 | # disable resume system-wide 61 | defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false 62 | 63 | # disable automatic termination of inactive apps 64 | defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true 65 | 66 | # set help viewer windows to non-floating mode 67 | defaults write com.apple.helpviewer DevMode -bool true 68 | 69 | # disable automatic capitalization as it's annoying when typing code 70 | defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false 71 | 72 | # disable smart dashes as they're annoying when typing code 73 | defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false 74 | 75 | # disable automatic period substitution as it's annoying when typing code 76 | defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false 77 | 78 | # disable smart quotes as they're annoying when typing code 79 | defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false 80 | 81 | # disable auto-correct 82 | defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false 83 | 84 | # enable tap to click for this user and for the login screen 85 | defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true 86 | defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 87 | defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1 88 | 89 | # increase sound quality for bluetooth headphones/headsets 90 | defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40 91 | 92 | # enable full keyboard access for all controls (e.g. enable Tab in modal dialogs) 93 | defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 94 | 95 | # use scroll gesture with the ctrl (^) modifier key to zoom and follow the keyboard focus while zoomed in 96 | defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true 97 | defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144 98 | defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true 99 | 100 | # disable press-and-hold for keys in favor of key repeat 101 | defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false 102 | 103 | # set a blazingly fast keyboard repeat rate 104 | defaults write NSGlobalDomain KeyRepeat -int 1 105 | defaults write NSGlobalDomain InitialKeyRepeat -int 10 106 | 107 | # Set language and text formats 108 | # Note: if you're in the US, replace `EUR` with `USD`, `Centimeters` with 109 | # `Inches`, `en_GB` with `en_US`, and `true` with `false`. 110 | defaults write NSGlobalDomain AppleLanguages -array "en" 111 | defaults write NSGlobalDomain AppleLocale -string "en_ID" 112 | defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters" 113 | defaults write NSGlobalDomain AppleMetricUnits -bool true 114 | 115 | # enable lid wakeup 116 | sudo pmset -a lidwake 1 117 | 118 | # restart automatically on power loss 119 | sudo pmset -a autorestart 1 120 | 121 | # restart automatically if the computer freezes 122 | sudo systemsetup -setrestartfreeze on 123 | 124 | # disable machine sleep while charging 125 | sudo pmset -c sleep 0 126 | 127 | # save screenshots to the desktop 128 | mkdir -p "${HOME}/Desktop/Screenshots" 129 | defaults write com.apple.screencapture location -string "${HOME}/Desktop/Screenshots" 130 | 131 | # save screenshots in png format (other options: bmp, gif, jpg, pdf, tiff) 132 | defaults write com.apple.screencapture type -string "png" 133 | 134 | # enable subpixel font rendering on non-apple lcds (https://github.com/kevinSuttle/macOS-Defaults/issues/17#issuecomment-266633501) 135 | defaults write NSGlobalDomain AppleFontSmoothing -int 1 136 | 137 | # enable hidpi display modes (requires restart) 138 | sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true 139 | 140 | # show icons for hard drives, servers, and removable media on the desktop 141 | defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true 142 | defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true 143 | defaults write com.apple.finder ShowMountedServersOnDesktop -bool true 144 | defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true 145 | 146 | # finder: show hidden files by default 147 | defaults write com.apple.finder AppleShowAllFiles -bool true 148 | 149 | # finder: show all filename extensions 150 | defaults write NSGlobalDomain AppleShowAllExtensions -bool true 151 | 152 | # finder: show status bar 153 | defaults write com.apple.finder ShowStatusBar -bool true 154 | 155 | # finder: show path bar 156 | defaults write com.apple.finder ShowPathbar -bool true 157 | 158 | # keep folders on top when sorting by name 159 | defaults write com.apple.finder _FXSortFoldersFirst -bool true 160 | 161 | # when performing a search, search the current folder by default 162 | defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" 163 | 164 | # disable the warning when changing a file extension 165 | defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false 166 | 167 | # enable spring loading for directories 168 | defaults write NSGlobalDomain com.apple.springing.enabled -bool true 169 | 170 | # remove the spring loading delay for directories 171 | defaults write NSGlobalDomain com.apple.springing.delay -float 0 172 | 173 | # avoid creating .DS_Store files on network or usb volumes 174 | defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true 175 | defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true 176 | 177 | # disable disk image verification 178 | defaults write com.apple.frameworks.diskimages skip-verify -bool true 179 | defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true 180 | defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true 181 | 182 | # show item info near icons on the desktop and in other icon views 183 | /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist 184 | /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist 185 | /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist 186 | 187 | # show item info to the right of the icons on the desktop 188 | /usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom false" ~/Library/Preferences/com.apple.finder.plist 189 | 190 | # enable snap-to-grid for icons on the desktop and in other icon views 191 | /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist 192 | /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist 193 | /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist 194 | 195 | # use list view in all finder windows by default 196 | # four-letter codes for the other view modes: `icnv`, `clmv`, `glyv` 197 | defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv" 198 | 199 | # enable airdrop over ethernet and on unsupported macs running lion 200 | defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true 201 | 202 | # show the ~/library folder 203 | chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library 204 | 205 | # show the /volumes folder 206 | sudo chflags nohidden /Volumes 207 | 208 | # expand the following file info panes: 209 | # "general", "open with", and "sharing & permissions" 210 | defaults write com.apple.finder FXInfoPanesExpanded -dict \ 211 | General -bool true \ 212 | OpenWith -bool true \ 213 | Privileges -bool true 214 | 215 | # enable highlight hover effect for the grid view of a stack (dock) 216 | defaults write com.apple.dock mouse-over-hilite-stack -bool true 217 | 218 | # enable spring loading for all dock items 219 | defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true 220 | 221 | # show indicator lights for open applications in the dock 222 | defaults write com.apple.dock show-process-indicators -bool true 223 | 224 | # speed up mission control animations 225 | defaults write com.apple.dock expose-animation-duration -float 0.1 226 | 227 | # don't automatically rearrange spaces based on most recent use 228 | defaults write com.apple.dock mru-spaces -bool false 229 | 230 | # automatically hide and show the dock 231 | defaults write com.apple.dock autohide -bool true 232 | 233 | # make dock icons of hidden applications translucent 234 | defaults write com.apple.dock showhidden -bool true 235 | 236 | # don't show recent applications in dock 237 | defaults write com.apple.dock show-recents -bool false 238 | 239 | # reset launchpad, but keep the desktop wallpaper intact 240 | find "${HOME}/Library/Application Support/Dock" -name "*-*.db" -maxdepth 1 -delete 241 | 242 | # privacy: don't send search queries to apple 243 | defaults write com.apple.Safari UniversalSearchEnabled -bool false 244 | defaults write com.apple.Safari SuppressSearchSuggestions -bool true 245 | 246 | # press tab to highlight each item on a web page 247 | defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool true 248 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true 249 | 250 | # show the full url in the address bar (note: this still hides the scheme) 251 | defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true 252 | 253 | # set safari's home page to `about:blank` for faster loading 254 | defaults write com.apple.Safari HomePage -string "about:blank" 255 | 256 | # prevent safari from opening 'safe' files automatically after downloading 257 | defaults write com.apple.Safari AutoOpenSafeDownloads -bool false 258 | 259 | # hide safari's bookmarks bar by default 260 | defaults write com.apple.Safari ShowFavoritesBar -bool false 261 | 262 | # hide safari's sidebar in top sites 263 | defaults write com.apple.Safari ShowSidebarInTopSites -bool false 264 | 265 | # disable safari's thumbnail cache for history and top sites 266 | defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2 267 | 268 | # enable safari's debug menu 269 | defaults write com.apple.Safari IncludeInternalDebugMenu -bool true 270 | 271 | # make safari's search banners default to contains instead of starts with 272 | defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false 273 | 274 | # remove useless icons from safari's bookmarks bar 275 | defaults write com.apple.Safari ProxiesInBookmarksBar "()" 276 | 277 | # enable the develop menu and the web inspector in safari 278 | defaults write com.apple.Safari IncludeDevelopMenu -bool true 279 | defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true 280 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true 281 | 282 | # add a context menu item for showing the web inspector in web views 283 | defaults write NSGlobalDomain WebKitDeveloperExtras -bool true 284 | 285 | # enable continuous spellchecking 286 | defaults write com.apple.Safari WebContinuousSpellCheckingEnabled -bool true 287 | # disable auto-correct 288 | defaults write com.apple.Safari WebAutomaticSpellingCorrectionEnabled -bool false 289 | 290 | # disable autofill 291 | defaults write com.apple.Safari AutoFillFromAddressBook -bool false 292 | defaults write com.apple.Safari AutoFillPasswords -bool false 293 | defaults write com.apple.Safari AutoFillCreditCardData -bool false 294 | defaults write com.apple.Safari AutoFillMiscellaneousForms -bool false 295 | 296 | # warn about fraudulent websites 297 | defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool true 298 | 299 | # block pop-up windows 300 | defaults write com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically -bool false 301 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically -bool false 302 | 303 | # disable auto-playing video 304 | defaults write com.apple.Safari WebKitMediaPlaybackAllowsInline -bool false 305 | defaults write com.apple.SafariTechnologyPreview WebKitMediaPlaybackAllowsInline -bool false 306 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false 307 | defaults write com.apple.SafariTechnologyPreview com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false 308 | 309 | # enable "do not track" 310 | defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true 311 | 312 | # update extensions automatically 313 | defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true 314 | 315 | # copy email addresses as `foo@example.com` instead of `foo bar ` in mail.app 316 | defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false 317 | 318 | # add the keyboard shortcut ⌘ + enter to send an email in mail.app 319 | defaults write com.apple.mail NSUserKeyEquivalents -dict-add "Send" "@\U21a9" 320 | 321 | # display emails in threaded mode, sorted by date (oldest at the top) 322 | defaults write com.apple.mail DraftsViewerAttributes -dict-add "DisplayInThreadedMode" -string "yes" 323 | defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortedDescending" -string "yes" 324 | defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortOrder" -string "received-date" 325 | 326 | # disable inline attachments (just show the icons) 327 | defaults write com.apple.mail DisableInlineAttachmentViewing -bool true 328 | 329 | # disable automatic spell checking 330 | defaults write com.apple.mail SpellCheckingBehavior -string "NoSpellCheckingEnabled" 331 | 332 | # hide spotlight tray-icon (and subsequent helper) 333 | sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search 334 | 335 | # disable spotlight indexing for any volume that gets mounted and has not yet been indexed before. 336 | # use `sudo mdutil -i off "/volumes/foo"` to stop indexing any volume. 337 | sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes" 338 | 339 | # only use utf-8 in terminal.app 340 | defaults write com.apple.terminal StringEncodings -array 4 341 | 342 | # enable secure keyboard entry in terminal.app (https://security.stackexchange.com/a/47786/8918) 343 | defaults write com.apple.terminal SecureKeyboardEntry -bool true 344 | 345 | # disable the annoying line marks 346 | defaults write com.apple.Terminal ShowLineMarks -int 0 347 | 348 | # prevent time machine from prompting to use new hard drives as backup volume 349 | defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true 350 | 351 | # disable local time machine backups 352 | hash tmutil &>/dev/null && sudo tmutil disablelocal 353 | 354 | # show the main window when launching activity monitor 355 | defaults write com.apple.ActivityMonitor OpenMainWindow -bool true 356 | 357 | # show all processes in activity monitor 358 | defaults write com.apple.ActivityMonitor ShowCategory -int 0 359 | 360 | # enable the debug menu in address book 361 | defaults write com.apple.addressbook ABShowDebugMenu -bool true 362 | 363 | # enable dashboard dev mode (allows keeping widgets on the desktop) 364 | defaults write com.apple.dashboard devmode -bool true 365 | 366 | # enable the debug menu in ical (pre-10.8) 367 | defaults write com.apple.iCal IncludeDebugMenu -bool true 368 | 369 | # use plain text mode for new textedit documents 370 | defaults write com.apple.TextEdit RichText -int 0 371 | # open and save files as utf-8 in textedit 372 | defaults write com.apple.TextEdit PlainTextEncoding -int 4 373 | defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4 374 | 375 | # enable the debug menu in disk utility 376 | defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true 377 | defaults write com.apple.DiskUtility advanced-image-options -bool true 378 | 379 | # enable the webkit developer tools in the mac app store 380 | defaults write com.apple.appstore WebKitDeveloperExtras -bool true 381 | 382 | # enable debug menu in the mac app store 383 | defaults write com.apple.appstore ShowDebugMenu -bool true 384 | 385 | # enable the automatic update check 386 | defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true 387 | 388 | # check for software updates daily, not just once per week 389 | defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1 390 | 391 | # install system data files & security updates 392 | defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1 393 | 394 | # prevent the app store to reboot machine on macos updates 395 | defaults write com.apple.commerce AutoUpdateRestartRequired -bool false 396 | 397 | # prevent photos from opening automatically when devices are plugged in 398 | defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true 399 | 400 | # disable smart quotes as it's annoying for messages that contain code 401 | defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false 402 | 403 | # disable continuous spell checking 404 | defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false 405 | 406 | # use the system-native print preview dialog 407 | defaults write com.google.Chrome DisablePrintPreview -bool true 408 | defaults write com.google.Chrome.dev DisablePrintPreview -bool true 409 | 410 | # expand the print dialog by default 411 | defaults write com.google.Chrome PMPrintingExpandedStateForPrint2 -bool true 412 | defaults write com.google.Chrome.dev PMPrintingExpandedStateForPrint2 -bool true 413 | 414 | # disable signing emails by default 415 | defaults write ~/Library/Preferences/org.gpgtools.gpgmail SignNewEmailsByDefault -bool false 416 | 417 | echo "Done! ✨" 418 | -------------------------------------------------------------------------------- /.config/fish/completions/fish-lsp.fish: -------------------------------------------------------------------------------- 1 | # 2 | # AUTO GENERATED BY 'fish-lsp' 3 | # 4 | # * Any command should generate the completions file 5 | # 6 | # >_ fish-lsp complete > ~/.config/fish/completions/fish-lsp.fish 7 | # >_ fish-lsp complete > $fish_complete_path[1]/fish-lsp.fish 8 | # >_ yarn install && yarn dev # from inside the '~/path/to/fish-lsp' source code 9 | # 10 | # * You can test the completions by editing: 11 | # 12 | # ~/.config/fish/completions/fish-lsp.fish 13 | # 14 | # or by using the command: 15 | # 16 | # >_ fish-lsp complete 17 | # 18 | # to visually check what is wrong 19 | # 20 | # * To interactively test the completions, you can use: 21 | # 22 | # >_ complete -c fish-lsp -e # erase all fish-lsp completions 23 | # >_ fish-lsp complete | source 24 | # 25 | # * For more info, try editing the generated output inside: 26 | # 27 | # ~/...install_path.../fish-lsp/src/utils/get-lsp-completions.ts 28 | # 29 | # * You can see if the completions are up to date by running the command: 30 | # 31 | # >_ fish-lsp info --check-health 32 | # 33 | # REPO URL: https://github.com/ndonfris/fish-lsp 34 | 35 | ############################################# 36 | # helper functions for fish-lsp completions # 37 | ############################################# 38 | 39 | # print all unique `fish-lsp start --enable|--disable ...` features (i.e., complete, hover, etc.) 40 | # if a feature is already specified in the command line, it will be skipped 41 | # the features can also be used in the global environment variables `fish_lsp_enabled_handlers` or `fish_lsp_disabled_handlers` 42 | function __fish_lsp_get_features -d 'print all features controlled by the server, not yet used in the commandline' 43 | set -l all_features complete hover rename definition implementation reference formatting formatRange typeFormatting codeAction codeLens folding signature executeCommand inlayHint highlight diagnostic popups 44 | set -l features_to_complete 45 | set -l features_to_skip 46 | set -l opts (commandline -opc) 47 | for opt in $opts 48 | if contains -- $opt $all_features 49 | set features_to_skip $features_to_skip $opt 50 | end 51 | end 52 | for feature in $all_features 53 | if not contains -- $feature $features_to_skip 54 | printf '%b\t%s\n' $feature "$feature handler" 55 | end 56 | end 57 | end 58 | 59 | # print all unique 'fish-lsp env --only ...` env_variables (i.e., $fish_lsp_*, ...) 60 | # if a env_variable is already specified in the command line, it will not be included again 61 | function __fish_lsp_get_env_variables -d 'print all fish_lsp_* env variables, not yet used in the commandline' 62 | # every env variable name 63 | set -l env_names fish_lsp_enabled_handlers \ 64 | fish_lsp_disabled_handlers \ 65 | fish_lsp_commit_characters \ 66 | fish_lsp_log_file \ 67 | fish_lsp_log_level \ 68 | fish_lsp_all_indexed_paths \ 69 | fish_lsp_modifiable_paths \ 70 | fish_lsp_diagnostic_disable_error_codes \ 71 | fish_lsp_enable_experimental_diagnostics \ 72 | fish_lsp_max_background_files \ 73 | fish_lsp_show_client_popups \ 74 | fish_lsp_single_workspace_support 75 | 76 | # every completion argument `name\t'description'`, only unused env variables will be printed 77 | set -l env_names_with_descriptions "fish_lsp_enabled_handlers\t'server handlers to enable'" \ 78 | "fish_lsp_disabled_handlers\t'server handlers to disable'" \ 79 | "fish_lsp_commit_characters\t'commit characters that select completion items'" \ 80 | "fish_lsp_log_file\t'path to the fish-lsp's log file'" \ 81 | "fish_lsp_log_level\t'minimum log level to include in the log file'" \ 82 | "fish_lsp_all_indexed_paths\t'directories that the server should always index on startup'" \ 83 | "fish_lsp_modifiable_paths\t'indexed paths that can be modified'" \ 84 | "fish_lsp_diagnostic_disable_error_codes\t'diagnostic codes to disable'" \ 85 | "fish_lsp_enable_experimental_diagnostics\t'enable fish-lsp's experimental diagnostics'" \ 86 | "fish_lsp_max_background_files\t'maximum number of files to analyze in the background on startup'" \ 87 | "fish_lsp_show_client_popups\t'send `connection/window/*` requests in the server'" \ 88 | "fish_lsp_single_workspace_support\t'limit workspace searching to only the current workspace'" 89 | 90 | # get the current command line token (for comma separated options) 91 | set -l current (commandline -ct) 92 | 93 | # utility function to check if the current token contains a comma 94 | function has_comma --inherit-variable current --description 'check if the current token contains a comma' 95 | string match -rq '.*,.*' -- $current || string match -rq -- '--only=.*' $current 96 | return $status 97 | end 98 | 99 | # get the current command line options, adding the current token if it contains a comma 100 | set -l opts (commandline -opc) 101 | has_comma && set -a opts $current 102 | 103 | # create two arrays, one for the env variables already used, and the other 104 | # for all the arguments passed into the commandline 105 | set -l features_to_skip 106 | set -l fixed_opts 107 | 108 | # split any comma separated options 109 | for opt in $opts 110 | if string match -rq -- '--only=.*' $opt 111 | set -a fixed_opts --only (string split -m1 -f2 -- '--only=' $opt | string split ',') 112 | else if string match -q '*,*' -- $opt 113 | set fixed_opts $fixed_opts (string split ',' -- $opt) 114 | else 115 | set fixed_opts $fixed_opts $opt 116 | end 117 | end 118 | 119 | # skip any env variable that is already specified in the command line 120 | for opt in $fixed_opts 121 | if contains -- $opt $env_names 122 | set -a features_to_skip $opt 123 | end 124 | end 125 | 126 | # if using the `--only=` syntax, remove the `--only` part. 127 | # when entries are separated by commas, we need to keep the current token's prefix comma 128 | # in the completion output 129 | set prefix '' 130 | if has_comma 131 | set prefix (string replace -r '[^,]*$' '' -- $current | string replace -r -- '^--only=' '') 132 | end 133 | 134 | # print the completions that haven't been used yet 135 | for line in $env_names_with_descriptions 136 | set name (string split -f1 -m1 '\t' -- $line) 137 | if not contains -- $name $features_to_skip 138 | echo -e "$prefix$line" 139 | end 140 | end 141 | end 142 | 143 | # check for usage of the main switches in env command `fish-lsp env --show|--create|--show-default|--names` 144 | # 145 | # requires passing in one of switches: `--none` or `--any` 146 | # - `--none` check that none of the main switches are used 147 | # - `--any` check that a main switch has been seen 148 | # - `--no-names` check that the `--names` switch is not used, but needs to be 149 | # paired with `--none` or `--any` 150 | # 151 | # used in the `env` completions, for grouping repeated logic on those 152 | # completions conditional checks. 153 | # 154 | # ``` 155 | # complete -n '__fish_lsp_env_main_switch --none' 156 | # ``` 157 | function __fish_lsp_env_main_switch --description 'check if the commandline contains any of the main env switches (--show|--create|--show-default|--names)' 158 | argparse any none no-names names-joined -- $argv 159 | or return 1 160 | 161 | # none means we don't want to see any of the main switches 162 | # no-names doesn't change anything here, since we are making sure that 163 | # names already doesn't exist in the command line 164 | if set -ql _flag_none 165 | not __fish_contains_opt names 166 | and not __fish_contains_opt -s s show 167 | and not __fish_contains_opt -s c create 168 | and not __fish_contains_opt show-default 169 | return $status 170 | end 171 | 172 | # any means that one of the main switches has been used. 173 | if set -ql _flag_any 174 | if set -ql _flag_no_names 175 | __fish_contains_opt names 176 | and return 1 177 | end 178 | not set -ql _flag_no_names && __fish_contains_opt names 179 | or __fish_contains_opt -s s show 180 | or __fish_contains_opt -s c create 181 | or __fish_contains_opt show-default 182 | return $status 183 | end 184 | 185 | # names joined means that both the --names and --joined switches are used 186 | if set -ql _flag_names_joined 187 | __fish_contains_opt names 188 | and not __fish_contains_opt -s j joined 189 | and return $status 190 | end 191 | # if no switches are found, return 1 192 | return 1 193 | end 194 | 195 | # make sure `fish-lsp start --stdio|--node-ipc|--socket` is used singularly 196 | # and not in combination with any other connection related option 197 | function __fish_lsp_start_connection_opts -d 'check if any option (--stdio|--node-ipc|--socket) is used' 198 | __fish_contains_opt stdio || __fish_contains_opt node-ipc || __fish_contains_opt socket 199 | end 200 | 201 | # check if the last `fish-lsp start ...` flag/switch is `--enable` or `--disable` 202 | # this will find the last `-*` argument in the command line, skipping any argument not starting with `-` 203 | # and make sure it matches any of the provided `$argv` passed in to the function (defaulting to: `--enable` `--disable`) 204 | # we use this to allow multiple sequential features to follow `fish-lsp start --enable|--disable ...` 205 | # USAGE: 206 | # > `fish-lsp --stdio --start complete hover --disable codeAction highlight formatting ` 207 | # `__fish_lsp_last_switch --enable --disable ` would return 0 since `--disable` is the last switch 208 | function __fish_lsp_last_switch -d 'check if the last argument w/ a leading `-` matches any $argv' 209 | set -l opts (commandline -opc) 210 | set -l last_opt 211 | for opt in $opts 212 | switch $opt 213 | case '-*' 214 | set last_opt $opt 215 | case '*' 216 | continue 217 | end 218 | end 219 | set -l match_opts $argv 220 | if test (count $argv) -eq 0 221 | set match_opts --enable --disable 222 | end 223 | for switch in $match_opts 224 | if test "$last_opt" = "$switch" 225 | return 0 226 | end 227 | end 228 | return 1 229 | end 230 | 231 | ############################### 232 | ### END OF HELPER FUNCTIONS ### 233 | ############################### 234 | 235 | ## disable file completions 236 | complete -c fish-lsp -f 237 | 238 | ## fish-lsp 239 | complete -c fish-lsp -n "__fish_is_first_arg; and __fish_complete_subcommand" -k -a " 240 | start\t'start the lsp' 241 | info\t'show info about the fish-lsp' 242 | url\t'show helpful url(s) related to the fish-lsp' 243 | complete\t'generate fish shell completions' 244 | env\t'generate environment variables for lsp configuration'" 245 | 246 | ## `fish-lsp -` 247 | complete -c fish-lsp -n 'not __fish_use_subcommand; and __fish_is_first_arg; and not __fish_contains_opt -s v version' -s v -l version -d 'Show lsp version' 248 | complete -c fish-lsp -n 'not __fish_use_subcommand; and __fish_is_first_arg; and not __fish_contains_opt -s h help' -s h -l help -d 'Show help information' 249 | complete -c fish-lsp -n 'not __fish_use_subcommand; and __fish_is_first_arg; and not __fish_contains_opt help-all' -l help-all -d 'Show all help information' 250 | complete -c fish-lsp -n 'not __fish_use_subcommand; and __fish_is_first_arg; and not __fish_contains_opt help-short' -l help-short -d 'Show short help information' 251 | complete -c fish-lsp -n 'not __fish_use_subcommand; and __fish_is_first_arg; and not __fish_contains_opt help-man' -l help-man -d 'Show raw manpage' 252 | 253 | ## `fish-lsp start --` 254 | complete -c fish-lsp -n '__fish_seen_subcommand_from start; and not __fish_contains_opt dump' -l dump -d 'stop lsp & show the startup options being read' 255 | complete -c fish-lsp -n '__fish_seen_subcommand_from start' -l enable -d 'enable the startup option' -xa '(__fish_lsp_get_features)' 256 | complete -c fish-lsp -n '__fish_seen_subcommand_from start' -l disable -d 'disable the startup option' -xa '(__fish_lsp_get_features)' 257 | complete -c fish-lsp -n '__fish_seen_subcommand_from start; and __fish_lsp_last_switch --disable --enable' -a '(__fish_lsp_get_features)' # allow completing multiple features in a row (when last seen switch is either: `--enable|--disable`) 258 | complete -c fish-lsp -n '__fish_seen_subcommand_from start; and not __fish_lsp_start_connection_opts' -l stdio -d 'use stdin/stdout for communication (default)' 259 | complete -c fish-lsp -n '__fish_seen_subcommand_from start; and not __fish_lsp_start_connection_opts' -l node-ipc -d 'use node IPC for communication' 260 | complete -c fish-lsp -n '__fish_seen_subcommand_from start; and not __fish_lsp_start_connection_opts' -l socket -d 'use TCP socket for communication' -x 261 | complete -c fish-lsp -n '__fish_seen_subcommand_from start; and not __fish_contains_opt memory-limit' -l memory-limit -d 'set memory usage limit in MB' -x 262 | complete -c fish-lsp -n '__fish_seen_subcommand_from start; and not __fish_contains_opt max-files' -l max-files -d 'override the maximum number of files to analyze' -xa '(echo 100; echo 500; seq 1000 500 10000)' 263 | complete -c fish-lsp -n '__fish_seen_subcommand_from start; and test (commandline -opc)[-1] = "--max-files"' -a '(echo 100; echo 500; seq 1000 500 10000)' -d 'override the maximum number of files to analyze' 264 | 265 | ## fish-lsp url -- 266 | complete -c fish-lsp -n '__fish_seen_subcommand_from url; and not __fish_contains_opt repo' -l repo -d 'show git repo url' 267 | complete -c fish-lsp -n '__fish_seen_subcommand_from url; and not __fish_contains_opt git' -l git -d 'show git repo url' 268 | complete -c fish-lsp -n '__fish_seen_subcommand_from url; and not __fish_contains_opt npm' -l npm -d 'show npmjs.com url' 269 | complete -c fish-lsp -n '__fish_seen_subcommand_from url; and not __fish_contains_opt homepage' -l homepage -d 'show website url' 270 | complete -c fish-lsp -n '__fish_seen_subcommand_from url; and not __fish_contains_opt contributing' -l contributing -d 'show git CONTRIBUTING.md url' 271 | complete -c fish-lsp -n '__fish_seen_subcommand_from url; and not __fish_contains_opt wiki' -l wiki -d 'show git wiki url' 272 | complete -c fish-lsp -n '__fish_seen_subcommand_from url; and not __fish_contains_opt issues' -l issues -d 'show git issues url' 273 | complete -c fish-lsp -n '__fish_seen_subcommand_from url; and not __fish_contains_opt report' -l report -d 'show git issues url' 274 | complete -c fish-lsp -n '__fish_seen_subcommand_from url; and not __fish_contains_opt discussions' -l discussions -d 'show git discussions url' 275 | complete -c fish-lsp -n '__fish_seen_subcommand_from url; and not __fish_contains_opt clients-repo' -l clients-repo -d 'show git clients-repo url' 276 | complete -c fish-lsp -n '__fish_seen_subcommand_from url; and not __fish_contains_opt sources' -l sources -d 'show useful url list of sources' 277 | 278 | ## fish-lsp complete -- 279 | complete -c fish-lsp -n '__fish_seen_subcommand_from complete; and not __fish_contains_opt fish' -l fish -d 'DEFAULT BEHAVIOR: show output for completion/fish-lsp.fish' 280 | complete -c fish-lsp -n '__fish_seen_subcommand_from complete; and not __fish_contains_opt names' -l names -d 'show names of subcommands' 281 | complete -c fish-lsp -n '__fish_seen_subcommand_from complete; and not __fish_contains_opt names-with-summary' -l names-with-summary -d 'show `name\tsummary\n` of subcommands' 282 | complete -c fish-lsp -n '__fish_seen_subcommand_from complete; and not __fish_contains_opt features' -l features -d 'show feature/toggle names' 283 | complete -c fish-lsp -n '__fish_seen_subcommand_from complete; and not __fish_contains_opt toggles' -l toggles -d 'show feature/toggle names' 284 | complete -c fish-lsp -n '__fish_seen_subcommand_from complete; and not __fish_contains_opt env-variables' -l env-variables -d 'show env variable completions' 285 | complete -c fish-lsp -n '__fish_seen_subcommand_from complete; and not __fish_contains_opt env-variable-names' -l env-variable-names -d 'show env variable names' 286 | 287 | ## fish-lsp info -- 288 | complete -c fish-lsp -n '__fish_seen_subcommand_from info; and not __fish_contains_opt bin' -l bin -d 'show the binary path' 289 | complete -c fish-lsp -n '__fish_seen_subcommand_from info; and not __fish_contains_opt repo' -l repo -d 'show the repo path' 290 | complete -c fish-lsp -n '__fish_seen_subcommand_from info; and not __fish_contains_opt build-time' -l build-time -d 'show the build-time' 291 | complete -c fish-lsp -n '__fish_seen_subcommand_from info; and not __fish_contains_opt lsp-version' -l lsp-version -d 'show the npm package for the lsp-version' 292 | complete -c fish-lsp -n '__fish_seen_subcommand_from info; and not __fish_contains_opt capabilities' -l capabilities -d 'show the lsp capabilities implemented' 293 | complete -c fish-lsp -n '__fish_seen_subcommand_from info; and not __fish_contains_opt man-file' -l man-file -d 'show man file path' 294 | complete -c fish-lsp -n '__fish_seen_subcommand_from info; and not __fish_contains_opt log-file' -l log-file -d 'show log file path' 295 | complete -c fish-lsp -n '__fish_seen_subcommand_from info; and not __fish_contains_opt more' -l more -d 'show more info' 296 | complete -c fish-lsp -n '__fish_seen_subcommand_from info; and not __fish_contains_opt time-startup' -l time-startup -d 'show startup timing info' 297 | complete -c fish-lsp -n '__fish_seen_subcommand_from info; and not __fish_contains_opt check-health' -l check-health -d 'show the server health' 298 | 299 | ## fish-lsp env -- 300 | # fish-lsp env 301 | complete -c fish-lsp -n '__fish_seen_subcommand_from env; and __fish_lsp_env_main_switch --none; and __fish_complete_subcommand --fcs-skip=2' -kra " 302 | --show-default\t'show the default values for fish-lsp env variables' 303 | -c\t'create the env variables' 304 | --create\t'create the env variables' 305 | -s\t'show the current fish-lsp env variables with their values' 306 | --show\t'show the current fish-lsp env variables with their values' 307 | --names\t'output only the names of the env variables'" 308 | # main switches (first arguments after the `env` subcommand) 309 | complete -c fish-lsp -n '__fish_seen_subcommand_from env; and __fish_lsp_env_main_switch --none' -l show-default -d 'show the default values for fish-lsp env variables' -k 310 | complete -c fish-lsp -n '__fish_seen_subcommand_from env; and __fish_lsp_env_main_switch --none' -s c -l create -d 'build initial fish-lsp env variables' -k 311 | complete -c fish-lsp -n '__fish_seen_subcommand_from env; and __fish_lsp_env_main_switch --none' -s s -l show -d 'show the current fish-lsp env variables' -k 312 | complete -c fish-lsp -n '__fish_seen_subcommand_from env; and __fish_lsp_env_main_switch --none' -l names -d 'output only the names of the env variables' -k 313 | # --only switch 314 | complete -c fish-lsp -n '__fish_seen_subcommand_from env; and __fish_lsp_env_main_switch --any' -l only -d 'show only certain env variables' -xa '(__fish_lsp_get_env_variables)' 315 | complete -c fish-lsp -n '__fish_seen_subcommand_from env; and __fish_lsp_last_switch --only' -xa '(__fish_lsp_get_env_variables)' 316 | # switches usable after the main switches 317 | complete -c fish-lsp -n '__fish_seen_subcommand_from env; and __fish_lsp_env_main_switch --any --no-names; and not __fish_contains_opt no-comments' -l no-comments -d 'skip outputting comments' 318 | complete -c fish-lsp -n '__fish_seen_subcommand_from env; and __fish_lsp_env_main_switch --any --no-names; and not __fish_contains_opt no-global' -l no-global -d 'use local exports' 319 | complete -c fish-lsp -n '__fish_seen_subcommand_from env; and __fish_lsp_env_main_switch --any --no-names; and not __fish_contains_opt no-local' -l no-local -d 'do not use local scope (pair with --no-global)' 320 | complete -c fish-lsp -n '__fish_seen_subcommand_from env; and __fish_lsp_env_main_switch --any --no-names; and not __fish_contains_opt no-export' -l no-export -d 'do not export variables' 321 | complete -c fish-lsp -n '__fish_seen_subcommand_from env; and __fish_lsp_env_main_switch --any --no-names; and not __fish_contains_opt confd' -l confd -d 'output for redirect to "conf.d/fish-lsp.fish"' 322 | complete -c fish-lsp -n '__fish_seen_subcommand_from env; and __fish_lsp_env_main_switch --names-joined; and not __fish_contains_opt joined' -l joined -d 'output the names in a single line' 323 | 324 | # built by any of the commands: 325 | # fish-lsp complete > ~/.config/fish/completions/fish-lsp.fish 326 | # fish-lsp complete > $fish_complete_path[1]/fish-lsp.fish 327 | # fish-lsp complete > $__fish_config_dir/completions/fish-lsp.fish 328 | --------------------------------------------------------------------------------