Skip to content

Lightweight, language-aware REPL integration for Neovim to work with Julia, Python and Matlab.

License

Notifications You must be signed in to change notification settings

urtzienriquez/replent.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

replent.nvim

Lightweight, language-aware REPL integration for Neovim, built on vim-slime.

Contributions are very welcomed! See Contributing


Features

  • Meant to work with Julia, Python and Matlab.
  • Smart block detection for Python and Julia – sends the whole function, class, or loop the cursor lives in, not just one line
  • Julia channel picker via juliaup (uses fzf-lua when available)
  • Working-directory sync between Neovim and the REPL
  • Buffer-local keymaps that activate only for configured filetypes and never override your existing maps
  • Zero-config – works out of the box; setup() is entirely optional

The plugin/ entrypoint does nothing on startup beyond registering a FileType autocommand. Every module is required lazily inside that callback, so the plugin has zero startup cost for unrelated filetypes.


Requirements

Requirement Notes
Neovim ≥ 0.10
vim-slime Must be listed as a dependency
tmux Only supported transport
juliaup Optional – for Julia channel picker
fzf-lua Optional – for Julia channel picker UI

Installation

lazy.nvim (recommended)

{
  "urtzienriquez/replent.nvim",
  ft = { "python", "julia", "matlab" },   -- lazy-load on these filetypes
  dependencies = { "jpalardy/vim-slime" },
  -- opts = {}  ← entirely optional, see Configuration below
}

No setup() call is needed. Drop the spec in, open a Python or Julia file, and the keymaps are there.

Customising

Pass an opts table (lazy.nvim calls setup() for you):

{
  "urtzienriquez/replent.nvim",
  ft = { "python", "julia", "matlab" },
  dependencies = { "jpalardy/vim-slime" },
  opts = {
    filetypes = { "python", "julia" },   -- remove matlab

    keymaps = {
      start_python = "<leader>rp",       -- remap
      debug_block  = false,              -- disable
    },

    repl_commands = {
      python = "ipython",                -- change launch command
    },
  },
}

Or without lazy.nvim:

require("replent").setup({
  keymaps = { send_buffer = false },
})

Default Keymaps

All keymaps are buffer-local and only appear for configured filetypes. A mapping is silently skipped when you already have a buffer-local map on that key.

Config key Default Mode Action
send_line <CR> n Send block / line at cursor
send_selection <CR> v Send visual selection
send_buffer <leader>sb n Send entire buffer
start_python <leader>op n Open Python REPL
start_julia <leader>oj n Open Julia REPL (channel picker)
start_matlab <leader>om n Open MATLAB REPL
close_python <leader>qp n Close Python REPL
close_julia <leader>qj n Close Julia REPL
close_matlab <leader>qm n Close MATLAB REPL
sync_cwd <leader>cd n Sync Neovim cwd → REPL
julia_instantiate <leader>ji n Pkg.activate + Pkg.instantiate
debug_block <leader>bc n Debug block detection

Public API

local replent = require("replent")

replent.setup(opts)          -- optional configuration
replent.send_block()         -- send block/line at cursor
replent.send_selection()     -- send visual selection
replent.send_buffer()        -- send entire buffer
replent.start_repl("python") -- open a REPL
replent.close_repl("julia")  -- close a REPL
replent.sync_cwd()           -- sync working directory
replent.has_active_repl()    -- → boolean

Contributing

Contributions are very welcome — bug reports, suggestions, and especially code. If you use a language or workflow that replent doesn't handle well, opening an issue or a pull request is the best way to improve it. Adding smart block detection for a new language (see lua/replent/julia.lua or lua/replent/python.lua for the pattern) or support for a new REPL transport are particularly impactful contributions.


Similar projects

  • R.nvim — the biggest inspiration for replent, and the best example of language-specific REPL integration in Neovim. If you work with R, use this — it offers a dedicated R communication layer, live autocompletion from your R environment, an object browser, inline help, and deep Quarto/RMarkdown support, among others.

  • matlab.nvim — another big inspiration for this plugin. It is simple, yet very powerful to develop and work with the matlab programming language in neovim. It uses tmux to communicate neovim with matlab.

  • vim-slime — the transport layer replent is built on. If you don't need smart block detection or language-specific features, vim-slime alone may be all you need.

  • iron.nvim — a full-featured REPL manager for Neovim. Supports many languages and transports, manages multiple REPLs simultaneously, and has its own send-motion system. More batteries included than replent, but also more configuration.

  • molten-nvim — Jupyter kernel integration for Neovim. The right choice if you want inline output rendered directly in the buffer rather than a terminal pane.

  • yarepl.nvim — another lightweight REPL plugin with multi-REPL support, parallel sessions, buffer attachments, and a flexible layout system. Worth a look if you need to run several REPLs side by side or want AI CLI (Aider, Codex) integration.


License

GNU General Public License v3.0 — see LICENSE.

About

Lightweight, language-aware REPL integration for Neovim to work with Julia, Python and Matlab.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages