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 v1
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
,pbcopy
andpbpaste
commands 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 status
on a docker volume was 8x slower than in a VM).
Why not using native macOS?
- git & docker operations are slow (
git status
on a relatively large repo takes450ms
, vs50ms
in a VM).
tab
isescape
right command
andright option
arebackspace
anddelete
.:
and;
are swapped.
<Command>-t
new tab<Command>-w
close tab<Command>-n
next tab<Command>-p
previous tab<Command>-]
move current tab to the right<Command>-[
move current tab to the left<Command>-o
focus on the address bar<Command>-u
undo close tab<Command>-y
copy url<Command>-f
accept suggestion & go<Control>-<Space>
search tabs
<Command>-t
new tab<Command>-w
close tab<Command>-n
next tab<Command>-p
previous tab<Command>-]
move current tab to the right<Command>-[
move current tab to the left<Command>-r
reload config<Command>-s
open a split
<Option>-t
new tab<Option>-w
close tab<Option>-n
next tab<Option>-p
previous tab<Option>-]
move current tab to the right<Option>-[
move current tab to the left<Option>-r
reload config<Option>-s
open a split
<C-f>
accept suggestion and execute<C-v>
edit the current command in vim<C-r>
fzf history<Tab>
fzf find
q
close bufferQ
close all buffers<Space>-s
startify<Space>-f
fzf files (MRU)<Space>-l
lf<Space>
selectx
cuty
copyd
deletep
paster
rename
<Space>-g
ripgrep all files<C-n>
next buffer<C-p>
previous buffer<Space>-<1-9>
jump to buffer #numbergs
git statusa/Va
stage/unstagex/Vx
discard changesd
show diffp
git push --force-with-leaseP
git push --forceC
commitca
commit amend editce
commit amend no editga
git absorbgr
rebaserr
rebase continuera
rebase abort
gb
git branchesg[
git pull --rebase origin masterg]
git push origin HEAD --force-with-leasegl
git loggL
git log current bufferm
git log current linegp
open github/gitlab pipelines in browsergo
open link to file on GitLab/GitHubgO
copy link to file on GitLab/GitHubgm
create/open MRgw
write buffer to diskM
switch 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/L
will perform character-level cursor movements.- Hold down an additional
Shift
key to select text.
- Hold down an additional
-
Option
+H/J/K/L
will perform word-level cursor movements.- Hold down an additional
Shift
key to select text.
- Hold down an additional
-
Control
+H/J/K/L
will perform page-level cursor movements.- Hold down an additional
Shift
key to select text.
- Hold down an additional
-
CapsLock
+N/P
to go down and up. -
Command
+<Up>
/<Down>
to maximize/almost-maximize a window. -
Command
+<Left>
/<Right>
to resize & tile window to the left/right.