# Julia-Vim tutorial for newbies

**URL:** <https://discourse.julialang.org/t/julia-vim-tutorial-for-newbies/36636>\
**Category:** Tooling\
**Tags:** question, vim\
**Created:** [March 28, 2020, 1:38pm UTC](https://discourse.julialang.org/t/julia-vim-tutorial-for-newbies/36636 "2020-03-28T13:38:39Z")\
**Posts on this page:** 10\
**Page:** 2

<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:** [April 13, 2020, 11:51am UTC](https://discourse.julialang.org/t/julia-vim-tutorial-for-newbies/36636/21 "2020-04-13T11:51:57Z")

</div>

I have julia v1.4.0 and LanguageServer v2.0.0 and this in my `coc-settings.json` (open in vim with `:CocConfig`)

```julia
{
"languageserver": {
  "julia": {
      "command": "julia",
           "args" : ["--startup-file=no", "--history-file=no", "-e",
                     "import Pkg; envpath = dirname(Pkg.Types.Context().env.project_file); const DEPOT_DIR_NAME = \".julia\"; depotpath = Sys.iswindows() ? joinpath(ENV[\"USERPROFILE\"], DEPOT_DIR_NAME) : joinpath(ENV[\"HOME\"], DEPOT_DIR_NAME); using LanguageServer; server = LanguageServerInstance(stdin, stdout, false, envpath, depotpath); run(server)"],
      "filetypes": ["julia"]
  }
}
}

```

---

<div class="post-metadata">

**Author:** ![jessebett](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jessebett/32/2006_2.png) [@jessebett](https://discourse.julialang.org/u/jessebett)\
**Post date:** [April 14, 2020, 3:13am UTC](https://discourse.julialang.org/t/julia-vim-tutorial-for-newbies/36636/22 "2020-04-14T03:13:34Z")

</div>

Wow @jbrea this is very nice!

---

<div class="post-metadata">

**Author:** ![jessebett](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jessebett/32/2006_2.png) [@jessebett](https://discourse.julialang.org/u/jessebett)\
**Post date:** [April 14, 2020, 3:17am UTC](https://discourse.julialang.org/t/julia-vim-tutorial-for-newbies/36636/23 "2020-04-14T03:17:06Z")

</div>

@FirstnameLastname Can you share your config to make it send cells to repl?

---

<div class="post-metadata">

**Author:** ![FirstnameLastname](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/firstnamelastname/32/6648_2.png) [@FirstnameLastname](https://discourse.julialang.org/u/FirstnameLastname)\
**Post date:** [April 14, 2020, 6:23am UTC](https://discourse.julialang.org/t/julia-vim-tutorial-for-newbies/36636/24 "2020-04-14T06:23:05Z")

</div>

You can use [this plugin](https://github.com/mroavi/vim-julia-cell) made by @mroavi. It’s easier and cleaner than my setup.

---

<div class="post-metadata">

**Author:** ![EarthGoddessDude](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/earthgoddessdude/32/13003_2.png) [@EarthGoddessDude](https://discourse.julialang.org/u/EarthGoddessDude)\
**Post date:** [August 7, 2020, 12:30am UTC](https://discourse.julialang.org/t/julia-vim-tutorial-for-newbies/36636/25 "2020-08-07T00:30:06Z")

</div>

@FirstnameLastname, I love how your setup looks. Are you able to share your config/dotfiles?

---

<div class="post-metadata">

**Author:** ![eo1989](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eo1989/32/20847_2.png) [@eo1989](https://discourse.julialang.org/u/eo1989)\
**Post date:** [January 17, 2021, 5:29pm UTC](https://discourse.julialang.org/t/julia-vim-tutorial-for-newbies/36636/26 "2021-01-17T17:29:17Z")

</div>

Hi, what do you mean from within vim ‘kitty @ --to unix:/tmp/mykitty send-text “blah”’??

I have a jl file open, open a h-split and with Neoterm open a terminal. I want to use kitty-navigator (plug-in similar to Tmux-navigator, which is also a great plugin for those of you who wish to use Tmux) to move between screens but for whatever reason when I type your “blah” containing command into the new terminal I just get an error.

---

<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:** [January 17, 2021, 7:56pm UTC](https://discourse.julialang.org/t/julia-vim-tutorial-for-newbies/36636/27 "2021-01-17T19:56:26Z")

</div>

If everything is within the same kitty window I don’t think you need `@ --to`.  
For some context where `@ --to` may be useful, see [this issue](https://github.com/jpalardy/vim-slime/issues/234).

Can’t you just use the `:T` command of neoterm for your setup?

---

<div class="post-metadata">

**Author:** ![eo1989](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eo1989/32/20847_2.png) [@eo1989](https://discourse.julialang.org/u/eo1989)\
**Post date:** [January 17, 2021, 10:55pm UTC](https://discourse.julialang.org/t/julia-vim-tutorial-for-newbies/36636/28 "2021-01-17T22:55:41Z")

</div>

I could, and do, but launching Julia from within a terminal within Nvim is actually slower than opening a new kitty window/pane within the kitty os window and launching a Julia repo from that. My MacBook is a good 8 years old at this point & I want to be as efficient as I can. (Hence the learned use of Neovim, Lua, and the terminal in general rather than relying on bloated VSCode… though I do use it from time to time when work _just_ needs to be done). Side note: Figured increasing my cmd line fu would make me an overall better programmer/data sci dilettante than just learning one editor.

---

<div class="post-metadata">

**Author:** ![osbornejr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/osbornejr/32/27381_2.png) [@osbornejr](https://discourse.julialang.org/u/osbornejr)\
**Post date:** [July 21, 2021, 5:04pm UTC](https://discourse.julialang.org/t/julia-vim-tutorial-for-newbies/36636/29 "2021-07-21T17:04:51Z")

</div>

In relation to many of these setups: I have been using the Vim \rightarrow vim-slime \rightarrow Julia REPL setup and it works great, especially with the Vim `:term` option as you can also then pass REPL lines back to Vim.

One non-criticial issue that persists is that sending lines that begin with `tab` characters (i.e. a lot of lines!) can freak out the REPL somewhat and cause it to dump all Base exports before executing a line. This becomes particularly overwhelming and gluggy when you try and send a big chunk or even the whole script file.

Has anyone else experienced this or come up with a nice way around it? I note that there are two related issues open on the Julia GitHub [here](https://github.com/JuliaLang/julia/issues/41052) and [here](https://github.com/JuliaLang/julia/issues/37815). It seems to be tied to the fact that `<tab>` `<tab>` in an empty REPL “autocompletes” _everything_ . I’ve tried playing around with tabs as spaces etc. but that makes it much harder to write readable code.

---

<div class="post-metadata">

**Author:** ![Skoffer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skoffer/32/378_2.png) [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Post date:** [July 21, 2021, 5:51pm UTC](https://discourse.julialang.org/t/julia-vim-tutorial-for-newbies/36636/30 "2021-07-21T17:51:58Z")

</div>

You can set

```julia
set tabstop=4
set shiftwidth=4
set expandtab

```

This way your code look exactly as if you use `tab`, but no actual tabs will be inserted.

[Previous page](https://discourse.julialang.org/t/julia-vim-tutorial-for-newbies/36636.md?page=1)
