4

If I quit Neovim's containing terminal without exiting Vim first, then the next time I run Neovim I get the error:

E575: Error while reading ShaDa file: mark entry at position 2957 has
Press ENTER or type command to continue

I want to not see this error on startup.

To reproduce this error run nvim --cmd term exit the terminal while still in vim and then run nvim --cmd term again. This error is caused by not exiting vim before closing the terminal.

  • 3
    Why are they unavoidable? I see various issues in the github repo, which have all been resolved. Please provide more information. – jamessan Feb 28 '18 at 2:09
  • 1
    Based on :h E575 and the error message you have corrupted data in your shada file. I'm not familiar with neovim but :h shada-file-name seems to indicate where is your shada file. So find your shada file, find the corrupted data and no more "unavoidable error" – statox Feb 28 '18 at 8:48
  • @statox quitting the terminal without closing vim causes this error. The error corrects it's self if I open and then close vim. – user Feb 28 '18 at 20:12
3
+50

Check your init.vim. If there is any line concerning viminfo, temporarily remove/comment it, you can later discover the reason it messed up.

Then backup and remove ~/.local/share/nvim/shada folder. Then start up Neovim, the folder will be auto-generated with a file named main.shada. Hopefully, your error will be gone.

The error possibly surfaced because neovim deprecated vim's viminfo format. Instead neovim uses shada or shared data. But possibly your init.vim contains some reference to viminfo formatted code which it can't read.

  • Nothing concerning viminfo. – user Mar 2 '18 at 22:40
  • Check the question for new details. I am not necessarily looking to get rid of the error, just to hide it. – user Mar 2 '18 at 22:46
  • 1
    Sorry, but I couldn't reproduce the error. I'm using v.0.2.3-dev. – klaus Mar 3 '18 at 3:00
0

if you are a linux user:

echo ':term' | nvim

will send the commands directly through the pipe. So there won't be any error.

I personally also put an alias into my .bashrc file too:

alias nvim='echo ":term" | nvim'

Edit: If you still want to open files with nvim you might want to put something like this into your bashrc file (and remove the alias)

nvim() {
    if [[ $@ == "." ]]; then
        command echo ":terminal" | nvim
    else
        command nvim "$@"
    fi
}
  • I'm not sure your answer will change something about OP's issue: Passing a command to neovim will not make it ignore the shada files containing some errors. Also, the recommended way to pass a command to vim is with +c (:h -c) and I think this is the same for neovim (but I may be wrong about this part). – statox Mar 9 '18 at 15:08
  • You are right it won't help you if you already have some errors in your shada file. But with this method you can exit the terminal without vim exiting first without throwing a error. – biocarl Mar 9 '18 at 15:40

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.