A comprehensive Neovim plugin for Julia development with an integrated REPL, workspace panel, and unified workflow mode for fast and efficient coding.
More info: Reddit Discussion
later in text you may seen instructions of building native module written in zig and cpp forget about it its in my experimental branch
How to install in julia
julia .
]
# pkg>
add https://github.com/kitajusSus/jEMach
# or
using Pkg
Pkg.add(url="https://github.com/kitajusSus/jEMach")
A standalone terminal UI for monitoring your Julia REPL session from a side tmux pane — no Neovim required, no external Julia packages needed.
If you are already in the terminal where you want to run the workspace:
- Split the window and run the TUI with a single command:
# If running from the cloned repository: tmux split-window -h -l 60 "./scripts/jl-assist" # Or if installed via Neovim package manager: tmux split-window -h -l 60 "~/.local/share/nvim/site/pack/core/opt/jemach/scripts/jl-assist"
- Start Julia in the left (original) pane:
julia -t auto --project=.
- Load the watcher in the Julia REPL:
# Load as a package (when running julia --project=.) using jEMach # Or fallback via include: include("scripts/jl_watcher.jl") # Or if installed via Neovim (Note: Julia's include() doesn't expand '~', so use homedir()): include(joinpath(homedir(), ".local/share/nvim/site/pack/core/opt/jemach/scripts/jl_watcher.jl"))
- Start Julia in your tmux pane:
julia -t auto --project=.
- Load the background watcher in the Julia REPL:
# Load as a package (when running julia --project=.) using jEMach # Or fallback via include: include("scripts/jl_watcher.jl")
- Split your tmux window vertically (e.g. press your tmux prefix, usually
Ctrl+b, then%) and launch the TUI in the new pane:# From repository: ./scripts/jl-assist # Or if installed via Neovim: ~/.local/share/nvim/site/pack/core/opt/jemach/scripts/jl-assist
The TUI opens in a new split to the right. It polls the state file every 1.5 s; the Julia watcher writes the file every 2 s — so changes appear within ~3.5 s.
| Key | Action |
|---|---|
j / k |
Move cursor down / up |
l / ↵ |
Expand module or send println(var) to REPL |
h |
Collapse module node |
d |
Hide selected item from view |
D |
Restore all hidden items |
r |
Force state refresh |
q |
Quit |
▼ Main
x Int64 42
greeting String "hello"
myfunc Function
▶ Revise [collapsed — press l to expand]
▼ MyPackage
my_var Float64 2.718
jl-assist [-p PANE_ID] [-w WIDTH] [-f]
-p PANE_ID tmux pane that runs the Julia REPL (auto-detected by default)
-w WIDTH width of the TUI pane in columns (default: 60)
-f force a new TUI pane even if one is already open
- luajit —
sudo pacman -S luajit(Arch Linux) - tmux — running in a tmux session
- Dual REPL Backends: Support for both toggleterm.nvim and vim-slime (tmux/screen)
- Smart Code Sending: Send current line, visual selection, or automatically detected code blocks using Tree-sitter
- Workspace Panel: Real-time view of variables, their types, and values updated asynchronously via JSON RPC (no text wrapping)
- Command History: Track and replay REPL commands using Telescope
- Workspace Persistence: Save and restore session state across restarts
- Project Awareness: Automatic project activation based on Project.toml files
- Revise.jl Support: Optional automatic loading of Revise for interactive development
- LSP Integration: Full Language Server Protocol support for IDE features (optional)
- Advanced tmux Integration: Intelligent panel management for tmux users
The plugin supports multiple layout configurations:
- Vertical Split Mode (default): Terminal on right, workspace underneath
- Unified Buffer Mode: REPL and workspace in same vertical split
- Classic Mode: Workspace on right, REPL at bottom (toggleterm)
Easy navigation between all three components with configurable keybindings!
Using lazy.nvim
{
"kitajusSus/jemach",
dependencies = {
"akinsho/toggleterm.nvim", -- Optional, only if using toggleterm mode
"nvim-telescope/telescope.nvim", -- Optional, for command history
"neovim/nvim-lspconfig", -- Optional, for LSP features
},
config = function()
require("jemach").setup({
-- REPL backend settings
backend = "auto", -- "toggleterm", "vim-slime", or "auto"
terminal_direction = "horizontal", -- "horizontal", "vertical", or "float"
terminal_size = 15,
-- Optional configuration
activate_project_on_start = true,
auto_update_workspace = true,
workspace_width = 50,
use_revise = true,
auto_save_workspace = false,
save_on_exit = true,
-- Keybindings (defaults shown)
keybindings = {
toggle_repl = "<C-\\>", -- Toggle REPL visibility
focus_repl = "<A-1>", -- Focus REPL window
focus_workspace = "<A-2>", -- Focus workspace panel
focus_code = "<A-3>", -- Focus code editor
cycle_focus = "<A-Tab>", -- Cycle between components
workflow_mode = "<leader>jw", -- Toggle workflow mode
},
})
end,
}Using packer.nvim
use {
"kitajusSus/jemach",
requires = {
"akinsho/toggleterm.nvim",
"nvim-telescope/telescope.nvim",
"neovim/nvim-lspconfig",
},
config = function()
require("jemach").setup()
end,
}:JuliaToggleREPL(:Jr) - Toggle Julia REPL terminal:JuliaSendToREPL(:Js) - Send current line/selection/block to REPL:JuliaToggleWorkspace(:Jw) - Toggle workspace panel:JuliaHistory(:Jh) - Show command history (requires Telescope)
:JuliaWorkflowMode(:Jfw) - Toggle unified workflow mode:JuliaFocusREPL- Focus REPL window:JuliaFocusWorkspace- Focus workspace panel:JuliaFocusCode- Focus code editor:JuliaCycleFocus- Cycle focus between components
:JuliaSetTerminal [float|horizontal|vertical]- Set terminal layout:JuliaCycleTerminal- Cycle through terminal layouts
:JuliaSaveWorkspace- Save workspace variables:JuliaRestoreWorkspace- Restore workspace from saved state:JuliaClearSavedWorkspace- Clear saved workspace data
:JuliaLspEnable/:JuliaLspDisable- Toggle LSP:JuliaGotoDefinition- Go to symbol definition:JuliaFindReferences- Find symbol references:JuliaRename- Rename symbol:JuliaCodeAction- Show code actions
When configured with default settings:
| Mode | Key | Action |
|---|---|---|
| Normal | <C-\> |
Toggle REPL visibility |
| Terminal | <C-\> |
Toggle REPL visibility |
| Normal | <A-1> |
Focus REPL window |
| Normal | <A-2> |
Focus workspace panel |
| Normal | <A-3> |
Focus code editor |
| Normal/Terminal | <A-Tab> |
Cycle focus between components |
| Normal | <leader>jw |
Toggle workflow mode |
When the workspace panel is focused:
| Key | Action |
|---|---|
<CR> |
Print variable value in REPL |
i |
Inspect variable (show type and size) |
d |
Delete variable (after confirmation) |
r |
Refresh workspace |
q |
Close workspace panel |
-
Open a Julia file
-
Press
<leader>jwto activate workflow mode -
Everything is automatically set up:
- Workspace panel on the right
- REPL at the bottom
- Your code in the main window
-
Navigate quickly:
<A-1>to jump to REPL<A-2>to check workspace<A-3>to return to code<A-Tab>to cycle through all
-- In normal mode, cursor on line:
:Js -- Sends current line
-- Visual selection:
-- Select code, then:
:Js -- Sends selection
-- Smart block detection (when enabled):
-- Cursor inside a function, struct, loop, etc.
:Js -- Automatically detects and sends the entire block- Send code to REPL:
:Js - Open workspace:
:Jw - The workspace panel automatically updates when you create or modify variables in the REPL
- Navigate variables:
<CR>on a variable to print its valueito inspect its type and sizedto delete itrto manually refresh the workspace
Note: The workspace panel automatically detects changes when you type commands directly in the Julia REPL (when auto_update_workspace = true). It securely communicates asynchronously with Julia using libuv local sockets without blocking your terminal.
require("jemach").setup({
-- REPL Backend Settings
backend = "auto", -- "toggleterm", "vim-slime", or "auto"
terminal_direction = "horizontal", -- "horizontal", "vertical", or "float"
terminal_size = 15, -- Size for terminal splits
-- Project Management
activate_project_on_start = true, -- Auto-activate Julia project
use_revise = true, -- Auto-load Revise.jl
-- Workspace Panel
auto_update_workspace = true, -- Auto-refresh after code execution
workspace_width = 50, -- Workspace panel width
workspace_update_debounce = 300, -- Debounce time in milliseconds
use_cache = true, -- Enable workspace caching
cache_ttl = 5000, -- Cache time-to-live in milliseconds
-- Workspace Persistence
auto_save_workspace = true, -- Auto-save workspace on changes
save_on_exit = true, -- Save workspace on Neovim exit
-- Code Execution
smart_block_detection = true, -- Auto-detect code blocks
max_history_size = 500, -- Max commands in history
-- LSP Integration
lsp = {
enabled = true, -- Enable LSP features
auto_start = true, -- Auto-start language server
detect_imports = true, -- Detect and manage imports
},
-- Keybindings
keybindings = {
toggle_repl = "<C-\\>",
focus_repl = "<A-1>",
focus_workspace = "<A-2>",
focus_code = "<A-3>",
cycle_focus = "<A-Tab>",
workflow_mode = "<leader>jw",
},
})require("jemach").setup({
backend = "toggleterm", -- or "auto"
})vim.g.slime_target = "tmux"
vim.g.slime_default_config = {
socket_name = "default",
target_pane = "{right-of}",
}
require("jemach").setup({
backend = "vim-slime",
})- Pros: Easy setup, automatic REPL management, integrated terminal
- Cons: Moderate flexibility, tied to Neovim
- Best for: Quick setup, single-window workflows
- Pros: Excellent performance, high flexibility, persistent REPL
- Cons: Requires tmux/screen, manual configuration
- Best for: tmux users, complex workflows, remote development
- Terminal on the right side
- Workspace panel underneath terminal
- Easy access with keyboard shortcuts
- REPL and workspace in same vertical split
- Compact layout for smaller screens
- Efficient screen usage
- Workspace panel on right
- REPL terminal at bottom
- Compatible with toggleterm.nvim features
The plugin can automatically detect and send entire code blocks using Neovim's Tree-sitter integration:
- Functions (
function ... end) - Macros (
macro ... end) - Modules (
module ... end) - Structs (
struct ... end,mutable struct ... end) - Blocks (
begin ... end,quote ... end,let ... end) - Control flow (
for ... end,while ... end,if ... end,try ... end)
When your cursor is inside any of these blocks (even deeply nested), :Js will send the outermost top-level block.
- Neovim >= 0.8.0
- Julia >= 1.6
- Optional:
- nvim-treesitter (for Smart Block Detection)
- toggleterm.nvim (for toggleterm backend)
- vim-slime (for slime backend)
- telescope.nvim (for command history)
- neovim/nvim-lspconfig (for LSP features)
- Fast Switching: Use
<A-Tab>to quickly cycle between REPL, workspace, and code - Terminal Mode: In terminal mode, use
<C-\>to hide REPL without switching focus - Project Root: Place a
Project.tomlfile in your project root for automatic activation - Revise Workflow: Enable
use_revisefor hot-reloading during development - Custom Layouts: Experiment with
terminal_directionto find your preferred layout - Persistent Sessions: Use workspace persistence to save your work across sessions
- Check that Julia is in your PATH:
julia --version - Ensure toggleterm.nvim is installed (for toggleterm backend)
- For vim-slime: ensure tmux/screen is running
- Start the REPL first (
:Jr) - Execute some code to create variables (
:Js) - Manually refresh (press
rin workspace panel)
- Make sure you called
setup()in your config - Check for conflicts with other plugins
- Customize keybindings in the setup options
- My Dad and My Mum
- My future wife
- Built with toggleterm.nvim
- Uses vim-slime for tmux integration
README is 99% created by vibes
