Created
May 20, 2011 15:18
-
-
Save twymer/983131 to your computer and use it in GitHub Desktop.
Move a file to a new location, open this new file, and delete the old buffer.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:movefunction(arg) | |
let oldnum = bufnr("%") | |
let newname = a:arg | |
execute "!mv %" . " " . newname | |
exe "new " . newname | |
exe "bd" . oldnum | |
endfunction | |
command! -nargs=* Newmv call s:movefunction('<args>') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment