in /tmp you dont have write permissions (so cannot create a new file, and falls back to overwrite), in home directory you have.
i dont see the behavior you describe after i edit file in vim the inode does not change (in linux) → ls -i /tmp/foo2.txt 4063325 /tmp/foo2.txt → vim !$ vim /tmp/foo2.txt #edit file → ls -i /tmp/foo2.txt 4063325…
in /tmp you dont have write permissions (so cannot create a new file, and falls back to overwrite), in home directory you have.
i dont see the behavior you describe after i edit file in vim the inode does not change (in linux) → ls -i /tmp/foo2.txt 4063325 /tmp/foo2.txt → vim !$ vim /tmp/foo2.txt #edit file → ls -i /tmp/foo2.txt 4063325…