beauwilliams / imnotaquitter.vim

Don't be a quitter. Be a real one.
23 stars 2 forks source link

[QUESTION] What is the purpose of this plugin? #3

Open H4ppy-04 opened 2 weeks ago

H4ppy-04 commented 2 weeks ago

About

I like the plugin, but I do have a couple of questions.

Questions

Assuming that this plugin is not a gimmick:

  1. Why is it 'bad' to exit Vim?
  2. Why don't pros[^1] exit Vim?[^2]

[^1]: What constitutes a 'pro'? [^2]: As stated in the README file

ChilloManiac commented 3 days ago

I guess it's because it's inefficient?

I'm assuming this plugin is to fix behavior such as

Make changes to project Exit (N)vim Run tests/lint in terminal Enter (N)vim Make more changes.

Using this plugin you would be forced to instead

This preserves whatever state has been loaded (LSP, Plugins etc) and where you are located in your project. No reason to throw it away anytime you want to run a command in your terminal

H4ppy-04 commented 21 hours ago

I guess it's because it's inefficient?

That makes sense. Reloading an LSP that has spent time indexing a large code-base would indeed be very inefficient (and slow).

Using this plugin you would be forced to instead

Run tests/lint from inside your editor using a task-runner, terminal inside vim or other way Open another terminal/tab/tmux and run inside there.

Indeed a tmux-driven workflow for tests (or test runner plugin) would be much faster than exiting vim.

This preserves whatever state has been loaded (LSP, Plugins etc) and where you are located in your project. No reason to throw it away anytime you want to run a command in your terminal

I do like this idea, however I don't feel that a plugin is needed for this. (N)Vim has existing support for suspending a process (with C-z). IMHO a more graceful approach could be to map exit commands to suspend vim, instead of prompting the user with a message.

The drawback of this 'alternative approach' would be incompatibility with operating systems such as Windows that only support sending process calls directly into the CPU from the kernel-level and don't natively support process suspension through the terminal[^1].

Thank you for your reply, and I'd love to hear your thoughts on this alternative approach!

[^1]: GNU/Bash does this nicely with a neat set of commands. Namely, fg, bg, disown, kill, jobs, etc