/dotfiles

My dotfiles

Primary LanguageShell

Zoltan's Dotfiles

macOS Setup

Install softwares

Setup git

git config --global user.name 'Your Name'
git config --global user.email 'your@email.address'
git config --global core.excludesfile ~/.gitignore
git config --global pager.branch false
echo ".idea\n.DS_Store\nnode_modules" > ~/.gitignore

Setup ssh

pbcopy < ~/.ssh/id_rsa.pub

Install brew and additional packages

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Install fasd, mc, xz, rbenv, pyenv, go, htop, coreutils, fnm, fsf, tmux, direnv

brew install fasd mc xz rbenv pyenv go htop coreutils fnm fsf tmux direnv
brew tap homebrew/cask-fonts
brew install --cask font-victor-mono

Setup dotfiles in your home folder

Clone this repository in ~/projects/dotfiles

mkdir ~/projects
git clone git@github.com:zoltan-nz/dotfiles.git ~/projects/dotfiles --recurse-submodules

Update submodules

cd ~/projects/dotfiles
git submodule update --recursive --remote

Symlink the following files:

ln -s ~/projects/dotfiles/dotfiles/vimrc ~/.vimrc &&
ln -s ~/projects/dotfiles/dotfiles/zshrc ~/.zshrc &&
ln -s ~/projects/dotfiles/dotfiles/gemrc ~/.gemrc &&
cp ~/projects/dotfiles/dotfiles/zshrc.local.template ~/.zshrc.local

Zsh is the default shell in macOS Catalina, so this step can be skipped. In previous macOS versions change the default shell to /bin/zsh manually. System Preferences > Users and Groups > Authenticate > Right click on user name > Advance Options. Change the login shell to /bin/zsh.

Install fonts

Drag and drop fonts files in Font Book.

Install fzf

What is fzf? A command-line fuzzy finder.

git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install

Language support

Install Python

pyenv install --list
pyenv install 3.9.0
pyenv global 3.9.0
pip install --upgrade pip
pip install pipenv poetry grip

Install Ruby

rbenv install --list
rbenv install 3.0.0
rbenv global 3.0.0

Install Rust

curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

Install Node.js with fnm

Follow the best tutorial about Installing Node.js with Yarn.

fnm list-remote
fnm install 15.5.0
fnm use 15.5.0
fnm default 15.5.0

Install Deno

cargo install deno

Install SDK-MAN for Java support

https://sdkman.io/

curl -s https://get.sdkman.io | zsh
sdk install java 15.0.1.j9-adpt

Setup Shell Session Limits on Mac

<<EOF | sudo tee /Library/LaunchDaemons/limit.maxfiles.plist > /dev/null && sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
        "http://www.apple.com/DTDs/PropertyList-1.0.dtd"\>
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>limit.maxfiles</string>
    <key>ProgramArguments</key>
    <array>
      <string>launchctl</string>
      <string>limit</string>
      <string>maxfiles</string>
      <string>262144</string>
      <string>524288</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>ServiceIPC</key>
    <false/>
  </dict>
</plist>
EOF

Optional setup

Fix holding down a key not repeating problem in macOS

defaults write -g ApplePressAndHoldEnabled -bool false

Use diff-so-fancy for formatting git diff output

Diff So Fancy repository

yarn global add diff-so-fancy && git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"

DNSMasq and loopalias

DNSMasq and loopalias in more detail: https://github.com/zoltan-nz/playing-with-gitlab#setup-dnsmasq-with-loopback-alias

Ubuntu specific setup

Prerequisites on Ubuntu for installing Python (source).

sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git

Notes

macOS startup folders

/Library/StartUpItems
/Library/LaunchDaemons
/Library/LaunchAgents
/System/Library/StartupItems
/System/Library/LaunchDaemons
/System/Library/LaunchAgents
~/Library/LaunchAgents