rktjmp / lush.nvim

Create Neovim themes with real-time feedback, export anywhere.
MIT License
1.4k stars 46 forks source link

Add warning in :LushRunTutorial to avoid loss of work with naive `:w`'s #132

Closed alice-lefebvre closed 1 year ago

alice-lefebvre commented 1 year ago

Hi !

Well first of all I need to say that the tutorial is really well made. The problem is that it's too well made, so it does encourage tinkering around and creating a theme.

The problem that happened to me is that I did :w file to save the progress I was making, and then regularly :w to save it. Well you see where this is going, only the first write wrote to file, the rest of them were writing on the temporary buffer that got discarded as soon as I exited nvim, and with it, my beautiful draft of a theme.

After reading vim help about :w, I see that the mistake comes from my own inexperience, as I should have used :sav file instead.

However, and this is why I'm filing this issue, I think this is an issue that is likely to happen again to people that are not that experienced with vim, since working with temporary buffer is really rare to me (only other instance I can think of is vimtutor)

So, to avoid other frustrating experiences, I'm proposing to add a warning in the comments, something like "if you want to save the modifications you've made in this buffer, prefer :sav <path> to :w <path>, since :w <path> creates an alternate file and subsequent :ws will NOT save your progress"

I don't know if it's a good suggestion, maybe everyone knows that, but I figured I would share that thought.

Thanks for reading and congrats on this project, it's really cool and I think I'm gonna have a lot of fun with it.

rktjmp commented 1 year ago

Sorry you ran into that. I updated the tutorial to have a warning :+1: