diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..bd07d73 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,28 @@ +# For more information about the configurations used +# in this file, please see the EditorConfig documentation. +# +# https://editorconfig.org + +root = true + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +[*] + +charset = utf-8 +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.{json,md,yml,yaml}] + +indent_size = 2 + +[Makefile] + +indent_style = tab + +[*.{conf,vim,vimrc}] + +indent_size = 4 diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index fb502f0..66244b6 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @lukasjuhas \ No newline at end of file +* @lukasjuhas diff --git a/.github/workflows/check_links.yml b/.github/workflows/check_links.yml index d3fa49a..12f81e0 100644 --- a/.github/workflows/check_links.yml +++ b/.github/workflows/check_links.yml @@ -1,22 +1,24 @@ -# For more information about the configurations used -# in this file, please see the GitHub Actions documentation. +# Weekly link-check of every Markdown file in the repo. # # https://docs.github.com/en/actions -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +name: Check links + +on: + schedule: + - cron: "0 0 * * SAT" + workflow_dispatch: + +permissions: + contents: read jobs: ubuntu: + name: Link check runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v6 - - name: Check links from Markdown file + - name: Check links from Markdown files run: ./scripts/check_links/markdown.sh - -name: Check links - -on: - schedule: - - cron: "0 0 * * SAT" diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index dabf895..54cef02 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,12 +1,20 @@ -# For more information about the configurations used -# in this file, please see the GitHub Actions documentation. +# Lint the dotfiles on every push and PR. # # https://docs.github.com/en/actions -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +name: macOS + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read jobs: - macOS: + lint: + name: Lint runs-on: macos-latest steps: - name: Checkout repository @@ -20,10 +28,3 @@ jobs: - name: Lint Markdown files run: ./scripts/lint/markdown.sh - - - name: Check links from Markdown file - run: ./scripts/check_links/markdown.sh - -name: macOS - -on: push diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000..7cd9946 --- /dev/null +++ b/Brewfile @@ -0,0 +1,191 @@ +# Declarative Homebrew install list. Applied via `brew bundle` from +# `src/os/installs/macos/brewfile.sh`. +# +# To check current state vs. this file: brew bundle check --file=Brewfile +# To install everything missing: brew bundle --file=Brewfile +# To regenerate from installed packages: brew bundle dump --file=Brewfile --force +# +# https://github.com/Homebrew/homebrew-bundle + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Shell & terminal +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +brew "bash" +brew "bash-completion@2" +brew "tmux" +brew "zellij" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Modern CLI quality-of-life +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +brew "bat" +brew "direnv" +brew "eza" +brew "fd" +brew "fzf" +brew "git-delta" +brew "mole" # https://github.com/tw93/Mole โ€” Mac cleanup +brew "ripgrep" +brew "tree" +brew "zoxide" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Dev workflow +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +brew "gh" +brew "git" +brew "just" +brew "lazygit" +brew "shellcheck" +brew "vim" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Security & signing +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +brew "gnupg" +brew "pinentry-mac" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Languages, runtimes & package managers +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +brew "cocoapods" +brew "composer" +brew "php" +brew "php-cs-fixer" +brew "pipx" +brew "pnpm" +brew "python@3.13" +brew "ruff" +brew "watchman" +brew "yarn" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Cloud & infrastructure +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +brew "awscli" +brew "terraform" +brew "tflint" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Databases +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +brew "mysql", restart_service: :changed +brew "redis", restart_service: :changed + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Media tooling +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +brew "ffmpeg" +brew "imagemagick" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Compression & web font tools +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +brew "brotli" +brew "zopfli" +tap "bramstein/webfonttools" +brew "bramstein/webfonttools/sfnt2woff" +brew "bramstein/webfonttools/sfnt2woff-zopfli" +brew "bramstein/webfonttools/woff2" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Mac App Store CLI +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +brew "mas" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Editors & dev tooling (casks) +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +cask "cursor" +cask "visual-studio-code" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Browsers +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +cask "google-chrome" +cask "firefox" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Containers & databases (UI) +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +cask "docker-desktop" +cask "tableplus" +cask "mongodb-compass" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# API / network tools +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +cask "postman" +cask "insomnia" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# AI assistants +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +cask "claude" +cask "chatgpt" +cask "block-goose" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Productivity & menubar +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +cask "raycast" +cask "rectangle" +cask "jordanbaird-ice" +cask "meetingbar" +cask "granola" +cask "linear-linear" +cask "kap" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Utilities +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +cask "the-unarchiver" +cask "1password" +cask "flux" +cask "protonvpn" +cask "proton-mail-bridge" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Communication +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +cask "slack" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Media +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +cask "spotify" +cask "sonos" +cask "vlc" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Fonts +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +cask "font-fira-code" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Mac App Store apps +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +mas "Things 3", id: 904280696 +mas "Amphetamine", id: 937984704 +mas "LittleIpsum", id: 405772121 diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..15b91c6 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Lukas Juhas + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/README.MD b/README.MD deleted file mode 100644 index ab2fadc..0000000 --- a/README.MD +++ /dev/null @@ -1,159 +0,0 @@ -[Lukas][repo]' dotfiles -================= - -[![CI status for macOS][ci badge macos]][ci link macos] - -Dotfiles and set up of a new environment (for more specific local needs I use the -[`*.local`](#local-settings) files). - -Table of Contents ------------------ - -* [๐Ÿ”ง Setup](#setup) -* [๐ŸŽจ Customize](#customize) - * [๐ŸŒ Local Settings](#local-settings) - * [๐Ÿš `~/.bash.local`](#bashlocal) - * [๐Ÿ” `~/.gitconfig.local`](#gitconfiglocal) - * [โŒจ๏ธ `~/.vimrc.local`](#vimrclocal) -* [โ†•๏ธ Update](#update) -* [๐Ÿ“‘ License](#license) - -Setup ------ - -To set up the dotfiles run the appropriate snippet in the terminal: - -(โš ๏ธ __DO NOT__ run the `setup` script if you do not fully understand -[what it does][setup]. Seriously, __DON'T__!) - -| OS | Snippet | -|:---|:---| -| macOS | `bash -c "$(curl -LsS https://raw.github.com/lukasjuhas/dotfiles/main/src/os/setup.sh)"` | - -That's it! โœจ - -The setup process will: - -* Download the dotfiles on your computer - (by default it will suggest `~/projects/dotfiles`). -* [Symlink][symlink] the [Git], [shell], [tmux], - and [Vim] related files. -* Install applications / command-line tools for - [macOS][install macos]. -* Set custom [macOS][preferences macos] -* Install the [Vim][vim plugins] and - [VS Code][vscode plugins] plugins. - -Customize ---------- - -### Local Settings - -The dotfiles can be easily extended to suit additional local -requirements by using the following files: - -#### `~/.bash.local` - -The `~/.bash.local` file will be automatically sourced after all -the other [Bash related files][shell], thus, allowing its content -to add to or overwrite the existing aliases, settings, `PATH`, etc. - -Here is an example: - -```shell -#!/bin/bash - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Set PATH additions. - -PATH="/Users/lukasjuhas/projects/dotfiles/src/bin/:$PATH" - -export PATH - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Set local aliases. - -alias g="git" -``` - -#### `~/.gitconfig.local` - -The `~/.gitconfig.local` file will be automatically included after -the configurations from `~/.gitconfig`, thus, allowing its content -to overwrite or add to the existing Git configurations. - -__Note:__ Use `~/.gitconfig.local` to store sensitive information -such as the Git user credentials, e.g.: - -```gitconfig -[commit] - - # Sign commits using GPG. - # https://help.github.com/articles/signing-commits-using-gpg/ - - gpgSign = true - -[user] - - name = Lukas Juhas - email = account@example.com - signingKey = XXXXXXXX -``` - -#### `~/.vimrc.local` - -The `~/.vimrc.local` file will be automatically sourced after -`~/.vimrc`, thus, allowing its content to add or overwrite the -settings from `~/.vimrc`. - -Here is an example: - -```vim -" Disable arrow keys in insert mode. - -inoremap :echoe "Use j" -inoremap :echoe "Use h" -inoremap :echoe "Use l" -inoremap :echoe "Use k" - -" Disable arrow keys in normal mode. - -nnoremap :echoe "Use j" -nnoremap :echoe "Use h" -nnoremap :echoe "Use l" -nnoremap :echoe "Use k" -``` - -Update ------- - -To update the dotfiles you can either run the [`setup` script][setup] -or, if you want to update one particular part, run the appropriate -[`os` script](src/os). - -License -------- - -The code is available under the [MIT license][license]. - ---- -Latest iteration inspired and based mainly from -[@alrra](https://github.com/alrra/dotfiles). Thank you! - - -[ci badge macos]: https://github.com/lukasjuhas/dotfiles/workflows/macOS/badge.svg -[ci link macos]: https://github.com/lukasjuhas/dotfiles/actions?query=workflow%3AmacOS -[Git]: src/git -[install macos]: src/os/installs/macos -[license]: LICENSE.txt -[preferences macos]: src/os/preferences/macos -[repo]: https://github.com/lukasjuhas -[setup]: src/os/setup.sh -[shell]: src/shell -[symlink]: src/os/create_symbolic_links.sh -[tmux]: src/tmux -[vim plugins]: src/vim/vim/pack/minpac/start -[Vim]: src/vim -[vscode plugins]: src/os/installs/macos/vscode.sh \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..a591be1 --- /dev/null +++ b/README.md @@ -0,0 +1,257 @@ +[Lukas's][repo] dotfiles +======================== + +[![CI status for macOS][ci badge macos]][ci link macos] + +Personal macOS dotfiles. Bash-first, plugin-light, designed for a fast +one-shot setup on a fresh machine. For machine-specific overrides see +the [`*.local`](#local-settings) files. + +Inspired by and structurally based on [@alrra/dotfiles][alrra]. + +Table of Contents +----------------- + +* [๐Ÿ”ง Setup](#setup) +* [๐Ÿ“‚ What's inside](#whats-inside) +* [๐ŸŽจ Customize](#customize) + * [๐ŸŒ Local Settings](#local-settings) + * [๐Ÿš `~/.bash.local`](#bashlocal) + * [๐Ÿ” `~/.gitconfig.local`](#gitconfiglocal) + * [โŒจ๏ธ `~/.vimrc.local`](#vimrclocal) +* [๐Ÿ› ๏ธ Common commands](#common-commands) +* [โœ๏ธ Editor configs (VS Code + Cursor)](#editor-configs-vs-code--cursor) +* [โ†•๏ธ Update](#update) +* [๐Ÿ“‘ License](#license) + +Setup +----- + +To set up the dotfiles run the appropriate snippet in the terminal: + +> โš ๏ธ __DO NOT__ run the `setup` script if you do not fully understand +> [what it does][setup]. Seriously, __DON'T__! + +| OS | Snippet | +|:------|:--------| +| macOS | `bash -c "$(curl -LsS https://raw.github.com/lukasjuhas/dotfiles/main/src/os/setup.sh)"` | + +That's it. โœจ + +The setup process will: + +* Download the dotfiles to your computer + (suggests `~/projects/dotfiles` by default). +* [Symlink][symlink] the [Git], [shell], [tmux], and [Vim] related + files into `$HOME`. +* [Symlink][link editors] the shared [VS Code / Cursor][vscode dir] + `settings.json`, `keybindings.json`, and `snippets/` into both + editors' user directories. +* Prompt for __Full Disk Access__ if missing (required on modern + macOS for many `defaults write` calls to take effect; see + [`init.sh`][prefs init]). +* Apply the [Brewfile][brewfile] (`brew bundle`) โ€” installs every + formula, cask, and Mac App Store app in one declarative pass. + Browser variants, dead taps, and unused apps have all been pruned; + this list contains only what is actually used. +* Set custom [macOS][preferences macos] defaults (Finder, Dock, + trackpad, keyboard, screenshots, Stage Manager off, etc.). + +Apple Silicon. Tahoe (macOS 26) or newer. + +What's inside +------------- + +```text +. +โ”œโ”€โ”€ Brewfile โ† every formula, cask, MAS app (declarative) +โ”œโ”€โ”€ justfile โ† shortcut recipes (see below) +โ”œโ”€โ”€ renovate.json โ† dependency updates +โ”œโ”€โ”€ scripts/ โ† lint + link-check (CI) +โ””โ”€โ”€ src/ + โ”œโ”€โ”€ bin/ โ† personal scripts (tile-dual, tile-quad, โ€ฆ) + โ”œโ”€โ”€ git/ โ† gitconfig, gitignore, gitattributes + โ”œโ”€โ”€ shell/ โ† bash_aliases, bash_exports, bash_prompt, โ€ฆ + โ”œโ”€โ”€ tmux/ โ† tmux.conf + โ”œโ”€โ”€ vim/ โ† minimal plugin-free vimrc + โ”œโ”€โ”€ vscode/ โ† shared VS Code + Cursor config + โ””โ”€โ”€ os/ + โ”œโ”€โ”€ setup.sh โ† entry point + โ”œโ”€โ”€ create_symbolic_links.sh โ† bash/git/tmux/vim symlinks + โ”œโ”€โ”€ link_vscode_configs.sh โ† VS Code + Cursor symlinks + โ”œโ”€โ”€ installs/ + โ”‚ โ”œโ”€โ”€ composer.sh โ† Laravel Valet wiring + โ”‚ โ”œโ”€โ”€ npm.sh โ† global npm updates + โ”‚ โ”œโ”€โ”€ nvm.sh โ† Node Version Manager (not on Homebrew) + โ”‚ โ””โ”€โ”€ macos/ + โ”‚ โ”œโ”€โ”€ bash.sh โ† chsh to Homebrew bash + โ”‚ โ”œโ”€โ”€ brewfile.sh โ† apply the root Brewfile + โ”‚ โ”œโ”€โ”€ homebrew.sh โ† install brew, wire /opt/homebrew into PATH + โ”‚ โ””โ”€โ”€ xcode.sh โ† Xcode CLT + licence accept + โ””โ”€โ”€ preferences/macos/ + โ”œโ”€โ”€ init.sh โ† Full Disk Access check + โ”œโ”€โ”€ dock.sh / finder.sh / โ€ฆ + โ””โ”€โ”€ ui_and_ux.sh โ† Stage Manager off, .DS_Store control, โ€ฆ +``` + +Customize +--------- + +### Local Settings + +The dotfiles can be extended for machine-specific needs via three +local files (sourced or included automatically): + +#### `~/.bash.local` + +Sourced after every other Bash file, so it can override aliases, +exports, and `PATH`. This is the right place for secrets and +host-specific tweaks (e.g. API tokens). + +```shell +#!/bin/bash + +# Add personal scripts to PATH. +PATH="$HOME/projects/dotfiles/src/bin:$PATH" +export PATH + +# Local secrets โ€” never commit. +export SOME_API_TOKEN="โ€ฆ" +export OPENAI_API_KEY="โ€ฆ" +``` + +> ๐Ÿ’ก For tokens with broader scope (per-project), consider +> [`direnv`][direnv] with an `.envrc` file inside the project โ€” both +> `direnv` and the bash hook are installed by these dotfiles. + +#### `~/.gitconfig.local` + +Included after `~/.gitconfig`, so it overrides or adds to the +configurations. Use it for your identity and signing key โ€” these are +__deliberately NOT__ tracked in this repo. + +```gitconfig +[user] + + name = Your Name + email = you@example.com + signingKey = XXXXXXXX + +[commit] + + # https://docs.github.com/en/authentication/managing-commit-signature-verification + gpgSign = true +``` + +#### `~/.vimrc.local` + +Sourced at the end of `~/.vimrc` (see [`src/vim/vimrc`][vimrc] last +block). The shared vim config is intentionally minimal (~140 lines, +zero plugins) since day-to-day editing happens in Cursor/VS Code. + +```vim +" Example: disable arrow keys in insert and normal mode. + +inoremap :echoe "Use j" +inoremap :echoe "Use h" +inoremap :echoe "Use l" +inoremap :echoe "Use k" +``` + +Common commands +--------------- + +[`just`][just] (installed via the Brewfile) provides shortcut +recipes: + +```bash +just # list recipes +just setup # full one-shot setup +just install # only run installers (Homebrew, casks, CLI) +just bundle # apply the Brewfile (formulae + casks + MAS) +just bundle-check # what's missing vs. the Brewfile? +just bundle-dump # rewrite the Brewfile from currently-installed packages +just prefs # only apply macOS defaults +just link # (re)create the bash/git/tmux/vim symlinks +just link-editors # (re)symlink VS Code + Cursor configs +just update # softwareupdate + brew + mas + npm + pnpm +just lint # shellcheck + markdownlint +just check # lint + broken-link check +``` + +The [Brewfile][brewfile] is the single source of truth for everything +installable via Homebrew (formulae, casks) and `mas` (Mac App Store). +To add a tool: edit the Brewfile, then `just bundle`. To audit drift +between this repo and your machine: `just bundle-check`. + +Editor configs (VS Code + Cursor) +--------------------------------- + +[`src/vscode/`][vscode dir] holds a single shared +`settings.json`, `keybindings.json`, and `snippets/` directory. +[`src/os/link_vscode_configs.sh`][link editors] symlinks them into +__both__ editors: + +```text +~/Library/Application Support/Code/User/ โ” + โ”œโ”€โ†’ src/vscode/ +~/Library/Application Support/Cursor/User/ โ”˜ +``` + +Cursor is a VS Code fork and reads the same format. Unknown keys +(e.g. `cursor.*` in VS Code, `claudeCode.*` in Cursor) are silently +ignored by the editor that doesn't know them, so a single shared +file just works. Pre-existing local files are backed up to +`.backup.` before the symlink is created. + +Update +------ + +To pull the latest dotfiles and re-run setup: + +```bash +just setup +``` + +To bring the system up to date (without re-running setup): + +```bash +just update +``` + +To re-run only one piece: + +```bash +just install # apps + CLI tools only +just prefs # macOS defaults only +just link # rebuild symlinks only +``` + +License +------- + +The code is available under the [MIT License](LICENSE.txt). + +--- + +Inspired by and based on [@alrra/dotfiles][alrra]. Thanks! + + +[alrra]: https://github.com/alrra/dotfiles +[brewfile]: Brewfile +[ci badge macos]: https://github.com/lukasjuhas/dotfiles/workflows/macOS/badge.svg +[ci link macos]: https://github.com/lukasjuhas/dotfiles/actions?query=workflow%3AmacOS +[direnv]: https://direnv.net/ +[Git]: src/git +[just]: https://github.com/casey/just +[link editors]: src/os/link_vscode_configs.sh +[prefs init]: src/os/preferences/macos/init.sh +[preferences macos]: src/os/preferences/macos +[repo]: https://github.com/lukasjuhas +[setup]: src/os/setup.sh +[shell]: src/shell +[symlink]: src/os/create_symbolic_links.sh +[tmux]: src/tmux +[Vim]: src/vim +[vimrc]: src/vim/vimrc +[vscode dir]: src/vscode diff --git a/justfile b/justfile new file mode 100644 index 0000000..18ca0e2 --- /dev/null +++ b/justfile @@ -0,0 +1,70 @@ +# Common operations for these dotfiles. +# Run `just` to list available recipes. +# +# https://github.com/casey/just + +set shell := ["bash", "-euo", "pipefail", "-c"] + +DOTFILES := justfile_directory() + +# Show available recipes. +default: + @just --list + +# Run the full setup (installs apps, symlinks dotfiles, applies macOS prefs). +setup: + bash {{DOTFILES}}/src/os/setup.sh + +# (Re)create the standard symlinks (bash, git, tmux, vim). +link: + bash {{DOTFILES}}/src/os/create_symbolic_links.sh + +# Symlink the shared VS Code / Cursor configs. +link-editors: + bash {{DOTFILES}}/src/os/link_vscode_configs.sh + +# Run all installers (Homebrew, casks, CLI tools, language runtimes). +install: + bash {{DOTFILES}}/src/os/installs/main.sh + +# Apply only the Brewfile (formulae + casks + MAS apps). +bundle: + brew bundle --no-lock --file={{DOTFILES}}/Brewfile + +# Show what's installed vs. what the Brewfile expects. +bundle-check: + brew bundle check --verbose --file={{DOTFILES}}/Brewfile + +# Regenerate the Brewfile from currently-installed packages. +# Use with care โ€” overwrites the committed Brewfile. +bundle-dump: + brew bundle dump --file={{DOTFILES}}/Brewfile --force + +# Apply macOS defaults. +prefs: + bash {{DOTFILES}}/src/os/preferences/main.sh + +# Update everything (system + Homebrew + Node + pnpm). +update: + sudo softwareupdate --install --all + brew update + brew upgrade + brew cleanup + -mas upgrade + -npm update -g + -pnpm update -g + +# Lint shell scripts with shellcheck. +lint-shell: + bash {{DOTFILES}}/scripts/lint/shell.sh + +# Lint markdown files. +lint-md: + bash {{DOTFILES}}/scripts/lint/markdown.sh + +# Run all linters. +lint: lint-shell lint-md + +# Check repo health (lint + broken links). +check: lint + bash {{DOTFILES}}/scripts/check_links/markdown.sh diff --git a/renovate.json b/renovate.json index 39a2b6e..87d5db9 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,25 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": [ - "config:base" + "config:recommended", + ":dependencyDashboard", + ":semanticCommits", + "schedule:weekly" + ], + "timezone": "America/New_York", + "labels": ["dependencies"], + "packageRules": [ + { + "description": "Auto-merge non-major GitHub Actions updates", + "matchManagers": ["github-actions"], + "matchUpdateTypes": ["minor", "patch", "digest"], + "automerge": true, + "platformAutomerge": true + }, + { + "description": "Group GitHub Actions updates into a single PR", + "matchManagers": ["github-actions"], + "groupName": "github-actions" + } ] } diff --git a/src/git/gitconfig b/src/git/gitconfig index 3556c25..fe15d26 100644 --- a/src/git/gitconfig +++ b/src/git/gitconfig @@ -220,6 +220,12 @@ changed = yellow reverse untracked = red reverse +[branch] + + # Sort branches by most recent commit when listing. + + sort = -committerdate + [core] abbrev = 12 @@ -228,6 +234,27 @@ editor = vim excludesFile = ~/.gitignore + # Use `delta` (https://github.com/dandavison/delta) as the pager + # when installed via Homebrew; falls back gracefully otherwise. + + pager = delta + +[credential "https://github.com"] + + helper = + helper = !gh auth git-credential + +[credential "https://gist.github.com"] + + helper = + helper = !gh auth git-credential + +[delta] + + line-numbers = true + navigate = true + syntax-theme = Solarized (dark) + [diff] # Show blocks of moved text of at least 20 @@ -243,6 +270,12 @@ textconv = hexdump --canonical --no-squeezing +[fetch] + + # Remove remote-tracking refs that no longer exist on the remote. + + prune = true + [help] # If a command is mistyped, make Git automatically @@ -254,6 +287,10 @@ defaultBranch = main +[interactive] + + diffFilter = delta --color-only + [pretty] custom = "%C(magenta)%h%C(red)%d %C(yellow)%ar %C(green)%s %C(yellow)(%an)" @@ -263,6 +300,11 @@ # โ”‚ โ””โ”€ decorations (branch, heads or tags) # โ””โ”€ hash (abbreviated) +[pull] + + # Rebase local commits on top of fetched ones rather than merging. + + rebase = true [push] @@ -271,14 +313,19 @@ followTags = true +[rerere] + + # Reuse recorded resolutions for repeated merge conflicts. + # https://git-scm.com/book/en/v2/Git-Tools-Rerere + + enabled = true + [user] # Do not guess the user's identity. # https://github.com/git/git/blob/90f7b16b3adc78d4bbabbd426fb69aa78c714f71/Documentation/config.txt#L2847-L2855 useConfigOnly = true - email = lukasjuhas@pm.me - name = Lukas Juhas # [!] DO NOT store sensitive information such as the Git user # credentials (`name` / `email`), or things such as the `signingkey` diff --git a/src/git/gitignore b/src/git/gitignore index 7c172ff..25e8461 100644 --- a/src/git/gitignore +++ b/src/git/gitignore @@ -1,6 +1,20 @@ # Useful `.gitignore` templates: # https://github.com/github/gitignore +# ---------------------------------------------------------------------- +# | Secrets & local state | +# ---------------------------------------------------------------------- + +.env +.env.* +.envrc +*.local +*.secret +*.pem +*.key +.backup.* + + # ---------------------------------------------------------------------- # | Linux | # ---------------------------------------------------------------------- @@ -12,13 +26,28 @@ # | Miscellaneous | # ---------------------------------------------------------------------- -# Node.js, npm, and yarn. +# Node.js, npm, pnpm, and yarn. node_modules npm-debug.log* +pnpm-debug.log* yarn-debug.log* yarn-error.log* +# Python + +.venv +__pycache__ +*.pyc + +# Build artifacts + +dist +build +.next +.turbo +.cache + # ---------------------------------------------------------------------- # | macOS | @@ -44,6 +73,15 @@ yarn-error.log* Session.vim +# ---------------------------------------------------------------------- +# | Editors | +# ---------------------------------------------------------------------- + +.idea +.vscode +*.code-workspace + + # ---------------------------------------------------------------------- # | Windows | # ---------------------------------------------------------------------- diff --git a/src/os/installs/composer.sh b/src/os/installs/composer.sh index 79a13d0..37414f9 100755 --- a/src/os/installs/composer.sh +++ b/src/os/installs/composer.sh @@ -3,104 +3,61 @@ cd "$(dirname "${BASH_SOURCE[0]}")" \ && . "../utils.sh" +# PHP, Composer, MySQL and Redis are installed declaratively via the +# top-level `Brewfile`. This script only handles the Composer-PATH +# wiring and Laravel Valet setup. + declare -r LOCAL_SHELL_CONFIG_FILE="$HOME/.bash.local" declare -r COMPOSER_DIRECTORY="$HOME/.composer/vendor/bin" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -add_composer_configs() { +add_composer_to_path() { + + if grep -F "$COMPOSER_DIRECTORY" < "$LOCAL_SHELL_CONFIG_FILE" &> /dev/null; then + return + fi declare -r CONFIGS=" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # PHP Composer -PATH=\"$COMPOSER_DIRECTORY:\$PATH\" - -export PATH - +export PATH=\"$COMPOSER_DIRECTORY:\$PATH\" " - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - execute \ - "printf '%s' '$CONFIGS' >> $LOCAL_SHELL_CONFIG_FILE \ - && . $LOCAL_SHELL_CONFIG_FILE" - + "printf '%s' '$CONFIGS' >> $LOCAL_SHELL_CONFIG_FILE" \ + "Composer (add $COMPOSER_DIRECTORY to PATH in $LOCAL_SHELL_CONFIG_FILE)" } -install_php() { - - # Install `php` via brew - - execute \ - "brew install php" - -} - -install_composer() { - - # Install `composer` via brew and add the necessary - # configs in the local shell config file. - - execute \ - "brew install composer" \ - && add_composer_configs - -} - -update_composer() { - - execute \ - "brew upgrade composer" - -} - -install_and_start_mysql() { - - execute \ - "brew install mysql" \ - "brew services start mysql" - -} - -install_and_start_redis() { - - execute \ - "brew install redis" \ - "brew services start redis" +install_laravel_valet() { -} + if [ ! -d "$COMPOSER_DIRECTORY" ] || ! command -v composer &> /dev/null; then + print_warning "Composer is not installed yet โ€” skipping Valet setup." + return + fi -install_laravel_valet() { - # Install laravel valet via composer + if command -v valet &> /dev/null; then + print_success "Laravel Valet (already installed)" + return + fi execute \ - "composer global require laravel/valet" \ - "valet install" \ - "valet trust" + "composer global require laravel/valet && \ + valet install && \ + valet trust" \ + "Laravel Valet" } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - main() { - print_in_purple "\n PHP, Composer & Laravel Valet\n\n" + print_in_purple "\n PHP / Composer / Laravel Valet\n\n" - install_php - - if [ ! -d "$COMPOSER_DIRECTORY" ]; then - install_composer - else - update_composer - fi - - source "$LOCAL_SHELL_CONFIG_FILE" - - install_and_start_mysql - install_and_start_redis + add_composer_to_path install_laravel_valet - } main diff --git a/src/os/installs/macos/brewfile.sh b/src/os/installs/macos/brewfile.sh new file mode 100755 index 0000000..86a17cb --- /dev/null +++ b/src/os/installs/macos/brewfile.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +cd "$(dirname "${BASH_SOURCE[0]}")" \ + && . "../../utils.sh" \ + && . "./utils.sh" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Apply the declarative package list from the repo root `Brewfile`. +# See: https://github.com/Homebrew/homebrew-bundle + +main() { + + print_in_purple "\n Brewfile (formulae + casks + MAS)\n\n" + + if ! cmd_exists "brew"; then + print_error "Homebrew is not installed" + return 1 + fi + + local brewfile="" + brewfile="$(cd "../../../.." && pwd)/Brewfile" + + if [ ! -f "$brewfile" ]; then + print_error "Brewfile not found at $brewfile" + return 1 + fi + + execute \ + "brew bundle --no-lock --file='$brewfile'" \ + "brew bundle ($brewfile)" +} + +main diff --git a/src/os/installs/macos/browsers.sh b/src/os/installs/macos/browsers.sh deleted file mode 100755 index 1fcc764..0000000 --- a/src/os/installs/macos/browsers.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../../utils.sh" \ - && . "./utils.sh" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -print_in_purple "\n Browsers\n" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -printf "\n" - -brew_install "Chrome" "google-chrome" "--cask" -brew_install "Chrome Canary" "google-chrome-canary" "--cask" "homebrew/cask-versions" -brew_install "Chromium" "chromium" "--cask" "homebrew/cask-versions" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -printf "\n" - -brew_install "Firefox" "firefox" "--cask" -brew_install "Firefox Developer" "firefox-developer-edition" "--cask" "homebrew/cask-versions" -brew_install "Firefox Nightly" "firefox-nightly" "--cask" "homebrew/cask-versions" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# `Safari Technology Preview` requires macOS 10.11.4 or la - -if is_supported_version "$(get_os_version)" "10.11.4"; then - printf "\n" - brew_install "Safari Technology Preview" "safari-technology-preview" "--cask" "homebrew/cask-versions" -fi diff --git a/src/os/installs/macos/compression_tools.sh b/src/os/installs/macos/compression_tools.sh deleted file mode 100755 index d959feb..0000000 --- a/src/os/installs/macos/compression_tools.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../../utils.sh" \ - && . "./utils.sh" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -print_in_purple "\n Compression Tools\n\n" - -brew_install "Brotli" "brotli" -brew_install "Zopfli" "zopfli" diff --git a/src/os/installs/macos/git.sh b/src/os/installs/macos/git.sh deleted file mode 100755 index bc088c6..0000000 --- a/src/os/installs/macos/git.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../../utils.sh" \ - && . "./utils.sh" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -print_in_purple "\n Git\n\n" - -brew_install "Git" "git" -brew_install "GitHub CLI" "github/gh/gh" diff --git a/src/os/installs/macos/gpg.sh b/src/os/installs/macos/gpg.sh deleted file mode 100755 index 517d999..0000000 --- a/src/os/installs/macos/gpg.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../../utils.sh" \ - && . "./utils.sh" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -print_in_purple "\n GPG\n\n" - -brew_install "GPG" "gpg" -brew_install "Pinentry" "pinentry-mac" diff --git a/src/os/installs/macos/homebrew.sh b/src/os/installs/macos/homebrew.sh index 13ea372..5d246e5 100755 --- a/src/os/installs/macos/homebrew.sh +++ b/src/os/installs/macos/homebrew.sh @@ -6,22 +6,6 @@ cd "$(dirname "${BASH_SOURCE[0]}")" \ # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -get_homebrew_git_config_file_path() { - - local path="" - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if path="$(brew --repository 2> /dev/null)/.git/config"; then - printf "%s" "$path" - return 0 - else - print_error "Homebrew (get config file path)" - return 1 - fi - -} - install_homebrew() { if ! cmd_exists "brew"; then @@ -34,53 +18,51 @@ install_homebrew() { } -opt_out_of_analytics() { - - local path="" +add_to_path() { - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Try to get the path of the `Homebrew` git config file. - - path="$(get_homebrew_git_config_file_path)" \ - || return 1 - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + declare -r LOCAL_SHELL_CONFIG_FILE="$HOME/.bash.local" + declare -r BREW_PREFIX="/opt/homebrew" - # Opt-out of Homebrew's analytics. - # https://github.com/Homebrew/brew/blob/0c95c60511cc4d85d28f66b58d51d85f8186d941/share/doc/homebrew/Analytics.md#opting-out + # Apple Silicon only โ€” Homebrew always installs to /opt/homebrew. + # Make sure it's on PATH in the local shell config (idempotent). - if [ "$(git config --file="$path" --get homebrew.analyticsdisabled)" != "true" ]; then - git config --file="$path" --replace-all homebrew.analyticsdisabled true &> /dev/null - print_result $? "Homebrew (opt-out of analytics)" + if ! grep -F "$BREW_PREFIX/bin" < "$LOCAL_SHELL_CONFIG_FILE" &> /dev/null; then + execute \ + "printf '\n# Homebrew\nexport PATH=\"%s/bin:\$PATH\"\n' '$BREW_PREFIX' >> $LOCAL_SHELL_CONFIG_FILE" \ + "Homebrew (add $BREW_PREFIX/bin to PATH in $LOCAL_SHELL_CONFIG_FILE)" fi - } -opt_out_of_auto_update() { +add_homebrew_env_configs() { declare -r LOCAL_SHELL_CONFIG_FILE="$HOME/.bash.local" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # If needed, add the necessary configs in the - # local shell configuration file. + # Modern Homebrew honors environment variables for both analytics + # opt-out and disabling auto-update. Write them once into the + # local shell config so they apply to every interactive shell. + # + # https://docs.brew.sh/Manpage#environment + # https://docs.brew.sh/Analytics#opting-out - if ! grep "HOMEBREW_NO_AUTO_UPDATE" < "$LOCAL_SHELL_CONFIG_FILE" &> /dev/null; then + if ! grep "HOMEBREW_NO_ANALYTICS" < "$LOCAL_SHELL_CONFIG_FILE" &> /dev/null; then declare -r CONFIGS=" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Configure Homebrew to not auto-update before running commands -# such as: \`brew install\`, \`brew upgrade\`, and \`brew tap\`. +# Homebrew: opt out of analytics and skip auto-update before +# every brew command (run \`brew update\` manually instead). # # https://docs.brew.sh/Manpage#environment +export HOMEBREW_NO_ANALYTICS=1 export HOMEBREW_NO_AUTO_UPDATE=1 +export HOMEBREW_NO_ENV_HINTS=1 " execute \ "printf '%s' '$CONFIGS' >> $LOCAL_SHELL_CONFIG_FILE" \ - "Homebrew (opt-out of auto-updating before running certain commands)" + "Homebrew (set HOMEBREW_NO_ANALYTICS / HOMEBREW_NO_AUTO_UPDATE in $LOCAL_SHELL_CONFIG_FILE)" fi } @@ -91,12 +73,12 @@ main() { print_in_purple "\n Homebrew\n\n" install_homebrew - opt_out_of_analytics + add_to_path brew_update brew_upgrade - opt_out_of_auto_update + add_homebrew_env_configs } main diff --git a/src/os/installs/macos/image_tools.sh b/src/os/installs/macos/image_tools.sh deleted file mode 100755 index 28ae67f..0000000 --- a/src/os/installs/macos/image_tools.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../../utils.sh" \ - && . "./utils.sh" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -print_in_purple "\n Image Tools\n\n" - -brew_install "ImageMagick" "imagemagick" -brew_install "ImageOptim" "imageoptim" "--cask" diff --git a/src/os/installs/macos/main.sh b/src/os/installs/macos/main.sh index b3fb5d8..ab3eb61 100755 --- a/src/os/installs/macos/main.sh +++ b/src/os/installs/macos/main.sh @@ -5,23 +5,21 @@ cd "$(dirname "${BASH_SOURCE[0]}")" \ && . "./utils.sh" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Order matters: +# 1. Xcode CLT (prerequisite for almost everything) +# 2. Homebrew itself +# 3. Bash 5 (changes the user's login shell) +# 4. Brewfile (formulae + casks + MAS apps) +# 5. nvm + Node (separate because nvm is not on Homebrew) +# 6. Global npm updates +# 7. Composer / Laravel Valet wiring +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ./xcode.sh ./homebrew.sh ./bash.sh +./brewfile.sh -./git.sh ./../nvm.sh -./browsers.sh -./../composer.sh -./compression_tools.sh -./gpg.sh -./image_tools.sh -./misc.sh -./misc_tools.sh ./../npm.sh -./tmux.sh -./video_tools.sh -./../vim.sh -./vscode.sh -./web_font_tools.sh +./../composer.sh diff --git a/src/os/installs/macos/misc.sh b/src/os/installs/macos/misc.sh deleted file mode 100755 index b355aad..0000000 --- a/src/os/installs/macos/misc.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../../utils.sh" \ - && . "./utils.sh" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -print_in_purple "\n Miscellaneous\n\n" - -brew_install "MAS" "mas" - -brew_install "PHP CS" "php-cs-fixer" -brew install "Docker" "docker" "--cask" -brew install "Docker Compose" "docker-compose" -brew_install "Python" "python" -brew_install "Table Plus" "tableplus" "--cask" -brew_install "Transmit" "transmit" "--cask" -brew_install "Insomnia" "insomnia" "--cask" - -brew_install "Raycast" "raycast" "--cask" -brew_install "Dozer" "dozer" "--cask" -brew_install "Rectangle" "rectangle" "--cask" -brew_install "Unarchiver" "the-unarchiver" "--cask" -brew_install "1password" "1password" "--cask" -brew_install "Flux" "flux" "--cask" -brew_install "Slack" "slack" "--cask" -brew_install "Kap" "kap" "--cask" -brew_install "Loom" "loom" "--cask" -brew_install "Proton VPN" "protonvpn" "--cask" -brew_install "Proton Mail Bridge" "protonmail-bridge" "--cask" -brew install "MeetingBar" "meetingbar" "--cask" -brew install "Bartender" "bartender" "--cask" -brew install "Transmission" "transmission" "--cask" -brew install "Adobe CC" "adobe-creative-cloud" "--cask" -brew install "Cursor" "cursor" "--cask" - -brew_install "Spotify" "spotify" "--cask" -brew_install "Sonos" "sonos" "--cask" -brew_install "VLC" "vlc" "--cask" - -brew_install "Fira Code Font" "font-fira-code" "--cask" "homebrew/cask-fonts" - -mas install 904280696 # Things 3 -mas install 937984704 # Amphetamine -mas install 405772121 # Littleipsum \ No newline at end of file diff --git a/src/os/installs/macos/misc_tools.sh b/src/os/installs/macos/misc_tools.sh deleted file mode 100755 index 6eb262e..0000000 --- a/src/os/installs/macos/misc_tools.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../../utils.sh" \ - && . "./utils.sh" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -print_in_purple "\n Miscellaneous Tools\n\n" - -brew_install "ShellCheck" "shellcheck" - -if [ -d "$HOME/.nvm" ]; then - brew_install "Yarn" "yarn" -fi diff --git a/src/os/installs/macos/tmux.sh b/src/os/installs/macos/tmux.sh deleted file mode 100755 index 0a379b5..0000000 --- a/src/os/installs/macos/tmux.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../../utils.sh" \ - && . "./utils.sh" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -print_in_purple "\n tmux\n\n" - -brew_install "tmux" "tmux" -brew_install "tmux (pasteboard)" "reattach-to-user-namespace" diff --git a/src/os/installs/macos/video_tools.sh b/src/os/installs/macos/video_tools.sh deleted file mode 100755 index 8e3bf61..0000000 --- a/src/os/installs/macos/video_tools.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../../utils.sh" \ - && . "./utils.sh" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -print_in_purple "\n Video Tools\n\n" - -brew_install "FFmpeg" "ffmpeg" diff --git a/src/os/installs/macos/vim.sh b/src/os/installs/macos/vim.sh deleted file mode 100755 index 890d668..0000000 --- a/src/os/installs/macos/vim.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "./utils.sh" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -brew_install "Vim" "vim" diff --git a/src/os/installs/macos/vscode.sh b/src/os/installs/macos/vscode.sh deleted file mode 100755 index 04f6c52..0000000 --- a/src/os/installs/macos/vscode.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../../utils.sh" \ - && . "./utils.sh" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -install_plugin() { - execute "code --install-extension $2" "$1 (plugin)" -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -print_in_purple "\n Visual Studio Code\n\n" : - -# Install VSCode -brew_install "Visual Studio Code" "visual-studio-code" "--cask" - -printf "\n" - -# Close VSCode -osascript -e 'quit app "Visual Studio Code"' diff --git a/src/os/installs/macos/web_font_tools.sh b/src/os/installs/macos/web_font_tools.sh deleted file mode 100755 index fb31fd8..0000000 --- a/src/os/installs/macos/web_font_tools.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../../utils.sh" \ - && . "./utils.sh" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -print_in_purple "\n Web Font Tools\n\n" - -brew_install "Web Font Tools: TTF/OTF โ†’ WOFF (Zopfli)" "sfnt2woff-zopfli" "" "bramstein/webfonttools" -brew_install "Web Font Tools: TTF/OTF โ†’ WOFF" "sfnt2woff" "" "bramstein/webfonttools" -brew_install "Web Font Tools: WOFF2" "woff2" "" "bramstein/webfonttools" diff --git a/src/os/installs/vim.sh b/src/os/installs/vim.sh deleted file mode 100755 index 75ee890..0000000 --- a/src/os/installs/vim.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../utils.sh" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -install_plugins() { - - declare -r VIM_PACK_DIR="$HOME/.vim/pack" - declare -r MINPAC_DIR="$VIM_PACK_DIR/minpac/opt/minpac" - declare -r MINPAC_GIT_REPO_URL="https://github.com/k-takata/minpac.git" - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Install plugins. - - execute \ - "rm -rf $VIM_PACK_DIR \ - && git clone --quiet $MINPAC_GIT_REPO_URL $MINPAC_DIR" \ - "Install plugins" \ - || return 1 - - vim +PluginsSetup - -} - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -main() { - - print_in_purple "\n Vim\n\n" - - "./$(get_os)/vim.sh" - install_plugins - -} - -main diff --git a/src/os/link_vscode_configs.sh b/src/os/link_vscode_configs.sh new file mode 100755 index 0000000..4fa1ece --- /dev/null +++ b/src/os/link_vscode_configs.sh @@ -0,0 +1,87 @@ +#!/bin/bash + +cd "$(dirname "${BASH_SOURCE[0]}")" \ + && . "utils.sh" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# +# Symlink `src/vscode/{settings.json,keybindings.json,snippets}` into +# both VS Code's and Cursor's User directories so the two editors stay +# in sync. +# +# Unknown configuration keys (e.g. `cursor.*` in VS Code, `claudeCode.*` +# in Cursor) are silently ignored by the editor that doesn't know +# them, so it's safe to share a single `settings.json`. +# +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +declare -r SHARED_DIR="$(cd .. && pwd)/vscode" + +declare -r -a EDITOR_USER_DIRS=( + "$HOME/Library/Application Support/Code/User" + "$HOME/Library/Application Support/Cursor/User" +) + +declare -r -a FILES_TO_SYMLINK=( + "settings.json" + "keybindings.json" + "snippets" +) + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +backup_if_real_file() { + + local target="$1" + + [ ! -e "$target" ] && return 0 + [ -L "$target" ] && return 0 + + local backup="${target}.backup.$(date +%Y%m%d%H%M%S)" + + execute \ + "mv \"$target\" \"$backup\"" \ + "Backup existing $target โ†’ $backup" +} + +link_editor_config() { + + local userDir="$1" + local sourceFile="$2" + local sourcePath="$SHARED_DIR/$sourceFile" + local targetPath="$userDir/$sourceFile" + + # If the editor isn't installed (no User directory), skip silently. + + [ ! -d "$userDir" ] && return 0 + + backup_if_real_file "$targetPath" + + if [ -L "$targetPath" ] && [ "$(readlink "$targetPath")" == "$sourcePath" ]; then + print_success "$targetPath โ†’ $sourcePath" + return 0 + fi + + execute \ + "rm -rf \"$targetPath\" && ln -fs \"$sourcePath\" \"$targetPath\"" \ + "$targetPath โ†’ $sourcePath" +} + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +main() { + + print_in_purple "\n โ€ข Symlink shared VS Code / Cursor configs\n\n" + + local userDir="" + local file="" + + for userDir in "${EDITOR_USER_DIRS[@]}"; do + for file in "${FILES_TO_SYMLINK[@]}"; do + link_editor_config "$userDir" "$file" + done + done + +} + +main "$@" diff --git a/src/os/preferences/macos/Solarized Dark.terminal b/src/os/preferences/macos/Solarized Dark.terminal deleted file mode 100644 index 4ddecdb..0000000 --- a/src/os/preferences/macos/Solarized Dark.terminal +++ /dev/null @@ -1,189 +0,0 @@ - - - - - BackgroundBlur - 0.0 - BackgroundColor - - YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS - AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPEC0w - LjAxNTI0OTAxNzI5IDAuMTI0MzYzMzMxMiAwLjE1OTY5NjAxMjcgMC45NwAQAYAC0hAR - EhNaJGNsYXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXll - ZEFyY2hpdmVy0RcYVHJvb3SAAQgRGiMtMjc7QUhOW2KSlJabpq+3usPV2N0AAAAAAAAB - AQAAAAAAAAAZAAAAAAAAAAAAAAAAAAAA3w== - - BlinkText - - CursorColor - - YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS - AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw - LjQ0MDU4MDI0ODggMC41MDk2MjkzMDkyIDAuNTE2ODU3OTgxNwAQAYAC0hAREhNaJGNs - YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp - dmVy0RcYVHJvb3SAAQgRGiMtMjc7QUhOW2KMjpCVoKmxtL3P0tcAAAAAAAABAQAAAAAA - AAAZAAAAAAAAAAAAAAAAAAAA2Q== - - Font - - YnBsaXN0MDDUAQIDBAUGGBlYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS - AAGGoKQHCBESVSRudWxs1AkKCwwNDg8QVk5TU2l6ZVhOU2ZGbGFnc1ZOU05hbWVWJGNs - YXNzI0AwAAAAAAAAEBCAAoADXU1lbmxvLVJlZ3VsYXLSExQVFlokY2xhc3NuYW1lWCRj - bGFzc2VzVk5TRm9udKIVF1hOU09iamVjdF8QD05TS2V5ZWRBcmNoaXZlctEaG1Ryb290 - gAEIERojLTI3PEJLUltiaXJ0dniGi5afpqmyxMfMAAAAAAAAAQEAAAAAAAAAHAAAAAAA - AAAAAAAAAAAAAM4= - - FontAntialias - - FontHeightSpacing - 1 - FontWidthSpacing - 1 - ProfileCurrentVersion - 2.06 - SelectionColor - - YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS - AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T - Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPEB8wLjM2NzI1OTQx - MTggMC4xMTU0Mzg3Mzk4IDEgMC42TxAVMC4zMTg4MDgzNzY4IDAgMSAwLjYAEAGAAoAG - 0xQNFRYXGFVOU0lDQ1lOU1NwYWNlSUSAA4AFEAzSGg0bHFdOUy5kYXRhTxECJAAAAiRh - cHBsBAAAAG1udHJSR0IgWFlaIAfhAAcABwANABYAIGFjc3BBUFBMAAAAAEFQUEwAAAAA - AAAAAAAAAAAAAAAAAAD21gABAAAAANMtYXBwbMoalYIlfxBNOJkT1dHqFYIAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACmRlc2MAAAD8AAAAZWNwcnQAAAFkAAAAI3d0 - cHQAAAGIAAAAFHJYWVoAAAGcAAAAFGdYWVoAAAGwAAAAFGJYWVoAAAHEAAAAFHJUUkMA - AAHYAAAAIGNoYWQAAAH4AAAALGJUUkMAAAHYAAAAIGdUUkMAAAHYAAAAIGRlc2MAAAAA - AAAAC0Rpc3BsYXkgUDMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAdGV4dAAA - AABDb3B5cmlnaHQgQXBwbGUgSW5jLiwgMjAxNwAAWFlaIAAAAAAAAPNRAAEAAAABFsxY - WVogAAAAAAAAg98AAD2/////u1hZWiAAAAAAAABKvwAAsTcAAAq5WFlaIAAAAAAAACg4 - AAARCwAAyLlwYXJhAAAAAAADAAAAAmZmAADypwAADVkAABPQAAAKW3NmMzIAAAAAAAEM - QgAABd7///MmAAAHkwAA/ZD///ui///9owAAA9wAAMBugATSHh8gIVokY2xhc3NuYW1l - WCRjbGFzc2VzXU5TTXV0YWJsZURhdGGjICIjVk5TRGF0YVhOU09iamVjdNIeHyUmXE5T - Q29sb3JTcGFjZaInI1xOU0NvbG9yU3BhY2XSHh8pKldOU0NvbG9yoikjXxAPTlNLZXll - ZEFyY2hpdmVy0S0uVHJvb3SAAQAIABEAGgAjAC0AMgA3AD8ARQBQAF0AYwBwAIUAjACu - AMYAyADKAMwA0wDZAOMA5QDnAOkA7gD2Ax4DIAMlAzADOQNHA0sDUgNbA2ADbQNwA30D - ggOKA40DnwOiA6cAAAAAAAACAQAAAAAAAAAvAAAAAAAAAAAAAAAAAAADqQ== - - ShowActiveProcessInTitle - - ShowCommandKeyInTitle - - ShowDimensionsInTitle - - ShowShellCommandInTitle - - ShowTTYNameInTitle - - ShowWindowSettingsNameInTitle - - TerminalType - xterm-256color - TextBoldColor - - YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS - AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECYw - LjUwNTk5MTkzNTcgMC41NjQ4NTgzNzcgMC41NjM2MzY1NDE0ABABgALSEBESE1okY2xh - c3NuYW1lWCRjbGFzc2VzV05TQ29sb3KiEhRYTlNPYmplY3RfEA9OU0tleWVkQXJjaGl2 - ZXLRFxhUcm9vdIABCBEaIy0yNztBSE5bYouNj5SfqLCzvM7R1gAAAAAAAAEBAAAAAAAA - ABkAAAAAAAAAAAAAAAAAAADY - - TextColor - - YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS - AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw - LjQ0MDU4MDI0ODggMC41MDk2MjkzMDkyIDAuNTE2ODU3OTgxNwAQAYAC0hAREhNaJGNs - YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp - dmVy0RcYVHJvb3SAAQgRGiMtMjc7QUhOW2KMjpCVoKmxtL3P0tcAAAAAAAABAQAAAAAA - AAAZAAAAAAAAAAAAAAAAAAAA2Q== - - UseBrightBold - - blackColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmg7JNIT2DkvUjPoO+F0s+AYY= - - blueColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmgyqcAj6DtOHsPoO+RUg/AYY= - - brightBlackColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmg+ZzgjyDs44BPoNahyM+AYY= - - brightBlueColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmg7yT4T6DEXcCP4POUAQ/AYY= - - brightCyanColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmg7CIAT+Dj5oQP4N8ShA/AYY= - - brightGreenColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmgzyujT6DFZy2PoOYFsQ+AYY= - - brightMagentaColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmgxMjsj6D+uazPoNkyTc/AYY= - - brightRedColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmgyfkPT+D/15aPoMgl5Y9AYY= - - brightWhiteColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmg49LfT+D0Dt1P4MGM10/AYY= - - brightYellowColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmg1MTpj6DeHnQPoPQg+A+AYY= - - cyanColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmg4VRFj6DfyESP4PkZwY/AYY= - - greenColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmg9lI5j6DIYkKP4PVjKU8AYY= - - magentaColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmg/4CRz+DBTzdPYMgzt4+AYY= - - name - Solarized Dark - redColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmg6i7UT+DUATePYMl2hA+AYY= - - shellExitAction - 1 - type - Window Settings - whiteColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmgzqGaj+D2tdjP4NYPUw/AYY= - - yellowColour - - BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU0NvbG9yAISECE5TT2JqZWN0AIWEAWMBhARm - ZmZmg0DAJT+DB17vPoM4Y8A8AYY= - - - diff --git a/src/os/preferences/macos/init.sh b/src/os/preferences/macos/init.sh new file mode 100755 index 0000000..8830005 --- /dev/null +++ b/src/os/preferences/macos/init.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +cd "$(dirname "${BASH_SOURCE[0]}")" \ + && . "../../utils.sh" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# On modern macOS (Catalina+) most `defaults write` commands silently +# no-op unless the terminal has "Full Disk Access". This block detects +# that and walks the user through granting it. +# +# https://lapcatsoftware.com/articles/containers.html + +if ! ls "$HOME/Library/Containers/com.apple.Safari/Data" &> /dev/null; then + printf "\n" + + open "x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles" + + ask "Please grant the terminal \"Full Disk Access\" and then press any key to continue. " +fi + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Close any open "System Settings" panes so they don't override the +# preferences we are about to change. + +./close_system_preferences_panes.applescript diff --git a/src/os/preferences/macos/main.sh b/src/os/preferences/macos/main.sh index a64c894..40cbb89 100755 --- a/src/os/preferences/macos/main.sh +++ b/src/os/preferences/macos/main.sh @@ -4,12 +4,7 @@ cd "$(dirname "${BASH_SOURCE[0]}")" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Close any open `System Preferences` panes in order to -# avoid overriding the preferences that are being changed. - -./close_system_preferences_panes.applescript - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +./init.sh ./app_store.sh ./chrome.sh @@ -22,7 +17,6 @@ cd "$(dirname "${BASH_SOURCE[0]}")" ./photos.sh ./safari.sh ./security_and_privacy.sh -./terminal.sh ./textedit.sh ./trackpad.sh ./ui_and_ux.sh diff --git a/src/os/preferences/macos/set_terminal_theme.applescript b/src/os/preferences/macos/set_terminal_theme.applescript deleted file mode 100755 index 5c1ff6f..0000000 --- a/src/os/preferences/macos/set_terminal_theme.applescript +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/osascript - -tell application "Terminal" - - local allOpenedWindows - local initialOpenedWindows - local windowID - - set themeName to "Solarized Dark" - - (* Store the IDs of all the open terminal windows. *) - set initialOpenedWindows to id of every window - - (* Open the custom theme so that it gets added to the list - of available terminal themes (note: this will open two - additional terminal windows). *) - do shell script "open '" & themeName & ".terminal'" - - (* Wait a little bit to ensure that the custom theme is added. *) - delay 1 - - (* Set the custom theme as the default terminal theme. *) - set default settings to settings set themeName - - (* Get the IDs of all the currently opened terminal windows. *) - set allOpenedWindows to id of every window - - repeat with windowID in allOpenedWindows - - (* Close the additional windows that were opened in order - to add the custom theme to the list of terminal themes. *) - if initialOpenedWindows does not contain windowID then - close (every window whose id is windowID) - - (* Change the theme for the initial opened terminal windows - to remove the need to close them in order for the custom - theme to be applied. *) - else - set current settings of tabs of (every window whose id is windowID) to settings set themeName - end if - - end repeat - -end tell diff --git a/src/os/preferences/macos/terminal.sh b/src/os/preferences/macos/terminal.sh deleted file mode 100755 index 45cd812..0000000 --- a/src/os/preferences/macos/terminal.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -cd "$(dirname "${BASH_SOURCE[0]}")" \ - && . "../../utils.sh" - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -print_in_purple "\n Terminal\n\n" - -execute "defaults write com.apple.terminal FocusFollowsMouse -string true" \ - "Make the focus automatically follow the mouse" - -execute "defaults write com.apple.terminal SecureKeyboardEntry -bool true" \ - "Enable 'Secure Keyboard Entry'" - -execute "defaults write com.apple.Terminal ShowLineMarks -int 0" \ - "Hide line marks" - -execute "defaults write com.apple.terminal StringEncodings -array 4" \ - "Only use UTF-8" - -execute "./set_terminal_theme.applescript" \ - "Set custom terminal theme" - -# Ensure the Touch ID is used when `sudo` is required. - -if ! grep -q "pam_tid.so" "/etc/pam.d/sudo"; then - execute "sudo sh -c 'echo \"auth sufficient pam_tid.so\" >> /etc/pam.d/sudo'" \ - "Use Touch ID to authenticate sudo" -fi diff --git a/src/os/preferences/macos/ui_and_ux.sh b/src/os/preferences/macos/ui_and_ux.sh index 127b6f7..9a0e8ce 100755 --- a/src/os/preferences/macos/ui_and_ux.sh +++ b/src/os/preferences/macos/ui_and_ux.sh @@ -39,8 +39,8 @@ execute "defaults write com.apple.screencapture type -string 'png'" \ "Save screenshots as PNGs" execute "defaults write com.apple.screensaver askForPassword -int 1 && \ - defaults write com.apple.screensaver askForPasswordDelay -int 0"\ - "Require password immediately after into sleep or screen saver mode" + defaults write com.apple.screensaver askForPasswordDelay -int 0" \ + "Require password immediately after entering sleep or screen saver mode" execute "defaults write -g AppleFontSmoothing -int 2" \ "Enable subpixel font rendering on non-Apple LCDs" @@ -64,42 +64,52 @@ execute "defaults write -g NSUseAnimatedFocusRing -bool false" \ "Disable the over-the-top focus ring animation" execute "defaults write -g NSWindowResizeTime -float 0.001" \ - "Accelerated playback when adjusting the window size." + "Accelerate window resize playback" execute "defaults write -g PMPrintingExpandedStateForPrint -bool true" \ "Expand print panel by default" execute "defaults write -g QLPanelAnimationDuration -float 0" \ - "Disable opening a Quick Look window animations." + "Disable Quick Look window opening animations" execute "defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false" \ "Disable resume system-wide" -execute "sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string 'Laptop' && \ - sudo scutil --set ComputerName 'laptop' && \ - sudo scutil --set HostName 'laptop' && \ - sudo scutil --set LocalHostName 'laptop'" \ - "Set computer name" - -execute "sudo systemsetup -setrestartfreeze on" \ +execute "sudo systemsetup -setrestartfreeze on &> /dev/null" \ "Restart automatically if the computer freezes" -execute "sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 0 && \ - sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist && \ - sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist" \ - "Turn Bluetooth off" - -execute "for domain in ~/Library/Preferences/ByHost/com.apple.systemuiserver.*; do - sudo defaults write \"\${domain}\" dontAutoLoad -array \ - '/System/Library/CoreServices/Menu Extras/TimeMachine.menu' \ - '/System/Library/CoreServices/Menu Extras/Volume.menu' - done \ - && sudo defaults write com.apple.systemuiserver menuExtras -array \ - '/System/Library/CoreServices/Menu Extras/Bluetooth.menu' \ - '/System/Library/CoreServices/Menu Extras/AirPort.menu' \ - '/System/Library/CoreServices/Menu Extras/Battery.menu' \ - '/System/Library/CoreServices/Menu Extras/Clock.menu' - " \ - "Hide Time Machine and Volume icons from the menu bar" +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# macOS Sequoia / Tahoe (15+/26+) additions +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +execute "defaults write com.apple.WindowManager GloballyEnabled -bool false" \ + "Disable Stage Manager" + +execute "defaults write com.apple.WindowManager EnableStandardClickToShowDesktop -bool false" \ + "Disable click-wallpaper-to-reveal-desktop" + +execute "defaults write com.apple.WindowManager StandardHideWidgets -bool true && \ + defaults write com.apple.WindowManager StageManagerHideWidgets -bool true" \ + "Hide desktop widgets" + +execute "defaults write com.apple.AppleMultitouchTrackpad ActuationStrength -int 0" \ + "Set trackpad click to 'light'" killall "SystemUIServer" &> /dev/null + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Opt-in only (commented out) โ€” uncomment if you want these behaviors +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# +# # Force computer name (annoying if you have multiple machines). +# execute "sudo scutil --set ComputerName 'laptop' && \ +# sudo scutil --set HostName 'laptop' && \ +# sudo scutil --set LocalHostName 'laptop'" \ +# "Set computer name" +# +# # Force Bluetooth off at every setup run (you almost never want this). +# execute "sudo defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 0 && \ +# sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist && \ +# sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist" \ +# "Turn Bluetooth off" + diff --git a/src/os/setup.sh b/src/os/setup.sh index d7fb649..f71fb52 100755 --- a/src/os/setup.sh +++ b/src/os/setup.sh @@ -159,7 +159,11 @@ extract() { verify_os() { - declare -r MINIMUM_MACOS_VERSION="10.10" + # Apple Silicon + Tahoe (macOS 26) or newer. These dotfiles use + # WindowManager (Stage Manager), modern Safari, and other keys + # that don't exist on older macOS. + + declare -r MINIMUM_MACOS_VERSION="26.0" local os_name="$(get_os)" local os_version="$(get_os_version)" @@ -241,6 +245,10 @@ main() { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ./link_vscode_configs.sh + + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ./create_local_config_files.sh # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/shell/bash_aliases b/src/shell/bash_aliases index 70ba407..99d51e7 100755 --- a/src/shell/bash_aliases +++ b/src/shell/bash_aliases @@ -29,6 +29,8 @@ alias ch="history -c && > ~/.bash_history" alias d="cd ~/Desktop" alias e="vim --" alias g="git" +alias gs="git status" +alias lg="lazygit" alias ip="dig +short myip.opendns.com @resolver1.opendns.com" alias ll="ls -l" alias m="man" @@ -39,45 +41,52 @@ alias path='printf "%b\n" "${PATH//:/\\n}"' alias q="exit" alias t="tmux" alias y="yarn" +alias pn="pnpm" alias pa="php artisan" alias co="composer" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -alias ip="dig +short myip.opendns.com @resolver1.opendns.com" -alias emojis="open http://www.emoji-cheat-sheet.com/" +alias emojis="open https://emojipedia.org/" alias whysoslow="top -o vsize" alias week='date +%V' # Get week number -alias update='sudo softwareupdate -i -a; brew update; brew upgrade; brew upgrade --cask; brew cleanup; npm install npm -g; npm update -g; sudo gem update --system; sudo gem update; composer global self-update; composer global update' -alias shrug='echo "ยฏ\_(ใƒ„)_/ยฏ" | pbcopy && echo "ยฏ\_(ใƒ„)_/ยฏ copied to clipboard."' +alias update='sudo softwareupdate --install --all \ + && brew update \ + && brew upgrade \ + && brew cleanup \ + && mas upgrade \ + && npm update -g \ + && pnpm update -g' +alias shrug='printf "%s" "ยฏ\_(ใƒ„)_/ยฏ" | pbcopy && echo "ยฏ\_(ใƒ„)_/ยฏ copied to clipboard."' alias cleanup_dsstore="find . -name '*.DS_Store' -type f -ls -delete" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# PHP / Laravel + function laravel() { composer create-project laravel/laravel "$@" --prefer-dist } alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail' +# Tail latest Laravel log +alias tl='tail -f `ls -1td ./storage/logs/*| /usr/bin/head -n1`' + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function dc() { - docker "$@" -} -function dcc() { - docker-compose "$@" -} +# Docker + +alias dc="docker compose" + function dcr() { - docker-compose run --rm "$1" + docker compose run --rm "$1" } + function deb() { docker exec -it "$1" bash } -# tail laravel log -alias tl='tail -f `ls -1td ./storage/logs/*| /usr/bin/head -n1`' - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Load OS specific configs. diff --git a/src/shell/bash_exports b/src/shell/bash_exports index 8a8a31e..59b49ab 100755 --- a/src/shell/bash_exports +++ b/src/shell/bash_exports @@ -105,3 +105,33 @@ fi # Make Python use UTF-8 encoding for output to stdin/stdout/stderr. export PYTHONIOENCODING="UTF-8" + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# pnpm +# +# Add the pnpm global store to PATH idempotently so re-sourcing this +# file does not duplicate entries. + +export PNPM_HOME="$HOME/Library/pnpm" +case ":$PATH:" in + *":$PNPM_HOME:"*) ;; + *) export PATH="$PNPM_HOME:$PATH" ;; +esac + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# Shell integrations for modern CLI tools (loaded only if installed). + +if command -v zoxide &> /dev/null; then + eval "$(zoxide init bash)" +fi + +if command -v direnv &> /dev/null; then + eval "$(direnv hook bash)" +fi + +if command -v fzf &> /dev/null; then + # fzf >= 0.48 ships its own bash integration. + eval "$(fzf --bash 2> /dev/null)" +fi diff --git a/src/tmux/tmux.conf b/src/tmux/tmux.conf index 87e2986..92b8111 100644 --- a/src/tmux/tmux.conf +++ b/src/tmux/tmux.conf @@ -34,13 +34,6 @@ bind C-a send-prefix # Use vim keybindings in copy mode setw -g mode-keys vi -# Workaround for accessing macOS' pasteboard -# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard - -if-shell \ - 'test "$(uname -s)" = Darwin' \ - 'set-option -g default-command "exec reattach-to-user-namespace -l $SHELL"' - # Remap the copy & paste keys to work as in vim unbind [ bind Escape copy-mode @@ -113,8 +106,11 @@ setw -g window-status-current-style fg=black,bg=yellow,dim # | Visual Styling | # ---------------------------------------------------------------------- -# Display things in 256 colors -set -g default-terminal "screen-256color" +# Display things in 256 colors with truecolor (RGB) support. +set -g default-terminal "tmux-256color" +set -ag terminal-overrides ",xterm-256color:RGB" +set -ag terminal-overrides ",xterm-ghostty:RGB" +set -ag terminal-overrides ",alacritty:RGB" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/vim/vim/pack/minpac/opt/minpac b/src/vim/vim/pack/minpac/opt/minpac deleted file mode 160000 index fdea308..0000000 --- a/src/vim/vim/pack/minpac/opt/minpac +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fdea308eaa3b3e035f357d2239d10e9811191784 diff --git a/src/vim/vim/pack/minpac/opt/vim-polyglot b/src/vim/vim/pack/minpac/opt/vim-polyglot deleted file mode 160000 index bc8a81d..0000000 --- a/src/vim/vim/pack/minpac/opt/vim-polyglot +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bc8a81d3592dab86334f27d1d43c080ebf680d42 diff --git a/src/vim/vim/pack/minpac/opt/webapi-vim b/src/vim/vim/pack/minpac/opt/webapi-vim deleted file mode 160000 index 70c49ad..0000000 --- a/src/vim/vim/pack/minpac/opt/webapi-vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 70c49ada7827d3545a65cbdab04c5c89a3a8464e diff --git a/src/vim/vim/pack/minpac/start/ctrlp.vim b/src/vim/vim/pack/minpac/start/ctrlp.vim deleted file mode 160000 index 8b4a952..0000000 --- a/src/vim/vim/pack/minpac/start/ctrlp.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8b4a9523632049b3b373de1233bef346073b8982 diff --git a/src/vim/vim/pack/minpac/start/delimitmate b/src/vim/vim/pack/minpac/start/delimitmate deleted file mode 160000 index 537a1da..0000000 --- a/src/vim/vim/pack/minpac/start/delimitmate +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 537a1da0fa5eeb88640425c37e545af933c56e1b diff --git a/src/vim/vim/pack/minpac/start/editorconfig-vim b/src/vim/vim/pack/minpac/start/editorconfig-vim deleted file mode 160000 index 7f4e4df..0000000 --- a/src/vim/vim/pack/minpac/start/editorconfig-vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7f4e4dfc58c480d154116614e616d90aac77204d diff --git a/src/vim/vim/pack/minpac/start/emmet-vim b/src/vim/vim/pack/minpac/start/emmet-vim deleted file mode 160000 index def5d57..0000000 --- a/src/vim/vim/pack/minpac/start/emmet-vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit def5d57a1ae5afb1b96ebe83c4652d1c03640f4d diff --git a/src/vim/vim/pack/minpac/start/neocomplcache.vim b/src/vim/vim/pack/minpac/start/neocomplcache.vim deleted file mode 160000 index c46106f..0000000 --- a/src/vim/vim/pack/minpac/start/neocomplcache.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c46106f6b9af0f224a78bba03caed73e1ddebebc diff --git a/src/vim/vim/pack/minpac/start/neosnippet b/src/vim/vim/pack/minpac/start/neosnippet deleted file mode 160000 index b7c241f..0000000 --- a/src/vim/vim/pack/minpac/start/neosnippet +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b7c241fb5737c50bf09cf1e26298492c3fc0457a diff --git a/src/vim/vim/pack/minpac/start/neosnippet-snippets b/src/vim/vim/pack/minpac/start/neosnippet-snippets deleted file mode 160000 index 725c989..0000000 --- a/src/vim/vim/pack/minpac/start/neosnippet-snippets +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 725c989f18e9c134cddd63a7c6b15bed5c244657 diff --git a/src/vim/vim/pack/minpac/start/nerdtree b/src/vim/vim/pack/minpac/start/nerdtree deleted file mode 160000 index fc85a6f..0000000 --- a/src/vim/vim/pack/minpac/start/nerdtree +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fc85a6f07c2cd694be93496ffad75be126240068 diff --git a/src/vim/vim/pack/minpac/start/rainbow_levels.vim b/src/vim/vim/pack/minpac/start/rainbow_levels.vim deleted file mode 160000 index e8badb7..0000000 --- a/src/vim/vim/pack/minpac/start/rainbow_levels.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e8badb7906b63d3639b840484e4370194de2b857 diff --git a/src/vim/vim/pack/minpac/start/syntastic b/src/vim/vim/pack/minpac/start/syntastic deleted file mode 160000 index 8d5e37c..0000000 --- a/src/vim/vim/pack/minpac/start/syntastic +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8d5e37c29cf5952fbf300b9230bffe424c61a488 diff --git a/src/vim/vim/pack/minpac/start/syntastic-local-eslint.vim b/src/vim/vim/pack/minpac/start/syntastic-local-eslint.vim deleted file mode 160000 index fd5da4d..0000000 --- a/src/vim/vim/pack/minpac/start/syntastic-local-eslint.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fd5da4df8ba032be411630b81770739f9846b078 diff --git a/src/vim/vim/pack/minpac/start/tabular b/src/vim/vim/pack/minpac/start/tabular deleted file mode 160000 index 339091a..0000000 --- a/src/vim/vim/pack/minpac/start/tabular +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 339091ac4dd1f17e225fe7d57b48aff55f99b23a diff --git a/src/vim/vim/pack/minpac/start/targets.vim b/src/vim/vim/pack/minpac/start/targets.vim deleted file mode 160000 index 642d3a4..0000000 --- a/src/vim/vim/pack/minpac/start/targets.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 642d3a4ce306264b05ea3219920b13ea80931767 diff --git a/src/vim/vim/pack/minpac/start/tcomment_vim b/src/vim/vim/pack/minpac/start/tcomment_vim deleted file mode 160000 index b4930f9..0000000 --- a/src/vim/vim/pack/minpac/start/tcomment_vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b4930f9da28647e5417d462c341013f88184be7e diff --git a/src/vim/vim/pack/minpac/start/tern_for_vim b/src/vim/vim/pack/minpac/start/tern_for_vim deleted file mode 160000 index 994ffbe..0000000 --- a/src/vim/vim/pack/minpac/start/tern_for_vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 994ffbe783da36d67786b6c66a4bf784c5eab300 diff --git a/src/vim/vim/pack/minpac/start/unicode.vim b/src/vim/vim/pack/minpac/start/unicode.vim deleted file mode 160000 index c8aa12b..0000000 --- a/src/vim/vim/pack/minpac/start/unicode.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c8aa12b1e2e1b6254885b12bdb239ce6c885fdb1 diff --git a/src/vim/vim/pack/minpac/start/vim-colors-solarized b/src/vim/vim/pack/minpac/start/vim-colors-solarized deleted file mode 160000 index 528a59f..0000000 --- a/src/vim/vim/pack/minpac/start/vim-colors-solarized +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 528a59f26d12278698bb946f8fb82a63711eec21 diff --git a/src/vim/vim/pack/minpac/start/vim-commentary b/src/vim/vim/pack/minpac/start/vim-commentary deleted file mode 160000 index e87cd90..0000000 --- a/src/vim/vim/pack/minpac/start/vim-commentary +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e87cd90dc09c2a203e13af9704bd0ef79303d755 diff --git a/src/vim/vim/pack/minpac/start/vim-css-color b/src/vim/vim/pack/minpac/start/vim-css-color deleted file mode 160000 index 5687a79..0000000 --- a/src/vim/vim/pack/minpac/start/vim-css-color +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5687a7978bc80263cd03d0a667c2f56890cfb940 diff --git a/src/vim/vim/pack/minpac/start/vim-es6 b/src/vim/vim/pack/minpac/start/vim-es6 deleted file mode 160000 index 3f080e3..0000000 --- a/src/vim/vim/pack/minpac/start/vim-es6 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3f080e31dc712ca52e4cb443b5e9cbfd543ba73c diff --git a/src/vim/vim/pack/minpac/start/vim-fugitive b/src/vim/vim/pack/minpac/start/vim-fugitive deleted file mode 160000 index 309c681..0000000 --- a/src/vim/vim/pack/minpac/start/vim-fugitive +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 309c68117eca3a95349093012e5886a184c1812d diff --git a/src/vim/vim/pack/minpac/start/vim-indent-guides b/src/vim/vim/pack/minpac/start/vim-indent-guides deleted file mode 160000 index a1e1390..0000000 --- a/src/vim/vim/pack/minpac/start/vim-indent-guides +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a1e1390c0136e63e813d051de2003bf0ee18ae30 diff --git a/src/vim/vim/pack/minpac/start/vim-javascript-syntax b/src/vim/vim/pack/minpac/start/vim-javascript-syntax deleted file mode 160000 index 7b8e2ee..0000000 --- a/src/vim/vim/pack/minpac/start/vim-javascript-syntax +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7b8e2ee761e5d81f2bff57a728909a7968df098b diff --git a/src/vim/vim/pack/minpac/start/vim-node b/src/vim/vim/pack/minpac/start/vim-node deleted file mode 160000 index ede0477..0000000 --- a/src/vim/vim/pack/minpac/start/vim-node +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ede047791792b9530ba1ae73ed86e9671cdd96b8 diff --git a/src/vim/vim/pack/minpac/start/vim-repeat b/src/vim/vim/pack/minpac/start/vim-repeat deleted file mode 160000 index 24afe92..0000000 --- a/src/vim/vim/pack/minpac/start/vim-repeat +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 24afe922e6a05891756ecf331f39a1f6743d3d5a diff --git a/src/vim/vim/pack/minpac/start/vim-signify b/src/vim/vim/pack/minpac/start/vim-signify deleted file mode 160000 index a05e63b..0000000 --- a/src/vim/vim/pack/minpac/start/vim-signify +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a05e63ba72411977f5087c27c1564c9287bfab66 diff --git a/src/vim/vim/pack/minpac/start/vim-surround b/src/vim/vim/pack/minpac/start/vim-surround deleted file mode 160000 index 3d188ed..0000000 --- a/src/vim/vim/pack/minpac/start/vim-surround +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3d188ed2113431cf8dac77be61b842acb64433d9 diff --git a/src/vim/vim/pack/minpac/start/vim-unimpaired b/src/vim/vim/pack/minpac/start/vim-unimpaired deleted file mode 160000 index 6d44a6d..0000000 --- a/src/vim/vim/pack/minpac/start/vim-unimpaired +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6d44a6dc2ec34607c41ec78acf81657248580bf1 diff --git a/src/vim/vim/pack/minpac/start/vim-xml-runtime b/src/vim/vim/pack/minpac/start/vim-xml-runtime deleted file mode 160000 index 54dd780..0000000 --- a/src/vim/vim/pack/minpac/start/vim-xml-runtime +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 54dd780c8516d97bb861cf771466939319a6a2ce diff --git a/src/vim/vim/snippets/emmet.json b/src/vim/vim/snippets/emmet.json deleted file mode 100644 index 9734917..0000000 --- a/src/vim/vim/snippets/emmet.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "html": { - "snippets": { - "html5": "\n\n\n\t\n\t\n\t\n\n\n\n\t${child}\n\n" - }, - "variables": { - "lang": "en" - } - } -} diff --git a/src/vim/vimrc b/src/vim/vimrc index fdbb001..1a46e89 100644 --- a/src/vim/vimrc +++ b/src/vim/vimrc @@ -2,739 +2,152 @@ " | General Settings | " ---------------------------------------------------------------------- -set nocompatible " Don't make Vim vi-compatibile. - -syntax on " Enable syntax highlighting. +set nocompatible " Don't make Vim vi-compatible. if has('autocmd') filetype plugin indent on - " โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Enable file type detection. - " โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Enable loading of indent file. - " โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Enable loading of plugin files. -endif - -set autoindent " Copy indent to the new line. - -set backspace=indent " โ” -set backspace+=eol " โ”‚ Allow `backspace` -set backspace+=start " โ”˜ in insert mode. - -set backupdir=~/.vim/backups " Set directory for backup files. - -if has('wildignore') - set backupskip=/tmp/* " โ” Don't create backups - set backupskip+=/private/tmp/* " โ”˜ for certain files. endif -set clipboard=unnamed " โ” - " โ”‚ Use the system clipboard -if has('unnamedplus') " โ”‚ as the default register. - set clipboard+=unnamedplus " โ”‚ -endif " โ”˜ - -set cpoptions+=$ " When making a change, don't - " redisplay the line, and instead, - " put a `$` sign at the end of - " the changed text. - if has('syntax') - set colorcolumn=73 " Highlight certain column(s). - set cursorline " Highlight the current line. + syntax on endif -set directory=~/.vim/swaps " Set directory for swap files. set encoding=utf-8 nobomb " Use UTF-8 without BOM. - -if has('cmdline_hist') - set history=5000 " Increase command line history. -endif - -if has('extra_search') - - set hlsearch " Enable search highlighting. - - set incsearch " Highlight search pattern - " as it is being typed. -endif - -set ignorecase " Ignore case in search patterns. - - -set laststatus=2 " Always show the status line. - -set lazyredraw " Do not redraw the screen while - " executing macros, registers - " and other commands that have - " not been typed. - -set listchars=tab:โ–ธ\ " โ” -set listchars+=trail:ยท " โ”‚ Use custom symbols to -set listchars+=eol:โ†ด " โ”‚ represent invisible characters. -set listchars+=nbsp:_ " โ”˜ - -set magic " Enable extended regexp. -" set mouse+=a " Enable mouse support. -set mousehide " Hide mouse pointer while typing. -set noerrorbells " Disable error bells. - -set nojoinspaces " When using the join command, - " only insert a single space - " after a `.`, `?`, or `!`. - -set nomodeline " Disable for security reasons. - " https://github.com/numirias/security/blob/cf4f74e0c6c6e4bbd6b59823aa1b85fa913e26eb/doc/2019-06-04_ace-vim-neovim.md#readme - -set nostartofline " Kept the cursor on the same column. -set number " Show line number. - -if has('linebreak') - set numberwidth=5 " Increase the minimal number of - " columns used for the `line number`. -endif - -set report=0 " Report the number of lines changed. - -if has('cmdline_info') - set ruler " Show cursor position. -endif - -set scrolloff=5 " When scrolling, keep the cursor - " 5 lines below the top and 5 lines - " above the bottom of the screen. - -set shortmess=aAItW " Avoid all the hit-enter prompts. - -if has('cmdline_info') - set showcmd " Show the command being typed. -endif - -set showmode " Show current mode. - -if has('syntax') - set spelllang=en_us " Set the spellchecking language. -endif - -set smartcase " Override `ignorecase` option - " if the search pattern contains - " uppercase characters. - -if has('syntax') - set synmaxcol=2500 " Limit syntax highlighting (this - " avoids the very slow redrawing - " when files contain long lines). -endif - -set tabstop=4 " โ” -set softtabstop=4 " โ”‚ Set global settings. -set shiftwidth=4 " โ”‚ -set expandtab " โ”˜ - -set ttyfast " Enable fast terminal connection. - -if has('persistent_undo') - set undodir=~/.vim/undos " Set directory for undo files. - set undofile " Automatically save undo history. -endif - -if has('virtualedit') - set virtualedit=all " Allow cursor to be anywhere. -endif - -set visualbell " โ” -set noerrorbells " โ”‚ Disable beeping and window flashing. -set t_vb= " โ”˜ https://vim.wikia.com/wiki/Disable_beeping - -if has('wildmenu') - set wildmenu " Enable enhanced command-line -endif " completion (by hitting in - " command mode, Vim will show the - " possible matches just above the - " command line with the first - " match highlighted). -if has('windows') - set winminheight=0 " Allow windows to be squashed. -endif - -" Prevent `Q` in `normal` mode from entering `Ex` mode. -nmap Q +set backspace=indent,eol,start " Allow `backspace` in insert mode. +set clipboard^=unnamed,unnamedplus " Use the system clipboard. " ---------------------------------------------------------------------- -" | Plugins | +" | Display | " ---------------------------------------------------------------------- -" Use `minpac` to manage the Vim plugins. -" https://github.com/k-takata/minpac - -function! InitPlugins() abort - - packadd minpac - - call minpac#init() - call minpac#add('k-takata/minpac', { 'type': 'opt' }) - - call minpac#add('altercation/vim-colors-solarized') - call minpac#add('ap/vim-css-color') - call minpac#add('chrisbra/unicode.vim') - call minpac#add('chrisbra/vim-xml-runtime') - call minpac#add('editorconfig/editorconfig-vim') - call minpac#add('godlygeek/tabular') - call minpac#add('isRuslan/vim-es6') - call minpac#add('jelera/vim-javascript-syntax') - call minpac#add('ctrlpvim/ctrlp.vim') - call minpac#add('marijnh/tern_for_vim', { 'do': ':silent ! cd $HOME/.vim/pack/minpac/start/tern_for_vim && npm i &> /dev/null' }) - call minpac#add('mattn/emmet-vim') - call minpac#add('mattn/webapi-vim', { 'type': 'opt' }) - call minpac#add('mhinz/vim-signify') - call minpac#add('moll/vim-node') - call minpac#add('mtscout6/syntastic-local-eslint.vim') - call minpac#add('nathanaelkane/vim-indent-guides') - call minpac#add('raimondi/delimitmate') - call minpac#add('scrooloose/nerdtree') - call minpac#add('scrooloose/syntastic') - call minpac#add('sheerun/vim-polyglot', { 'type': 'opt' }) - call minpac#add('shougo/neocomplcache.vim') - call minpac#add('shougo/neosnippet') - call minpac#add('shougo/neosnippet-snippets') - call minpac#add('thiagoalessio/rainbow_levels.vim') - call minpac#add('tomtom/tcomment_vim') - call minpac#add('tpope/vim-commentary') - call minpac#add('tpope/vim-fugitive') - call minpac#add('tpope/vim-repeat') - call minpac#add('tpope/vim-surround') - call minpac#add('tpope/vim-unimpaired') - call minpac#add('wellle/targets.vim') - -endfunction - -silent! packadd webapi-vim - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" Define custom commands for managing plugins. - -command! PluginsClean call InitPlugins() | call minpac#clean() -command! PluginsSetup call InitPlugins() | call minpac#update('', { 'do': 'quit! | quit!' }) -command! PluginsStatus call InitPlugins() | call minpac#status() -command! PluginsUpdate call InitPlugins() | call minpac#update('', { 'do': 'call minpac#status() | quit! | quit!' }) - -" ---------------------------------------------------------------------- -" | Plugins - Emmet | -" ---------------------------------------------------------------------- - -" Redefine trigger key. -let g:user_emmet_leader_key="," - -" Only enable normal mode functions. -let g:user_emmet_mode='a' - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +set number " Show line numbers. +set ruler " Show cursor position. +set showcmd " Show partial commands in the status line. +set showmode " Show current mode. +set laststatus=2 " Always show the status line. +set scrolloff=5 " Keep 5 lines of context around cursor. +set sidescrolloff=5 +set lazyredraw " Don't redraw during macros. +set ttyfast " Fast terminal connection. +set shortmess+=I " No intro message. +set noshowmode " Mode is already in the status line. +set splitright " New vertical splits to the right. +set splitbelow " New horizontal splits below. -" Load custom snippets. -if &runtimepath =~ 'webapi-vim' - let g:user_emmet_settings = webapi#json#decode(join(readfile(expand("~/.vim/snippets/emmet.json")), "\n")) +if has('syntax') + set cursorline " Highlight the current line. + set colorcolumn=80 " Visual marker at column 80. endif +" Display invisible characters with `:set list`. +set listchars=tab:โ–ธ\ ,trail:ยท,eol:โ†ด,nbsp:_ " ---------------------------------------------------------------------- -" | Plugins - Indent Guides | +" | Search | " ---------------------------------------------------------------------- -" Set custom indent colors. -" https://github.com/nathanaelkane/vim-indent-guides#setting-custom-indent-colors - -let g:indent_guides_auto_colors = 0 - -autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd - \ guibg=#00323D - \ ctermbg=Magenta - -autocmd VimEnter,Colorscheme * :hi IndentGuidesEven - \ guibg=#073642 - \ ctermbg=DarkMagenta - +set ignorecase " Ignore case in search. +set smartcase " ...unless the pattern has uppercase. +set incsearch " Incremental search. +set hlsearch " Highlight matches. " ---------------------------------------------------------------------- -" | Plugins - Markdown | +" | Indentation | " ---------------------------------------------------------------------- -" Disable Folding. -" https://github.com/plasticboy/vim-markdown#disable-folding - -let g:vim_markdown_folding_disabled=1 - - -" ---------------------------------------------------------------------- -" | Plugins - NeoComplCache | -" ---------------------------------------------------------------------- - -" Enable `neocomplcache` by default. -" https://github.com/Shougo/neocomplcache.vim#installation - -let g:neocomplcache_enable_at_startup=1 - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" Make `Tab` autocomplete. - -inoremap pumvisible() ? "\" : "\" - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" Make `Shift+Tab` insert `Tab` character. - -inoremap - -" ---------------------------------------------------------------------- -" | Plugins - Signify | -" ---------------------------------------------------------------------- - -" Disable Signify by default. -" https://github.com/mhinz/vim-signify - -let g:signify_disable_by_default=1 - +set autoindent +set expandtab " Use spaces, not tabs. +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set shiftround " Round indent to multiple of shiftwidth. " ---------------------------------------------------------------------- -" | Plugins - Syntastic | +" | Files & Persistence | " ---------------------------------------------------------------------- -" Inform Syntastic which checkers to use based on file types. -" https://github.com/scrooloose/syntastic#faq - -let g:syntastic_javascript_checkers = [ 'eslint' ] - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" Disable syntax checking by default. +set hidden " Allow background buffers without saving. +set autoread " Reload file when changed outside vim. +set nobackup " Don't keep backup files alongside. +set nowritebackup +set noswapfile " Disable swap files (use undofile instead). -let g:syntastic_mode_map = { - \ "active_filetypes": [], - \ "mode": "passive", - \ "passive_filetypes": [] -\} +if has('persistent_undo') + set undodir=~/.vim/undos + set undofile +endif +" Keep these directories around for compatibility with anything that +" still wants them (and so the symlink target stays well-formed). +set backupdir=~/.vim/backups +set directory=~/.vim/swaps " ---------------------------------------------------------------------- -" | Helper Functions | +" | UX | " ---------------------------------------------------------------------- -function! GetGitBranchName() - - let branchName = "" - - if exists("g:loaded_fugitive") - let branchName = "[" . fugitive#Head() . "]" - endif - - return branchName - -endfunction - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function! PrettyPrint() - - if ( &filetype == 'json' && (has('python3') || has('python')) ) - %!python -m json.tool - norm! ggVG== - elseif ( &filetype == 'svg' || &filetype == 'xml' ) - set formatexpr=xmlformat#Format() - norm! Vgq - endif - -endfunction - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function! StripBOM() - if has('multi_byte') - set nobomb - endif -endfunction - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function! StripTrailingWhitespaces() - - " Save last search and cursor position. - - let searchHistory = @/ - let cursorLine = line(".") - let cursorColumn = col(".") - - " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " Strip trailing whitespaces. - - %s/\s\+$//e - - " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " Restore previous search history and cursor position. - - let @/ = searchHistory - call cursor(cursorLine, cursorColumn) - - -endfunction - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +set mouse=a " Enable mouse. +set mousehide +set noerrorbells +set visualbell +set t_vb= +set timeoutlen=500 " Faster key sequences. +set updatetime=300 " Faster swap/CursorHold. +set history=5000 -function! ToggleLimits() - - " [51,73] - " - " * Git commit message - " http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html - " - " [81] - " - " * general use - " https://daniel.haxx.se/blog/2020/11/30/i-am-an-80-column-purist/ - - if ( &colorcolumn == "73" ) - set colorcolumn+=51,81 - else - set colorcolumn-=51,81 - endif - -endfunction - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -function! ToggleRelativeLineNumbers() - - if ( &relativenumber == 1 ) - set number - else - set relativenumber - endif +if has('wildmenu') + set wildmenu +endif -endfunction +set wildignore+=*.o,*.obj,*.pyc,*.swp,*.zip +set wildignore+=*/node_modules/*,*/.git/*,*/dist/*,*/build/* +set nomodeline " Disable for security. + " https://github.com/numirias/security/blob/cf4f74e0c6c6e4bbd6b59823aa1b85fa913e26eb/doc/2019-06-04_ace-vim-neovim.md " ---------------------------------------------------------------------- -" | Automatic Commands | +" | Colors | " ---------------------------------------------------------------------- -if has("autocmd") - - " Autocommand Groups. - " http://learnvimscriptthehardway.stevelosh.com/chapters/14.html - - " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " Automatically reload the configurations from - " the `~/.vimrc` file whenever they are changed. - - augroup auto_reload_vim_configs - - autocmd! - autocmd BufWritePost vimrc source $MYVIMRC - - augroup END - - " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " Correctly recognize files. - - augroup correctly_recognize_files - - autocmd! - autocmd BufEnter gitconfig :setlocal filetype=gitconfig - autocmd BufEnter .gitconfig.local :setlocal filetype=gitconfig - - augroup END - - " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " Use relative line numbers. - " http://jeffkreeftmeijer.com/2012/relative-line-numbers-in-vim-for-super-fast-movement/ - - augroup relative_line_numbers - - autocmd! - - " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " Automatically switch to absolute - " line numbers when Vim loses focus. - - autocmd FocusLost * :set number - - " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " Automatically switch to relative - " line numbers when Vim gains focus. - - autocmd FocusGained * :set relativenumber - - " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " Automatically switch to absolute - " line numbers when Vim is in insert mode. - - autocmd InsertEnter * :set number - - " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " Automatically switch to relative - " line numbers when Vim is in normal mode. - - autocmd InsertLeave * :set relativenumber - - - augroup END - - " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " Automatically strip whitespaces when files are saved. - - augroup strip_whitespaces - - " List of file types for which the whitespaces - " should not be removed: - - let excludedFileTypes = [] - - " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " Only strip the whitespaces if the file type is not - " in the excluded list. - - autocmd! - autocmd BufWritePre * if index(excludedFileTypes, &ft) < 0 | - \ :call StripBOM() | - \ :call StripTrailingWhitespaces() - - augroup END - +if has('termguicolors') && ($COLORTERM ==# 'truecolor' || $COLORTERM ==# '24bit') + set termguicolors endif +set background=dark -" ---------------------------------------------------------------------- -" | Color Scheme | -" ---------------------------------------------------------------------- - -set t_Co=256 " Enable full-color support. - -set background=dark " Use colors that look good - " on a dark background. - -" Set custom configurations for when the -" Solarized theme is used from Vim's Terminal mode. -" -" https://github.com/altercation/vim-colors-solarized - -if !has("gui_running") - let g:solarized_contrast = "high" - let g:solarized_termcolors = 256 - let g:solarized_termtrans = 1 - let g:solarized_visibility = "high" -endif - -silent! colorscheme solarized " Use custom color scheme. +silent! colorscheme habamax " Ships with Vim 8.2+; falls back silently. " ---------------------------------------------------------------------- " | Key Mappings | " ---------------------------------------------------------------------- -" Use a different mapleader (default is "\"). - let mapleader = "," -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,* ] Search and replace the word under the cursor. - -nmap * :%s/\<\>// - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,cc] Toggle code comments. -" https://github.com/tomtom/tcomment_vim - -map cc :TComment - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,cr] Calculate result. -" http://vimcasts.org/e/56 - -nmap cr 0yt=A=" - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,cs] Clear search. - -map cs :noh - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,gd] Toggle Git differences. - -map gd :SignifyToggle - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,h ] Show hex dump. - -nmap h :%!xxd - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,l ] Toggle `set list`. - -nmap l :set list! - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,n ] Toggle `set relativenumber`. - -nmap n :call ToggleRelativeLineNumbers() - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,pp] Pretty print - -map pp :call PrettyPrint() - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,rl ] Toggle `RainbowLevels`. - -map rl :RainbowLevelsToggle - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,sb] Strip BOM (Byte Order Mark). - -nmap sb :call StripBOM() - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,sr] Strip carriage returns. - -nmap sr :%s/\r//g - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,sw] Strip trailing whitespace. - -nmap sw :call StripTrailingWhitespaces() - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,t ] Toggle NERDTree. - -map t :NERDTreeToggle - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,ti] Toggle indent. - -nmap ti IndentGuidesToggle - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,tl] Toggle show limits. - -nmap tl :call ToggleLimits() - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,ts] Toggle Syntastic. - -nmap ts :SyntasticToggleMode \| w - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" [,v ] Make the opening of the `.vimrc` file easier. - -nmap v :vsp $MYVIMRC +" Prevent `Q` from entering Ex mode. +nmap Q -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +" Clear search highlight with `,`. +nnoremap :nohlsearch -" [,W ] Sudo write. +" Quick save / quit. +nnoremap w :w +nnoremap q :q -map W :w !sudo tee % +" Toggle line numbers and invisible characters. +nnoremap n :set number! +nnoremap l :set list! +" Window navigation with hjkl + ctrl. +nnoremap h +nnoremap j +nnoremap k +nnoremap l " ---------------------------------------------------------------------- -" | Status Line | +" | Local overrides | " ---------------------------------------------------------------------- -" Terminal types: -" -" 1) term (normal terminals, e.g.: vt100, xterm) -" 2) cterm (color terminals, e.g.: MS-DOS console, color-xterm) -" 3) gui (GUIs) - -highlight ColorColumn - \ term=NONE - \ cterm=NONE ctermbg=237 ctermfg=NONE - \ gui=NONE guibg=#073642 guifg=NONE - -highlight CursorLine - \ term=NONE - \ cterm=NONE ctermbg=235 ctermfg=NONE - \ gui=NONE guibg=#073642 guifg=NONE - -highlight CursorLineNr - \ term=bold - \ cterm=bold ctermbg=NONE ctermfg=178 - \ gui=bold guibg=#073642 guifg=Orange - -highlight LineNr - \ term=NONE - \ cterm=NONE ctermfg=241 ctermbg=NONE - \ gui=NONE guifg=#839497 guibg=#073642 - -highlight User1 - \ term=NONE - \ cterm=NONE ctermbg=237 ctermfg=Grey - \ gui=NONE guibg=#073642 guifg=#839496 - -" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -set statusline= -set statusline+=%1* " User1 highlight -set statusline+=\ [%n] " Buffer number -set statusline+=\ %{GetGitBranchName()} " Git branch name -set statusline+=\ [%f] " File path -set statusline+=%m " Modified flag -set statusline+=%r " Readonly flag -set statusline+=%h " Help file flag -set statusline+=%w " Preview window flag -set statusline+=%y " File type -set statusline+=[ -set statusline+=%{&ff} " File format -set statusline+=: -set statusline+=%{strlen(&fenc)?&fenc:'none'} " File encoding -set statusline+=] -set statusline+=%= " Left/Right separator -set statusline+=%c " File encoding -set statusline+=, -set statusline+=%l " Current line number -set statusline+=/ -set statusline+=%L " Total number of lines -set statusline+=\ (%P)\ " Percent through file - -" Example result: -" -" [1] [main] [vim/vimrc][vim][unix:utf-8] 17,238/381 (59%) - - -" ---------------------------------------------------------------------- -" | Local Settings | -" ---------------------------------------------------------------------- - -" Load local settings if they exist. -" -" [!] The following needs to remain at the end of this file in -" order to allow any of the above settings to be overwritten -" by the local ones. - -if filereadable(glob("~/.vimrc.local")) +" Load `~/.vimrc.local` last so it can override anything above. +if filereadable(expand('~/.vimrc.local')) source ~/.vimrc.local endif diff --git a/src/vscode/keybindings.json b/src/vscode/keybindings.json new file mode 100644 index 0000000..8e86069 --- /dev/null +++ b/src/vscode/keybindings.json @@ -0,0 +1,26 @@ +// Shared keybindings for VS Code and Cursor. +[ + { + "key": "alt+enter", + "command": "editor.action.showContextMenu", + "when": "editorTextFocus" + }, + { + "key": "shift+f10", + "command": "-editor.action.showContextMenu", + "when": "editorTextFocus" + }, + { + "key": "ctrl+o", + "command": "extension.jumpy-line" + }, + { + "key": "cmd+i", + "command": "composerMode.agent" + }, + { + "key": "alt+cmd+s", + "command": "workbench.action.toggleUnifiedSidebarFromKeyboard", + "when": "!isAuxiliaryWindowFocusedContext" + } +] diff --git a/src/vscode/settings.json b/src/vscode/settings.json new file mode 100644 index 0000000..bdaf98e --- /dev/null +++ b/src/vscode/settings.json @@ -0,0 +1,88 @@ +{ + // Block CPE mandate (CPENG-706). Required security keys โ€” do not remove. + "block.comment": "Three liveshare configs (liveshare.guestApprovalRequired, liveshare.anonymousGuestApproval, and liveshare.shareExternalFiles) are a mandatory security requirement which must be met (CPENG-706). Please leave them as-is.", + "liveshare.anonymousGuestApproval": "reject", + "liveshare.guestApprovalRequired": true, + "liveshare.shareExternalFiles": false, + + // Editor + + "editor.fontFamily": "FiraCode-Retina, Menlo, Monaco, monospace", + "editor.fontLigatures": true, + "editor.formatOnPaste": true, + "editor.formatOnSave": true, + "editor.formatOnType": true, + "editor.tabSize": 2, + + // Workbench + + "workbench.colorTheme": "Cobalt Next Dark", + "window.autoDetectColorScheme": false, + "window.systemColorTheme": "dark", + "extensions.ignoreRecommendations": true, + "vsicons.dontShowNewVersionMessage": true, + + // Diff + + "diffEditor.ignoreTrimWhitespace": false, + + // Terminal + + "terminal.integrated.fontFamily": "monospace", + + // Git / GitHub + + "git.autofetch": true, + "githubPullRequests.terminalLinksHandler": "github", + + // TypeScript + + "typescript.tsserver.maxTsServerMemory": 8144, + "typescript.tsserver.nodePath": "node", + + // ESLint / Prettier + + "eslint.nodePath": "/opt/homebrew/lib/node_modules", + "eslint.validate": ["glimmer-ts", "glimmer-js"], + "prettier.documentSelectors": ["**/*.gts", "**/*.gjs"], + + // Per-language overrides + + "[glimmer-js]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.foldingStrategy": "indentation" + }, + "[glimmer-ts]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.foldingStrategy": "indentation" + }, + "[dockercompose]": { + "editor.insertSpaces": true, + "editor.tabSize": 2, + "editor.autoIndent": "advanced", + "editor.quickSuggestions": { + "other": true, + "comments": false, + "strings": true + }, + "editor.defaultFormatter": "redhat.vscode-yaml" + }, + "[github-actions-workflow]": { + "editor.defaultFormatter": "redhat.vscode-yaml" + }, + + // CircleCI + + "circleci.hostUrl": "", + "circleci.notifications.mute": true, + + // Cursor-specific (silently ignored by VS Code) + + "cursor.windowSwitcher.sidebarHoverCollapsed": true, + + // VS Code-specific (silently ignored by Cursor) + + "claudeCode.preferredLocation": "panel", + "react-native-tools.networkInspector.consoleLogsColorTheme": "Dark", + "settingsSync.ignoredExtensions": [] +}