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

SlimeSend0 with append a return or newline #340

Closed huijunchen9260 closed 2 years ago

huijunchen9260 commented 2 years ago

Dear Jonathan:

Recently I am using SlimeSend0 with the julia terminal so that I can send customized debugger command to the terminal. Somehow I notice that the text sent by SlimeSend0 does not automatically being executed, and I have go to the terminal and press an enter. Is there anyway to do it?

I know there's SlimeSend1 which indeed append newline, while somehow SlimeSend1 doesn't execute my line and file information. Currently I am using the following keymapping:

autocmd FileType julia nnoremap <c-s>e :SlimeSend0 '@enter ' . substitute(getline('.'), ".* = ", "", "")<CR>

So I need vim to evaluate the substitute command before send the result to the julia terminal.

HJ

huijunchen9260 commented 2 years ago

What the heck I just figured how LMAO

Just append the newline character \n and somehow it will do the job:

autocmd FileType julia nnoremap <c-s>e :SlimeSend0 "@enter " . substitute(getline('.'), ".* = ", "", "") . "\n"<CR>
jpalardy commented 2 years ago

Hi @huijunchen9260

Good you found a workaround 👍