Skip to content

Vault.rename method

Vault › rename

Official

Rename or move a file. To ensure links are automatically renamed, use FileManager.renameFile instead.

This method only moves the file: links pointing to it are left as they were, so they break. FileManager.renameFile moves it the same way and then updates the links, asking the user first when the "Automatically update internal links" setting is off.

Signature:

rename(file: TAbstractFile, newPath: string): Promise<void>

Parameters:

ParameterTypeDescription
fileTAbstractFileThe file or folder.
newPathstringThe new vault absolute path.

Returns: Promise<void>

Since: 0.9.11