A wrapper around distant that
enables users to edit remote files from the comfort of their local environment.
- Requires neovim 0.7+
- Requires distant 0.20.0-alpha.4
π§ (Alpha stage software) This plugin is in rapid development and may break or change frequently! π§
Supports the following features against remote machines:
- Retrieving a list of available files & directories
- Editing remote files
- Creating and deleting files & directories
- Copying files & directories
- Renaming files & directories
- Running LSPs remotely and getting live results locally
- telescope.nvim integration via
:Telescope distant search
It is highly recommended to not use the master branch of this plugin. Instead, prefer either a branch (
v0.1orv0.2) or a specific tag (v0.1.1) to lock in the plugin. When using a branch, you will get rolling updates to that branch. When using a tag, you are locked into the features and stability of the plugin at that point!
Using packer.nvim, the quickest way to get up and running is the following:
use {
'chipsenkbeil/distant.nvim',
branch = 'v0.2',
config = function()
require('distant').setup {
-- Applies Chip's personal settings to every machine you connect to
--
-- 1. Ensures that distant servers terminate with no connections
-- 2. Provides navigation bindings for remote directories
-- 3. Provides keybinding to jump into a remote file's parent directory
['*'] = require('distant.settings').chip_default()
}
end
}The above will initialize the plugin with the following:
- Any spawned distant server will shutdown after 60 seconds of inactivity
- Standard keybindings are assigned for remote buffers (described below)
| Key | Action |
|---|---|
- |
lua distant.nav.actions.up() |
| Key | Action |
|---|---|
<Return> |
lua distant.nav.actions.edit() |
- |
lua distant.nav.actions.up() |
K |
lua distant.nav.actions.mkdir() |
N |
lua distant.nav.actions.newfile() |
R |
lua distant.nav.actions.rename() |
D |
lua distant.nav.actions.remove() |
Run :DistantInstall to complete the setup.
- For more information on installation, check out
:help distant-installation - For more information on settings, check out
:help distant-settings
In order to operate against a remote machine, we first need to establish
a connection to it. To do this, we run :DistantLaunch {host} where the host
points to the remote machine and can be an IP address like 127.0.0.1 or
a domain like example.com.
The launch command will attempt to SSH into the remote machine using port 22
by default and start an instance of distant.
Once started, all remote operations will be sent to that machine! You can try
out something simple like displaying a list of files, directories, and symlinks
by running :DistantOpen /some/dir, which will open a dialog that displays
all of the contents of the specified directory.
For more details on available functions, settings, commands, and more,
please check out the vim help documentation via
:help distant.txt.
Demonstrates using distant.nvim to edit files and use a language server on a remote machine.
Demonstrates the new release of distant.nvim (v0.1.0) leveraging distant's new lua module (v0.15.0). Main highlights include:
- integrated ssh authentication
- ssh mode
- refactored and simplified vim & Lua APIs
- complete help documentation
This project is licensed under either of
Apache License, Version 2.0, (LICENSE-APACHE or apache-license) MIT license (LICENSE-MIT or mit-license) at your option.