Mark files in netrw and upload them with rsync over SSH. Pure Lua. Minimal UI. No netrw internals poked.
mmtoggle mark on the current netrw entry (shows a green dot at EOL usingDiagnosticOkor falls back onDiffAdded)mu/:RsyncUploaduploads all marked files withrsyncmU/:RsyncUploadRemoveuploads all marked files withrsync --remove-source-files- Preserves directory structure on the destination (e.g.
Fish Pictures→/backup/Fish Pictures) - After transfer, any marked directories that become empty will be automatically removed locally
- Preserves directory structure on the destination (e.g.
mC/:RsyncClearMarksclears all marks:RsyncSetDestination user@host:/pathsets the remote destination for this session- Floating terminal shows
rsyncprogress and completion notifications
- Neovim 0.8+
rsyncandsshmust be installed and available in yourPATH
{
"rbledsaw3/rsync-netrw.nvim",
ft = "netrw",
opts = {
dest = "destination_user@destination_ip:/path/to/destination", -- placeholder
rsync_flags = { "-avhP", "--progress" },
-- ssh = { "-i", "~/.ssh/id_ed25519" }, -- set only if you need custom ssh args; otherwise rsync uses ssh by default
use_relative = false,
extra = {},
keymaps = true,
},
keys = {
{ "mm", function() require("rsync_netrw").toggle_mark() end, ft = "netrw", desc = "Rsync: toggle mark" },
{ "mC", function() require("rsync_netrw").clear_marks() end, ft = "netrw", desc = "Rsync: clear marks" },
{ "mu", function() require("rsync_netrw").upload_marked() end, ft = "netrw", desc = "Rsync: upload marked" },
{ "mU", function() require("rsync_netrw").upload_marked_remove() end, ft = "netrw", desc = "Rsync: Upload and remove source files" },
},
}If you use LazyVim, drop that spec in ~/.config/nvim/lua/plugins/rsync_netrw.lua.
:Exto open netrw.mmto mark entries.:RsyncSetDestination user@host:/pathonce per session.mu(or:RsyncUpload) to send the marked files.mU(or:RsyncUploadRemove) to send the marked files and delete from source afterwards.- Delete source files after successful upload
- Remove any empty marked directories
If the destination is still the placeholder, the plugin will error and prompt you to run :RsyncSetDestination.
dest- remote target, e.g.user@host:/srv/backup(required; can be set at runtime)rsync_flags- defaults{ "-avhP", "--progress" }ssh- optional list of extra ssh args; if set, we pass-e 'ssh ...'use_relative- iftrue, adds--relativeto preserve path portionsextra- additional rsync args, e.g.{ "--delete-after" }keymaps- install the default netrw keymaps (mm/mC/mu/mU)
MIT