Wikia

Vim Tips Wiki

Editing a hard link to a file

Talk0
1,613pages on
this wiki
Revision as of 06:36, July 13, 2012 by JohnBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Tip 1590 Printable Monobook Previous Next

created 2008 · complexity basic · author Metacosm · version 7.0


On Unix-based systems, the shell command ln x y creates y as a hard link to file x. There is only a single file, so if you edit y, you will also change x.

If wanted, you can configure Vim so that it will break hard links whenever a file is written, providing a backup is made. In that case, editing y would automatically remove the link, and create a separate file, leaving x unchanged. The Vim command (in vimrc) is:

set backupcopy=auto,breakhardlink

ReferencesEdit

CommentsEdit

Around Wikia's network

Random Wiki