2

I'm new to Vim editor.

I used Sublime Text before using Vim. In Sublime Text, there was a plugin named SublimeREPL, which is optimized for using REPL such as irb, python, and scala. The plugin highlighted the code I type and provide a simple code completion like this.

enter image description here

Is there any plugin similar to this in Vim?

  • I'm putting this in a comment since I'm not sure it'll work well or at all with languages outside of the Lisp family, but Slimv provides a REPL and other quick expression evaluation tools. – 8bittree Dec 12 '16 at 15:25
3

You might find Shougo's VimShell similar. It gives you a terminal session in a Vim buffer, which is quite neat!

However, in my experience, I've found it to be a little buggy. YMMV. Also, three days ago, development on it officially stopped.

I think it's fair to say that things like this have been on vimmers' wishlists for some time now. Unfortunately, I don't know that it'll ever happen. Vim's strength is that it's a terrific editor -- but the price for that is that Vim's buffers don't lend themselves too well to the sort of interaction a CLI needs. So we can run a terminal in a Vim buffer, but I don't know that it'll ever be quite right; it's not what Vim's designed to do.

Instead, I offer you two alternatives I use after experimenting with VimShell and finding it wasn't for me -- but they'll only work with Vim in a terminal, not something like gvim:

  1. Using something to do terminal multiplexing, like tmux. Using this you can break a shell out at the side of your vim window, or have a shell in another tmux panel, or what have you. I use this every day, and seriously recommend getting into tmux as a part of your development environment.
  2. CTRL-z is your friend. Really, the shell that you launched Vim from is only a key command away. CTRL-z will pause Vim, background it, and bring you back to your shell. You can launch your repl from there, and when you're done, the fg command will bring Vim back to the foreground. Experiment with it! It's really simple in practice. I use this every day also.

Hope that helps!

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.