1

While editing a file my neovim crashed when I tried to save the file (with the error message "init.vim" 77L, 2423C writtennvim(5888,0x7fffa9f29340) malloc: *** error for object 0x7f861301d400: pointer being freed was not allocated), and after that I tried to edit it again, the following dialog is shown.

Swap file "~/.local/share/nvim/swap//%Users%me%.config%nvim%init.vim.swp" already exists!

[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:

However, it seems that all of the options I choose lead to the same crash and recover loop, so I tried to delete all the swap files.

cd ~/.local/share/nvim/swap
rm -rf *

The swap files are all gone, but even after that, when I tried to open the file, edit, and save it, the same crash occured, and then the swap file is created and the same recovery mode is shown on the next launch.

How can I discard the swap and regain my editing capability without installing it again?

  • 4
    You've already used two methods to delete the swap files (through the prompt and manually). That isn't the problem here, so your title is misleading. This should probably be a bug report for either your distribution or for neovim proper, depending on the version of neovim you're using. Neovim shouldn't be crashing and that is the problem, not the swap files. – jamessan Feb 11 '18 at 16:29

Your Answer

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

Browse other questions tagged or ask your own question.