macOS Initial setup of CLI and Python Dev 2


This article covers my setup of a MacBook from a clean slate to it revved up for some Python development. I focus on the tricking out of the command line.

This is the 3rd article of 3 of my machine set-ups. My motivation for these was mainly as a reference for ease of future newly minted set ups. Since CLI comprises of many commands and configuration file settings, I found it prudent to log these somewhere to lighten the mental cognitive load of trying to remember them.

I relied heavily on many other setup articles of which I’ve referenced. Please peruse the documentation and the other articles to develop your own masterpiece.

This article is lengthy, but I tried to capture as much as I think was needed to rerun a setup on a new machine. With that, time to get cracking.

iterm2 macOS terminal emulator with multiple panes and tabs
iterm2 showing multiple panes and tabs. Top to Bottom, Left to Right 1) neofetch and CL on a master brach 2) pyenv versions with the current version showing in the CLI 3) vim editor in .zshrc 4) fzf preview window showing .zshrc with bat highlighting 4) htop (activated while the others are opaque)

Homebrew

Homebrew The Missing Package Manager for macOS (or Linux).

Fire up the terminal with ⌘ Space > Terminal and run the following command to install.

# Install brew. Double check the link from the website.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

For brew commands based on the extent of detail desired, run the following in order from basic to more in depth: brew -h, brew commands or the full Monty man brew.

Run the following occasionally:
brew update && brew upgrade && brew cleanup && brew doctor

and for her sister casks:
brew cask upgrade && brew cask doctor

Git

Git –local-branching-on-the-cheap

Install git and define initial configurations settings:

brew install git
git config --global user.name "Bradley Sawler"
git config --global user.email "<email>"
git config --list --show-origin

# Lists the files in your .ssh directory, if they exist
ls -al ~/.ssh

# Generate an authentication key
ssh-keygen

# Copy and paste key into GitHub
pbcopy < ~/.ssh/id_rsa.pub

# Make a folder and clone my notes repo
mkdir git && cd git
git clone git@github.com:bradleysawler/<my notes repo>.git

My go-to git reference of choice is Pro Git book by Scott Chacon and Ben Straub.

Terminal

iTerm2

iTerm2 is a terminal emulator for macOS that does amazing things.

Install with the following command:

brew cask install iterm2

Integrate iTerm2 with the shell by clicking in the menu iTerm2 > Install Shell Integration (sorry, no keyboard shortcut).

Here are a few preferences that I set for now (subject to change):

iTerm2 > Preferences ⌘, > Keys > Hotkey > ☑️ Show/hide all windows with a system-wide hotkey and set as ⌘~

iTerm2 > Preferences ⌘, > Pointer > General:

☑︎ Click opens filename/URL (semantic history)
☐ Click reported to apps, does not open menu
☑︎ Click moves cursor
☑︎ Three-finger tap emulates middle click
☑︎ Focus follows mouse

Focus follows mouse will activate the iTerm2 window when the mouse hovers over it.

I added the ⌥h and ⌥v key bindings to split the panes but noticed they don’t show up in the cheatsheets app. I also added the splits to the Touch Bar, but they too didn’t appear.

Oh My Zsh

Oh My ZshYour terminal never felt this good before.

Install by running one of the following commands:

# Install oh-my-zsh via curl
$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# Or Install oh-my-zsh via wget
$ sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

Zsh Plugins

Built-ins

ohmyzsh/plugins collection contains over 100+ and you can activate any of them by providing the names in the plugin section of .zshrc.

I have the following plugins activated:

  • alias-finderThis plugin searches the defined aliases and outputs any that match the command inputted. This makes learning new aliases easier. alias-finder [--longer or -l, --exact or -e] "<search term in quotes>"
  • copydirCopies the path of your current folder to the system clipboard.
  • copyfilePuts the contents of a file in your system clipboard so you can paste it anywhere. copyfile <filename>
  • historyProvides a couple of convenient aliases for using the history command to examine your command line history. h for history, hs for history | grep and hsi for history | grep -i
  • vi-modeThis plugin increase vi-like zsh functionality. Use ESC or CTRL-[ to enter Normal mode.
  • zThis plugin defines the z command that tracks your most visited directories and allows you to access them with very few keystrokes.

Customs

# Clone these repositories into oh-my-zsh's plugins directory:

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Activate the plugins in ~/.zshrc

plugins=( [plugins...] 
            git
            zsh-syntax-highlighting
            zsh-autosuggestions
            fasd)

Restart iTerm2 from the menu instead of source ~/.zshrc according to the documentation.

Zsh Themes

Built-ins

ohmyzsh/themes should be in your ~/.oh-my-zsh/themes/ directory. There are over 140 to choose from.

To enable a theme, set the theme variable in .zshrc:

ZSH_THEME = <name of the theme without the extension>
ZSH_THEME = "robbyrussell" # default theme for example

Many themes require installing the Powerline Fonts to render properly. I cover this below in Vim – Plugins.

Customs

romkatv/powerlevel10k: A Zsh themeis a theme for Zsh. It emphasizes speed, flexibility and out-of-the-box experience.

It is a favorite among the Medium community, so I jumped on the bandwagon. To install, run the following command:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Then make sure to add the following:

ZSH_THEME="powerlevel10k/powerlevel10k" to the .zshrc and then restart iTerm.

The configuration wizard should start automatically but if not, or you want to rerun to change, just run p10k configure

Update the terminal color to suit:

iTerm2 Profiles > Open Profiles... ⌘O > Default > Edit Profiles > Colors > Color Presets... > <cycle through until you find your mojo>

Note: Solarized Dark has the same background as the default zsh-autocompletions text, so you cannot see it. Moving the Minimum Contrast slider to about half way will solve this.

Searching Tools

The following are some tools I have installed. They each serve their own purpose, and I will touch on each.

 brew install ripgrep fasd fzf fd

ripgrep rg

BurntSushi/ripgrep – ripgrep recursively searches directories for a regex pattern

Great use is trying to find where an alias has been set. I use these frequently to find code snippets in my Python folders.

$ rg --binary '^alias v=' # search for binary files with text lines starting with "alias = v"

plugins/fasd/fasd.plugin.zsh
14:alias v='f -e "$EDITOR"'

plugins/vim-interaction/vim-interaction.plugin.zsh
56:alias v=callvim

# Finding code snippets
rg -t py "import requests"
learning/py_scripts/scrape_headings.py
3:import requests

fasd

fasd – Command-line productivity booster, offers quick access to files and directories, inspired by autojump, z and v.

To get fasd working in the shell, add the following initialization code eval "$(fasd --init auto)" into .zshrc, and include fasd into the plugins section.

Note: The oh my zsh fasd built-in plugin assigns the alias v = fasd -f -e "$EDITOR". Therefore, the editor has to be assigned in the .zshrc by add the following:

# Set the Editor
EDITOR="vim"

Then you can run v zshrc which will run fasd -f -e vim zshrc' and will open .zshrc in vim.

fd

sharkdp/fdis a simple, fast and user-friendly alternative to find.

One of my favorite commands is to delete files:

fd -H '^\.DS_Store$' -tf -X rm # remember to drop -X rm first before running!
fd ... -X bat # send results to bat to display (bat install required)

The Tutorial contains many more use cases.

fzf

fzf – is a general-purpose command-line fuzzy finder.

Run the following to install useful key binds and fuzzy completion:

# To install useful key bindings and fuzzy completion. Include $ in the command.
$(brew --prefix)/opt/fzf/install

# Upgrading fzf
brew update && brew reinstall fzf

The three main key binds are:

  • control-T ⌃T – Pastes the selected files and directories onto the command-line
  • control-R ⌃R – Pastes the selected command from history onto the command-line. Cycle control-R ⌃R to toggle between commands in chronological order or sorting by relevance.
  • option-C ⌥C – cd into the selected directory. Note: You may need to set the option-C key binding in the .zshrc:
# Bind option-C ⌥C to cd into the selected directory
bindkey "ç" fzf-cd-widget

Fuzzy completions

# Files and directories
# Files under current directory
# - You can select multiple items with TAB key
vim **<TAB>

# Files under parent directory
vim ../**<TAB>

# Files under parent directory that match `fzf`
vim ../fzf**<TAB>

# Files under your home directory
vim ~/**<TAB>

# Directories under current directory (single-selection)
cd **<TAB>

# Directories under ~/github that match `fzf`
cd ~/github/fzf**<TAB>

# Process IDs
# Can select multiple processes with <TAB> or <Shift-TAB> keys
kill -9 <TAB>

# Host names
ssh **<TAB>
telnet **<TAB>

# Environment variables / Aliases
unset **<TAB>
export **<TAB>
unalias **<TAB>

Preview Window

brew install bat by sharkdp: A cat clone with wings. for syntax highlighting in the preview pane.

brew install tree to view in the window.

Added the following bindings and settings to ~/.zshrc. Thanks to Vinicius for the thorough explanation in his article.

export FZF_DEFAULT_OPTS="
--layout=reverse
--info=inline
--height=80%
# Enable multi-mode 
--multi
# Set the preview window to hidden by default
--preview-window=:hidden
# Preview window settings once toggled on
--preview '([[ -f {} ]] && (bat --style=numbers --color=always {} || cat {})) || ([[ -d {} ]] && (tree -C {} | less)) || echo {} 2> /dev/null | head -200'
--color='hl:148,hl+:154,pointer:032,marker:010,bg+:237,gutter:008
--prompt='∼ ' --pointer='▶' --marker='✓'
# Toggle preview window visibility with '?'
--bind '?:toggle-preview'
# Select all entries with 'CTRL-A'
--bind 'ctrl-a:select-all'
# Copy the selected entries to the clipboard with 'CTRL-Y'
--bind 'ctrl-y:execute-silent(echo {+} | pbcopy)'
# Open the selected entries in vim with 'CTRL-E'
--bind 'ctrl-e:execute(echo {+} | xargs -o vim)'
# Open the selected entries in VSCode with 'CTRL-V'
--bind 'ctrl-v:execute(code {+})'
"

The docs note that fzf is a general purpose text filter and not a file finder, and suggests not to set the preview window to run by default, hence the --preview-window=:hidden. To show the preview window, assign a key binding to toggle it on/off (? used above).

Multi-select mode is set with --multi. TAB and Shift-TAB will mark multiple items.

Assign a few useful key bindings like select all, copy selected and open selected in vim or VS Code.

Use fd instead of default find

Include the following with your flags of choice to the .zshrc:

# fzf's commands to change from find to fd
export FZF_DEFAULT_COMMAND="fd --hidden --follow --exclude '.git'"
# CTRL-T's command
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# ALT-C's command
export FZF_ALT_C_COMMAND="$FZF_DEFAULT_COMMAND --type d"

In addition, the following edits are required to the completion.zsh located in cd /usr/local/opt/fzf/shell/

# Use fd (https://github.com/sharkdp/fd) instead of the default find
# command for listing path candidates.
# - The first argument to the function ($1) is the base path to start traversal
# - See the source code (completion.{bash,zsh}) for the details.
_fzf_compgen_path() {
  fd --hidden --follow --exclude ".git" . "$1"
}

# Use fd to generate the list for directory completion
_fzf_compgen_dir() {
  fd --type d --hidden --follow --exclude ".git" . "$1"
}

Integration with z

Like normal z when used with arguments but displays an fzf prompt when used without.

# Integration with z.
# like normal z when used with arguments but displays a fzf prompt when used without.
unalias z 2> /dev/null
z() {
  [ $# -gt 0 ] && _z "$*" && return
  cd "$(_z -l 2>&1 | fzf --height 40% --nth 2.. --reverse --inline-info +s --tac --query "${*##-* }" | sed 's/^[0-9,.]* *//')"
}

I tried the 2nd version on the wiki page using zz, but got a zsh error on startup.

Command history

Pipe in your history into fzf with the following example) by running fh:

# fh - repeat history
fh() {
  print -z $( ([ -n "$ZSH_NAME" ] && fc -l 1 || history) | fzf +s --tac | sed -E 's/ *[0-9]*\*? *//' | sed -E 's/\\/\\\\/g')
}

Other Examples

The documentation wiki contains many other uses. I plan to explore Git, Homebrew, man pages.

Vim

Themes

onedark.vim: A dark Vim/Neovim color scheme inspired by Atom’s One Dark syntax theme.

Install per the following commands:

$ git clone https://github.com/joshdick/onedark.vim.git ~/onedark
$ cd ~/onedark
$ mkdir ~/.vim/colors
$ cp colors/onedark.vim ~/.vim/colors/
$ cp autoload/onedark.vim ~/.vim/autoload/

Then add the following to the .vimrc:

colorscheme onedark
syntax on
set number
highlight Normal ctermbg=None
highlight LineNr ctermfg=DarkGrey

Plugin Manager

vim-plugMinimalist Vim Plugin Manager

Install per the following command:

curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

Usage: Add a vim-plug section to ~/.vimrc per the following example:

" Specify a directory for plugins
" - For Neovim: stdpath('data') . '/plugged'
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')

" Make sure you use single quotes

Plug <Add plugin call details here> 
Plug <Add another plugin call details here> 

" Initialize plugin system
call plug#end()

Reload in Vim with :source ~/.vimrc then :PlugInstall to install the plugins.

Here is a list of a few other Plugin Managers to consider: Pathogen;
NeoBundle; Vundle; VAM; Dein; minpac

Plugins

vim-airline

These plugins jazz up the vim’s status bar at the bottom of each vim window.

Add the following lines to the vim-plug section of ~/.vimrc:

" from https://github.com/vim-airline/vim-airline#themes (note Plug not Plugin)
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'

To extend the powerlevel10k theme symbols (powerline fonts) to the vim status bar, you would need to install them.

Install the powerline-fonts as per the following commands:

# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
rm -rf fonts

Add this convenience variable to the ~/.vimrc, which should automatically populate the g:airline_symbols dictionary of the powerline symbols:

let g:airline_powerline_fonts = 1

FZF Plugin in Vim

fzfFZF Vim integration

Add Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } to the ~/.vimrc and then install the plugin with :PlugInstall.

Fire up fzf with the following command :FZF

NERDtree

nerdtreeA tree explorer plugin for vim

Add the following configurations into the .zshrc:

# Add these lines
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif

# Add the Plug into the plug call
call plug#begin('~/.vim/plugged')
Plug 'preservim/nerdtree'
call plug#end()

Install with :PlugInstall and activate with :NERDTree.

Python and Tools

Python

Install Python with brew:

$ brew install python3
Warning: python@3.8 3.8.5 is already installed and up-to-date

I added the following alias to .zshrc for convenience:

alias python='python3'
alias pip='pip3'

Environment

Installation Management Tool

pyenvSimple Python Version Management

brew update

# install dependencies
brew install openssl readline sqlite3 xz zlib

# Using the pyenv-installer
# https://github.com/pyenv/pyenv-installer
curl https://pyenv.run | bash

# add to the end of the shell to enable shims and autocompletion.
echo -e 'PATH="$HOME/.pyenv/bin:$PATH"\n\nif command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\n  eval "$(pyenv virtualenv-init -)"\nfi' >> ~/.zshrc

$ exec "$SHELL" # Or just restart your terminal

Using pyenv to Install Python

# Upgrade pyenv
$ brew upgrade pyenv

# List all available python versions which can be installed
$ pyenv install --list

# Install a version of Python of your choice from the --list
$ pyenv install 3.8.5

# list python versions controlled by pyenv
$ ls ~/.pyenv/versions/
3.7.8 3.8.5

# Set the global python version
$ pyenv global 3.8.5

# Show the current Python version(s) and its origin
$ pyenv versions
system
3.7.8
* 3.8.5 (set by /Users/bgs/.pyenv/version)

$ python -V
Python 3.8.5

$ which python3
/Users/bgs/.pyenv/shims/python3

$ pyenv which python
/Users/bgs/.pyenv/versions/3.8.5/bin/python

Creating Virtual Environments

# Create a Virtual Environment with
# pyenv virtualenv <python_version> <environment_name>
$ pyenv virtualenv 3.8.5 ds38

$ pyenv which python
/Users/bgs/.pyenv/versions/3.8.5/bin/python

# Activating an environment within a folder with
# pyenv local <environment_name>

# Create folder, go to it, activate the local environment
$ mkdir ~/git/temp && cd ~/git/temp
$ pyenv local ds38

# Run within the local folder
$ pyenv local ds38

$ pyenv which python
/Users/bgs/.pyenv/versions/ds38/bin/python

pip installs

I keep a copy of some common python packages in a requirements.txt file that I use as a template for any newly created python environments.

My file was just a copy of handson-ml2/requirements.txt and I commented out most and added any I use regularly. Here is a list of the current packages:

##### Core scientific packages
jupyter
matplotlib
numpy
pandas
scipy
requests
seaborn

##### Machine Learning packages
scikit-learn

These can then be installed with a simple command.

python -m pip install -r requirements.txt

VSCode

Installation

VSCode is my IDE of choice at the moment. I install it with brew and create a symbolic link to the settings file to control it over on my GitHub repo of dot files.

brew cask install visual-studio-code

settings.json can be found with ⇧⌘P > >Preferences: Open Settings (JSON)

To enable Intellisense in Jupyter notebooks I added the following command in the settings.json per Issue #8567.

// config from https://github.com/microsoft/vscode-python/issues/8567#issuecomment-560356230
"python.dataScience.runStartupCommands": "%config IPCompleter.use_jedi = False" 

Extensions

Here is a short list of extensions I have installed:

  • Pythonincludes features such as IntelliSense, linting, debugging, code navigation, code formatting, Jupyter notebook support, refactoring, variable explorer, test explorer, snippets, and more!
  • Prettier – Code formatteris an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
  • Python Docstring GeneratorAutomatically generates detailed docstrings for python functions
  • Visual Studio IntelliCodeAI-assisted development
  • GitLens — Git superchargedsupercharge the Git capabilities built into Visual Studio Code — Visualize code authorship at a glance via Git blame annotations and code lens, seamlessly navigate and explore Git repositories, gain valuable insights via powerful comparison commands, and so much more
  • VimVim emulation for Visual Studio Code

To remap Vim <Esc> to get back to Normal mode from Insert mode, add the following to the settings.json:

// Vim insert <Esc> to Normal mode
"vim.insertModeKeyBindings": [
        {
            "before": ["i", "i"],
            "after": ["<Esc>"]
        }

Apple Settings (Subject to Change)

System Preferences

First Time Setup

Apple menu  > About this Mac > Software Update… > ☑️ Automatically keep my Mac up-to-date (checked)

General

Default web browser: Firefox

Dock

Position on screen: Left
☑️ Automatically hide and show the Dock (unchecked). I mainly use keyboard shortcuts and hardly ever use the dock.

Users & Groups

Confirm Guest User is set to Off.

Accessibility

Pointer Control > Mouse & Trackpad > Trackpad Options… > ️️☑️ Enable dragging > without drag lock

The dragging function allows for dragging around windows, highlighting text etc. after holding down on the second tap. I find this light drag is easier on the fingertips than the Single force hold and drag.

Security & Privacy

General > ☑️ Require password > 5 minutes
FileVault > Turn on
Firewall > Turn on

Keyboard

Keyboard > Touch Bar shows > F1, F2, etc. Keys
Keyboard > Press Fn key to > Show Control Strip

Text > ☐ Add period with double-space – Coding out 4 space indents or double spaces after at the end of a line in markdown is a nightmare.

Trackpad

Point & Click
Look up & data detectors > ☑️ Tap with three fingers
Secondary click > ☑️ Click or tap with two fingers
Point & Click > ☑️ Tap to click with one finger

Click > Light | Tracking speed > Fast
I find that Light works well for long usage and Fast will get across the width of my 28″ screen within the swipe width of the trackpad.

Scroll and Zoom
️️☑️ Check all four

More Gestures
️️☑️ All checked

Finder

⌘, to open Finder Preferences

Finder Preferences

Preferences > Advanced > ☑️ Show all filename extensions

General
Check all and set New Finder windows shows: Recent

Sidebar
Check all except Recent Tags.

Advanced
☑️ Show all filename extensions

Menu Bar

View > Show Path Bar ⌥⌘P
View > Show Status Bar ⌘/

# Show path bar
defaults write com.apple.finder ShowPathbar -bool true

# Show status bar
defaults write com.apple.finder ShowStatusBar -bool true

Show hidden files

We can toggle ⇧⌘ hidden files on/off, or more permanently, by running the following command in the terminal.

# Permanently hide [true] or show [false] hidden files
write com.apple.Finder AppleShowAllFiles true
killall Finder

Post Setup

Installs

Mac Apps

# Some cask installs
brew cask install firefox
brew cask install flux
brew cask install alfred
brew cask install bettertouchtool

Shortcuts

# Some other cask installs
brew cask install cheatsheet
brew cask install karabiner-elements
brew cask install keyboard-maestro

Karabiner-ElementsA powerful and stable keyboard customizer for macOS.

My only use for Karabiner-Elements so far is setting a hyper key (⇧⌃⌥⌘ set to caps-lock) to use with Keyboard Maestro.

Text Expansion

espansoCross-platform Text Expander written in Rust

Install and start the application with the following commands:

brew tap federico-terzi/espanso
brew install espanso
espanso --version
espanso register
espanso start

I also control the default.yml with all my expansions in my dot files repo.

Quick Look plugins

Mark a file in Finder and press Space to start Quick Look.

brew cask install \
    qlcolorcode \
    qlstephen \
    qlmarkdown \
    quicklook-json \
    qlprettypatch \
    quicklook-csv \
    betterzip \
    webpquicklook \
    suspicious-package

Note: Apple will return an error that the App can’t be opened because Apple can’t check it for malicious software. Work-around: run sudo spctl --master-disable which will add an Allow apps downloaded from: Anywhere to Security & Privacy. To disable run sudo spctl --master-enable. You may still have to unlock in the Security settings to allow individual installs.

Misc

I installed brew install htop and to run you have to sudo htop which changes the permissions to the .config directory to root. Change it back to user with:

$ ls -ld ~/.config

# if the owner is root, then change the owner to your user
$ sudo chown -R $USER ~/.config

If you notice your shell is slow when pasting text into it, you might want to uncomment this line (remove #) in your .zshrc:
# DISABLE_MAGIC_FUNCTIONS=true.

You can copy/paste directly from/to your terminal by piping (|) to/from pbcopy and pbpaste.

. dot files management

Version controlling of configuration dot files for safe keeping accomplished with git and GitHub.

Having these located and controlled in one location removes the burden of going around and locating them and forgetting about them in the event you wipe your computer for a clean install.

I accomplished this by creating folders, moving/coping configuration files and symbolic linking back to their root locations. Simple!

# Create a folder for the dot files and initialise it in git
mkdir ~/git/config_files/dotfiles

# Move or Copy config files over to the controlled folder for subfolder
# and create/update a symbolic link back to its original location

mv ~/.vimrc ~/git/config_files/dotfiles
ln -sfn ~/git/config_files/dotfiles/vimrc ~/.vimrc

mv ~/.zshrc ~/git/config_files/dotfiles
ln -sfn ~/git/config_files/dotfiles/zshrc ~/.zshrc

vim ~/git/config_files/dotfiles/ripgreprc # amend to suit
ln -sfn ~/git/config_files/dotfiles/ripgreprc ~/.ripgreprc

mkdir ~/git/config_files/fzf
cp /usr/local/opt/fzf/shell/completion.zsh ~/git/config_files/fzf
ln -sfn ~/git/config_files/fzf/completion.zsh /usr/local/opt/fzf/shell/completion.zsh

mkdir ~/git/config_files/vscode
cp ~/Library/Application\ Support/Code/User/settings.json ~/git/config_files/vscode/
ln -sfn ~/git/config_files/vscode/settings.json /Users/bgs/Library/Application\ Support/Code/User/settings.json

mkdir ~/git/config_files/espanso
cp /Users/bgs/Library/Preferences/espanso/default.yml ~/git/config_files/espanso/
ln -sfn ~/git/config_files/espanso/default.yml /Users/bgs/Library/Preferences/espanso/default.yml

# Note to create a link with ln -s and update use ln -sfn 

References

I garnered a lot of inspiration from these articles. Please note, some may be behind a pay wall.

Terminal

Python


2 thoughts on “macOS Initial setup of CLI and Python Dev

Comments are closed.