# Neovim/slime/tmux and bracketed-paste

**URL:** https://discourse.julialang.org/t/neovim-slime-tmux-and-bracketed-paste/98778
**Category:** Tooling
**Tags:** neovim
**Created:** [May 13, 2023, 3:16am UTC](https://discourse.julialang.org/t/neovim-slime-tmux-and-bracketed-paste/98778 "2023-05-13T03:16:27Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![ZuseZ4](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zusez4/32/49755_2.png) [@ZuseZ4](https://discourse.julialang.org/u/ZuseZ4)
#### Post date: [May 13, 2023, 3:57am UTC](https://discourse.julialang.org/t/neovim-slime-tmux-and-bracketed-paste/98778/2 "2023-05-13T03:57:09Z")

</div>

These are my julia plugins for neovim, I do use the default neovim lsp

```julia
    Plug 'JuliaEditorSupport/julia-vim'
    Plug 'jpalardy/vim-slime'
    Plug 'autozimu/LanguageClient-neovim', {'branch': 'next', 'do': 'bash install.sh'}

```

I don’t use things like OhMyRepl.jl, and some quick test also didn’t seem to help,  
but I am happy to change my julia setup if that helps.

Looking at the ~/.slime\_paste buffer that holds the last send text it does indeed look like there is an issue with the block sending. The buffer file only contains the lower half of my testcase, so I assume it is sending my testset in multiple blocks? The julia repl still shows the whole testcase as one single block/command/history entry, but I guess the bracketed-paste special symbols get messed up?

Just for completeness, the testcase does work fine if I just run  
`julia --project dot.jl`

> **~/.slime\_paste**
>
> ```julia
> ➜ Enzyme.jl git:(axpy) cat ~/.slime_paste 
> fdm, (x, y) -> fun(n, x, inc, y, inc), one(Float32), x, y
> )
> @show inc
> ret = autodiff(
> ReverseWithPrimal,
> fun,
> Tret,
> Const(n),
> x_annot,
> Const(inc),
> y_annot,
> Const(inc),
> )
> dval, val = ret
> 
> @test all(isnothing, dval)
> @test val ≈ vexp
> @test ∂xcopy ≈ dexp[1] * !(Tx <: Const || Tret <: Const) + ∂x
> @test ∂ycopy ≈ dexp[2] * !(Ty <: Const || Tret <: Const) + ∂y
> end
> end
> end%    
> 
> ```

> **Full Testcase**
>
> ```julia
> julia> @testset "BLAS rules" begin                                                                                                                                                                                                                                                                                                                                                                                                      
> fdm = central_fdm(5, 1)                                                                                                                                                                                                                                                                                                                                                                                                      
> RTs = (Float32, Float64)  
> n = 10
> 
> fun = BLAS.dot
> 
> #Enzyme.API.print!(true)
> @testset "reverse" begin
> 
> @testset for Tret in (Active,),
> Tx in (Const,),
> Ty in (Duplicated,),
> pfun in (identity,),
> #T in (Float32,),
> (sz, inc) in ((10, 1), ((2, 20), -2)),
> 
> Tx <: Const && Ty <: Const && !(Tret <: Const) && continue
> 
> x, ∂x = ntuple(_ -> randn(Float32, sz), 2)
> y, ∂y = ntuple(_ -> randn(Float32, sz), 2)
> ∂z = randn(Float32)
> xcopy, ycopy, ∂xcopy, ∂ycopy = map(copy, (x, y, ∂x, ∂y))
> 
> x_annot =
> Tx <: Const ? Const(pfun(x)) : Duplicated(pfun(xcopy), pfun(∂xcopy))
> y_annot =
> Ty <: Const ? Const(pfun(y)) : Duplicated(pfun(ycopy), pfun(∂ycopy))
> 
> vexp = fun(n, x, inc, y, inc)
> dexp = FiniteDifferences.j′vp(
> fdm, (x, y) -> fun(n, x, inc, y, inc), one(Float32), x, y
> )
> @show inc
> ret = autodiff(
> ReverseWithPrimal,
> fun,
> Tret,
> Const(n),
> x_annot,
> Const(inc),
> y_annot,
> Const(inc),
> )
> dval, val = ret
> 
> @test all(isnothing, dval)
> @test val ≈ vexp
> @test ∂xcopy ≈ dexp[1] * !(Tx <: Const || Tret <: Const) + ∂x
> @test ∂ycopy ≈ dexp[2] * !(Ty <: Const || Tret <: Const) + ∂y
> end
> end
> end
> ERROR: syntax: invalid iteration specification
> Stacktrace:
> [1] top-level scope
> @ none:1
> 
> ```

Well it turns out that while getting the small testcase fixed using the bracketed pasting mode I did modify the large testcase without noticing, so it was actually invalid julia at the end of the day. So I did fix the actual slime issue a long time ago without noticing. _sigh_

---

_[View the full topic](https://discourse.julialang.org/t/neovim-slime-tmux-and-bracketed-paste/98778)._
