![]() |
|---|
| my macos |
Here are dotfiles for my systems:
- Framework 13: runs the latest Fedora KDE Plasma + Sway (see Haunted Tiles, my Sway configuration)
- M4 Mac Mini: runs the latest macOS
- ThinkPad X270: currently running Fedora Server, TBD for how I am going to use this
- M1 MacBook Air: served me well since 2021, TBD for what I am going to do with this
The tools in this repository are primarily open-source utilities for development.
Important
Read the code before using them!
If you are not me, skip this section and use HTTPS cloning.
# Change the hostname
# macOS:
HOSTNAME=<my computer>; sudo scutil --set ComputerName "$HOSTNAME" && sudo scutil --set HostName "$HOSTNAME"
# Linux:
hostnamectl set-hostname --static <my computer>
ssh-keygen -t ed25519 -C "Theo's ED25519 key @ $(hostname) for GitHub Auth"
# Followed by RET to accept the default path + passphrase
# Add the public key to GitHub Settings -> SSH and GPG Keys
cat ~/.ssh/id_ed25519.pub
# Linux: my Fish config automatically launches keychain and ssh-agent
# macOS: execute the following commands
eval "$(ssh-agent -s)"
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
# Did you know that the Heredoc End-of-Transmission delimiter could be anything?
# Double quote means no parameter expansion
cat <<"HI" >> ~/.ssh/config
Host github.com
IdentityFile ~/.ssh/id_ed25519
AddKeysToAgent yes
UseKeychain yes
HI# Install dev tools (including Git)
xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew analytics off
cd $HOME
git clone git@github.com:theopn/dotfiles.git
cd $HOME/dotfiles
# Install formulae
brew bundle --file ./homebrew/Brewfile_core
brew bundle --file ./homebrew/Brewfile_optional
# Install Nerd Fonts
brew install --cask font-fantasque-sans-mono-nerd-font font-proggy-clean-tt-nerd-font
# Deploy dotfiles using Stow
./bootstrap.sh
# macOS settings
./misc/macos-settings.sh# Install packages
sudo dnf upgrade
# TODO: Make a DNF installation script
sudo dnf install git keychain python3-pip stow vim zsh
cd $HOME
git clone git@github.com:theopn/dotfiles.git
cd $HOME/dotfiles
# Move Fedora default bashrc
mv ~/.bashrc ~/.bashrc-fedora
# Deploy dotfiles using Stow
./bootstrap.sh
# Install fonts with font-cache
mkdir -p ~/.local/share/fonts && cd ~/.local/share/fonts/
# TODO: Check that this link is up-to-date before you proceed
wget -O tmp.zip https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/FantasqueSansMono.zip
unzip tmp.zip && rm tmp.zip
# -v: verbose
# -f: force generation
# -r: erase existing cache
fc-cache -vfr
cd -Now is a good time to reopen the shell.
# Fish writes universal variables to `$XDG_CONFIG_HOME/fish/fish_variables` for performance
# I created a script to set global variables only once
fish ~/dotfiles/fish/.config/fish/set-universal.fish
# Create and add directories to the directory bookmark/favorites list for my `cdf` fish/zsh function
mkdir -p $XDG_DATA_HOME/theoshell && touch $XDG_DATA_HOME/theoshell/cd-fav.txt
cat <<AHH >> $XDG_DATA_HOME/theoshell/cd-fav.txt
$XDG_CONFIG_HOME
$XDG_DATA_HOME
AHH
# Neovim Treesitter and LSP servers
nvim -c "TSInstall bash c cpp fish html java javascript latex lua luadoc markdown markdown_inline python sql vim vimdoc"
nvim -c "MasonInstall bash-language-server clangd lua-language-server python-lsp-server texlab"
# Generate and copy public SSH key to my school's remote server
ssh-keygen -t rsa -b 4096 -C "Theo's RSA Key @ $(hostname) for Purdue CS servers auth"
ssh-copy-id -i ~/.ssh/id_rsa.pub $(whoami)@data.cs.purdue.edu
# Add SSH alias
# Skip the last two lines in Linux (my Fish config handles launching Keychain and ssh-agent)
cat <<BYE >> ~/.ssh/config
Host data
Hostname data.cs.purdue.edu
User $(whoami)
IdentityFile ~/.ssh/id_rsa
AddKeysToAgent yes
UseKeychain yes
BYE- Linux systems: install Sway and follow the instructions in the Haunted Tiles repository
- Also Linux: follow the instructions for the private configurations and scripts in my Framework 13 repository (private)
- macOS: follow the instructions for the private configurations and scripts in my script repository (private)
- Bash: Basic configuration for my school SSH server
- ZSH: My
$SHELL- Minimal plugin manager (
plug,plug_update) to download and source zsh-autocompletion - Rudimentary implementation of trash-cli (
trash) - Vim mode & Git info in the prompt
- Minimal plugin manager (
- Fish: Main interactive shell
- Cool handmade prompt
- multicd:
..tocd ..,...tocd../.., ... - CD favorites/bookmark:
cdf_addto add current directory to the list,cdfto use FZF to search the directory and CD into it, andcdf_editto edit the list with$EDITOR
- Wezterm: My favorite terminal emulator. Watch my YouTube video Configure Wezterm terminal emulator in Lua with me [ASMR Coding] :)
- Many keybindings in the video now been changed to match the Tmux keybindings, but the overall functionality remains the same
LDR=C-aLDR [: enters the copy modeLDR :: opens the command paletteLDR s: opens the fuzzy picker for workspace (similar to sessions in Tmux)- Tabs (similar to windows in Tmux)
LDR w: opens the picker for tabsLDR c: creates a new tabLDR p/n: navigates previous/next tabsLDR ,: renames the tabLDR .: enters themove_tabmode where you can usehj/klto order tabs andESCorRETto confirmLDR 1-9: moves to the tab with the given index
- Panes
LDR %/": creates a new pane vertically/horizontallyLDR hjkl: navigates paneLDR SPC: zooms the current paneLDR x: closes the current paneLDR !: breaks the current pane into a new tabLDR r: enters theresize_panemode where you can resize the pane with<>-+andESCorRETto confirm
$ wezterm show-keys --luato get the Lua table of all keybindings available
- Kitty: The secondary terminal, but its speed as well as the ability to set scrollback pager to Neovim is slowly winning me over.
As Kitty's window/tab management is vastly different from Tmux and Wezterm, so are keybindings.
When I use Kitty, I tend to rely on tilign WM and Neovim for multiplexing.
- Scrollback history
ctrl+a > up/down: scroll to previous/next promptctrl+a > [: open scrollback history in Neovim with special settings
- Windows (pane in Tmux)
ctrl+a > enter: create a new windowctrl+a > x: close a windowctrl+a > h/j/p: move to a previous windowctrl+a > k/l/n: move to a next windowctrl+a > shift+h/j/p: swap current window with the previous windowctrl+a > shift+k/l/n: swap current window with the next windowctrl+a > shift+t: make current window to be the "master window"ctrl+a > r: enter resizing modectrl+a > q: Like "Display Pane Numbers" in Tmuxctrl+a > shift+q: Like "Display Pane Numbers" in Tmux but for swapping windows
- Tab (windows in Tmux)
ctrl+a > c: create a new tabctrl+a >,: set tab titlectrl+a > 1-9: move to tabs 1-9
- Window Layout
ctrl+a > o: cycle between tall, horizontal, vertical, and stack layoutsctrl+a > shift+o: reverse cyclectrl+a > z: toggle stack (full screen) layout
- Reference the config for more
- Scrollback history
- Tmux: Most of the time, I try to use a terminal emulator without Tmux.
But Tmux still comes in handy, especially when working in a remote environment.
The following are things that are different from the defaults:
- Settings: Some terminal information, all indexing starts from 1, increased history limit, and reduced escape time
C-ais the prefix, andPFX + C-asendsC-ato the applicationPFX + C-rreloads the configPFX + ccreates a new window with the same CWD as the current panePFX + %/"creates a new pane with the same CWD as the current panePFX + hjklnavigates panes (the defaultlis unbound which is:last-window)PFX + C-sprompts you to send the current pane to a selected window- Vi-copy-mode is set,
yin copy mode yanks the selection -- I do not know what this is not the default sinceyis not bound to anything by default - Status bar displaying the current session & window information, CWD, and the current command
- Use
PFX + ?(list keys) andPFX + / + <key>(describe key) for more help
- Neovim: My IDE, to-do list, Pomodoro timer, and a life-long software engineering project. Read
:h theovim, a7001080 lines of help documentation I wrote on custom functions, plugin configurations, and Vim tips I have accumulated over the years- Read Neovim related posts in my blog!
- Neovide: Neovim GUI frontend with pretty animations
- Vim: Simple config with Vimwiki for journal writing
- My Vimrc is built with Kickstart.vim, featuring
.vim/plugindirectory features 40-line Vimscript bufferline and "Bufferpanel"- Choose between
(Bufferpanel + Tabline) || (Tabpanel + Bufferpanel)by settingg:theoline_buflistandg:theopanel:buflistvariables
- LF: Simple and fast terminal file manager
- For my custom
previewscript support: installbatand Poppler (forpdftotextcommand); make sure your terminal has either (1) Sixel support and haschafainstalled OR (2) Kitty'sicatprotocol support - If preview breaks for whatever reason, use
C-lto reset the screen ee: Open a file in$EDITORec: You choose what editor you want to open a file inDD: Move a file to$XDG_DATA_HOME/theoshell/trashgs: [g]it [s]tatusml,mr,ms: [m]ark [l]oad, [m]ark [r]emove, [m]ark [s]avemd: mkdirmf: Create a file and open in$EDITORmo: chmod
- For my custom
- Git: Some Git settings and global
.gitignorefile - Fastfetch: essential
![NOTE] I no longer use Sketchybar, but the config works just fine. Please reference the archive readme for more information.
My Aerospace configuration is very close to the default (the opt/alt/⌥ key is the modifier):
alt-shift-space: Toggle between floating and tiling for the current windowalt-enter: Open Weztermalt-d: Open Terminal with a command to pick a window to focus This feature is a workaround and should be updated when it is implemented natively, see: nikitabobko/AeroSpace#1371alt-slash: Toggle between horizontal and vertical tilingalt-comma: Toggle between horizontal and vertical accordion modealt-h/j/k/l: Focus windowsalt-shift-h/j/k/l: Move windowsalt-minus/equal(-/+): Resize windowalt-1 - 9: Move to workspace 1 - 9alt-shift-1 - 9: Move the current tree to workspace 1 - 9alt-tab: Switch between previously used workspacesalt-shift-tab: Move current workspace to a different monitoralt-shift-space: Enter the service modeesc: Reload the config and exit the service moder: Reset layout and exit the service modealt-shift-h/j/k/l: Join windows into different trees
Bolded items are in Brewfile_core, and other items are in Brewfile_optional, either because I don't want them to be installed on every machine or are too large.
Formulae:
- bat:
catwith syntax highlighting (LF preview script dependency) - btop: system monitor
- chafa: convert images to Sixel format (Lf preview script dependency for certain terminals)
- exiftool: read and modify EXIF data in image files
- fastfetch
- fd: faster alternative to
find(Neovim Telescope dependency) - ffmpeg:
ffmpeg -i in.xxx out.yyy - figlet: ASCII art generator
- fish: de facto default shell
- fzf: command line fuzzy finder
- git-filter-repo: a tool to rewrite Git history
- hugo: static website generator
- imagemagick: image manipulation
- lf: my favorite CLI file manager
- lua
- neovim: what more can I say
- node
- poppler:
pdftotext in.pdf -(LF preview script dependency) - r
- ripgrep: faster alternative to
grep(Neovim Telescope dependency) - rust
- stow: managing Dotfiles (used in
./bootstrap.sh) - tmux: terminal multiplexer
- tree: tree-like directory view
- tree-sitter-cli: tree-sitter parser generator (Neovim tree-sitter installer dependency)
- wget: be careful with what you download
Casks:
| Development | Fun | Productivity | Sync | System | Tools | Web |
|---|---|---|---|---|---|---|
| Docker | Discord | Itsycal | Cryptomator | Aerospace | Bitwarden | Firefox |
| IntelliJ CE | Minecraft | Notion | Filen | Ice | CEmu | Tailscale |
| kitty | Spotify | Nextcloud | Maccy | GIMP | Thunderbird | |
| MacTex (no GUI) | Syncthing | Stats | KeyCastr | Ungoogled Chromium | ||
| Macvim | OBS | |||||
| Neovide | Skim | |||||
| RStudio | VLC | |||||
| UTM | ||||||
| Wezterm |
./misc/macos-settings.sh includes some macOS settings like adding a Dock spacer, show hidden files in Finder, changing screenshot format and location, etc.
Warning
Configuration files in the archive directory are no longer maintained
See the list of archived configurations.
- Font(s): I use Comic Code (yes, I paid $30 for the monospaced Comic Sans), Fantasque Sans, and Ubuntu Sans Mono; all Nerd Font patched
- macOS wallpaper: "Firewatch 2" in nordic-wallpapers
- Aerospace:
default-config.tomland DevOps Toolbox's Dotfiles - LF: example
lfrc, Brodie Robertson's Dotfiles, andlfimgforbatorcatfunction - Neovim: Spiritual successor of Theovim
- Theovim logo and my shell startup function cats are ASCII arts of my cat Oliver, many of which are taken from ASCII Art Archive or made with a help of my friend Jonathan
\/ \/ /\_______/\ / o o \ ( == ^ == ) ) [Ollie] ( ( ) ( ( ) ( ) ) (__(__)___(__)__) ___ | |_ _ _ o __ | | |(/_(_)\_/ | |||
- Theovim logo and my shell startup function cats are ASCII arts of my cat Oliver, many of which are taken from ASCII Art Archive or made with a help of my friend Jonathan
- Sketchybar: default plugins
- Vim: kickstart.vim
- Wezterm: my Wezterm config video
- Haunted Tiles has dotfiles for my minimal, Dracula-themed i3/Sway environment.
