# Extra square brackets appended when sending lines using both vim-slime and ToggleTerm in neovim

**URL:** <https://discourse.julialang.org/t/extra-square-brackets-appended-when-sending-lines-using-both-vim-slime-and-toggleterm-in-neovim/128368>\
**Category:** Tooling\
**Tags:** question, neovim\
**Created:** [April 24, 2025, 1:31pm UTC](https://discourse.julialang.org/t/extra-square-brackets-appended-when-sending-lines-using-both-vim-slime-and-toggleterm-in-neovim/128368 "2025-04-24T13:31:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gottacatchenall](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gottacatchenall/32/18265_2.png) [@gottacatchenall](https://discourse.julialang.org/u/gottacatchenall)\
**Post date:** [April 24, 2025, 1:31pm UTC](https://discourse.julialang.org/t/extra-square-brackets-appended-when-sending-lines-using-both-vim-slime-and-toggleterm-in-neovim/128368/1 "2025-04-24T13:31:59Z")

</div>

I’m trying to use neovim as an editor while sending lines to a REPL in a separate window. I’ve tried using both vim-slime and ToggleTerm.nvim, and everything works fine except for when I send lines that contain square-brackets. When sending a line with a square-bracket, e.g.

```julia
x = [1,2,3]

```

an extra square bracket gets sent, i.e. the REPL receives `x = [1,2,3]]` which obviously causes an error.

This persists after disabling all other plugins. I’m using nvim v0.11.0, Kitty 0.41.1 (but it also happens in other terminal emulators), toggleterm.nvim v2.13.1, and the current version of vim-slime (no version number associated with it).

I’ve tried identical tests in Python, and it doesn’t occur there, so it must be something specific to Julia. It also occurs when the file open in vim doesn’t have an extension, so I think it has something to do specifically with how the REPL parses the buffer it’s sent, rather than anything with the language server in vim.

Screen recording demo [here](https://imgur.com/a/HGKWiUR)

Has anyone else run into this issue?

---

<div class="post-metadata">

**Author:** ![aris](https://avatars.discourse-cdn.com/v4/letter/a/258eb7/32.png) [@aris](https://discourse.julialang.org/u/aris)\
**Post date:** [May 16, 2025, 12:52pm UTC](https://discourse.julialang.org/t/extra-square-brackets-appended-when-sending-lines-using-both-vim-slime-and-toggleterm-in-neovim/128368/2 "2025-05-16T12:52:03Z")

</div>

An alternative to slime is [yeet](https://github.com/samharju/yeet.nvim). Perhaps switching to it might solve the issue?

---

<div class="post-metadata">

**Author:** ![pat-alt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pat-alt/32/34264_2.png) [@pat-alt](https://discourse.julialang.org/u/pat-alt)\
**Post date:** [May 21, 2025, 5:09pm UTC](https://discourse.julialang.org/t/extra-square-brackets-appended-when-sending-lines-using-both-vim-slime-and-toggleterm-in-neovim/128368/3 "2025-05-21T17:09:57Z")

</div>

I’m having the exact same issue. Have you found a solution by any chance @gottacatchenall?

---

<div class="post-metadata">

**Author:** ![jbrea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbrea/32/3879_2.png) [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Post date:** [May 22, 2025, 6:46am UTC](https://discourse.julialang.org/t/extra-square-brackets-appended-when-sending-lines-using-both-vim-slime-and-toggleterm-in-neovim/128368/4 "2025-05-22T06:46:39Z")

</div>

Do you use OhMyREPL.jl? I have `enable_autocomplete_brackets(false)` in my startup. If I set it to `true`, I also get the extra square bracket.

---

<div class="post-metadata">

**Author:** ![DoktorMike](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/doktormike/32/2736_2.png) [@DoktorMike](https://discourse.julialang.org/u/DoktorMike)\
**Post date:** [May 24, 2025, 7:33pm UTC](https://discourse.julialang.org/t/extra-square-brackets-appended-when-sending-lines-using-both-vim-slime-and-toggleterm-in-neovim/128368/5 "2025-05-24T19:33:48Z")

</div>

Yes this also happened to my. I stopped using OhMyREPL and I had no more issues. Didn’t know about the flag. But I will try that

---

<div class="post-metadata">

**Author:** ![gottacatchenall](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gottacatchenall/32/18265_2.png) [@gottacatchenall](https://discourse.julialang.org/u/gottacatchenall)\
**Post date:** [May 25, 2025, 4:03pm UTC](https://discourse.julialang.org/t/extra-square-brackets-appended-when-sending-lines-using-both-vim-slime-and-toggleterm-in-neovim/128368/6 "2025-05-25T16:03:40Z")

</div>

Check jbrea’s answer. It has to do with autoclosing brackets in OhMyREPL.

There’s been an [issue](https://github.com/KristofferC/OhMyREPL.jl/issues/338) open for over a year, but for now `enable_autocomplete_brackets(false)` in startup.jl is a fix.

---

<div class="post-metadata">

**Author:** ![pat-alt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pat-alt/32/34264_2.png) [@pat-alt](https://discourse.julialang.org/u/pat-alt)\
**Post date:** [May 26, 2025, 10:20am UTC](https://discourse.julialang.org/t/extra-square-brackets-appended-when-sending-lines-using-both-vim-slime-and-toggleterm-in-neovim/128368/7 "2025-05-26T10:20:21Z")

</div>

Ah great, thank you!
