remove header and footer properly
escape swap file correctly in the gitignorefile