Skip to content

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 packages via Brewfile
  • 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 Neovim with pure Lua configuration
  • Install .Net tooling
  • Install Nerd Fonts
  • Install Rust

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

Homebrew Packages

Packages are managed declaratively via Brewfile. Common commands:

brew bundle              # Install all packages from Brewfile
brew bundle check        # Check which packages are missing
brew bundle cleanup      # Remove packages not in Brewfile
brew bundle dump --force # Regenerate Brewfile from installed packages

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 Neovim

Deno is configured via LSP (denols) automatically. No additional setup needed.

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 Neovim.

C# IDE like abilities

OmniSharp provides IDE capabilities within Neovim via the built-in LSP using the nvim-lspconfig plugin.

OmniSharp needs to be downloaded from the OmniSharp GitHub releases. Unpack the download and add it to ~/.cache/omnisharp-vim/omnisharp-roslyn/ as 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.

Pane text search

Search text across tmux panes using fzf. Selecting a match switches to the pane and scrolls to the matching line. Requires fzf and tmux to be installed.

  • prefix + f — search across all panes in all sessions (1000 lines scrollback)
  • prefix + F — search panes in the current window only (10000 lines scrollback)

Within the search popup:

Key Action
ctrl-w Toggle searching window/session names
ctrl-/ Toggle preview (surrounding context)
ctrl-d / ctrl-u Half page down/up
ctrl-f / ctrl-b Full page down/up
ctrl-g / G Jump to first/last result
ctrl-y Copy selected line to clipboard

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 Neovim config without restarting - :so $MYVIMRC or <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 Neovim plugins? Try updating them with :Lazy sync

  • Missing formatters or linters? Check :Mason to see installed tools

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

  • Open Windows Terminal settings with Ctrl+,

Key bindings to remember

Diagnostics

source

  • ]d jumps to the next diagnostic in the buffer
  • [d jumps to the previous diagnostic in the buffer
  • ]D jumps to the last diagnostic in the buffer
  • [D jumps to the first diagnostic in the buffer
  • <C-w>d shows diagnostic at cursor in a floating window

NvimTree

  • g? shows help/keybindings menu

Ghostty

  • Cmd+Shift+, reload config

Architecture Decision Records

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

About

Personal dotfiles

Topics

Resources

Stars

Watchers

Forks

Contributors