# Development Workflow for Persistent Julia Sessions

**URL:** <https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081>\
**Category:** Tooling\
**Tags:** first-steps, workflow, vim\
**Created:** [October 26, 2020, 10:20pm UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081 "2020-10-26T22:20:24Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Post date:** [October 26, 2020, 10:20pm UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/1 "2020-10-26T22:20:25Z")

</div>

## UPDATE: NEW BLOG POST AND VIDEO!

By popular demand, I have written up a more formal blog post on this workflow which you can visit [here](http://jacobzelko.com/workflow/). Furthermore, I also created a companion video which you can see in the blog post or separately on [my channel here](https://youtu.be/2SLZQQfMF8E). Have fun and I hope this spurs you all on to even better workflows! 🌳

> NOTE: For future readers, I shall endeavor to keep this link up to date on my website and to not change the url so you will always have a reference to my most recent workflow iteration.

## Background on This Workflow 👋

I am @TheCedarPrince and am involved with the Julia community as a [Twitch Streamer](https://twitch.tv/thecedarprince) and am co-creator of [Javis.jl](https://github.com/Wikunia/Javis.jl) and the creator of [NeuriViz](https://github.com/TheCedarPrince/NeuriViz). I have had several people over the last couple months both in my streams and in the community ask me about my toolchain for development. Without further ado, here is a brief explanation of my workflow to manage persistent Julia sessions! There should be something in here for everyone - beginner to expert alike!

## Tools of Choice 🔧

I use [Alacritty](https://github.com/alacritty/alacritty) as my terminal, [zsh](https://www.zsh.org/) and [oh-my-zsh](https://ohmyz.sh/) as my shell and plugin manager respectively, [tmux](https://github.com/tmux/tmux) as my multiplexer, [lsd](https://github.com/Peltoche/lsd) as my list command with fun icons, [Fantasque Sans Mono](https://github.com/belluzj/fantasque-sans) as my typeface font, [vim](https://github.com/vim/vim) for my editor, and [gruvbox-dark](https://github.com/morhetz/gruvbox-contrib) as my general color palette.

Here are gists to the relevant config files I use to modify my interface and user experience:

- Vim: [.vimrc](https://gist.github.com/TheCedarPrince/7b9b51af4c146880f17c39407815b594)
- Alacritty: [.alacritty.yml](https://gist.github.com/TheCedarPrince/7743091bd8743a7568b718f30bf707c2)
- tmux: [.tmux.conf](https://gist.github.com/TheCedarPrince/07f6f8f79b1451ec436ff8dee236ccdd)
- zsh: [.zshrc](https://gist.github.com/TheCedarPrince/77afe2674803d965a0f5abd108337040)

Here is a picture of what that looks like altogether:

 ![terminal_shenanigans](https://global.discourse-cdn.com/julialang/original/3X/5/d/5def5b2a5d6138ec2682b1880ab456122fe9d0af.png)

## Workflow in Action 🎬

### Persistent Julia Sessions :julia:

 ![tmux_restore](https://global.discourse-cdn.com/julialang/original/3X/a/e/aefb049b181cce644dc714b00663cb7e91e270fc.gif)

Though it is a little hard to see, I close my terminal completely. The sessions are gone for everything! Oh no! But have no fear, tmux is here!

I use `resurrect` and `continuum` to have tmux remember all my layouts and current sessions. This includes the Julia REPL! Also, my config allows vim to remember what was its last layout as well and to instantly open you back to its properly layout out thanks to `obsession`. This is great for when your computer unexpectedly dies or crashes as everything is backed up thanks to tmux!

### Vim-Slime for Rapid Julia Evaluation 💯

 ![vim_slime](https://global.discourse-cdn.com/julialang/original/3X/b/0/b0051005ed8b4a292421c77aa4e49f272a9b0450.gif)

Here, I target the Julia REPL in a tmux panel and use the `vim-slime` plugin to send code from my Julia script to the Julia REPL for rapid evaluation. Also works for code chunks such as functions or loops! (Note: this works for more than just Julia - I use it for my Python work too! 🐍)

### Mouse Mode 🐁

 ![mouse_mode](https://global.discourse-cdn.com/julialang/original/3X/b/3/b3f2715c9b8d270342a3dfcf6fcc3f4da043fe97.gif)

tmux also supports mouse mode and interactivity! I can quickly jump all over the place with my mouse if I so choose or just easily resize a tmux pane. 🙂

### Fuzzy Finding for Files and Citation 🔎

 ![vim_fzf](https://global.discourse-cdn.com/julialang/original/3X/3/6/36912c882b05ffff005c00c5f5b90487e35b743a.gif)

I use my vim editor for all my writing and research so being able to search up files and explore things is imperative! I use `FZF` with `ripgrep` to find files I search for and `pandoc` to enable citations in pandoc-markdown or TeX files.

## Conclusion 📚

I hope you find my workflow useful and possibly helpful to any new Julian or individual finding their way around the REPL and terminal! If you have any questions, feel free to post and I will try to get back to you!

~ TCP

---

<div class="post-metadata">

**Author:** ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Post date:** [October 26, 2020, 10:24pm UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/2 "2020-10-26T22:24:28Z")

</div>

Mouse Mode would have saved me a ton of trouble back when I used to use a setup like this. Nice documentation of a tmux workflow.

---

<div class="post-metadata">

**Author:** ![kdheepak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kdheepak/32/10881_2.png) [@kdheepak](https://discourse.julialang.org/u/kdheepak)\
**Post date:** [October 26, 2020, 10:39pm UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/3 "2020-10-26T22:39:34Z")

</div>

Nice write up! `tmux` has floating window support too [1], so you can get that fzf preview functionality in tmux too 🙂

[1] [https://github.com/tmux/tmux/issues/1842](https://github.com/tmux/tmux/issues/1842)

---

<div class="post-metadata">

**Author:** ![miguelraz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miguelraz/32/631_2.png) [@miguelraz](https://discourse.julialang.org/u/miguelraz)\
**Post date:** [October 27, 2020, 3:32am UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/4 "2020-10-27T03:32:07Z")

</div>

This is an awesome use of the #workflow tag - I hope more people start submitting their setups!

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [October 27, 2020, 8:55pm UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/5 "2020-10-27T20:55:53Z")

</div>

how to make tmux remember to re-open Julia REPL after reboot? I can see the history of Julia in the restored panel but it doesn’t really re-start automatically.

---

<div class="post-metadata">

**Author:** ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Post date:** [October 27, 2020, 11:11pm UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/6 "2020-10-27T23:11:21Z")

</div>

Hey @jling, I haven’t had a chance to test it out just yet, but if you add

`set -g @resurrect-process '~julia'`

to your `.tmux.conf`, I think it should work. I didn’t realize that `resurrect` wouldn’t bring it back without being told explicitly to bring back the process. Also, if that doesn’t work, maybe check out this: [https://github.com/tmux-plugins/tmux-resurrect/issues/224](https://github.com/tmux-plugins/tmux-resurrect/issues/224)

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [October 27, 2020, 11:33pm UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/7 "2020-10-27T23:33:18Z")

</div>

not working for some reason, I suspect maybe has something to do with escape sequence, because every time it restores with a lot of lines above the last save position. And vim would glitch out (double status bar etc.), not drawing correctly

---

<div class="post-metadata">

**Author:** ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Post date:** [October 27, 2020, 11:37pm UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/8 "2020-10-27T23:37:25Z")

</div>

Hunh. If you have the ability, could you open this issue over at [https://github.com/tmux-plugins/tmux-resurrect/issues/](https://github.com/tmux-plugins/tmux-resurrect/issues/) ? I have not encountered issues in these areas before. Could you please tag me on GH (same tag: @thecedarprince)? Thanks!

---

<div class="post-metadata">

**Author:** ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Post date:** [October 29, 2020, 1:31am UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/9 "2020-10-29T01:31:50Z")

</div>

Hey @kdheepak - didn’t know that! That is wicked! Just curious tho - what would be the use case for this feature? I have difficulty seeing what utility it offers that I could incorporate into my workflow/toolchain. Thanks!

---

<div class="post-metadata">

**Author:** ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Post date:** [October 29, 2020, 2:09am UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/10 "2020-10-29T02:09:39Z")

</div>

Opened an issue on this here: [https://github.com/tmux-plugins/tmux-resurrect/issues/366](https://github.com/tmux-plugins/tmux-resurrect/issues/366)

Hopefully we get some answers soon! 🤞

---

<div class="post-metadata">

**Author:** ![kdheepak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kdheepak/32/10881_2.png) [@kdheepak](https://discourse.julialang.org/u/kdheepak)\
**Post date:** [October 29, 2020, 4:47am UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/11 "2020-10-29T04:47:24Z")

</div>

I tend to use floating windows / pop ups for temporary information. Checking `git status` is probably my most common use case. I use [`lazygit`](https://github.com/jesseduffield/lazygit) for git operations from inside nvim (using [`lazygit.nvim`](https://github.com/kdheepak/lazygit.nvim)). I have a shortcut in nvim to open a floating terminal window that I do a lot of stuff in. I think you’ll find more similar use cases when you continue experiment with it 🙂

---

<div class="post-metadata">

**Author:** ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Post date:** [October 29, 2020, 3:39pm UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/12 "2020-10-29T15:39:41Z")

</div>

Do you have a stream / video of doing all of this stuff? Hard to tell exactly what’s going on, but looks nice!

---

<div class="post-metadata">

**Author:** ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Post date:** [October 29, 2020, 4:28pm UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/13 "2020-10-29T16:28:54Z")

</div>

Great idea. I’ll make a video demonstrating everything mentioned here. I am formalizing this post into an actual blog post on my website. I will include a video of my workflow in it as well. 😄

---

<div class="post-metadata">

**Author:** ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Post date:** [October 30, 2020, 3:45am UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/14 "2020-10-30T03:45:57Z")

</div>

@kevbonham, @Olivier_Merchiers, and @cuihantao - blog post and video made! Please check out my initial post for the update and links to relevant post and video! Hope this helps. Feel free to comment on my blog post or here if you have any questions.

---

<div class="post-metadata">

**Author:** ![Olivier\_Merchiers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olivier_merchiers/32/4073_2.png) [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Post date:** [October 30, 2020, 10:14am UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/15 "2020-10-30T10:14:29Z")

</div>

This is a goldmine!  
I will give it a try.  
Thanks again!

---

<div class="post-metadata">

**Author:** ![TheCedarPrince](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thecedarprince/32/17323_2.png) [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Post date:** [November 2, 2020, 12:59am UTC](https://discourse.julialang.org/t/development-workflow-for-persistent-julia-sessions/49081/16 "2020-11-02T00:59:54Z")

</div>

Thanks to @jling, the `tmux-resurrect` dilemma has been solved! Please refer to [https://github.com/tmux-plugins/tmux-resurrect/issues/366](https://github.com/tmux-plugins/tmux-resurrect/issues/366) for more in-depth answers, but my tmux config will be updated to reflect this solution going forward.
