add remote plugin to nvim

This commit is contained in:
Alexander Navarro 2025-07-22 14:33:01 -04:00
parent b6eea93564
commit dd9c225fd9
7 changed files with 74 additions and 7 deletions

View file

@ -1,3 +1,5 @@
. ~/.cargo/env.fish
if status is-interactive
# Commands to run in interactive sessions can go here
zoxide init --cmd cd fish | source

View file

@ -2002,7 +2002,7 @@ map ctrl+space>ctrl+v launch --location=split
#:: For more details, see launch
#:: <https://sw.kovidgoyal.net/kitty/launch/>.
map ctrl+space>g launch --cwd=current --type=overlay lazygit
map ctrl+space>g launch --cwd=current --type=overlay --var lazy_float=true lazygit
#: New OS window

View file

@ -262,10 +262,10 @@ quitOnTopLevelReturn: true
# Config relating to things outside of Lazygit like how files are opened, copying to clipboard, etc
os:
# Command for editing a file. Should contain "{{filename}}".
edit: ""
edit: "nvim -- {{filename}} && kitten @ close-window -m var:lazy_float=true --ignore-no-match"
# Command for editing a file at a given line number. Should contain
# "{{filename}}", and may optionally contain "{{line}}".
editAtLine: ""
editAtLine: "nvim +{{line}} -- {{filename}} && kitten @ close-window -m var:lazy_float=true --ignore-no-match"
# Same as EditAtLine, except that the command needs to wait until the
# window is closed.
editAtLineAndWait: ""
@ -273,7 +273,7 @@ os:
openDirInEditor: ""
# A built-in preset that sets all of the above settings. Supported presets
# are defined in the getPreset function in editor_presets.go.
editPreset: "nvim-remote"
editPreset: "nvim"
# Command for opening a file, as if the file is double-clicked. Should
# contain "{{filename}}", but doesn't support "{{line}}".
open: "xdg-open {{filename}} >/dev/null"
@ -308,7 +308,7 @@ disableStartupPopups: false
# - 'quit': exit Lazygit
notARepository: quit
# If true, display a confirmation when subprocess terminates. This allows you to view the output of the subprocess before returning to Lazygit.
promptToReturnFromSubprocess: true
promptToReturnFromSubprocess: false
# Keybindings
keybinding:
universal:

View file

@ -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" },

View file

@ -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,
},
}

View 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
},
}

View file

@ -39,6 +39,11 @@ prepend_keymap = [
{ on = ["g", "t"], run = "cd /tmp", desc = "Go to the temporary directory" },
{ on = ["g", "r"], run = "shell 'ya emit cd \"$(git rev-parse --show-toplevel)\"'", desc = "Go to git root" },
{ on = ["g", "<Space>"], run = "cd --interactive", desc = "Go to a directory interactively" },
{ on = ["<C-x>", "j"], run = "shell 'ya pub-to 0 TransferDownload --list \"$@\"'", desc = "Download with transfer.nvim" },
{ on = ["<C-x>", "k"], run = "shell 'ya pub-to 0 TransferUpload --list \"$@\"'", desc = "Upload with transfer.nvim" },
{ on = ["<C-x>", "d"], run = ["shell 'ya pub-to 0 DiffRemote --orphan --list \"$@\"'", "quit"], desc = "Diff with transfer.nvim" },
{ on = ["<C-x>", "<S-D>"], run = ["shell 'ya pub-to 0 TransferDirDiff --list \"$@\"'"], desc = "Diff directory with transfer.nvim" },
]
[input]