Clone this repo to ~/dotfiles and follow the instructions in
macOS/bootstrap.sh and local/bootstrap.sh.
I'm using this lima fedora40 image at the moment.
limactl start --name=fedora40 macOS/lima/fedora40.yaml
limactl shell fedora40
sudo dnf install -y git
cd ~
git clone https://github.com/anhpt379/dotfiles.git
bash dotfiles/local/bootstrap.sh
# If moving to a newer VM, use these commands to transfer the data:
limactl copy -r fedora39:~/.local/share/fish/fish_history fedora40:~/.local/share/fish/
limactl copy -r fedora39:~/.local/share/zoxide/db.zo fedora40:~/.local/share/zoxide/db.zo
limactl copy -r fedora39:~/.ssh/conf.d/work.conf fedora40:~/.ssh/conf.d/
limactl copy -r fedora39:~/.ssh/id_ed25519 fedora40:~/.ssh/
limactl copy -r fedora39:~/notes fedora40:~/notes
limactl copy -r fedora39:~/data fedora40:~/data
# On the old VM:
tar cf code.tar ~/code
# Then, on macOS:
limactl copy -r fedora39:~/code.tar fedora40:~/code.tar
# Then, on the new VM:
cd
tar xf code.tar
rm -f code.tar
# Finally, go back to macOS and create a snapshot for the new VM:
limactl snapshot create fedora40 --tag v1Key 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.
<Command>-<Space>Open Raycast (Karabiner)<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 diffrrebasepgit 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.

