This repo is a collection of my dotfiles and configurations for zsh, tmux, vim, git and some custom scripts. It contains:
- aliases.zsh
- .asfrc
- Brewfile for Brew packages
- Global .gitattributes, .gitconfig and .gitignore
- Ruby's .gemrc, .pryrc
- Scripts on Mac for battery, disk usage and temperature
- .tmux.conf
- .vimrc
- Zsh configs (in execution orderder)
- .zshenv
- .zprofile
- .zshrc
- .zlogin
- Install Brew (This will also install dev tools if missing e.g
git
) - Clone the repo
git clone https://github.com/cristianriano/dotfiles.git ~/dotfiles
- Run
aliases.zsh
and then the functionsdotfiles_link
andconfig_link
on the shell - Run
brew bundle
inside the repo - Set
zsh
as the default shellchsh -s /bin/zsh
- Open a new terminal, it should download
zi
and install the packages (you might have to do it multiple times) - Create a new ssh-key
ssh-keygen -t rsa -C "<email>" -b 4096
Terminal needs a Nerd font to allow you see all the icons & glyphs in the prompt.
This setup uses MesloLGM Nerd Font
which is downloaded automatically and saved in ~/Library/Fonts/
by ZI the first time zhell is started.
If the Font is not detected by the system copy+paste them in the Font Book
Set the Font by going to Preferences > Profiles > Text > Font
Set the Font by going to Settings > Appearance > Text > Terminal Font
Activate prompt go to Settings > Features > Session > Honor user's custom prompt (PS1)
Change themes Setttings > Appearance > Themes
- Sync with OS
- Solarized Dark & Light
This configuration uses ZI for loading plugins, and leverages the Turbo mode to
increass loading speed (currently ~300ms, run timezsh
for a report from initializing zsh 10 times).
To check the time to load each package
zi time
To update and compile it run
zi self-update
- Autosuggestions Fish style
- Additional completions for zsh
- Prezto completions
- Auto pair/delete delimiters
- FZF - Command line Fuzzy Finder
- Fasd
- ASDF - Version Manager
- History search multi world
- History substring search
- Fast Highlighting
- diff-so-fancy
- Power 10K theme
- Don't add twice
dotfiles/bin
toPATH
when opening tmux - Syntax highlight in VsCode and Vim for .envrc
Change between Desktops Keyboard settings > Shortcuts > Mission Control
- Move left a space -> Ctrl-Cmd-Left
- Disable Ctrl-Up and Ctrl-Down
Key repetition Keyboard settings > Keyboard
- Key repeat -> Fast
- Delay Until repeat -> Short
Scroll Reverser Install it from here
- Install settings Sync
- Login using Github and choose the gist
- Enable auto download
- Trigger "Download Settings"
There is a minimalistic Vim setup using vim-plug.
To install new plugins add it to the .vimrc
file and run :PlugInstall
inside vim
-
List all available versions
asdf list
-
Current versions
asdf current
-
Update all plugins
asdf plugin update --all
-
Reshim
asdf reshim ruby
Direnv loads env variables when navigating to a folder with .envrc
There is also a plugin with asdf
to avoid the roundtrip to the shims. To enable it in a parent folder
echo 'use asdf' > .envrc
And then allow the execution by running
direnv allow
- Generate a UUID on the fly
ruby -r securerandom -e 'puts SecureRandom.uuid
- Install package from source
go install github.com/mikefarah/yq/v4@latest
-
New session
tmux new -s work
-
Attach
tmux attach -t work
-
List configuration
git config --list --show-origin
-
Rubocop Prehook
touch .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
git diff --diff-filter AM --name-only --staged | grep "\.rb$" | xargs bundle exec rubocop --parallel --disable-pending-cops
-
Run auto-cleaned container command
docker run -it --rm ubuntu /bin/bash
-
Buildx and tag
docker buildx build --tag mytag:1.0 --build-arg key=value --ssh default .
-
Buld with custom cache
docker buildx build --tag mytag:1.0 --file Dockerfile --cache-from=type=local,src=/tmp/.buildx-cache --cache-to=type=local,dest=/tmp/.buildx-cache .
If direnv is not creating the executable to the correct versions defined in .tool-versions
then run direnv reload
When running the Erlang observer :observer.start
it doesn't render properly on Mac
Solution
When installing Erlang 24 you get a message error about crypto library like this:
checking for OpenSSL in /usr/local/opt/[email protected]... configure: error: neither static nor dynamic crypto library found in /usr/local/opt/[email protected]
rm ~/.zcompdump* && compinit