Skip to content

eulersson/dotfiles

Repository files navigation

Dotfiles

Collection of configuration files.

Tool Purpose
Alacritty Cross-platform terminal emulator.
tmux Terminal multiplexer.
Zsh Unix shell.
Starship Cross-shell prompt.
LazyVim Customizable Neovim setup.
Raycast Productivity app (among best features is window manager).
Manager Purpose
Antigen Package manager for zsh.
tpm Tmux plugin manager.
pyenv Python version management.
nvm Node.js version management.

Cheat Sheet

See the CHEATSHEET.md document for most common commands and key strokes.

Requirements

Install Homebrew (brew):

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

Install brew packages (produce with brew bundle dump --file=Brewfile):

brew bundle --file=Brewfile

Find a description of all the casks and packages installed in:

Install JetBrainsMono Nerd Font from fonts/JetBrainsMono/fonts/ttf:

cp ./fonts/JetBrainsMono/fonts/ttf/*.ttf ~/Library/Fonts

Tools

Some of the tools included in the brew file:

Tool Purpose
anki Memory training application.
asciinema Record and share terminal sessions.
cloudflared Cloudflare local tunnel proxy.
dark-notify Watcher for macOS 10.14+ light/dark mode changes.
difftastic Diff that understands syntax.
fzf Command-line fuzzy finder written in Go.
get_iplayer Utility for downloading TV and radio programmes from BBC iPlayer.
glow Render markdown on the CLI.
grip Preview GitHub README.md files locally before committing them.
horcrux A program for splitting your files into encrypted fragments.
keycastr Open-source keystroke visualiser.
lazygit Simple terminal UI for git commands.
mas Mac App Store command-line interface.
mat2 Metadata anonymization toolkit.
obsidian Private flexible note‑taking app that adapts to the way you think.
ocenaudio Audio editor.
rancher Open-source multi-cluster orchestration platform.
raycast Control your tools with a few keystrokes.
ripgrep Search tool like grep and The Silver Searcher.
virtualbox Virtualiser for x86 hardware.
visual-studio-code Open-source code editor
yt-dlp Feature-rich command-line audio/video downloader.
... Check brew/descr-formulae.txt and brew/descr-casks.txt for more.

Installation

Clone the configurations at home:

cd ~
git clone git@github.com:eulersson/.dotfiles

Symlink the configuration folders:

cd ~

touch .env.secrets
chmod 600 .env.secrets

ln -s $HOME/.dotfiles/.markdownlint-cli2.yaml .

mkdir -p $HOME/.config
cd $HOME/.config

ln -s $HOME/.dotfiles/themes .
ln -s $HOME/.dotfiles/config/alacritty .
ln -s $HOME/.dotfiles/config/tmux .
ln -s $HOME/.dotfiles/config/lazygit .
ln -s $HOME/.dotfiles/config/nvim .

cd $HOME
ln -s .dotfiles/*.zsh* .

Install an agent that detects changes on dark-light macOS preference and update Alacritty theme.

./config/alacritty/create-launch-agent.sh

Install Tmux Plugin Manager:

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

Now run tmux and install all the tpm plugins within tmux with: ⌃ + b, I.

Important

If you don't get the tokyonight.nvim theme in tmux, try opening tmux and toggle back and forth the Light-Dark mode in System Settings > Appearance, this will create the file that tmux looks for when loading the theme. You won't have to run it again.

Raycast

  • Avoid Raycast key conflicts
    • Disable hotkey for Spotlight
      • System Preferences > Keyboard > Shortcuts > Spotlight and disable the keyboard shortcut.
    • Disable hotkey for language switching
      • System Preferences > Keyboard > Shortcuts > Input Sources and disable or change the shortcut.
    • Ensure "Ask Siri" is not using the same shortcut
      • System Preferences > Siri and set it to something else like pressing fn (Function) Space_.
  • Exclude folders from search
  • Search Files
    • You can check that Raycast has access to your files and folders in System Preferences > Security & Privacy > Privacy > Files and Folders.
  • Set Hyper Key to be Caps Lock (⇪).
  • Extensions:

Configuration is backed up and kept in private iCloud. It does not allow keeping a configuration file that's safe for version tracking. Some of the options I set up is:

  • All the shortcuts in CHEATSHEET.md.
  • Extensions
    • Apple Reminders
    • Arc
    • GitHub
    • Toggle Track

Zsh

Now make zsh your default shell as explained here:

chsh -s $(which zsh)

Secrets

  • Using keepassxc-cli show -sa password ~/Documents/MySecrets.kdbx "/Internet/OpenAI ChatGPT.nvim API Key"
  • Using gpg --encrypt and gpg --decrypt on files that contain tokens
    • For ChatGPT.nvim to work it needs a openai-api-token.txt.gpg encrypted file in your home.

pyenv

https://github.com/pyenv/pyenv#installation

Install the latest Python version and set it as default system-wide:

env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.12.2
pyenv global 3.12.2
pyenv virtualenv shell
pyenv global shell

Some tools I use with my shell have to be installed with pip:

pip install shell-gpt

nvm

https://github.com/nvm-sh/nvm#installing-and-updating

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash

Visual Studio Code

https://code.visualstudio.com/

Python Development

I usually install poetry on all pyenv distributions I have, otherwise if you install poetry using the bash script they offer it will be tied to a particular python version.

It's useful to have the zsh completions:

mkdir -p ~/.zfunc
poetry completions zsh > ~/.zfunc/_poetry

For Python I use the poetry for an organized way to manage and resolve dependencies.

When installing packages with poetry it is all encapsulated in a virtual environment managed by poetry.

❯ poetry env info

Virtualenv
Python:         3.11.5
Implementation: CPython
Path:           /Users/eulersson/Library/Caches/pypoetry/virtualenvs/sound-detector-oq1WgInS-py3.11
Executable:     /Users/eulersson/Library/Caches/pypoetry/virtualenvs/sound-detector-oq1WgInS-py3.11/bin/python
Valid:          True

System
Platform:   darwin
OS:         posix
Python:     3.11.5
Path:       /Users/eulersson/.pyenv/versions/3.11.5/Library/Frameworks/Python.framework/Versions/3.11
Executable: /Users/eulersson/.pyenv/versions/3.11.5/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11

To develop with Neovim having the Python LSP available these are the requirements:

  • To have pynvim as a dev dependency in the poetry project poetry add --dev pynvim.
  • To have a pyrightconfig.json pointing to the poetry virtualenv.

After having the information with poetry env show you can craft the pyrightconfig.json at the root of the python project.

{
  "venv": "sound-detector-oq1WgInS-py3.11",
  "venvPath": "/Users/eulersson/Library/Caches/pypoetry/virtualenvs"
}

You can now open up Neovim.

C++ Development

Neovim's LSP for C++ uses a JSON file that has information on how to build the source files. This file can be built using Bear (or if using CMake, then exporting CMAKE_EXPORT_COMPILE_COMMANDS).

Other macOS Applications

About

Configuration files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published