tags:

views:

90

answers:

1

In Vim script, if I have a file name, how to get it's path? For example, I want to get a path of the temp directory Vim uses. I can get a name of temp file by calling tempname(). But how to extract path from name returned?

+6  A: 

To remove the last path component:

fnamemodify(tempname(), ":h")
Rüdiger Hanke