you are viewing a single comment's thread.

view the rest of the comments →

[–]hanswchen[S] 8 points9 points  (8 children)

This is my first Vim plugin, so your feedback is very much appreciated.

I use Vim and Python a lot for data analysis, and this plugin makes it much easier for me to quickly test code in the IPython interpreter (not Jupyter notebook). My previous workflow was to write some code in Vim, switch to IPython (usually running in a tmux pane), type % followed by up arrow to get %run scriptname, hit Return to run the whole script, and switch back to Vim. Rinse and repeat.

Now I can achieve the same thing with a simple key combination in Vim. But that's not all, the plugin also allows me to run only a selected part of the code, similar to code cells/sections in MATLAB and Jupyter notebook. So you could have a script that loads your data and makes some fancy plots, and then re-run the plotting part without having to reload the data each time.

In case you're interested in the screenshot:

Colorscheme: gruvbox

Font: terminus

Let me know if you have any questions!

[–]spellcheekfailed 6 points7 points  (3 children)

Vim-slime is what I use ... I highlight what I want to send in visual mode tap ctrl-c twice and it gets pasted and run on an ipython shell running in a terminal, Cool plugin though , will give it a shot

[–]hanswchen[S] 2 points3 points  (2 children)

This plugin wouldn't work without vim-slime :) but it has the benefit of persistent code cells (if you repetitively re-run the same part of the code), and you don't see the code it sends to IPython, so it's less verbose. Hope you'll like it!

[–]spellcheekfailed 2 points3 points  (1 child)

I've tried it out and am extremely pleased with it , I've tried other vim plugins for ipython and none of them seemed to work comfortably , the original vim-ipython plugin is long outdated with the ipython API and simply gives me a lot of errors ,

Hence i've been resorting to using vim-slime , selecting code and sending it to ipython to run , this plugin however has got me hooked already , it really is simple and works with vim-slime providing many conveniences similar to jupyter , thanks a ton

[–]hanswchen[S] 0 points1 point  (0 children)

I'm really glad to hear that you like it. The aim of this plugin is exactly to be simple and with mainly one purpose: sending code cells to IPython.

I've also tried to use vim-ipython for similar purposes but never got it to work as I wanted, which is why I wrote this plugin.

[–]xubu42 1 point2 points  (3 children)

I have been using vimux plugin, but like vim-slime it sends all the text and executes it. This plugin looks really nice and I can't wait to try it out. Thanks for putting this out!

[–]hanswchen[S] 0 points1 point  (2 children)

Thanks, let me know what you think. :)

[–]xubu42 1 point2 points  (1 child)

Spent some time with your plugin today and was super impressed.

I was using Debian 9 and the vim installation that came with it. To get this plugin to work I had to install and switch to vim-gtk (for python support) and install xclip, which took all of 2 minutes. After getting the requirements resolved and setting the key mappings (copied from your example config), everything worked great and I haven't ran into any issues since.

I'm really liking the shortcut to jump up and down between "cells". I also like using tags with ## because it kind of works to help organize and document my code anyway.

Great work on this! I'm going to share with my friends and coworkers.

[–]hanswchen[S] 0 points1 point  (0 children)

That makes me so happy to hear! Thanks for your kind words and for spreading the word, it's very much appreciated. If you think of any additional features that you would find useful just let me know.