Skip to content

A continuous work in progress of my personal dotfiles for daily development using Emacs.

Notifications You must be signed in to change notification settings

wcalderipe/dotfiles

Repository files navigation

dotfiles

https://github.com/wcalderipe/dotfiles/workflows/CI/badge.svg

A continouos working in progress of my workstation personal configurations.

resources/macos-screenshot-emacs.png

See also a Linux screenshot.

Install

I’m using Ansible to manage system dependencies and configuration orchestration.

macOS

You first need to install Homebrew by following the instructions from their official website.

# Install Xcode Command Line Tools
xcode-select --install

# Install git and ansible
brew install git ansible

# To install everything from scratch.
ansible-playbook \
    --inventory ./ansible/hosts \
    ./ansible/macos.yml

See ansible/macos.yml for the full list tags.

Linux

⚠️ I have been using macOS lately. Keep in mind a few things may be out of date on Linux.

# Before start, install the minimal dependencies.
sudo apt-get install git ansible --quiet --yes

# To install everything from scratch.
ansible-playbook \
    --inventory ./ansible/hosts \
    ./ansible/linux.yml

# You can also filter or skip by tags.
ansible-playbook \
    --inventory ./ansible/hosts \
    --tags "emacs" \
    --skip-tags "deps" \
    ./ansible/linux.yml

# To install in a Docker container, skip apps, gnome and keyboard tags.
ansible-playbook \
    --inventory ./ansible/hosts \
    --skip-tags "apps,gnome,keyboard" \
    ./ansible/linux.yml

See ansible/linux.yml for the full list tags.

Docker

docker build --tag dotfiles .

docker run -it \
       --volume ~/dev/dotfiles/ansible:/home/tester/dev/dotfiles/ansible \
       dotfiles

docker run dotfiles \
       ansible-playbook \
       --inventory ./ansible/hosts \
       --skip-tags "apps,gnome,keyboard" \
       ./ansible/linux.yml

Unfortunately, a container has its limitations. It will only work for the Linux dotfiles. Moreover, it won’t cover software that depends on GUI like Emacs (outside the terminal) and GNOME.

Manual steps

iTerm theme (macOS)

  1. Launch iTerm.
  2. Open the preferences by typing CMD-i.
  3. Go to the Colors tab.
  4. Click on Load Presets.
  5. Click on Import.
  6. Select the .itermcolors file from the iterm folder in this dotfiles.

For more iTerm themes see iterm2-color-schemes.

Change capslock to control (macOS)

  1. Launch System Preferences.
  2. Go to Keyboard.
  3. Click on Modifier Keys....
  4. Change Caps Lock to ^ Control.

Make sure to do the same for the external keyboard if you have one.

Change 🌐 key to show Emoji & Symbols (macOS)

  1. Launch System Preferences.
  2. Go to Keyboard.
  3. Click on Input Sources.
  4. Change “Press 🌐 key to” to “Show Emoji & Symbols”

jEnv (macOS)

Add the installed OpenJDK to jEnv.

# This is an example. Check where the JDK was installed on your machine. 
jenv add /opt/homebrew/opt/java/libexec/openjdk.jdk/Contents/Home/

Add a global version.

jenv global 20.0.1 

Display settings (macOS)

  1. Launch System Preferences.
  2. Go to Displays.
  3. Change Resolution to Scaled.
  4. Change More Space.

To prevent external monitor flickering issues:

  1. Go to Displays > Display Settings.
  2. Change the external monitor’s color profile to Color LCD.
  3. Change the external monitor’s refresh rate to 60 Hz.
  4. Turn off Auto Adjust Brightness, True Tone, and Night Shift.

GitHub

Generate a new SSH key (you can follow the GitHub’s official steps here).

  1. Copy the SSH key to the clipboard.
  2. Go to GitHub settings.
  3. Go to SSH and GPG keys.
  4. Click on New SSH key.
  5. Paste the key and save.

For the GPG key, you can follow the GitHub’s official steps here.

Tell Git to automatically sign all commits.

# Set your signing key
git config --global user.signingkey <YOUR_GPG_KEY_ID>

# Tell Git to automatically sign all commits.
git config --global commit.gpgsign true

Uninstall

# Remove all links created in your home directory.
$DOTFILES_DIR/shell/clean.sh

Emacs

Key Binding

My key bindings are defined using general.el within use-package scattered in lisp/my-* files. So, if you want to check them all do M-x general-describe-keybindings.

Emacs Tabs

I normally have multiple projects open at the same time in Emacs and I like to have them separated by workspace. For that, I have been using eyebrowse with hydra.

Hit C-c + t to see the menu.

Org

Styled HTML exports

I often share thoughts and ideas with other people in my daily basis. For that I like to export my Org notes to HTML and then PDF. Thus, I created a minimal stylesheet that mimics GitHub’s Markdown styles for the features I use most in Org. See org.css.

Add the snippet below to include the styles in a Org file.

#+OPTIONS: html-style:nil html-postamble:nil num:nil
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="__REPLACE_ME_WITH REAL_LINK__"/>

Find a proper place to host the org.css file

GitHub pages might be a good candidate.

Fix export to HTML without a theme

See setup.org and org.css.:

Cheat Sheet

PDF Operations

To convert HTML to PDF I use wkhtmltopdf.

wkhtmltopdf SOURCE.html TARGET.pdf

Kill process by port

I often have ghost processes started from within Emacs but never properly terminated blocking ports. The command below help me to kill a process by its port number.

kill -9 $(lsof -i tcp:3000 -t)

References