check if a file exists in vim script

1,515 views
Skip to first unread message

coot_.

unread,
Jun 28, 2009, 4:43:04 AM6/28/09
to vim_use
Hello,

How to check if a specific file exists in vim script, or how to check
is swap file exists.

Thanks for any tips,
Coot

Dennis Benzinger

unread,
Jun 28, 2009, 6:18:31 AM6/28/09
to vim...@googlegroups.com
Am 28.06.2009 10:43, coot_. schrieb:
> Hello,
>
> How to check if a specific file exists in vim script, or how to check
> is swap file exists.
> [...]

To check if a file exists you can use filereadable() or glob(). See
:help filereadable and :help glob


HTH,
Dennis Benzinger

coot_.

unread,
Jun 28, 2009, 5:22:05 PM6/28/09
to vim_use
Thanks.

On Jun 28, 12:18 pm, Dennis Benzinger <Dennis.Benzin...@gmx.net>
wrote:
Reply all
Reply to author
Forward
0 new messages