Skip to content

Instantly share code, notes, and snippets.

@mipmip
Last active September 18, 2019 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mipmip/78153fcf8ae78afac0e4bb9389e59ab1 to your computer and use it in GitHub Desktop.
Save mipmip/78153fcf8ae78afac0e4bb9389e59ab1 to your computer and use it in GitHub Desktop.
Vim mapping: saveas with proposed new filename populated in Ex-mode
function! s:saveas()
return ":saveas ". expand("%:r") . "_COPY." .expand("%:e")
endfunction
nnoremap <expr> <leader>sa <SID>saveas()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment