I am using vim for coding. When I have something like the following:
SomeModule->actualMethod() if I take the cursor to SomeModule and I do a gf I get a complaint that SomeModule- does not exist in the path.
How can I get rid of the - so that the SomeModule file opens?


What Vim considers part of a filename is controlled by the 'isfname' option. You need to remove the dash from it for your example to work:

:set isfname-=-

Note that when your SomeModule file has a file extension, you also need to add it to 'suffixesadd'.

  • So the =- means that what comes after = is not part of a filename? And if I need to exclude other characters? E.g. a - and a : as not acceptable parts of filename? – user65971 May 21 '13 at 20:20
  • 2
    The -= deletes the following string from isfname. See :help :set-=. If you wish to delete other characters from isfname, be sure to delete them one character at a time. That is, execute :set isfname-=- and :set isfname-=:, not :set isfname-=-:. The last command will work only if -: are present in isfname together and in that order. – garyjohn May 21 '13 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.