diff --git a/Makefile b/Makefile index 892c680..a3aa79f 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ SYMLINK_DIRS := \ tmux \ vim -export __fish_config_dir := $(shell fish -c 'echo $$__fish_config_dir') +export __fish_config_dir := ${HOME}/.config/fish asdf: ## Installs asdf plugins. Usage: `make asdf`. $(info Installing asdf plugins) @@ -89,16 +89,16 @@ link: ## Symlinks config files. Usage: `make link`. $(info Linking config files) @brew list stow > /dev/null 2>&1 || brew install stow @for dir in $(SYMLINK_DIRS); do \ - stow --verbose $$dir; \ + stow --verbose --no-folding $$dir; \ done mac: ## Applies new macOS settings. Usage: `make mac`. $(info Setting new macOS defaults) - @./scripts/set-macos-defaults.fish + @./scripts/set-macos-defaults.sh mac-reset: ## Resets macOS defaults. Usage: `make mac-reset`. $(info Resetting macOS defaults) - @./scripts/reset-macos-defaults.fish + @./scripts/reset-macos-defaults.sh omz: ## Installs Oh My Zsh. Usage: `make omz`. $(info Installing Oh My Zsh) @@ -108,6 +108,6 @@ omz: ## Installs Oh My Zsh. Usage: `make omz`. sh -c "$$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; \ fi -setup: chip mac brew asdf omz dracula fonts link ## Symlinks config files and installs tools. Usage: `make setup`. +setup: chip mac link brew asdf omz dracula fonts ## Symlinks config files and installs tools. Usage: `make setup`. .DEFAULT_GOAL := help diff --git a/README.md b/README.md index 49a6e4f..a1d934c 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ ![Screenshot of my shell prompt](https://user-images.githubusercontent.com/13588399/248551301-5a08c7ba-de5c-4e3b-aafb-4dfaa27fcccd.png) -My personal dotfiles for a `fish` shell on an ARM-based Mac, including essential tools and opinionated settings. You -probably don't want to adopt these wholesale, but feel free to take what you like. +These are my personal dotfiles for a `fish` shell on an ARM-based Mac, including essential tools and opinionated +settings. ## 🧭 Prerequisites @@ -31,8 +31,9 @@ git clone https://github.com/mbd-s/dotfiles.git ~/dotfiles cd ~/dotfiles ``` -The setup script bootstraps a new Mac. It will symlink the config files and install a bunch of tools (iTerm2, Visual -Studio Code, Go, Terraform, Starship, etc.) via Homebrew and [asdf](https://github.com/asdf-vm/asdf): +The setup script bootstraps a fresh installation of macOS. It will set sane defaults, symlink config files, and install +a bunch of tools (iTerm2, Visual Studio Code, Go, Terraform, Starship, etc.) via Homebrew and +[asdf](https://github.com/asdf-vm/asdf): ```shell make setup @@ -83,22 +84,12 @@ files are ignored by `git`.) The common packages are installed in any case. ### iTerm2 -#### Profile - 1. Open iTerm2 2. Select `iTerm2 > Preferences` 3. Select `Profiles` 4. Select the `Other Actions...` dropdown menu and click `Import JSON profiles...` 5. Choose the profile you want to use from the ones in `$DOTFILES/iterm/` -#### Key mappings - -1. Open iTerm2 -2. Select `iTerm2 > Preferences` -3. Select `Profiles`, then `Keys` -4. Select the `Presets...` dropdown menu and click `Import...` -5. Choose `$DOTFILES/iterm/custom.itermkeymap` - ### Visual Studio Code I find it's best to manage your VS Code settings with profiles and settings sync. The config here is just for reference. diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index 5fed57e..a645961 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -56,11 +56,6 @@ if command -v starship >/dev/null starship init fish | source end -# Configure 1password-cli -if command -v op >/dev/null - source ~/.config/op/plugins.sh -end - # Configure fzf if command -v fzf >/dev/null fzf --fish | source diff --git a/iterm2/custom.itermkeymap b/iterm2/custom.itermkeymap deleted file mode 100644 index 5013572..0000000 --- a/iterm2/custom.itermkeymap +++ /dev/null @@ -1 +0,0 @@ -{"Key Mappings":{"0xf700-0x260000":{"Text":"[1;6A","Action":10},"0x37-0x40000":{"Text":"0x1f","Action":11},"0x32-0x40000":{"Text":"0x00","Action":11},"0xf709-0x20000":{"Text":"[17;2~","Action":10},"0xf70c-0x20000":{"Text":"[20;2~","Action":10},"0xf729-0x20000":{"Text":"[1;2H","Action":10},"0xf72b-0x40000":{"Text":"[1;5F","Action":10},"0xf705-0x20000":{"Text":"[1;2Q","Action":10},"0xf703-0x260000":{"Text":"[1;6C","Action":10},"0xf700-0x220000":{"Text":"[1;2A","Action":10},"0xf701-0x280000":{"Text":"0x1b 0x1b 0x5b 0x42","Action":11},"0x38-0x40000":{"Text":"0x7f","Action":11},"0x33-0x40000":{"Text":"0x1b","Action":11},"0xf703-0x220000":{"Text":"[1;2C","Action":10},"0xf701-0x240000":{"Text":"[1;5B","Action":10},"0xf70d-0x20000":{"Text":"[21;2~","Action":10},"0xf702-0x260000":{"Text":"[1;6D","Action":10},"0xf729-0x40000":{"Text":"[1;5H","Action":10},"0xf706-0x20000":{"Text":"[1;2R","Action":10},"0x34-0x40000":{"Text":"0x1c","Action":11},"0xf700-0x280000":{"Text":"0x1b 0x1b 0x5b 0x41","Action":11},"0x2d-0x40000":{"Text":"0x1f","Action":11},"0xf70e-0x20000":{"Text":"[23;2~","Action":10},"0xf702-0x220000":{"Text":"[1;2D","Action":10},"0xf703-0x280000":{"Text":"f","Action":10},"0xf700-0x240000":{"Text":"[1;5A","Action":10},"0xf707-0x20000":{"Text":"[1;2S","Action":10},"0xf70a-0x20000":{"Text":"[18;2~","Action":10},"0x35-0x40000":{"Text":"0x1d","Action":11},"0xf70f-0x20000":{"Text":"[24;2~","Action":10},"0xf703-0x240000":{"Text":"[1;5C","Action":10},"0xf701-0x260000":{"Text":"[1;6B","Action":10},"0xf702-0x280000":{"Text":"b","Action":10},"0xf72b-0x20000":{"Text":"[1;2F","Action":10},"0x36-0x40000":{"Text":"0x1e","Action":11},"0xf708-0x20000":{"Text":"[15;2~","Action":10},"0xf701-0x220000":{"Text":"[1;2B","Action":10},"0xf70b-0x20000":{"Text":"[19;2~","Action":10},"0xf702-0x240000":{"Text":"[1;5D","Action":10},"0xf704-0x20000":{"Text":"[1;2P","Action":10}},"Touch Bar Items":[]} diff --git a/scripts/reset-macos-defaults.fish b/scripts/reset-macos-defaults.sh similarity index 60% rename from scripts/reset-macos-defaults.fish rename to scripts/reset-macos-defaults.sh index 52be39f..3f18bdc 100755 --- a/scripts/reset-macos-defaults.fish +++ b/scripts/reset-macos-defaults.sh @@ -1,8 +1,8 @@ -#!/usr/bin/env fish +#!/bin/bash sudo -v -Echo $GREEN"• Don't show hidden files in the Finder" +echo "• Don't show hidden files in the Finder" defaults write com.apple.finder AppleShowAllFiles false echo "• Hide all filename extensions" @@ -18,7 +18,7 @@ echo "• Enable warning before emptying the Trash" defaults write com.apple.finder WarnOnEmptyTrash -bool true echo "• Always show scroll bars" -defaults write -g AppleShowScrollBars -string Always +defaults write -globalDomain AppleShowScrollBars -string Always echo "• Click in the scroll bar to jump to the next page" defaults write -globalDomain AppleScrollerPagingBehavior -bool false @@ -29,25 +29,26 @@ defaults write com.apple.dock autohide -bool false echo "• Display recent applications in the Dock" defaults write com.apple.dock show-recents -bool true -echo $YELLOW"• Resetting the default Finder location to the virtual Recents folder has to be done manually. Open Finder settings, select \"Sidebar\", and check \"Recents.\""$NORMAL +echo "• Resetting the default Finder location to the virtual Recents folder has to be done manually. Open Finder settings, select \"Sidebar,\" and check \"Recents.\"" -echo $GREEN"• Don't change the Appearance automatically (takes effect after the next restart)" -defaults write -g AppleInterfaceStyleSwitchesAutomatically -bool false +echo "• Don't change the Appearance automatically (takes effect after the next restart)" +defaults write -globalDomain AppleInterfaceStyleSwitchesAutomatically -bool false echo "• Reset the screenshot location to ~/Desktop" defaults delete com.apple.screencapture location echo "• Hide full URLs in Safari" -defaults write com.apple.safari ShowFullURLInSmartSearchField -bool false +sudo defaults write com.apple.safari ShowFullURLInSmartSearchField -bool false echo "• Don't ask websites not to track" -defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool false +sudo defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool false echo "• Show a warning when changing the file extension" defaults write com.apple.finder FXEnableExtensionChangeWarning -bool true -echo "• Enable auto-correct"$NORMAL -defaults write -g NSAutomaticSpellingCorrectionEnabled -bool true +echo "• Enable auto-correct" +defaults write -globalDomain NSAutomaticSpellingCorrectionEnabled -bool true +# Restart Finder and Dock to apply changes killall Finder killall Dock diff --git a/scripts/set-macos-defaults.fish b/scripts/set-macos-defaults.sh similarity index 75% rename from scripts/set-macos-defaults.fish rename to scripts/set-macos-defaults.sh index 2ae9e2c..d60cb9d 100755 --- a/scripts/set-macos-defaults.fish +++ b/scripts/set-macos-defaults.sh @@ -1,8 +1,8 @@ -#!/usr/bin/env fish +#!/bin/bash sudo -v -echo $GREEN"• Show hidden files in the Finder" +echo "• Show hidden files in the Finder" defaults write com.apple.finder AppleShowAllFiles true echo "• Show all filename extensions" @@ -18,7 +18,7 @@ echo "• Disable warning before emptying the Trash" defaults write com.apple.finder WarnOnEmptyTrash -bool false echo "• Show scroll bars only when scrolling" -defaults write -g AppleShowScrollBars -string WhenScrolling +defaults write -globalDomain AppleShowScrollBars -string WhenScrolling echo "• Click in the scroll bar to jump to the spot that's clicked" defaults write -globalDomain AppleScrollerPagingBehavior -bool true @@ -33,23 +33,24 @@ echo "• Set the default Finder location to the Home folder" defaults write com.apple.finder NewWindowTarget -string PfLo && defaults write com.apple.finder NewWindowTargetPath -string "file://$HOME" echo "• Set the Appearance to Auto (takes effect after the next restart)" -defaults write -g AppleInterfaceStyleSwitchesAutomatically -bool true +defaults write -globalDomain AppleInterfaceStyleSwitchesAutomatically -bool true echo "• Set the screenshot location to ~/Documents/Screenshots" mkdir -p ~/Documents/Screenshots defaults write com.apple.screencapture location -string "~/Documents/Screenshots" echo "• Show full URLs (apart from the scheme) in Safari" -defaults write com.apple.safari ShowFullURLInSmartSearchField -bool true +sudo defaults write com.apple.safari ShowFullURLInSmartSearchField -bool true echo "• Ask websites not to track" -defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true +sudo defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true echo "• Don't show a warning when changing the file extension" defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false -echo "• Disable auto-correct"$NORMAL -defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false +echo "• Disable auto-correct" +defaults write -globalDomain NSAutomaticSpellingCorrectionEnabled -bool false +# Restart Finder and Dock to apply changes killall Finder killall Dock