1. iTerm2
  2. zsh & oh-my-zsh
  3. delta
  4. dotfiles
  5. X11
  6. Fonts
  7. Alfred
  8. Github Page
  9. Proxy

iTerm2

  • shell integration
  • ssh with tmux
    • ssh -Yt [target] tmux -2u -CC new -A -s [session]

zsh & oh-my-zsh

zsh is instlled by default in mac

chsh -s /bin/zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

delta

A viewer for git and diff output

brew install git-delta

.gitconfig
[pager]
    diff = delta
    log = delta
    reflog = delta
    show = delta

[interactive]
diffFilter = delta --color-only

[delta]
features = side-by-side line-numbers decorations
whitespace-error-style = 22 reverse

[delta "decorations"]
commit-decoration-style = bold yellow box ul
file-style = bold yellow ul
file-decoration-style = none

dotfiles

My dotfiles

X11

brew install xquartz
open /Applications/Utilities/XQuartz.app
ssh -Y [target]

Fonts

  • Fira Code
    • brew install font-fira-code
  • Hack Nerd ------ Non-ASCII Font
    • brew install font-hack-nerd-font

Alfred

Preferences -> Features -> Terminal -> Application -> Custom

change default terminal to iTerm2
on alfred_script(q)
	if application "iTerm2" is running or application "iTerm" is running then
		run script "
			on run {q}
				tell application \":Applications:iTerm.app\"
					activate
					try
						select first window
						set onlywindow to false
					on error
						create window with default profile
						select first window
						set onlywindow to true
					end try
					tell current session of the first window
						if onlywindow is false then
							tell split vertically with default profile
								write text q
							end tell
						end if
					end tell
				end tell
			end run
		" with parameters {q}
	else
		run script "
			on run {q}
				tell application \":Applications:iTerm.app\"
					activate
					try
						select first window
					on error
						create window with default profile
						select first window
					end try
					tell the first window
						tell current session to write text q
					end tell
				end tell
			end run
		" with parameters {q}
	end if
end alfred_script
  

Github Page

Ruby(default) RubyGems(default) nvm node

  • nvm
    • curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
  • node
    • nvm install --lts long-term-support verson
[sudo] gem install jekyll
git clone [github page url]
cd [github page dir]
bundle init  # create Gemfile if there's no one
echo 'gem "minima"' >> Gemfile  # load theme
bundle install
bundle exec jekyll serve --trace  # running jekyll on a local port
rake new  # create a new post from a template

Proxy

assume system proxy has been set

#proxy_addr="http://127.0.0.1:8118"
proxy_addr="socks5://127.0.0.1:1080"
alias proxy="export all_proxy=$proxy_addr"
alias unproxy="unset all_proxy"