my macbook |
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.
Tools in this repository are mostly open-source utilities for development.
Important
Read the code if you decide to use them!
# Clone the repository
git clone git@github.com:theopn/dotfiles.git
# Homebrew bootstrap
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew analytics off
# Install formulae
cd $HOME/dotfiles
brew bundle --file ./homebrew/Brewfile_core
brew bundle --file ./homebrew/Brewfile_optional
# tap font repository and install Ubuntu Mono Nerd Font
brew tap homebrew/cask-fonts &&
brew install --cask font-ubuntu-mono-nerd-font
# Deploy dotfiles using custom Stow bootstrap script
./bootstrap.sh
# macOS settings
./misc/macos-settings.sh
# Add SSH shortcuts
# Fun fact: Heredoc can accept any string as End-of-Transmission delimiter (quotes prevent parameter expansion)
cat <<"HELLO" >> ~/.ssh/config
Host [nickname]
Hostname [url]
User [username]
HELLO
# Create and add directories to the directory bookmark/favorites list for my `cdf` fish function
mkdir -p $XDG_DATA_HOME/theoshell && touch $XDG_DATA_HOME/theoshell/cd-fav.txt
cat <<BYE >> $XDG_DATA_HOME/theoshell/cd-fav.txt
$XDG_CONFIG_HOME
$XDG_DATA_HOME
BYE
- 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
) - Git info in the prompt
- Minimal plugin manager (
- Fish: Main interactive shell
- Fish writes universal variables to
$XDG_CONFIG_HOME/fish/fish_variables
for better performance. Thus, you need to set global variables only once for your system. I created a script to set all the universal environment variables at once; run:fish $HOME/dotfiles/fish/.config/fish/set-universal.fish
- multicd:
..
tocd ..
,...
tocd../..
, ... - CD favorites/bookmark:
cdf_add
to add current directory to the list,cdf
to use FZF to search the directoy and CD into it, andcdf_edit
to edit the list with$EDITOR
- Fish writes universal variables to
- Tmux - things different from the defaults:
- Settings: Some terminal information, all indexing starts from 1, increased history limit, and reduced escape time
C-a
is the prefix, andPFX + C-a
sendsC-a
to the terminalPFX + C-r
reloads the configPFX + c
creates a new window with the same CWD as the current panePFX + %/"
creates a new pane with the same CWD as the current panePFX + hjkl
navigates panes (the defaultl
is unbound which is:last-window
)PFX + C-s
prompts you to send the current pane to a selected window- Vi-copy-mode is set,
y
in copy mode yanks the selection -- I do not know what this is not the default sincey
is not bound to anything by default - Dracula themed status bar displaying the current session & window information, CWD, and current command running
- Use
PFX + ?
(list keys) andPFX + / + <key>
(describe key) for more help
- 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 has been changed to match the Tmux keybindings, but the overall functionality remains the same
LDR
=C-a
LDR [
: 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_tab
mode where you can usehj
/kl
to order tabs andESC
orRET
to 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_pane
mode where you can resize the pane with<>-+
andESC
orRET
to confirm
$ wezterm show-keys --lua
to get the Lua table of all keybindings available
- Kitty: The secondary terminal
- Colorscheme can be changed with
kitten themes
- Colorscheme can be changed with
- Neovim: My IDE, to-do list, Pomodoro timer, and a life-long software engineering project. Read
:h theovim
, a7001000 lines of help documentation I wrote on custom functions, plugin configurations, and Vim tips I have accumulated over the years- Read Neovim content 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, features
.vim/plugin
directory features 40-line Vimscript bufferline and "Bufferpanel"- Choose between
(Bufferpanel + Tabline) || (Tabpanel + Bufferpanel)
by settingg:theoline_buflist
andg:theopanel:buflist
variables
- LF: Simple and fast terminal file manager
- For my custom
preview
script support: installbat
and Poppler (forpdftotext
command); make sure your terminal has either (1) Sixel support and haschafa
installed OR (2) Kitty'sicat
protocol support - If preview breaks, which might happen while displaying images in Tmux, use
C-l
to reset the screen ee
: Open a file in$EDITOR
ec
: You choose what editor you want to open a file inDD
: Move a file to$XDG_DATA_HOME/theoshell/trash
gs
: [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$EDITOR
mo
: chmod
- For my custom
- Git: Some Git settings and global
.gitignore
file;editor
andpager
are set to require Neovim - Fastfetch: essential
Tools used to create my Tokyo-Night-themed tiling WM setup for my macOS environment:
Install Aerospace and Sketchybar
brew install nikitabobko/tap/aerospace FelixKratz/formulae/sketchybar
Add Aerospace to your login item in System Settings.
Aerospace will automatically launch Sketchybar on the startup.
Do not use brew services start sketchybar
to launch Sketchybar as Sketchybar needs to be launched after Aerospace has been launched (via after-startup-command
in aerospace.toml
) in order to correctly render workspaces.
The configuration and keybindings are very close to the default with a couple of tweaks (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
![NOTE] In this commit, a rudimentary UI customization for the Aerospace tray icon has been added, which is frankly all I need. Along with Ice, I am experimenting with the native menu bar.
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:
cat
with syntax highlighting (LF preview script dependency) - chafa: convert images to Sixel format (Lf preview script dependency)
- 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: 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: Purpose of my life
- node
- poppler:
pdftotext in.pdf -
(LF preview script dependency) - 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 | Sync | System | Tools | Web |
---|---|---|---|---|---|---|
Docker | Discord | Itsycal | Cryptomator | Aerospace | Bitwarden | Chromium |
IntelliJ CE | Minecraft | Notion | Filen | Ice | GIMP | Firefox |
kitty | Spotify | Nextcloud | Maccy | OBS | Tailscale | |
MacTex (no GUI) | Syncthing | Stats | Skim | Thunderbird | ||
Macvim | e | VLC | ||||
Neovide | ||||||
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.
- macOS wallpaper: "Firewatch 2" in nordic-wallpapers
- Aerospace:
default-config.toml
and DevOps Toolbox's Dotfiles - LF: example
lfrc
, Brodie Robertson's Dotfiles, andlfimg
forbatorcat
function - Neovim: Spiritual successor of Theovim
- Sketchybar: default plugins
- Vim: kickstart.vim
- Wezterm: my Wezterm config video
- Haunted Tiles has dotfiles for my minimal, Dracula-themed Fedora i3/Sway Spin environment.