Skip to content

mlaursen/dotfiles

Repository files navigation

dotfiles

This repo contains my dotfiles.

bash <(curl -s https://raw.githubusercontent.com/mlaursen/dotfiles/master/init.sh)

Manual Installation

Download fonts and colorscheme

Setup Terminal

Mac
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install git
brew cask install iterm2

Open iterm2

open ~/Downloads/nightfox.itermcolors
rm ~/Downloads/nightfox.itermcolors

Update profile as needed to use font and colorscheme.

Windows
  • Install Terminal from the App Store
  • Install Ubuntu from the App Store
  • Start Terminal and create simple mlaursen user
  • Open the settings (<ctrl-,>)
    • Open the settings.json file
      • Paste the contents of windows_terminal.json into the themes section
    • Update the Ubuntu appearance to use font and colorscheme
  • Symlink wslview to xdg-open so that gx and gX work
    • sudo ln -s $(which wslview) /usr/local/bin/xdg-open

Setup dotfiles

Clone this repo and setup code directory:

git clone git@github.com:mlaursen/dotfiles.git "~/dotfiles"
mkdir ~/code

Symlink dotfiles

ln -s ~/dotfiles/.zshrc ~/.zshrc
ln -s ~/dotfiles/.gitconfig ~/.gitconfig
ln -s ~/dotfiles/.dir_colors ~/.dir_colors
ln -s ~/dotfiles/.tmux.conf ~/.tmux.conf
ln -s ~/dotfiles/.editorconfig ~/.editorconfig
ln -s ~/dotfiles/lazyvim/nvim ~/.config/nvim

Install packages

# Mac
cd ~/dotfiles
brew bundle

# Windows
# I don't know the full list at this time
sudo apt install neovim python3

Switch to zsh and setup oh my zsh

chsh -s /usr/zsh

If the command above fails, run chsh -l to find the correct zsh path and run with that instead

Logout for the new shell to take effect. Then install oh-my-zsh:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Symlink my custom theme:

ln -s ~/dotfiles/mlaursen.zsh-theme ~/.oh-my-zsh/themes/mlaursen.zsh-theme

Install haskell stack:

curl -sSL https://get.haskellstack.org/ | sh

Setup zsh-git-prompt:

git clone https://github.com/zsh-git-prompt/zsh-git-prompt ~/code/
cd ~/code/zsh-git-prompt
stack setup
stack build && stack install
If this fails on Apple Silicon M1 Chips

I got it to work by updating the haskell/stack.yaml file with:

diff --git a/haskell/stack.yaml b/haskell/stack.yaml
index 7c9ea71..b4b5a22 100644
--- a/haskell/stack.yaml
+++ b/haskell/stack.yaml
@@ -1,14 +1,18 @@
# For more information, see: https://github.com/commercialhaskell/stack/blob/release/doc/yaml_configuration.md

# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
-resolver: lts-5.0
+resolver:
+  compiler: ghc-8.10.7

# Local packages, usually specified by relative directory name
packages:
- '.'

# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
-extra-deps: []
+extra-deps:
+  - QuickCheck-2.14.2
+  - random-1.2.1.1
+  - splitmix-0.1.0.4

# Override default flag values for local packages and extra-deps
flags: {}

Install node

Install volta to manage node and package managers

curl https://get.volta.sh | bash
source ~/.zshrc

volta install node@18
volta install node

volta install pnpm

volta install yarn@1
volta install yarn

Setup neovim

ln -s ~/dotfiles/lazyvim/nvim ~/.config/nvim
pip3 install neovim

# If it failed
pip3 install neovim --user

# Start nvim to start installing packages
nvim

Setup GPG for signing commits

Create a new GPG

Check out Methods of Signing with GPG

Mac
ln -s ~/dotfiles/install/mac/gpg.conf ~/.gnupg/gpg.conf
ln -s ~/dotfiles/install/mac/gpg-agent.conf ~/.gnupg/gpg-agent.conf
Windows
  • Create a new GPG
  • Export the GPG key: gpg --armor --export-secret-keys UUID_OF_GPG_KEY > private.cert
  • Copy the private.cert to Windows Download folder by navigating to \\wsl$\Ubuntu\eome\mlaursen
  • Install Kleopatra
    • Uncheck everything except for the required one and Kleopatra
  • Import the private.cert into Kleopatra and then certify the new private.cert
  • Increase the passphrase duration
    • Ctrl+Shift+, -> GnuPG System -> Private Keys -> Update all caches to 28800
ln -s ~/dotfiles/install/windows/gpg-agent.conf ~/.gnupg/gpg-agent.conf
gpg-connect-agent reloadagent /bye

(Windows): Add support for Playwright/Cypress gui:

  • Install VcXsrv Windows X Server

  • Update .zshrc to include:

    # set DISPLAY variable to the IP automatically assigned to WSL2
    export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0
    
    # might need this as well to start dbus daemon
    # sudo /etc/init.d/dbus start &> /dev/null
  • Start X Server (xLaunch)

    • use default options for display settings
    • disable access control in client startup settings
    • allow both private and public networks when the Windows security popup appears
    • save the config somewhere
    • pin the saved xLaunch config to the taskbar
  • Whenever I want to use the gui

    • Right click the pin and click the config to start the server
    • Start up the terminal

About

A repo for my bashrc and .vimrc settings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published