Open nickeisenberg opened 1 year ago
This is similar I believe to this issue. It is said that cursor preservation was added later on in the 'happy path'?
Hi @nickeisenberg
Cursor save/restore goes through https://github.com/jpalardy/vim-slime/blob/main/plugin/slime.vim#L16
A few things:
g:slime_preserve_curpos
is unset or set to 1?I just tried setting g:slime_preserve_curspos
to both 0 and 1 and still had the same result. And I believe I am just usingthe standard key binding c-c c-c to send code to the other tmux pane.
Before pressing c-c c-c, do you select text?
What I see
the invocation, depending on selected or not, is different
Using '>
after the c-c/c-c will move you to the selection end.
I never knew about '>
but that is exactly what I wanted! I think im seeing here that c-c c-c
is mapped to something called <Plug>SlimeRegionSend
. Is there a way to instead map c-c c-c
to <Plug>SlimeRegionSend '>
so that the cursor automatically stays at the end of my selection>
Is there a way to instead map [...] ?
Definitely 😄
But is '>
what you always want to do after c-c/c-c?
I've done something similar to step through a bunch of paragraphs:
Let me know if you can make that work — if not, we can try a few things
I figured out what I needed! I did the following:
let g:slime_no_mappings = 1
xmap <c-c><c-c> <Plug>SlimeRegionSend <Esc> `>
nmap <c-c><c-c> <Plug>SlimeParagraphSend
nmap <c-c>v <Plug>SlimeConfig
Thanks for the quick replies, I really appreciate it!
Excellent — I'm glad you found a working combination 🎉
Suppose I select some text in order to send it to another terminal pane. If I select the text from top to bottom (ie the cursor is at the bottom of the selection when I send the text to the other tmux pane), then the cursor returns to the top where the selection started. Is there a way to not have this be the case and to keep the cursor in the exact location where I initiate the code sending?