Skip to content

Instantly share code, notes, and snippets.

@farskid
Last active February 25, 2021 11:18
Show Gist options
  • Save farskid/7563efc64717cf2c5167dd9e1c5daea0 to your computer and use it in GitHub Desktop.
Save farskid/7563efc64717cf2c5167dd9e1c5daea0 to your computer and use it in GitHub Desktop.
Mac settings and extensions (Read `Notes.md` before using any of files)
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
function fuzzy_open() {
code $(fd $1)
}
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/farzadyousef-zadeh/.oh-my-zsh"
export ZSH_DISABLE_COMPFIX=true
export ZSH_CACHE_DIR=$HOME/.zsh
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="af-magic"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
git-open
git-extras
npm
yarn
node
github
zsh-syntax-highlighting
zsh-autosuggestions
)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# tabtab source for serverless package
# uninstall by removing these lines or running `tabtab uninstall serverless`
[[ -f /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/serverless.zsh ]] && . /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/serverless.zsh
# tabtab source for sls package
# uninstall by removing these lines or running `tabtab uninstall sls`
[[ -f /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/sls.zsh ]] && . /usr/local/lib/node_modules/serverless/node_modules/tabtab/.completions/sls.zsh
ssh-add -K 2>&1 | cat - > /dev/null
source ~/.bash_profile
# AutoJump
[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh
# Code insiders alias
# alias code="code-insiders"
# alias c="code-insiders"
eval "$(fnm env)"
#export NVM_DIR="$HOME/.nvm"
#[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
#[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
#alias gotoproject="cd ~/Projects"
alefragnani.rtf
angryobject.react-pure-to-class-vscode
asvetliakov.snapshot-tools
be5invis.toml
bierner.lit-html
bradlc.vscode-tailwindcss
bungcip.better-toml
christian-kohler.npm-intellisense
CoenraadS.bracket-pair-colorizer
crisward.riot-tag
dbaeumer.vscode-eslint
donjayamanne.githistory
dracula-theme.theme-dracula
dzhavat.css-flexbox-cheatsheet
eamodio.gitlens
EditorConfig.EditorConfig
eg2.tslint
esbenp.prettier-vscode
felixrieseberg.vsc-travis-ci-status
file-icons.file-icons
formulahendry.auto-rename-tag
GitHub.vscode-pull-request-github
humao.rest-client
jaredly.reason-vscode
jevakallio.vscode-hacker-typer
johnpapa.vscode-peacock
jpoissonnier.vscode-styled-components
jumpinjackie.vscode-map-preview
kisstkondoros.vscode-codemetrics
mariusschulz.yarn-lock-syntax
mikestead.dotenv
mrmlnc.vscode-scss
ms-azuretools.vscode-docker
ms-mssql.mssql
ms-python.python
ms-vscode.Go
ms-vsliveshare.vsliveshare
msjsdiag.vscode-react-native
naumovs.color-highlight
neilding.language-liquid
nepaul.editorconfiggenerator
ngryman.codesandbox-theme
octref.vetur
pepri.subtitles-editor
pomber.git-file-history
redhat.vscode-yaml
RobbOwen.synthwave-vscode
robinbentley.sass-indented
sbrink.elm
scala-lang.scala
Shan.code-settings-sync
shinnn.stylelint
silvenon.mdx
SimonSiefke.svg-preview
stevencl.addDocComments
stkb.rewrap
teabyii.ayu
thomaspink.theme-github
tlent.jest-snapshot-language-support
vncz.vscode-apielements
waderyan.gitblame
wayou.vscode-todo-highlight
whizkydee.material-palenight-theme
wix.vscode-import-cost
{
"Profiles": [
{
"Link Color" : {
"Red Component" : 0,
"Color Space" : "sRGB",
"Blue Component" : 0.73423302173614502,
"Alpha Component" : 1,
"Green Component" : 0.35916060209274292
},
"Tags" : [
],
"Ansi 12 Color" : {
"Green Component" : 0.57647058823529407,
"Blue Component" : 0.97647058823529409,
"Red Component" : 0.74117647058823533
},
"Ansi 7 Color" : {
"Green Component" : 0.73333334922790527,
"Blue Component" : 0.73333334922790527,
"Red Component" : 0.73333334922790527
},
"Reduce Flicker" : true,
"Bold Color" : {
"Green Component" : 0.90237069129943848,
"Blue Component" : 0.90237069129943848,
"Red Component" : 0.90237069129943848
},
"Ansi 8 Color" : {
"Green Component" : 0.33333333333333331,
"Blue Component" : 0.33333333333333331,
"Red Component" : 0.33333333333333331
},
"Ansi 9 Color" : {
"Green Component" : 0.33333333333333331,
"Blue Component" : 0.33333333333333331,
"Red Component" : 1
},
"Ansi 1 Color" : {
"Green Component" : 0.3333333432674408,
"Blue Component" : 0.3333333432674408,
"Red Component" : 1
},
"Rows" : 25,
"Default Bookmark" : "No",
"Horizontal Spacing" : 1,
"Cursor Guide Color" : {
"Red Component" : 0.70213186740875244,
"Color Space" : "sRGB",
"Blue Component" : 1,
"Alpha Component" : 0.25,
"Green Component" : 0.9268307089805603
},
"Non-ASCII Anti Aliased" : true,
"Use Bright Bold" : true,
"Ansi 10 Color" : {
"Green Component" : 0.98039215686274506,
"Blue Component" : 0.4823529411764706,
"Red Component" : 0.31372549019607843
},
"Ambiguous Double Width" : false,
"Jobs to Ignore" : [
"rlogin",
"ssh",
"slogin",
"telnet"
],
"Show Status Bar" : false,
"Ansi 15 Color" : {
"Green Component" : 1,
"Blue Component" : 1,
"Red Component" : 1
},
"Foreground Color" : {
"Green Component" : 0.90032327175140381,
"Blue Component" : 0.90032327175140381,
"Red Component" : 0.90032327175140381
},
"Working Directory" : "\/Users\/farskid",
"Blinking Cursor" : false,
"Disable Window Resizing" : true,
"Sync Title" : false,
"Prompt Before Closing 2" : 0,
"BM Growl" : true,
"Command" : "",
"Description" : "Default",
"Mouse Reporting" : true,
"Screen" : -1,
"Selection Color" : {
"Green Component" : 0.27843138575553894,
"Blue Component" : 0.35294118523597717,
"Red Component" : 0.26666668057441711
},
"Only The Default BG Color Uses Transparency" : false,
"Columns" : 80,
"Idle Code" : 0,
"Ansi 13 Color" : {
"Green Component" : 0.47450980392156861,
"Blue Component" : 0.77647058823529413,
"Red Component" : 1
},
"Custom Command" : "No",
"ASCII Anti Aliased" : true,
"Non Ascii Font" : "Monaco 12",
"Vertical Spacing" : 1.01,
"Use Bold Font" : true,
"Option Key Sends" : 0,
"Selected Text Color" : {
"Green Component" : 1,
"Blue Component" : 1,
"Red Component" : 1
},
"Background Color" : {
"Green Component" : 0.12215272337198257,
"Blue Component" : 0.15977837145328522,
"Red Component" : 0.11765811592340469
},
"Character Encoding" : 4,
"Ansi 11 Color" : {
"Green Component" : 0.98039215686274506,
"Blue Component" : 0.5490196078431373,
"Red Component" : 0.94509803921568625
},
"Use Italic Font" : true,
"Unlimited Scrollback" : true,
"Keyboard Map" : {
"0xf728-0x80000" : {
"Text" : "d",
"Action" : 10
},
"0xf702-0x280000" : {
"Text" : "b",
"Action" : 10
},
"0xf70d-0x20000" : {
"Text" : "[21;2~",
"Action" : 10
},
"0x7f-0x80000" : {
"Text" : "0x1b 0x7f",
"Action" : 11
},
"0xf708-0x20000" : {
"Text" : "[15;2~",
"Action" : 10
},
"0x33-0x40000" : {
"Text" : "0x1b",
"Action" : 11
},
"0xf703-0x260000" : {
"Text" : "[1;6C",
"Action" : 10
},
"0xf729-0x20000" : {
"Text" : "[1;2H",
"Action" : 10
},
"0xf702-0x260000" : {
"Text" : "[1;6D",
"Action" : 10
},
"0x38-0x40000" : {
"Text" : "0x7f",
"Action" : 11
},
"0xf72b-0x40000" : {
"Text" : "[1;5F",
"Action" : 10
},
"0xf70c-0x20000" : {
"Text" : "[20;2~",
"Action" : 10
},
"0xf701-0x260000" : {
"Text" : "[1;6B",
"Action" : 10
},
"0x32-0x40000" : {
"Text" : "0x00",
"Action" : 11
},
"0xf707-0x20000" : {
"Text" : "[1;2S",
"Action" : 10
},
"0xf703-0x240000" : {
"Text" : "[1;5C",
"Action" : 10
},
"0xf700-0x260000" : {
"Text" : "[1;6A",
"Action" : 10
},
"0xf702-0x240000" : {
"Text" : "[1;5D",
"Action" : 10
},
"0x37-0x40000" : {
"Text" : "0x1f",
"Action" : 11
},
"0x3-0x200000" : {
"Text" : "0xd",
"Action" : 11
},
"0xf701-0x240000" : {
"Text" : "[1;5B",
"Action" : 10
},
"0xf70b-0x20000" : {
"Text" : "[19;2~",
"Action" : 10
},
"0xf703-0x220000" : {
"Text" : "[1;2C",
"Action" : 10
},
"0xf739-0x0" : {
"Text" : "",
"Action" : 13
},
"0xf728-0x0" : {
"Text" : "0x4",
"Action" : 11
},
"0xf706-0x20000" : {
"Text" : "[1;2R",
"Action" : 10
},
"0xf700-0x240000" : {
"Text" : "[1;5A",
"Action" : 10
},
"0xf702-0x220000" : {
"Text" : "[1;2D",
"Action" : 10
},
"0x36-0x40000" : {
"Text" : "0x1e",
"Action" : 11
},
"0xf70f-0x20000" : {
"Text" : "[24;2~",
"Action" : 10
},
"0xf701-0x220000" : {
"Text" : "[1;2B",
"Action" : 10
},
"0xf70a-0x20000" : {
"Text" : "[18;2~",
"Action" : 10
},
"0xf729-0x40000" : {
"Text" : "[1;5H",
"Action" : 10
},
"0xf72b-0x20000" : {
"Text" : "[1;2F",
"Action" : 10
},
"0xf700-0x220000" : {
"Text" : "[1;2A",
"Action" : 10
},
"0x30-0x200000" : {
"Text" : "0",
"Action" : 12
},
"0xf705-0x20000" : {
"Text" : "[1;2Q",
"Action" : 10
},
"0x31-0x200000" : {
"Text" : "1",
"Action" : 12
},
"0x33-0x200000" : {
"Text" : "3",
"Action" : 12
},
"0x35-0x40000" : {
"Text" : "0x1d",
"Action" : 11
},
"0x34-0x200000" : {
"Text" : "4",
"Action" : 12
},
"0x32-0x200000" : {
"Text" : "2",
"Action" : 12
},
"0x35-0x200000" : {
"Text" : "5",
"Action" : 12
},
"0x36-0x200000" : {
"Text" : "6",
"Action" : 12
},
"0x37-0x200000" : {
"Text" : "7",
"Action" : 12
},
"0x2d-0x40000" : {
"Text" : "0x1f",
"Action" : 11
},
"0x38-0x200000" : {
"Text" : "8",
"Action" : 12
},
"0x2a-0x200000" : {
"Text" : "*",
"Action" : 12
},
"0x39-0x200000" : {
"Text" : "9",
"Action" : 12
},
"0x2b-0x200000" : {
"Text" : "+",
"Action" : 12
},
"0xf70e-0x20000" : {
"Text" : "[23;2~",
"Action" : 10
},
"0x2d-0x200000" : {
"Text" : "-",
"Action" : 12
},
"0x2e-0x200000" : {
"Text" : ".",
"Action" : 12
},
"0xf709-0x20000" : {
"Text" : "[17;2~",
"Action" : 10
},
"0x7f-0x100000" : {
"Text" : "0x15",
"Action" : 11
},
"0x2f-0x200000" : {
"Text" : "\/",
"Action" : 12
},
"0xf704-0x20000" : {
"Text" : "[1;2P",
"Action" : 10
},
"0x34-0x40000" : {
"Text" : "0x1c",
"Action" : 11
},
"0xf703-0x280000" : {
"Text" : "f",
"Action" : 10
}
},
"Window Type" : 0,
"Blur Radius" : 30,
"Cursor Type" : 0,
"Background Image Location" : "",
"Blur" : false,
"Semantic History" : {
"editor" : "com.microsoft.VSCode",
"text" : "",
"action" : "editor"
},
"Badge Color" : {
"Red Component" : 1,
"Color Space" : "sRGB",
"Blue Component" : 0,
"Alpha Component" : 0.5,
"Green Component" : 0.1491314172744751
},
"Scrollback Lines" : 0,
"Send Code When Idle" : false,
"Close Sessions On End" : true,
"Terminal Type" : "xterm-256color",
"Visual Bell" : true,
"Flashing Bell" : false,
"Status Bar Layout" : {
"components" : [
{
"class" : "iTermStatusBarNetworkUtilizationComponent",
"configuration" : {
"knobs" : {
"base: priority" : 5,
"base: compression resistance" : 1
},
"layout advanced configuration dictionary value" : {
"algorithm" : 0
}
}
},
{
"class" : "iTermStatusBarBatteryComponent",
"configuration" : {
"knobs" : {
"base: priority" : 5,
"base: compression resistance" : 1
},
"layout advanced configuration dictionary value" : {
"algorithm" : 0
}
}
},
{
"class" : "iTermStatusBarCPUUtilizationComponent",
"configuration" : {
"knobs" : {
"base: priority" : 5,
"base: compression resistance" : 1
},
"layout advanced configuration dictionary value" : {
"algorithm" : 0
}
}
},
{
"class" : "iTermStatusBarMemoryUtilizationComponent",
"configuration" : {
"knobs" : {
"base: priority" : 5,
"base: compression resistance" : 1
},
"layout advanced configuration dictionary value" : {
"algorithm" : 0
}
}
},
{
"class" : "iTermStatusBarSearchFieldComponent",
"configuration" : {
"knobs" : {
"base: priority" : 5,
"base: compression resistance" : 1
},
"layout advanced configuration dictionary value" : {
"algorithm" : 0
}
}
},
{
"class" : "iTermStatusBarWorkingDirectoryComponent",
"configuration" : {
"knobs" : {
"path" : "path",
"base: priority" : 5,
"base: compression resistance" : 1,
"minwidth" : 0,
"maxwidth" : 1.7976931348623157e+308
},
"layout advanced configuration dictionary value" : {
"algorithm" : 0
}
}
},
{
"class" : "iTermStatusBarGitComponent",
"configuration" : {
"knobs" : {
"iTermStatusBarGitComponentPollingIntervalKey" : 2,
"base: priority" : 5,
"base: compression resistance" : 1,
"minwidth" : 0,
"maxwidth" : 1.7976931348623157e+308
},
"layout advanced configuration dictionary value" : {
"algorithm" : 0
}
}
}
],
"advanced configuration" : {
"font" : ".AppleSystemUIFont 12",
"algorithm" : 0
}
},
"Silence Bell" : false,
"Ansi 14 Color" : {
"Green Component" : 0.9137254901960784,
"Blue Component" : 0.99215686274509807,
"Red Component" : 0.54509803921568623
},
"ASCII Ligatures" : false,
"Name" : "Default",
"Cursor Text Color" : {
"Green Component" : 1,
"Blue Component" : 1,
"Red Component" : 1
},
"Shortcut" : "",
"Cursor Color" : {
"Green Component" : 0.73333334922790527,
"Blue Component" : 0.73333334922790527,
"Red Component" : 0.73333334922790527
},
"Transparency" : 0,
"Ansi 0 Color" : {
"Green Component" : 0,
"Blue Component" : 0,
"Red Component" : 0
},
"Guid" : "E3BE7BF4-2785-4F6A-B0DD-BBC63B506896",
"Ansi 2 Color" : {
"Green Component" : 0.98039215686274506,
"Blue Component" : 0.4823529411764706,
"Red Component" : 0.31372549019607843
},
"Ansi 4 Color" : {
"Green Component" : 0.57647058823529407,
"Blue Component" : 0.97647058823529409,
"Red Component" : 0.74117647058823533
},
"Right Option Key Sends" : 0,
"Use Non-ASCII Font" : false,
"Ansi 6 Color" : {
"Green Component" : 0.9137254901960784,
"Blue Component" : 0.99215686274509807,
"Red Component" : 0.54509803921568623
},
"Normal Font" : "Monaco 12",
"Ansi 3 Color" : {
"Green Component" : 0.98039215686274506,
"Blue Component" : 0.5490196078431373,
"Red Component" : 0.94509803921568625
},
"Custom Directory" : "Recycle",
"Ansi 5 Color" : {
"Green Component" : 0.47450980392156861,
"Blue Component" : 0.77647058823529413,
"Red Component" : 1
}
}
]
}

.zsh.rc

install zsh (Ships with Mac)

Make zsh the default shell echo $SHELL

install oh-my-zsh

save this as ~/.zshrc and replace user's name in the file

Install all plugins mentioned in ~/.zshrc

extensions.txt

Make sure code is installed in your user Path.

use this snippet and run it with Nodejs to install extensions automatically.

const fs = require("fs");
const execSync = require('child_process').execSync;

const extensions = fs.readFileSync("./extensions.txt")
const extensionsArray = extensions.toString().split("\n").filter(e => e.length > 0)


extensionsArray.forEach(e => {
    execSync(`code --install-extension ${e}`);
})

iterm2_profiles.json

enable Natural word procvessing: check out https://apple.stackexchange.com/a/293988/229199

validate prefrences -> profiles -> general -> working directory to be set to Reuse previous...

validate prefrences -> profiles -> Text -> font to be set to operator mono for normal and monaco for non-ascii characters

use Iterm2 -> prefrences -> profiles -> other actions -> import json profiles and import this profile file.

{
"editor.fontFamily": "Operator Mono",
"editor.fontSize": 16,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"javascript.implicitProjectConfig.checkJs": true,
"window.zoomLevel": 0,
"workbench.colorTheme": "Dracula",
"workbench.iconTheme": "ayu",
"window.newWindowDimensions": "inherit",
"javascript.updateImportsOnFileMove.enabled": "always",
"javascript.validate.enable": false,
"git.autofetch": true,
"typescript.updateImportsOnFileMove.enabled": "always",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"peacock.favoriteColors": [
{
"name": "Angular Red",
"value": "#b52e31"
},
{
"name": "Auth0 Orange",
"value": "#eb5424"
},
{
"name": "Azure Blue",
"value": "#007fff"
},
{
"name": "C# Purple",
"value": "#68217A"
},
{
"name": "Gatsby Purple",
"value": "#639"
},
{
"name": "Go Cyan",
"value": "#5dc9e2"
},
{
"name": "Java Blue-Gray",
"value": "#557c9b"
},
{
"name": "JavaScript Yellow",
"value": "#f9e64f"
},
{
"name": "Mandalorian Blue",
"value": "#1857a4"
},
{
"name": "Node Green",
"value": "#215732"
},
{
"name": "React Blue",
"value": "#00b3e6"
},
{
"name": "Something Different",
"value": "#832561"
},
{
"name": "Vue Green",
"value": "#42b883"
}
],
"peacock.affectAccentBorders": true,
"peacock.affectTabActiveBorder": true,
"peacock.surpriseMeOnStartup": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.requireConfig": true,
"workbench.panel.defaultLocation": "right",
"terminal.integrated.cursorBlinking": true,
"terminal.integrated.copyOnSelection": true,
"terminal.integrated.enableBell": true,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment