For instance, how do I open a file I am going to use as the template for a file, but open it up as an unsaved buffer maybe? I don’t know what methods I should use but I want to be able to save it right after as the file it’s supposed to be.
My situation is for a jekyll blog where I have a basic post template and want to open that in vim from the command line so I can begin the post and then :w *filename.md*
Use the
saveascommand. Assuming you have a template for posts namedtemplate.md, opentemplate.md, make some edits, then instead of using:w, do:sav newPost.md.No need to switch buffers: now your buffer will contain the file
newPost.md, andtemplate.mdwill remain unchanged on the filesystem.