Note
Collection of my configuration files. The reason why this README is so long is totally not because I like wasting time writing documentation that no one will ever read instead of doing actual work.
macOS |
Fedora w/ Sway WM ( |
Here are dotfiles for my systems, M1 MacBook Air and Lenovo ThinkPad X270. MBA runs the latest version of macOS, and X270 runs the latest version of Fedora Sway Spin with i3 WM installed (Wayland is almost there).
Tools in this repository are mostly open-source utilities for development.
Important
You are welcome to take inspiration from any files in this repository, but I do not claim any responsibility for any of the contents of the configurations (licensed under the MIT License). Read the code before you use it!
-
Configure cross-platform utilities using the following commands:
git clone https://github.com/theopn/dotfiles.git ~/dotfiles ~/dotfiles/dotfiles-util.sh --install ~/dotfiles/dotfiles-util.sh --delete-backup # Optional
-
Install Homebrew and configure macOS-specific utilities and settings using the following commands:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew analytics off ~/dotfiles/dotfiles-util.sh --macos-install
Don't forget to follow the further instructions in the macOS tiling WM section!
-
Choose configurations in the
misc
directory and manually copy them! Follow the commands in./misc/README.md
.
Note
Shameless plugs
- Theovim "is my Neovim configuration, geared toward my CS studies (C, Python, Java, LaTeX, LaTeX, and LaTeX). It features opinionated base Vim settings and keybindings, ~30 carefully selected plug-ins, and custom UI components written 100% in Lua."
- Haunted Tiles "is my personal i3 WM and Sway setup, along with essential tiling WM tools. It used to be a part of my dotfiles repository, and with the growing size of configurations and shared scripts between i3 and Sway, I made a separate repository for it."
-
Install Doom Emacs:
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs ~/.config/emacs/bin/doom install
- I had the best experience running natively-compiled emacs-plus in macOS
brew tap d12frosted/emacs-plus brew install emacs-plus --with-native-comp --with-modern-doom3-icon ~/.emacs.d/bin/doom sync # if you have already initialized Doom with other version of Emacs
-
Add SSH shortcut for frequently used servers:
~/dotfiles/dotfiles-util.sh --add-ssh-shortcut # Follow the prompt
-
To install fonts via
fontconfig
and the included function indotfiles-util.sh
:- Navigate to NERD Fonts download website
- Right-click on the font download and copy the link
- Execute the following
$FONT_URL=thing-you-just-copied ~/dotfiles/dotfiles-util.sh --install-font $FONT_URL
-
To install Iosevka Nerd Font (for terminal emulators and text editors) and FantasqueSansM Nerd Fonts (for window managers) using Homebrew:
brew tap homebrew/cask-fonts && brew install --cask font-iosevka-nerd-font font-fantasque-sans-mono-nerd-font
Rich built-in features, questionable syntax
It's the de facto default shell that launches when Wezterm opens.
It has a fantastic built-in auto-completion and stupidly fast asynchronous Git status, but I cannot say I prefer the syntax over POSIX in contrary to the popular opinion.
Because it's not POSIX compatible, Zsh is my $SHELL
.
Usage: Most of the aliases and functions of my Zsh config are supported in Fish.
The shell
- Usage:
- Prompt:
[vi-mode]` ➜ /current/path/ git-branch(* for unstaged, + for staged changes) | last-exit-code ❱
- Basic aliases:
cdf
to navigate directories quickly usingfzf
,cl
toclear
,l
tols
with list view and other options,histgrep
to look up previous commands trash
,trash_cd
,trash_empty
,trash_print
: trash related functions. The trash directory is located in~/.theoshell/trash
. This directory will be used again for LFtheoshell_plug <github-username>/<repo-name>
: installs Zsh plug-in from a GitHub repository (to~/.theoshell/zsh-plugins
) and/or source it- I only install zsh-autocomplete by default
theoshell_upgrade
: Upgrade all Zsh plug-ins in~/.theoshell/zsh-plugins
- Prompt:
Universal terminal multiplexer
I usually pair Tmux with a simple terminal emulator like Kitty or Alacritty. Because I am not the biggest fan of the default keybindings, many are unbound and rebound to Vim-style navigation and window/pane management.
- Usage:
- For the complete list of keybindings, disabled default keybindings, and frequently used default bindings, use
C-a ?
and read the comment in line 20 C-a
is the prefixPFX c
: Copy modePFX hjkl
: Pane navigationPFX r/x
: Swap panesPFX s/v
: Create a split horizontally/verticallyPFX -+<>
: Resize panePFX C-s
: Send the current pane to the window of the given index (will be prompted for the index)PFX C-j
: Join the pane from the window of the given index (will be prompted for the index)PFX t
: Create a new windowPFX q
: Kill a pane (there is no separatekill-window
binding; close all panes to kill a window)PFX [/]
: Navigate windowsPFX {/}
: Swap window indices with adjacent windowsPFX m
: Move the current window to the given indexPFX ?
: Open~/.tmux.conf
in a floating popup
- For the complete list of keybindings, disabled default keybindings, and frequently used default bindings, use
Over-engineered terminal emulator, nailed the fundamental features, and it is configured in Lua!
Wezterm is my primary terminal emulator/multiplexer! Watch my YouTube video Configure Wezterm terminal emulator in Lua with me [ASMR Coding] :)
- Usage:
LDR
=C-a
LDR c
: Copy modeLDR s/v
: Create a split paneLDR hjkl
: Navigate paneLDR q
: Close paneLDR z
: Zoom paneLDR o
: Rotate paneLDR r
:resize_pane
mode. Usehjkl
to resize pane andESC
orEnter
to confirmLDR t
: New tabLDR [/]
Navigate tabLDR 1-9
: Navigate tab by indexLDR n
: Launch tab navigatorLDR e
: Rename tab titleLDR m
:move_tab
mode. Usehj
/kl
to move tabs andESC
orEnter
to confirmLDR {/}
: Move tab without entering themove_tab
mode
LDR w
: Workspace launcher$ wezterm show-keys --lua
to get the Lua table of all keybindings available
Good OS, mediocre text editor even with Evil mode
Emacs is my to-do list, idea capture, knowledge databases, and tools for other Second Brain functionalities.
- Usage:
- All the stock Emacs + Evil mode keybindings
%
: Jump between parenthesis like in VimC-c t
: Toggle transparencyC-c a
: Org AgendaC-c c
: Org CaptureC-c o
: Display Org file outline usingoccur
C-c f
: Find Org-roam nodeC-c i
: Insert Org-roam nodeC-c r b
: List all Org-roam references in the current bufferC-c r r
: Sync Org-roam database
Focused note-taker
Because of my extensive Neovim IDE config, My Vimrc is kept minimal as my journal writer with the Vimwiki plug-in.
My Vimrc is built using Kickstart.vim.
- Config:
- Kickstart.vim contents, including sensible defaults and LSP setup
- Handmade TabLine
- Vimwiki setup for my personal journal writing
My favorite terminal file manager
When I see a CLI file manager with Vim keybindings and a minimalistic feature set, I like it. I use it.
- Usage:
~
: Go to the home directoryee
: Open a file in$EDITOR
ec
: You choose what editor you want to open a file inDD
: Move a file to~/.theoshell/trash
(it integrates with my Zsh trash functions)gs
: [g]it [s]tatusmd
: mkdirmf
: Open a file with the supplied name in Neovimml
,mr
,ms
: [m]ark [l]oad, [m]ark [r]emove, [m]ark [s]avemo
: chmodsh
: Launch$SHELL
at the current directory
Thanks Linus
No comments.
Note
These are single-file, minimal configurations that do not change very often.
These are meant to be manually deployed as needed.
Use the commands in ./misc/README.md
to deploy these configurations.
bashrc
: I prioritize simplicity and performance since Zsh and Fish take care of my interactive uses and most of my scripts are written in Bash. Thus, my.bashrc
is kept minimal with a simple prompt, some aliases, and variableskitty.conf
: Kitty is my secondary terminal emulator. The configuration is kept minimal since I always pair it up with Tmuxideavimrc
: Sorry to disappoint you, but I code in Java sometimes
Tools used to create my Tokyo-Night-themed tiling WM setup for my macOS environment:
To begin, modify the macOS settings as follows:
- "Desktop & Dock" (Mission Control) -> "Displays have separate Spaces" -> On
- "Desktop & Dock" (Menu Bar) -> "Automatically hide and show the menu bar" -> "Always"
- Make shortcuts for switching desktops using a built-in macOS key modifier (if you are to use Yabai for this, it requires disabling SIP)
- Create 6 Mission Control desktops
- "Keyboard" -> "Keyboard Shortcuts" -> "Mission Control" -> "Mission Control" -> Turn on "Switch to Desktop n" (where "n" is the number 1 - 6)
- Set the shortcut to
^n
(Ctrl n
) or⌥n
(Opt n
) - While you are at it, go to "Modifier Keys" and switch "Caps Lock key" and "Control key". Your pinky will thank you
Copy or create symlinks for Yabai, Skhd, and Sketchybar configuration files.
Install and start utilities:
- Install Yabai, Skhd, and Sketchybar:
brew install koekeishiya/formulae/skhd koekeishiya/formulae/yabai FelixKratz/formulae/sketchybar
- Start Skhd:
skhd --start-service
- Use
ctrl + alt - s
keybinding (ctrl + opt + s) to start sketchybar and Yabai. - Use
ctrl + alt - q
keybinding (ctrl + opt + q) to stop sketchybar and Yabai.
Keybindings:
- The
opt
/alt
(⌥
) key is the modifier mod + ret
: Open Weztermmod + hjkl
: Navigate windowsmod + shift + hjkl
: Swap windowsmod + ctrl + hjkl
: Move the focused window (tiled with what is already there)mod + shift + y/x
: Mirror left and right/top and bottommod + shift + r
: Rotate 270 degreesmod + shift + f
: Toggle fullscreenmod + shift + SPC
: Toggle fullscreenmod + shift + 0
: Balance all window sizemod + shift + <>
: Increase or decrease window size horizontallymod + shift + =-
: Increase (=
, meant to represent+
) or decrease (-
) window size verticallymod + shift + 1-6
: Move the window to WS 1-6
Yabai is a fantastic tool, but there is a few limitations due to the nature of macOS.
- Layout not persisting after exiting a full-screen video play in Firefox
- Windows with minimum width (e.g., Apple Calendar, Spotify, Discord) not tiling nicely
- Emacs not tiling (even with
(menu-bar-mode t)
) - Kitty not tiling (with the window decorations removed)
- Being unable to delete a Mission Control desktop with Yabai running
- High CPU usage of
WindowServer
process
Use cat /tmp/yabai_$USER.err.log
and cat /tmp/skhd_$USER.err.log
to view the Yabai and Skhd log messages.
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:
- 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: tool to rewrite Git history
- htop: System monitor
- hugo: Static website generator
- imagemagick: Command line image manipulation
- lf: My favorite CLI file manager
- lua
- neovim: My second home
- node
- ripgrep: faster alternative to
grep
(Neovim Telescope dependency) - rust
- tmux: Universal terminal multiplexer
- tree: Tree-like directory view
- wget: Be careful with what you download
Casks:
Development | Fun | Productivity | System (macOS) | Tools | Web |
---|---|---|---|---|---|
Docker | Discord | Emacs | App Cleaner | Bitwarden | Firefox |
IntelliJ CE | Minecraft | Itsycal | Maccy | Cryptomator | Thunderbird |
kitty | Spotify | Notion | Rectangle | GIMP | |
MacTex (no GUI) | Stats | OBS | |||
Wezterm | Spaceman | Skim | |||
VLC |
./macos/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.
- The macOS wallpaper is by arsenicxs
- I drew inspirations from a lot of difference places, but I am confident to say that all of the config/code in this repository is mine (besides some default configurations)
- I dislike having code that I do not understand, especially in my day-to-day development environment. I try to understand and rewrite configurations on my own
- I give credit to all the amazing developers and the open-source community who developed all these tools I rely on everyday
- and people in communities like Dotfyle and r/unixporn who share their dotfiles
- If you have any questions, concerns, or suggestions, do not hesitate to let me know through issues or PR!