vim-slime icon indicating copy to clipboard operation
vim-slime copied to clipboard

Is there a way , let slime automatic knew the "language" we use.

Open brucejuz opened this issue 2 years ago • 3 comments

I have set the slime automatic start the interpreter as this

let g:slime_target = "vimterminal"
let g:slime_vimterminal_cmd = "scheme"
let g:slime_vimterminal_config = {"term_finish": "close", "vertical": 1}

so each time I send a line, it will automatic open a window, run "scheme" and the line.

Is there a way, slime can know the language I use, so when I use "R", it will open "R", or when I use "Python", it will open "Python", or "C"... automatically.

Thanks a lot! By the way this plugin helps a lot!

brucejuz avatar Oct 19 '22 07:10 brucejuz

Hi @brucejuz

You can try the &ft (filetype) variable, which reflects the type of file vim thinks you've got open.

Let me know how that goes 👍

jpalardy avatar Oct 19 '22 16:10 jpalardy

I add these line to my vimrc

autocmd Filetype scheme let g:slime_vimterminal_cmd = "scheme"
autocmd Filetype python let g:slime_vimterminal_cmd = "**python3**"

Now, when I open *.py, send a line, it will open python automatically; if I open *.scm, send a line then it will open scheme. Nice:)

But in python, it must set cmd to "python3"; set cmd to "python" just does not work in vim-slime, even though in my terminal when I input "python", it can open python.

Thanks a lot!

brucejuz avatar Oct 25 '22 09:10 brucejuz

I add these line to my vimrc

autocmd Filetype scheme let g:slime_vimterminal_cmd = "scheme"
autocmd Filetype python let g:slime_vimterminal_cmd = "**python3**"

Now, when I open *.py, send a line, it will open python automatically; if I open *.scm, send a line then it will open scheme. Nice:)

But in python, it must set cmd to "python3"; set cmd to "python" just does not work in vim-slime, even though in my terminal when I input "python", it can open python.

Thanks a lot!

brucejuz avatar Oct 25 '22 09:10 brucejuz

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 07 '23 19:01 stale[bot]