KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm looking for an elegant way in Vimscript to check if a file exists in the current directory. I came up with the code below but I'm not sure if that's the most elegant solution (I'll set a Vim option if the file exists). Is there any way of not having to do another comparison of the filename? Maybe use a different built-in function from Vim? :function! SomeCheck() : if findfile("SpecificFile", ".") == "SpecificFile" : echo "SpecificFile exists" : endif :endfunction
Tags (comma-separated)
Save Edits
Cancel