Skip to content

Personal dotfiles

Notifications You must be signed in to change notification settings

st3v3nhunt/dotfiles

Repository files navigation

Dot files

Release Build Status semantic-release Known Vulnerabilities

Dotfiles repository for macOS and Linux WSL distros

Clone the repository somewhere on the local disk and run ./install.sh. This will do most of the following but some installation steps are OS dependent. The details can be seen in install.sh.:

  • Symlink all dotfiles into the user's home directory
  • Install Oh My Zsh and some plugins
  • Install Homebrew and some brews
  • Install Caskroom and some casks (GUI applications, mostly)
  • Install some Gems
  • Install some Pips
  • Install some Node.js stuff including nvm and globally installed npm packages including Yarn
  • Install and setup tmux related stuff
  • Install and setup Vim and neovim and other related stuff
  • Install .Net tooling
  • Install Nerd Fonts
  • Install Rust

At several stages during the running of the installation scripts your password will be prompted for.

Git Config

Machine specific Git signing key

In order to sign commits (a good idea) a signing key needs to be associated to your Git profile.

The easiest way to manage this is to use the same key on each machine where the signing needs to happen. Once a key has been generated it can be exported and imported (details).

# List the keys and get id of the one of interest (in braces in the output)
gpg --list-secret-keys [--keyid-format=long]
# Export the key of interest to a file called `private.key`
gpg --export-secret-keys <key-id> > private.key
# Move the file to the machine where it is to be imported
gpg --import private.key

If this isn't possible (or desirable) there are other ways around this, most notably using Git's includeIf. However, this would likely introduce additional complexity and worse ergonomics (e.g. using a specifically named directory to determine which key to use).

WSL/Windows

Windows Terminal is used, settings are available in WSL/profiles.json. See install-wsl-stuff for details.

macOS

Manual steps

  • Set Resolution of display (System Preferences -> Displays -> Display Settings...)
  • Set Text shortcuts (System Preferences -> Keyboard -> Text). Useful shortcuts:
Replace With
@p personal email address
@w work email address
mob mobile phone number

iTerm2

Preferences

iTerm2 preferences are stored @ /plists/com.googlecode.iterm2.plist. Within iTerm2 this setting will need to be entered before these will be used. Go to Preferences->General->Preferences and enter ~/code/dotfiles/plists into the option for Load preferences from a custom folder or URL:.

Themes

The iterm preference file uses Monokai-Dark for the theme. This can be downloaded from iterm2colorschemes

Installing Docker for Mac

At the time of writing Docker for Mac is not available via Homebrew. It can be downloaded from the Docker Store.

Language specifics

Deno setup in Vim

Setup Vim for a Deno project by running :CocCommand deno.initializeWorkspace as per these instructions.

Go language support in Vim

Install vim-go. The plugin will be installed when running ./install-vim-stuff. Once the plugin is installed :GoInstallBinaries needs to be run from within Vim.

C# IDE like abilities

OmniSharp will provide IDE like capabilities within (Neo)Vim in collaboration with Nvim's LSP using the nvim-lspconfig plugin.

When a .cs file is opened, the plugin will check for an existing installation of OmniSharp, if none can be found you will be prompted to install it.

OmniSharp needs to be installed as per the instructions. It will need to be downloaded from the OmniSharp GitHub releases. Unpack the download and add it to the same directory specified in lsp.lua.

Install gt

Terminal

Nerd Fonts for Powerline

In order to get the icons (glyphs) working for the Powerline theme for Oh My Zsh follow these instructions. It involves downloading and installing your favourite Nerd Font from font-downloads. Use JetBrains Mono, it is a very good choice and the configuration within this repository has been setup expecting it to be installed. Once installed the terminal(s) will need to be restarted.

Tmux plugin manager is installed along with the following plugins:

  • tmux-resurrect - enables session saving and restoration via prefix + Ctrl-s and prefix + Ctrl-r
  • tmux-continuum - automates session the actions of tmux-resurrect

In order to have the plugins installed, reload the config with prefix + I. This can also fix problems with the plugins not working.

FAQ

  • No linting in Vim and no lint warning or error symbols in the margin?

    • Check the repository's packages have been installed
    • Try restarting the ESLint server. At the terminal run eslint_d restart
  • No completion in VIM?

  • Command failed and error reported ...can't decompress data; zlib not available

    • Run sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
  • If an error like this occurs - Warning: Unexpected method 'license' called on Cask <cask_name>. it might be because the cask is old and out of date, try:

    • Removing the cask via rm -rf $(brew --prefix)/Caskroom/<cask_name>
  • Want to fetch all PRs from GitHub or MRs from GitLab locally?

    • Add the following to the repository's .git/config:
    [remote "origin"]
    fetch = +refs/pull/*:refs/remotes/origin/pull/*
    fetch = +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*
  • Reload .vimrc within Vim without restarting Vim - :so $MYVIMRC or just <leader>sv

  • Sort Vim's dictionary in place (-o) and case insensitively (-f) - sort -f -o vim/en.utf-8.add vim/en-utf-8.add

  • Errors like nvm is not compatible with the npm config "prefix" option

    • Try running nvm unalias default
  • No deno shell autocompletion?

    • They probably failed to be created after deno had been installed. Re-run the commands as shown in the docs and re-source the shell
  • Problems with Vim plugins? Try updating them with :PlugUpdate

  • Toggle Windows Terminal focus mode with Ctrl+Shift+Enter

  • Open Windows Terminal settings with Ctrl+,

Architecture Decision Records

This repository uses Architecture Decision Records to record architectural decisions for this project. They are stored in doc/architecture/decisions.