# Albert Vila's Dotfiles
This is a collection of dotfiles and scripts I use for customizing OS X to my liking and setting up the software development tools I use on a day-to-day basis. It can be cloned anywhere. It includes a setup script that creates the symlinks from your home directory to the cloned repository.
The setup script is smart enough to back up your existing dotfiles into a ~/.dotfiles_old/ directory if you already have any dotfiles.
I prefer zsh as my shell of choice. As such, the setup script will install prezto and zsh. If zsh is installed, and it is not already configured as the default shell, the setup script will execute a chsh -s $(which zsh) command. This changes the default shell to zsh, and takes effect as soon as a new zsh is spawned or on next login.
Check config.sh file if you want to know all packages/modules to install and the lib/os.sh to know the osx defaults that will be changed. Vim plugins are located in vim/plugins.vim.
The config.sh file contains the default packages/modules, it can be extend with a custom file per user, for example I also use the config_albert.sh file.
Recap
- Setup dotfiles (Note that the first time you ran the setup script it may throw some errors, just run the script twice)
- Install osx dev packages for brew/pip/npm/gem/yarn/vscode/brew cask and osx defaults
- Install prezto & zsh as shell (https://github.com/sorin-ionescu/prezto)
- Shell Starship (https://starship.rs/)
- Colors theme solarized (iterm2, gnome-terminal, vim, intellij) (http://ethanschoonover.com/solarized)
- Fonts powerline (https://github.com/powerline/fonts)
The customized theme looks like

If you would like to change the theme just run p10k configure
Before installing under OSX make sure you have the git command installed. If not, just open a Terminal and install the command line tools by typing xcode-select --install.
$ git clone https://github.com/albertvila/dotfiles.git ~/dotfiles
$ cd ~/dotfiles
$ sh ./setup.shIf you have a custom file like config_XXX.sh then you should use the ./setup -uXXX command, it will install the default and the custom packages/modules.
Just run ./setup.sh from time to time to automatically update all modules and applications. Use the -f option to avoid being asked for a confirmation.
- Open OSX keyboard settings and remove spotlight shortcut
- Open Alfred and set spotlight shortcut, also select to be opened at login
- Open rectangle and select to be opened at login
- Generate a new GPG key & add it to Github.com
- Generate a new SSH key & add it to Github.com
- Register the new SSH key using
ssh-add ~/.ssh/github
- Execute
/usr/libexec/java_home -Vto know all java versions installed on your computer jenv add ...to add themjenv global ...to set up the version you want to use
More information here
If the first command does not return anything, just run brew info java and brew info java11 and execute the symlink for the sytem Java wrappers
- Install the Nerd fonts (https://github.com/romkatv/powerlevel10k#fonts)
-
Issues signing commits with Github. First follow all steps from here https://sabbour.me/setting-up-signed-git-commits-on-macos/ If the problem still persist, enable the git Trace mode to properly see the error using
export GIT_TRACE=1 -
If you get issues with gpg, first check the current key is not expired using
gpg --list-secret. If expired, you can change the expiratoin time usinggpg --edit-key XXXand then using theexpirecommand within the shell. Also be sure the variableexport GPG_TTY=$(tty)is properly set, more information here -
If some Alfred workflows does not work it may be because they need the
phpcommand.
Automatically sync
- AdBlock plus
- Bear Chrome
- Dark Reader
- GIFs for Github
- Google Docs Offline
- I don't care about cookies
- JSON Formatter
- Keepa - Amazon Price Tracker
- Pushbullet
- Refined GitHub
- Tampermonkey
- Run
aws configureand set up your aws credentials
- If the Strikethrough shortcut does not work, review if it's used by a Chrome extension using
chrome://extensions/shortcuts
- Open the extension settings, export to a file and then import to the new computer
- You need to configure your gitconfig user section, to do so just create a file named
~/.gitconfig-userin your home folder with the following properties:
[user]
name = Github User
email = [email protected]
signingkey = XXX
Replace:
-
Github Userwith your name and surname -
[email protected]with the email used to login into github -
XXXwith the signing key id -
The ~/.gitconfig-lm file contains company specific hooks, so you can skip this if you want, or add your own hooks.
[core]
hooksPath = __PATH_TO_YOUR_HOOKS__/git-hooks
-
Permission issues with homebrew under OS X El Capitan. Check /usr/local folder if it has de right permissions. Maybe you need to run
sudo chown $(whoami):admin /usr/local && sudo chown -R $(whoami):admin /usr/local -
If you get the error
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrunon OS X High Sierra then you need to reinstall the xcode tools. Runxcode-select --installand the errors will disappear -
If you find the following error while updating homebrew apps, then you should remove one of the taps. You can see all of them using
brew tapand remove one usingbrew untap XXX
Error: Cask java8 exists in multiple taps:
homebrew/cask-versions/java8
caskroom/versions/java8
- To fix the following issue
nvm is not compatible with the npm config "prefix"just run the following commands with the node version displayed from the output of the first command
npm config delete prefix
npm config set prefix $NVM_DIR/versions/node/v6.13.7
- If you get any error related to
pygmentizedoing a cat or more, just run the following commandsudo easy_install Pygmentsto see if it solves the issue
iTerm and zsh tips