2015-04-14 20:28 GMT+03:00 Ben Fritz <fritzophre...@gmail.com>: > On Tuesday, April 14, 2015 at 10:43:11 AM UTC-5, Thiago Arruda wrote: >> > It's easy to accidentally make a Vim script that consumes all >> memory. >> >> If you see this often then you must be running Vim on a machine with >> an extremely low amount of memory. This is not the case for most users >> though, in the few years using Vim I never experienced this and I use >> some pretty heavy plugins. Even if OOM was common due to bugs in >> vimscript, it's not like the user will try to recover the current Vim >> instance without exiting. The common course of action would be to exit >> and remove the buggy vimscript program. > > I know it's not common...probably even very rare...but wouldn't the common > course of action actually be: > > 1. SAVE ALL WORK
NeoVim saves work in swap files. I also have habit of saving whenever I pause which is recommended because OOM is less common then - Hardware power loss. - Buggy VimL (or especially Python) with endless loop or deadlock. (Vim with my configuration for some reason cannot stop `while 1 | sleep 1 | endwhile` with `<C-c>` even though `vim -u NONE` can: this is in case you want to say “there are no endless loops in VimL”; you may also construct one using `catch /^Vim:Interrupt$/`.) - Accidentally closed terminal emulator or Vim instance itself. - `kill -KILL` send to a wrong Vim instance. In neither of the above cases Vim OOM handling is going to work or you will have any chances to save your work. So you can’t rely on yourself being able to save your work in case of some troubles and suggested course of action is either relying on swap files or saving your work whenever possible. Both work in OOM case as well. (Note: even if you have a habit of constantly saving your work it does not mean you should not buy an UPS, test code in the same instance you write it, close applications which are temporary not needed or think about what you are killing before running `kill -KILL`.) > 2. Exit Vim > 3. Remove buggy vimscript > > Step 1 is impossible if Vim just exits. True, it may not succeed if Vim > attempts to handle the situation, either, but at least it can *try*. > > -- > -- > You received this message from the "vim_dev" maillist. > Do not top-post! Type your reply below the text you are replying to. > For more information, visit http://www.vim.org/maillist.php > > --- > You received this message because you are subscribed to the Google Groups > "vim_dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to vim_dev+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.