This info can also be found on the Internet, but I thought I compile it here too.
Problem
You want to save something (say passwords) in a file and protect the file with a master password (say with your PGP/GPG key). This can be cumbersome unless you have vim.
The following examples will handle *.gpg files differently, vim will
decrypt the file when opening it and encrypt the file when writing it.
Also the use of a swap file is disabled.