|
1 | 1 | return { |
2 | | - "amitds1997/remote-nvim.nvim", |
3 | | - version = "*", -- Pin to GitHub releases |
4 | | - dependencies = { |
5 | | - "nvim-lua/plenary.nvim", -- For standard functions |
6 | | - "MunifTanjim/nui.nvim", -- To build the plugin UI |
7 | | - "nvim-telescope/telescope.nvim", -- For picking b/w different remote methods |
8 | | - }, |
| 2 | + -- "amitds1997/remote-nvim.nvim", |
| 3 | + "remote-nvim.nvim", |
| 4 | + dev = true, |
| 5 | + version = "*", -- Pin to GitHub releases |
| 6 | + dependencies = { |
| 7 | + "nvim-lua/plenary.nvim", -- For standard functions |
| 8 | + "MunifTanjim/nui.nvim", -- To build the plugin UI |
| 9 | + "nvim-telescope/telescope.nvim", -- For picking b/w different remote methods |
| 10 | + }, |
9 | 11 | config = function() |
10 | 12 | require("remote-nvim").setup( |
11 | 13 | { |
12 | | - client_callback = function(port, workspace_config) |
13 | | - local cmd = ("wezterm cli set-tab-title --pane-id $(wezterm cli spawn nvim --server localhost:%s --remote-ui) %s"):format( |
14 | | - port, |
15 | | - ("'Remote: %s'"):format(workspace_config.host) |
16 | | - ) |
17 | | - if vim.env.TERM == "xterm-kitty" then |
18 | | - cmd = ("kitty -e nvim --server localhost:%s --remote-ui"):format(port) |
19 | | - end |
20 | | - vim.fn.jobstart(cmd, { |
21 | | - detach = true, |
22 | | - on_exit = function(job_id, exit_code, event_type) |
23 | | - -- This function will be called when the job exits |
24 | | - print("Client", job_id, "exited with code", exit_code, "Event type:", event_type) |
25 | | - end, |
26 | | - }) |
27 | | - end, |
28 | | - |
29 | | - -- Remote configuration |
30 | | - remote = { |
31 | | - -- List of directories that should be copied over |
32 | | - copy_dirs = { |
33 | | - -- What to copy to remote's Neovim data directory |
34 | | - data = { |
35 | | - base = vim.fn.stdpath("data"), |
36 | | - dirs = "*", |
37 | | - compression = { |
38 | | - enabled = true, |
39 | | - }, |
40 | | - }, |
41 | | - -- What to copy to remote's Neovim cache directory |
42 | | - cache = { |
43 | | - base = vim.fn.stdpath("cache"), |
44 | | - dirs = {'codeium'}, |
45 | | - compression = { |
46 | | - enabled = true, |
47 | | - }, |
48 | | - }, |
49 | | - }, |
50 | | - }, |
| 14 | + -- You can supply your own callback that should be called to create the local client. This is the default implementation. |
| 15 | + -- Two arguments are passed to the callback: |
| 16 | + -- port: Local port at which the remote server is available |
| 17 | + -- workspace_config: Workspace configuration for the host. For all the properties available, see https://github.com/amitds1997/remote-nvim.nvim/blob/main/lua/remote-nvim/providers/provider.lua#L4 |
| 18 | + -- A sample implementation using WezTerm tab is at: https://github.com/amitds1997/remote-nvim.nvim/wiki/Configuration-recipes |
| 19 | + client_callback = function(port, workspace_config) |
| 20 | + local cmd = "" |
| 21 | + if vim.env.TERM == "tmux-256color" then |
| 22 | + cmd = ("tmux new-window -n '%s' nvim --server localhost:%s --remote-ui"):format( |
| 23 | + workspace_config.host, |
| 24 | + port |
| 25 | + ) |
| 26 | + elseif vim.env.TERM == 'wezterm' then |
| 27 | + cmd = ("wezterm cli set-tab-title --pane-id $(wezterm cli spawn nvim --server localhost:%s --remote-ui) %s"):format( |
| 28 | + port, |
| 29 | + ("'Remote: %s'"):format(workspace_config.host) |
| 30 | + ) |
| 31 | + elseif vim.env.TERM == "xterm-kitty" then |
| 32 | + cmd = ("kitty -e nvim --server localhost:%s --remote-ui"):format(port) |
| 33 | + end |
| 34 | + vim.fn.jobstart(cmd, { |
| 35 | + detach = true, |
| 36 | + on_exit = function(job_id, exit_code, event_type) |
| 37 | + -- This function will be called when the job exits |
| 38 | + print("Client", job_id, "exited with code", exit_code, "Event type:", event_type) |
| 39 | + end, |
| 40 | + }) |
| 41 | + end, |
51 | 42 |
|
| 43 | + -- Remote configuration |
| 44 | + remote = { |
| 45 | + -- List of directories that should be copied over |
| 46 | + copy_dirs = { |
| 47 | + local_plugins = { |
| 48 | + -- home folder |
| 49 | + base = "/home/arnaud/devel/nvim", |
| 50 | + dirs = "*", |
| 51 | + compression = { |
| 52 | + enabled = true, |
| 53 | + }, |
| 54 | + }, |
52 | 55 |
|
| 56 | + -- What to copy to remote's Neovim data directory |
| 57 | + data = { |
| 58 | + base = vim.fn.stdpath("data"), |
| 59 | + -- dirs = "*", |
| 60 | + dirs = nil, |
| 61 | + compression = { |
| 62 | + enabled = true, |
| 63 | + }, |
| 64 | + }, |
| 65 | + -- What to copy to remote's Neovim cache directory |
| 66 | + cache = { |
| 67 | + base = vim.fn.stdpath("cache"), |
| 68 | + dirs = {'codeium'}, |
| 69 | + compression = { |
| 70 | + enabled = true, |
| 71 | + }, |
| 72 | + }, |
| 73 | + }, |
| 74 | + } |
53 | 75 | } |
54 | 76 | ) |
55 | 77 | end, |
|
0 commit comments