Clone this repo to ~/dotfiles and follow the instructions in
macOS/bootstrap.sh and local/bootstrap.sh.
I'm using this lima fedora42 image at the moment.
limactl start --name=fedora42 --yes macOS/lima/fedora42.yaml
limactl shell fedora42
sudo dnf install -y git
cd ~
git clone https://github.com/anhpt379/dotfiles.git
bash -x dotfiles/local/bootstrap.sh
# On the old VM:
mkdir /Users/$USER/data/fedora41
cd /Users/$USER/data/fedora41
mkdir -p .local/share/fish/ && cp ~/.local/share/fish/fish_history .local/share/fish/
mkdir -p .local/share/zoxide/ && cp ~/.local/share/zoxide/db.zo .local/share/zoxide/
mkdir -p .ssh/ && cp ~/.ssh/id_ed25519 .ssh/
mkdir -p .ssh/conf.d/ && cp ~/.ssh/conf.d/work.conf .ssh/conf.d/
mkdir -p .gnupg/ && cp -r ~/.gnupg/ .gnupg/
mkdir -p notes && cp -r ~/notes notes
mkdir -p data && cp -r ~/data data
tar cf code.tar ~/code
# Then, on macOS:
limactl copy -r ~/data/fedora41/ fedora42:~/
# Then, on the new VM:
cd
tar xf code.tar --strip-components=2
rm -f code.tarNote: if switching to a new machine, it's better to compress ~/data & transfer
it manually to the new machine using python3 -m http.server.
Key concepts:
- macOS is in charge of handling clipboard, notifications and GUI-based applications (Chrome, Slack, Kitty, etc.).
- the linux VM is in charge of text-based applications (fish, nvim, git, etc.).
- ssh port forwards (port 2224 → 2227) are being used to make
open,noti,pbcopyandpbpastecommands work within the VM.
Why using a VM?
- it's easier to reproduce the setup.
- git & docker are much (10x) faster.
Why not using docker (with Docker Desktop for Mac)?
- slow storage performance (
git statuson a docker volume was 8x slower than in a VM).
Why not using native macOS?
- git & docker operations are slow (
git statuson a relatively large repo takes450ms, vs50msin a VM).
tabisescaperight commandandright optionarebackspaceanddelete.:and;are swapped.
<Control>-<CapsLock>-mClipboard History (Maccy)<Command>-<CapsLock>-nNext Window (Karabiner)<Command>-<CapsLock>-pPrevious Window (Karabiner)<Command>-<CapsLock>-<Up>Maximize (Rectangle)<Command>-<CapsLock>-<Down>Almost Maximize (Rectangle)<Command>-<CapsLock>-<Left>First Three Fourths (Rectangle)<Command>-<CapsLock>-<Right>Last Fourth (Rectangle)
<Command>-tnew tab<Command>-wclose tab<Command>-nnext tab (MRU Tab Switcher - Normal switch forward)<Command>-pprevious tab (MRU Tab Switcher - Normal switch backward)<Command>-]move current tab down<Command>-[move current tab up<Command>-ofocus on the address bar<Command>-uundo close tab<Command>-<Shift>-uhistory<Command>-ycopy url<Command>-faccept suggestion & go<Command>-`switch to previous tab (MRU Tab Switcher - Quick switch)<Command>-<Shift>-tsearch tabs<Command>-<Shift>-nnext tab<Command>-<Shift>-pprevious tab
<Command>-tnew tab<Command>-wclose tab<Command>-nnext tab<Command>-pprevious tab<Command>-]move current tab to the right<Command>-[move current tab to the left<Command>-rreload config<Command>-sopen a split<Command>-)next split<Command>-(previous split<Command>-'resize split<Command>-<Shift>-tnew window
<Option>-tnew tab<Option>-wclose tab<Option>-nnext tab<Option>-pprevious tab<Option>-]move current tab to the right<Option>-[move current tab to the left<Option>-rreload config<Option>-sopen a split<Option>-)next split<Option>-)previous split<Option>-'resize split
<C-f>accept suggestion and execute<C-v>edit the current command in vim<C-r>fzf history<Tab>fzf find
qclose bufferQclose all buffers<Space>-sstartify<Space>-ffzf files (MRU)<Space>-llf<Tab>selectxcutycopyddeleteppasterrename
<Space>-gripgrep all files<C-n>next buffer<C-p>previous buffergsgit statusa/Vastage/unstagex/Vxdiscard changesdshow diffrrebasemopen merge request linkpgit push --force-with-leasePgit push --forceCcommitcacommit amend editcecommit amend no editgagit absorbrrrebase continuerarebase abort
gbgit branchesg[git pull --rebase origin masterg]git push origin HEAD --force-with-leaseglgit loggLgit log current buffermgit log current linegpopen github/gitlab pipelines in browsergoopen link to file on GitLab/GitHubgOcopy link to file on GitLab/GitHubgmcreate/open MRgwwrite buffer to diskMswitch to branch master
Vim HJKL everywhere with Karabiner
When pressed together with Command, Option or CapsLock, HJKL will
become arrow keys (Left/Down/Up/Right):
-
Command+H/J/K/Lwill perform character-level cursor movements.- Hold down an additional
Shiftkey to select text.
- Hold down an additional
-
Option+H/J/K/Lwill perform word-level cursor movements.- Hold down an additional
Shiftkey to select text.
- Hold down an additional
-
Control+H/J/K/Lwill perform page-level cursor movements.- Hold down an additional
Shiftkey to select text.
- Hold down an additional
-
CapsLock+N/Pto go down and up.

