add remote plugin to nvim
This commit is contained in:
parent
b6eea93564
commit
dd9c225fd9
7 changed files with 74 additions and 7 deletions
|
|
@ -4,6 +4,7 @@
|
|||
"catppuccin": { "branch": "main", "commit": "56a9dfd1e05868cf3189369aad87242941396563" },
|
||||
"comment-box.nvim": { "branch": "main", "commit": "06bb771690bc9df0763d14769b779062d8f12bc5" },
|
||||
"conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" },
|
||||
"flatten.nvim": { "branch": "main", "commit": "72527798e75b5e34757491947c2cb853ce21dc0e" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"fzf-lua": { "branch": "main", "commit": "758173f499d15410ecb50c5519a41b27c33e645d" },
|
||||
"grapple.nvim": { "branch": "main", "commit": "b41ddfc1c39f87f3d1799b99c2f0f1daa524c5f7" },
|
||||
|
|
@ -21,6 +22,7 @@
|
|||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"render-markdown": { "branch": "main", "commit": "4a39681990fb515d00dd898de3d7bf2973805f1a" },
|
||||
"smart-splits.nvim": { "branch": "master", "commit": "5ef94ca23b28148187846fc46f10184aad4d17b0" },
|
||||
"transfer.nvim": { "branch": "main", "commit": "ab12253c09f83a5b0b6ee108fc131be45abe446a" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
|
||||
"ts-node-action": { "branch": "master", "commit": "bfaa787cc85d753af3c19245b4142ed727a534b5" },
|
||||
"vim-dadbod": { "branch": "master", "commit": "e95afed23712f969f83b4857a24cf9d59114c2e6" },
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ return {
|
|||
'neovim/nvim-lspconfig',
|
||||
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
||||
{
|
||||
"mason-org/mason.nvim",
|
||||
opts = { }
|
||||
"mason-org/mason.nvim",
|
||||
opts = {}
|
||||
},
|
||||
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
||||
{
|
||||
|
|
@ -26,4 +26,17 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
-- allow to reuse the same nvim instance when opening files in the same terminal context
|
||||
"willothy/flatten.nvim",
|
||||
opts = {
|
||||
integrations = {
|
||||
kitty = true,
|
||||
wezterm = false,
|
||||
},
|
||||
},
|
||||
-- Ensure that it runs first to minimize delay when opening file from terminal
|
||||
lazy = false,
|
||||
priority = 1001,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
45
Configs/nvim/.config/nvim/lua/aleidk/plugins/remote-dev.lua
Normal file
45
Configs/nvim/.config/nvim/lua/aleidk/plugins/remote-dev.lua
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
return {
|
||||
{
|
||||
"coffebar/transfer.nvim",
|
||||
lazy = true,
|
||||
cmd = { "TransferInit", "DiffRemote", "TransferUpload", "TransferDownload", "TransferDirDiff", "TransferRepeat" },
|
||||
opts = {},
|
||||
keys = {
|
||||
{ "<leader>xx", function() vim.cmd("TransferRepeat") end, desc = "Repeat last transfer" },
|
||||
{ "<leader>xc", function() vim.cmd("TransferInit") end, desc = "Config transfer.nvim" },
|
||||
{ "<leader>xj", function() vim.cmd("TransferDownload") end, desc = "Download current file with transfer.nvim" },
|
||||
{ "<leader>xJ", function() vim.cmd("TransferDownload " .. vim.uv.cwd()) end, desc = "Download root dir with transfer.nvim" },
|
||||
{ "<leader>xk", function() vim.cmd("TransferUpload") end, desc = "Upload current file with transfer.nvim" },
|
||||
{ "<leader>xK", function() vim.cmd("TransferUpload " .. vim.uv.cwd()) end, desc = "Upload root dir with transfer.nvim" },
|
||||
{ "<leader>xd", function() vim.cmd("DiffRemote") end, desc = "Diff current file with transfer.nvim" },
|
||||
{ "<leader>xD", function() vim.cmd("TransferDirDiff " .. vim.uv.cwd()) end, desc = "Diff root dir with transfer.nvim" },
|
||||
},
|
||||
init = function()
|
||||
require("yazi").config.forwarded_dds_events = {
|
||||
"TransferUpload",
|
||||
"TransferDownload",
|
||||
"DiffRemote",
|
||||
"TransferDirDiff",
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "YaziDDSCustom",
|
||||
callback = function(event)
|
||||
-- vim.print(event.data);
|
||||
local data = vim.json.decode(event.data.raw_data)
|
||||
|
||||
if event.data.type == "DiffRemote" or event.data.type == "TransferDirDiff" then
|
||||
local response = vim.system({ "ya", "emit-to", "0", "close" }, { timeout = 1000 }):wait()
|
||||
|
||||
if response.stderr ~= "" then
|
||||
vim.notify(response.stderr, vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
vim.iter(data):each(function(path) vim.cmd(string.format("%s %s", event.data.type, path)) end)
|
||||
end,
|
||||
})
|
||||
end
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue