How should I rename my current file in Vim?
For example:
person.html_erb_spec.rbperson
This little script isn't perfect (the extra carriage-return you have to press) but it get's the job done.
function Rename()
let new_file_name = input('New filename: ')
let full_path_current_file = expand("%:p")
let new_full_path = expand("%:p:h")."/".new_file_name
bd
execute "!mv ".full_path_current_file." ".new_full_path
execute "e ".new_full_path
endfunction
command! Rename :call Rename()
nmap RN :Rename