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
2009-10-17 14:04:39