4359 links
  • Arnaud's links
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
  • thumbnail
    Edit a file in-place in vim - Stack Overflow

    Comment perdre 30 min

    :set backupcopy=yes

    When you want to modify a file, you have two options, each with its benefits and drawbacks.

    You can overwrite the file in place. This does not use any extra space, and conserves the hard links, permissions and any other attribute beyond the content of the existing file. The major drawback of doing this is that if anything happens while the file is being written (the application crashes, or the power goes out), you end up with a partially written file.
    You can write the new version of the file to a new file with a different name, then move it into place. This uses more space and breaks hard links, and if you have write permissions on a file but not on the directory it contains, you can't do it at all. On the flip side, the old version of the file is atomically replaced by the new version, so at every point in time the file name points to a valid, complete version of the file.

    http://vimdoc.sourceforge.net/htmldoc/options.html#%27backup%27

    November 23, 2016 at 3:24:04 PM GMT+1 - permalink - archive.org - http://stackoverflow.com/questions/11043534/edit-a-file-in-place-in-vim
    docker vim mount file
Links per page: 20 50 100
Shaarli - The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community - Help/documentation