Question: I am trying to find a combination of commands, macro or a plugin to copy the file I am editing in VIM (actually macvim) to the same location but with a different name. I am sure this could be achieved with a simple:

```
 !cp $CURRENT_FILE_PATH $NEW_PATH

```

but I don't know what variables to use nor the syntax.

Answer: 
`:saveas %:p:h/new_name`

For more information:

```
:h :saveas

```
```
:!cp % %:h/new_name

```

* `%` expands to the current filename
* `%:h` expands to the current filename's directory

To learn more:

* `:help expand()`
* `:help filename-modifiers`