install homebrew package manager. Allows installing of many every day apps including most developer tools. It provides a legendary cli for managing these packages, and provides one of the best and sometimes only real way to actually uninstall apps from your mac.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
echo 'eval "$( /opt/homebrew/bin/brew shellenv)"' >> /Users/<username>/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
brew update
brew install mas
Sign In - updated
If you haven't already logged into the App Store, you can do so now.
mas signin [email protected]**NOTE: ** after version 10.13 we can no loger signin via the cli, you must login to the App Store manually. Then you can run the Brewfile once you've logged in in the app.
# Brewfile
#formulas
brew 'tree'
brew 'mas'
brew 'git'
brew 'postgresql'
brew 'tree'
#casks
cask 'hiddenbar'
cask 'hyper'
cask 'proxyman'
cask 'obsidian'
cask 'cloudflare-warp'
cask 'visual-studio-code'
# native apps -- requires user to be logged into app store
mas 'Xcode', id: 497799835
mas 'IP Friend', id: 1560408065
See Here for full Brewfile
We can run the Brewfile by running this command from the same directory:
brew bundle install
uPic - requires github PAT - see bitwarden
brew install bigwig-club/brew/upic --cask
brew install --cask xpipe-io/tap/xpipe
mocha keyboard (Not Developer Related)
OneTagger (Not Developer Related)
Trackhunter (Not Developer Related)
mp3Tag (Not Developer Related)
memory cleaner (Not Developer Related)
Exa -- unmaintained - fork available
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
You might have to add the following to your
.bashrc
or.zshrc
manually if it is unable to do it automatically.export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvmrelaunch your Terminal and check nvm version
$ nvm --versionList your installed node versions if any:
$ nvm list
Install the latest version of node
nvm install node
Restart the terminal and run:
nvm use node
Confirm that you are using the latest version of Node and npm.
node -v && npm -v
You can search for node versions easily using the following command:
nvm ls-remote | grep -i <version> nvm ls-remote | grep -i 'v12'It is safe if you choose one of the most recent LTS (long time support) version and install it with the following command:
$ nvm install <node-version>Use a specific version.
$ nvm use <node-version>Install the version of Node.js you want
- Install the latest version with
nvm install node
- Use the latest version with
nvm use node
And to set the default:
nvm alias default xx.xx
For later, here's how to update nvm.
nvm install node --reinstall-packages-from=nodeTo Uninstall Node
$ nvm uninstall <node-version>Switching between various nodes versions
$ nvm use <node-version> $ nvm use node (switch to latest Node.js version)You can also test with
which node
, which will output your Node path and version number./Users/yourusername/.nvm/versions/node/v7.8.0/bin/nodeHere's how to switch to another version and use it.
nvm install xx.xx nvm use xx.xx
npm is installed as a package with Node
Check the version
$ npm -v
To upgrade npm
$ npm install -g npm@latest
Upgrade the default zsh shell, install Oh My Zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# .zshrc plugins=( git dotenv macos )
Clone this repository into
$ZSH_CUSTOM/plugins
(by default~/.oh-my-zsh/custom/plugins
)git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Add the plugin to the list of plugins for Oh My Zsh to load (inside
~/.zshrc
):plugins=(zsh-autosuggestions)https://github.com/denysdovhan/spaceship-prompt
To work correctly, you will first need:
zsh
(v5.2 or recent) must be installed.- Powerline Font must be installed and used in your terminal (for example, switch font to Fira Code).
💡 Tip: Update Spaceship to new versions as you would any other package.
[Spaceship Theme](https://github.com/pascaldevink/spaceship-zsh-theme#:~:text=Spaceship ZSH An “Oh My ZSH!” theme for,work%2C without unnecessary complications%2C like a real spaceship.)
❗❗❗Install via homebrew:vs Below❗❗❗❗
- Must have zsh version greater than 5.8.1
echo $ZSH_VERSION #> 5.8.1
- Powerline Font or Nerd Font (even better) must be installed and used in your terminal. Fira Code is a popular choice. To check if Powerline Font works for you, run:
echo -e "\xee\x82\xa0" #>
Clone this repo:
git clone https://github.com/spaceship-prompt/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
Symlink
spaceship.zsh-theme
to your oh-my-zsh custom themes directory:ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
‼️ SetZSH_THEME="spaceship"
in your.zshrc
.**NOTE: ** you can view a full list of available zsh themese from here.
-- see image - must be me and logged into discord : )
NOTE: There is a known incompatibility with spaceship prompt and warp, we can use this workaround :
"SPACESHIP_PROMPT_ASYNC=FALSE" >>! ~/.zshrcYou can also individually disable support for any items that might conflict like zsh plugins and themes:
if [[ $TERM_PROGRAM != "WarpTerminal" ]]; then ##### WHAT YOU WANT TO DISABLE FOR WARP - BELOW # Unsupported Custom Prompt Code ##### WHAT YOU WANT TO DISABLE FOR WARP - ABOVE fiYou can just use
exec
to replace your current shell with a new shell:Switch to
bash
:exec bash
Switch to
zsh
:exec zsh
This won't affect new terminal windows or anything, but it's convenient.
alias ls="exa"
see settings.md for full zsh settings
add the following to your .zshrc
file
# timestamps to command prompt
PROMPT='%{$fg[yellow]%}[%D{%f/%m/%y} %D{%L:%M:%S}] '$PROMPT
touch ~/.gitconfig
[user]
name = {{firstname}} {{lastname}}
email = {{email_address}}
[github]
user = {{username}}
[alias]
mgd = "!git merge $1 && git branch -d $1; #"
# usage: git mgd branch-name ## merge and delete branch
# https://stackoverflow.com/posts/62796796/revisions
a = add
ca = commit -a
cam = commit -am
cm = commit -m
s = status
p = push
pom = push origin master
puom = pull origin master
cob = checkout -b
co = checkout
fp = fetch --prune --all
l = log --oneline --decorate --graph
lall = log --oneline --decorate --graph --all
ls = log --oneline --decorate --graph --stat
lt = log --graph --decorate --pretty=format:'%C(yellow)%h%Creset%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)%an%Creset'
[init]
defaultBranch = main
see settings.md for full config
You can generate an SSH key to distribute.
ssh-keygen -t ed25519 -C "[email protected]"
- The
-t
flag specifies the type of SSH keys to create.- The
-C
flag allows for comments that get added as metadata at the end of the public key.
Setup SSH Config File
Simplify the process of SSHing into other boxes with your SSH config file. Create ~/.ssh/config
if it does not already exist.
Add the following contents, changing the variables for any hosts that you connect to. Using the below will be the same as running ssh -i ~/.ssh/key.pem [email protected]
.
Create an SSH config file.
touch .ssh/config
Add the following contents, changing the variables for any hosts that you connect to. Using the below will connect to -i key.pem [email protected]
. You can remove the IdentityFile if you don’t connect with a pem key. The output will then simply be [email protected]
and you’ll be prompted for password authentication.
Host github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa_
Add Key to SSH Agent - Start ssh-agent.
WE USED TO HAVE TO RUN THE FOLLOWING - NO LONGER REQUIRED
ssh-add-l
eval "$(ssh-agent -s)"
Add key.
ssh-add --apple-use-keychain ~/.ssh/id_rsa
Now just run the alias to connect.
ssh myssh
Finally, Add the SSH public key to your account on GitHub. For more information, see "Adding a new SSH key to your GitHub account."
Copy key to clipboard from cli
pbcopy < ~/.ssh/id_rsa.pub
Testing Github ssh
-
Enter the following:
$ ssh -T [email protected] # Attempts to ssh to GitHub
You may see a warning like this:
> The authenticity of host 'github.com (IP ADDRESS)' can't be established. > RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. > Are you sure you want to continue connecting (yes/no)?
or like this:
> The authenticity of host 'github.com (IP ADDRESS)' can't be established. > RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. > Are you sure you want to continue connecting (yes/no)?
-
Verify that the fingerprint in the message you see matches one of the messages in step 2, then type
yes
:> Hi username! You've successfully authenticated, but GitHub does not > provide shell access.
-
Verify that the resulting message contains your username. If you receive a "permission denied" message, see "Error: Permission denied (publickey)".
[Copying SSH Keys from the Command Line](https://osxdaily.com/2012/07/13/move-ssh-keys-from-one-computer-to-another/#:~:text=Moving SSH Keys Between Computers If you’re already,both machines and do a drag and drop%3A) Using the terminal is faster for many of us, you’ll obviously have to be connected to the other computer through a network for this to work.
cp .ssh/id_rsa* /Network/path/to/username/.ssh/
Simple enough, and will work for any version of OS X and most variations of unix or linux.
ssh-add -D
This will remove all ssh identities, and you can then safely delete the .ssh folder.
This was already installed by the brewfile, but just incase:
brew install gh
? What account do you want to log into? GitHub.com ? What is your preferred protocol for Git operations on this host? SSH ? Upload your SSH public key to your GitHub account? Skip ? How would you like to authenticate GitHub CLI? Paste an authentication token Tip: you can generate a Personal Access Token here https://github.com/settings/tokens The minimum required scopes are 'repo', 'read:org'. ? Paste your authentication token: ****************************************
- gh config set -h github.com git_protocol ssh ✓ Configured git protocol ✓ Logged in as gaurangrshah
- NOTE: Install .sh scripts
The trick here is to create a bare
repository instead of normal.
- create a
bare
repository in your home directory by doing
git init --bare $HOME/<folder_name>
- create an alias with the name
dotfiles
in your.zshrc
for convenience
alias config='/usr/bin/git --git-dir=$HOME/<folder_name>/ --work-tree=$HOME'
This alias will replace
git
in our git commands so:git config <args> #-becomes- config configgit pull #-becomes- config pull
NOTE: Because of changes to how github cli allows authentication, we now must ensure that we are pushing to the ssh://
remote rather than the https://
remote.
config remote -v # show all remotes
config remote set-url <remote_name> <new_url>
# example config remote set-url <remote_name> ssh://[email protected]/<username>/<repo>.gitOnce this is in place you should be able to push up freely.
-
Ensure that no untracker files are included
config config status.showUntrackedFiles no
-
Then you can use it like normal git repository to add, commit and push.
# to check the status of the tracked and untracked files
config status
# to add all tracked changes:
config add -u
# to add a specific file
config commit .tmux.conf -m ".tmux.conf added"
# push new files or changes to the github
config push origin main
No extra tooling, no symlinks, files are tracked on a version control system, you can use different branches for different computers, you can replicate you configuration easily on new installation. SEE THIS ARTICLE
Read more about this + how to automate installation of apps and libs - https://github.com/kalkayan/dotfiles
I don't like a lot of the Apple defaults so here are the things I always change.
To get the Home folder in the finder, press CMD + SHIFT + H
and drag the home folder to the sidebar.
- Fira Code
- Operator mono
- Set Dark mode
- Make Arc default browser
- Automatically hide and show Dock
- Show indicators for open applications
- Key Repeat -> Fast
- Delay Until Repeat -> Short
- Disable "Correct spelling automatically"
- Disable "Capitalize words automatically"
- Disable "Add period with double-space"
- Disable "Use smart quotes and dashes"
- Allow apps downloaded from App Store and identified developers
- Turn FileVault On (makes sure SSD is securely encrypted)
- Change computer name
- Make sure all file sharing is disabled
A few more commands to change some defaults.
# Show Library folder
chflags nohidden ~/Library
# Show hidden files
defaults write com.apple.finder AppleShowAllFiles YES
# Show path bar
defaults write com.apple.finder ShowPathbar -bool true
# Show status bar
defaults write com.apple.finder ShowStatusBar -bool true
# Prevent left and right swipe (in chrome) or two-finger scroll
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false
# Allow Apps from anywhere
sudo spctl --master-disable
-
Finder -> File -> Settings
-
Deselect all except
connected servers
option -
Sidebar settings - add user folder to sidebar
-
Advanced settings = Change default search to "Search Current Folder"
-
-
System Prefs:
-
Desktop & Dock
-
Dock size - smaller
-
-
Trackpad
-
Force Click with One Finger
-
Click or Tap with Two Fingers
-
-
Battery
- Click the Info button next to Battery Health on the right, then turn on Optimized Battery Charging and “Manage battery longevity.”
-
Right click Desktop -> Click "Show View Options"
- Adjust icon and text sizes
- Install uBlock Origin
- Bitwarden
- Command Palette
- Decentraleyes
- Download All Images
- Online Tools
- Privacy
- Refined GIthub
- SnipCSS
- Tag Assistant Companion
- TLDR
- Install React DevTools
- Install Redux DevTools
- Install JSONView
- Install Duplicate Tab Shortcut
- Settings -> Set theme to "Dark"
- Install & Configure Dev Fonts
- Operator Mono
- Fira Code
- VSCode Font Css
- Requires the extension Custom CSS
// settings.json
"editor.fontFamily": "'Operator Mono Medium', 'Fira Code'",
"editor.fontLigatures": true,
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"name": "comment",
"scope": ["comment"],
"settings": {
"fontStyle": "italic"
}
},
{
"name": "Variable",
"scope": ["variable.language", "string.other.link.title.markdown"],
"settings": {
"fontStyle": "italic"
}
},
{
"name": "Keyword, Storage",
"scope": [
"keyword",
"storage.modifier",
"storage.type.class",
"storage.type.function"
],
"settings": {
"fontStyle": "italic"
}
},
{
"name": "Keyword Control",
"scope": ["keyword.control"],
"settings": {
"fontStyle": "italic"
}
},
{
"name": "Storage Type",
"scope": ["storage.type"],
"settings": {
"fontStyle": "italic"
}
},
{
"name": "Storage Type Function",
"scope": ["storage.type.function"],
"settings": {
"fontStyle": "italic"
}
},
{
"name": "Storage Type Class",
"scope": ["storage.type.class"],
"settings": {
"fontStyle": "italic"
}
},
{
"scope": [
"keyword",
"storage.modifier",
"storage.type.class.js",
"storage.type.js"
],
"settings": {
"fontStyle": "italic"
}
},
{
"name": "Keyword Storage",
"scope": ["storage"], // variables let, const
"settings": {
"fontStyle": "italic"
}
},
{
"name": "Entity",
"scope": ["entity.other.attribute-name", "entity.name.method"],
"settings": {
"fontStyle": "italic"
}
},
{
"scope": ["keyword.control.conditional", "keyword.operator"],
"settings": {
"fontStyle": "italic"
}
}
]
},
"editor.renderControlCharacters": true,
"editor.fontSize": 14,
"editor.renderWhitespace": "all",
"editor.lineHeight": 20.3,
"editor.letterSpacing": 0.5,
"editor.accessibilitySupport": "off",
"editor.cursorBlinking": "smooth",
"editor.cursorStyle": "block",
"editor.tabCompletion": "on",
"editor.rulers": [80],
"editor.tabSize": 2,
"workbench.fontAliasing": "auto",
"workbench.iconTheme": "file-icons",
"workbench.editor.labelFormat": "short",
-
Open command palette (
CMD + SHIFT + P
) and install "code" command in PATH. -
settings.json:
{ "telemetry.telemetryLevel": "off", "emmet.showSuggestionsAsSnippets": true, "emmet.syntaxProfiles": { "javascript": "jsx" }, "emmet.includeLanguages": { "markdown": "html", "javascript": "javascriptreact" }, "search.searchEditor.doubleClickBehaviour": "openLocationToSide", "editor.suggest.localityBonus": true, "editor.quickSuggestionsDelay": 0, "editor.suggest.insertMode": "replace", "editor.snippetSuggestions": "bottom", "editor.quickSuggestions": { "comments": "on", "strings": "on", "other": "on" }, "javascript.updateImportsOnFileMove.enabled": "always", "javascript.suggest.completeJSDocs": false, "search.mode": "newEditor", "search.exclude": { "**/.next": true, "**/node_modules": true, "**/bower_components": true, "**/coverage": true, "**/dist": true, "**/build": true, "**/.build": true, "**/.gh-pages": true }, "zenMode.fullScreen": false, "files.exclude": { "**/.next/": true, "**/node_modules": true "**/.history": true }, }
-
"local-history.exclude": // Files or folders to not save // (default) ['**/.history/**', '**/.vscode**', '**/node_modules/**', '**/typings/**', '**/out/**'] "local-history.daysLimit": 30 // A day number to purge local history. (0: no purge) "local-history.maxDisplay": 10 // A max files to display with local history commands "local-history.saveDelay": 0 // A delay in seconds to save file in local history. {0: no delay}
"errorLens.enabledDiagnosticLevels": ["warning", "info", "error"], "errorLens.enabled": true,
"typescript.enablePromptUseWorkspaceTsdk": true, "totalTypeScript.hideAllTips": false, "totalTypeScript.hideBasicTips": false, "totalTypeScript.hiddenTips": [ "ts-object-type", "typing-function-parameters", "basic-types", "literal-type", "passing-generics-to-types", "keyof", "optional-object-property", "typeof", "type-alias-declaration", "variable-type-annotation", "array-type", "union-type", "interface-declaration", "null-keyword", "function-return-type", "record-utility-type", "undefined-keyword", "as-assertion", "partial-utility-type", "returntype-utility-type", "any-type" ],
-
-
"todohighlight.isEnable": true, "todohighlight.isCaseSensitive": true, "todohighlight.defaultStyle": { "color": "#000", "backgroundColor": "rgb(236, 130, 70, 0.25)", "overviewRulerColor": "rgb(236, 130, 70, 0.25)" }, "todohighlight.exclude": [ "**/node_modules/**", "**/bower_components/**", "**/dist/**", "**/build/**", "**/.vscode/**", "**/.github/**", "**/_output/**", "**/*.min.*", "**/*.map", "**/.next/**" ], "todohighlight.keywords": [ { "color": "rgb(255,255, 255, 0.45)", "overviewRulerColor": "rgba(255,234,148,0.30)", "backgroundColor": "rgba(255,234,148,0.30)", "text": "NOTE:" }, { "color": "white", "border": "1px solid rgb(44, 232, 74, 0.25)", "borderRadius": "2px", "backgroundColor": "rgb(44, 86, 232, 0.25)", "text": "OBJECTIVE:" }, { "color": "darkgray", "border": "1px solid rgba(189, 255, 235, 0.25)", "borderRadius": "2px", "backgroundColor": "rgba(189, 255, 235, 0.25)", "text": "DONE:" }, { "color": "rgba(189, 255, 235, 0.45)", "border": "1px solid rgb(232, 44, 225, 0.25)", "borderRadius": "2px", "backgroundColor": "rgb(232, 44, 225, 0.15)", "text": "HACK:" }, { "color": "darkgray", "text": "SCOPE: ", "backgroundColor": "rgb(41, 70, 173, 0.4)" }, { "color": "yellow", "text": "EDIT: ", "backgroundColor": "rgba(230,230,230,0.25)" }, { "color": "white", "text": "EXAMPLE: ", "backgroundColor": "rgba(266,250,255,0.4)" }, { "color": "lightgray", "font-size": "0.25em", "borderRadius": "2px", "backgroundColor": "rgba(229,227,255,0.25)", "text": "USAGE:" }, { "color": "rgba(0,0,0,0.8)", "font-size": "0.25em", "borderRadius": "2px", "backgroundColor": "rgba(229,227,255,0.25)", "text": ">>:" }, { "color": "rgba(232,205,30,0.8)", "font-size": "0.25em", "borderRadius": "2px", "backgroundColor": "rgba(219,103,79,0.45)", "text": "LINK:" } ],
-
"cSpell.userWords": [ "Astro", "btns", "Chakra", "ciel", "clsx", "cmyk", "didn", "favorited", "fontsource", "Gaurang", "gaurangrshah", "Hashnode", "heroicons", "ianvs", "lucide", "nextjs", "postbuild", "roadmap", "Supa", "supabase", "superjson", "Swatchr", "tailwindcss", "tanstack", "tinycolor", "trpc", "upsert" ],
-
Reference Dotfiles for keyboard shortcuts and settings
-
"gitlens.ai.experimental.provider": "openai", "gitlens.ai.experimental.openai.model": "gpt-4-turbo-preview", "gitlens.views.commitDetails.files.layout": "list" "gitlens.autolinks": [ { "prefix": "SWT", "url": null } ],
-
Install GIthub Copilot Chat
"github.copilot.enable": { "*": true, "plaintext": false, "markdown": false, "scminput": false, "yaml": false, "search-result": true },
-
Turbo Console Log and Console Ninja
"turboConsoleLog.delimiterInsideMessage": "|", "turboConsoleLog.insertEnclosingFunction": false, "console-ninja.featureSet": "Community",
-
- See here for workspace settings.json
-
TailwindCSS Kit - includes Intellisense | Fold | Documentation
- File -> Install CLI
- Tools -> Install Hyper CLI command
in
PATH
- Configure keyboard shortcuts:
- Jump forward:
⌥←
(change via "Send Escape Sequence" withb
) - Jump backward:
⌥→
(change via "Send Escape Sequence" withf
)
- Jump forward: