Search code examples
phplinuxvimfile-extension

.php~ in file extension after exiting vim editor


This may be a dumb question but I can't seem to figure out why a php file with the same name is created but with extension index.php~ after I finish editing index.php file on my remote server using vim.

I quit the vim editor with :wq! command, on Windows the ~ in file extension usually mean unsaved or file that is currently opened, is it the same thing on Linux server?


Solution

  • index.php~ is backup and contains a file as it was before you edited index.php

    You can disable this behavior in your .vimrc file:

    set nobackup