I know that vim retains some meta information about a file (like cursor position before you last closed it, file type if you have manually set it)

How can I reset this information? I'm in a very weird situation where I have a file x and I have a file y that is just a symlink to x.

I'm getting a weird error whenever I try to edit y but I don't encounter it when editing x directly, indicating that this has something to do with the file state rather than the error being legitimate (error message is about a plugin but removing that plugin doesn't stop vim from trying to invoke functions in that plugin in the file y, though it does not give any error in file x or any other symlinks of x)

How do I just reset the file y? I've tried deleting and restoring it, to no avail. I cannot rename it, it's a configuration file so it must be present in a certain location.

Answers to some follow up questions:

  1. Are the file extensions same? Yes, and so is :set ft?.
  2. Are any plugins that save / restore session state? I have inspected the plugins and does not seem that's the case
  3. Is :scriptnames same between both the files? Yes
  • Note: I couldn't find an appropriate tag for this question, edits welcome Nov 24, 2020 at 7:08
  • 2
    Try deleting the .viminfo file in your home directory, though I have doubts about this being the cause: vi.stackexchange.com/questions/10671/…
    – Endre Both
    Nov 24, 2020 at 8:40
  • What plugin functions does Vim try to invoke?
    – Endre Both
    Nov 24, 2020 at 8:40
  • 1
    What is the error?
    – Rich
    Nov 24, 2020 at 9:48
  • @EndreBoth remove from where? removing ~/.viminfo does not seem to reset file state (vim still remembers last edit position). Nov 24, 2020 at 10:36


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.