jpalardy / vim-slime

A vim plugin to give you some slime. (Emacs)
http://technotales.wordpress.com/2007/10/03/like-slime-for-vim/
MIT License
1.87k stars 227 forks source link

move to the end of selected Visual area #353

Closed tanloong closed 1 year ago

tanloong commented 1 year ago

After SlimeRegionSending, the cursor stays at the start of the selected Visual area. Moving the cursor to the end side would be helpful. It will allow us to just continue to select and send lines that come after.

jpalardy commented 1 year ago

hi @tanloong

Thanks for pitching in!

Is it possible to do this in a mapping instead? Does it belong (as the default behavior) in the slime logic?

tanloong commented 1 year ago

Thanks for replying!

The reason that I didn't choose the mapping way is that I don't know how to, although there have already been a related #331.

I tried xmap <F5> <Plug>SlimeRegionSend|'> in nvim, but got E20: Mark not set.

If there is a mapping doing the same thing, I am happy to use it. Otherwise letting slime itself do it, in default, fits me, with, from your point of view, the cost of the slime logic. In that regard, I will use my fork if the change is not for vim-slime.

So, how can I map this behavior? Or how should I modify the above mapping?

Excuse me if the language looks strange. I am not a native speaker.

jpalardy commented 1 year ago

Hi @tanloong

Although it's not exactly the same, I've used this binding to navigate after sending a paragraph.

Also, I just tried:

# mnemonic: end
vmap ,e <c-c><c-c>`>

which seems to work (if I understand what you were trying to do)

Let me know if that helps 😄

tanloong commented 1 year ago

It works! I use this:

vim.keymap.set('x', '<F5>', '<c-c><c-c>`>', {remap=true}) -- written in lua

vimscript equivalent:

xmap <F5> <c-c><c-c>`>

Thanks!

jpalardy commented 1 year ago

Happy to hear that ^