Closed sameera207 closed 6 years ago
Hi, sorry for the delay, I haven't found an effective strategy for dealing with notifications.
SiB itself doesn't have an option for this. I could add one, but it feels like this belongs in the editor itself. Eg, in this case, vim would only send the selected lines to SiB and then update them. That feels like the most flexible way to do it.
I've updated my vim bindings to set the scope to just the selected portion when in visual line mode, give this a try: https://github.com/JoshCheek/dotfiles/blob/ce7c47d14e4ae4ff2d736607efb515c75c3e00e4/vimrc#L131-L190
(note I've been told you need at least vim 8 for this to work, IIRC, it's because of the function
thing, but if you're on an older one, you can just duplicate the WithoutChangingCursor
in each of the three functions)
@JoshCheek , Thanks for the reply and I agree with you on not adding this this to SiB . Also, thanks a lot for the explanation and link to your .vimrc file.
I've updated mine and now it works perfectly
I've upgraded my vim to be 8.1.3
closing the issue as the suggested solution works :)
A suggestion, given your example: I wouldn't use the p
function. p
prints the inspection stdout, which you don't need to do since SiB will display the inspection inline.
Also, given 👆 a thought that entered my brain which feels worth saying aloud, even though I don't have an intent to act on it:
If people are using SiB to make examples for others (eg in a book or whatever) they may have the preference of putting the p
in the code so that people without SiB can run it and see the output, but still want the example updated as if it was not called. Perhaps SiB should offer a way to configure how p
works?
And now that I've thought that out loud, as I was writing it, I realized the best solution is probably for the user to configure SiB to require their custom file of modifications using the -r
flag (maybe the -I
flag, too). That's more flexible and doesn't require complicating SiB.
Hey @JoshCheek ,
First off, thanks the this awesome plugin,
Quick question.. ( I'm sure I must be doing something wrong here), but I cannot get this work only for selected lines in vim.
Currently I got it working for the entire file. But what I want is for it to run on the line where my cursor is on.
So, following is a screen record of what's happening. I'm doing..
as you can see, instead of running the line with current cursor on, it runs the full file.
Following is my
.vimrc
mappingsAny help would be much appreciated
cheers