-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to remain the system clipboard content when exit yazi.nvim? #658
Comments
I noticed I got the same behaviour in the reproduction environment. no-register.movHowever, if I add this setting clipboard.mov |
This is a really good point - thanks for reporting. I was not aware that my neovim distro (lazyvim) sets this on by default (here) I'll add something that makes this more obvious, maybe a notice in the |
@mikavilpas Thanks for the response! However actually I already have EDIT: Is it possible I added it in an inappropriate position? where did you put the |
I put it here 😄 Details
-- You can use this file to reproduce an issue with your configuration.
---@module "yazi"
---@module "lazy"
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
vim.g.mapleader = " "
vim.opt.clipboard = "unnamedplus" -- 👈🏻
-- install the following plugins
---@type LazySpec
local plugins = {
{ "catppuccin/nvim", name = "catppuccin", opts = { flavour = "macchiato" } },
{
"mikavilpas/yazi.nvim",
event = "VeryLazy",
keys = {
{
"<leader>-",
"<cmd>Yazi<cr>",
desc = "Open yazi at the current file",
},
{
-- Open in the current working directory
"<leader>cw",
"<cmd>Yazi cwd<cr>",
desc = "Open the file manager in nvim's working directory",
},
{
-- NOTE: this requires a version of yazi that includes
-- https://github.com/sxyazi/yazi/pull/1305 from 2024-07-18
"<c-up>",
"<cmd>Yazi toggle<cr>",
desc = "Resume the last yazi session",
},
},
---@type YaziConfig
opts = {
open_for_directories = false,
log_level = vim.log.levels.DEBUG,
},
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
install = { colorscheme = { "catppuccin" } },
})
vim.cmd.colorscheme("catppuccin")
-- add anything else here |
Can you see if it works for you if you open |
@mikavilpas yeah using |
The only place yazi.nvim should change the clipboard related registers is when you use the That should only be done when you enter the keybinding for that (the default is What version of neovim do you have? I'm trying to think what could cause this. |
Is there something else on your system that might interfere with this?
The reproduction environment does not account for all of these things, but I suppose they might play a role. |
Also, can you post the results of
I should compare my values to yours. Here is what I have:
|
@mikavilpas Yeah I think probably there's something else impacting this behavior but I don't know what's that yet. Thanks a lot for the info here! And here's my neovim version and the outputs: neovim versionNVIM v0.10.3
Build type: RelWithDebInfo
LuaJIT 2.1.1731601260
Run "nvim -V1 -v" for more info and yes I'm using zsh and tmux(I also tested outside tmux and remains the same issue). :checkhealth provider.clipboardprovider.clipboard: require("provider.clipboard.health").check()
Clipboard (optional) ~
- OK Clipboard tool found: xsel :checkhealth yaziyazi: require("yazi.health").check()
yazi ~
- Running yazi.nvim version 6.11.1
- Found `yazi` version `Yazi 0.4.1 (Arch Linux 2024-12-19)` 👍
- yazi.nvim log file is at /home/laughing/.local/state/nvim/yazi.log
- hint: use `gf` to open the file path under the cursor
- Found `ya` version `Ya 0.4.1 (Arch Linux 2024-12-19)` 👍
yazi.config ~
- hint: execute the following command to see your configuration: >
:lua =require('yazi').config
- OK yazi
yazi --debugYazi
Version: 0.4.1 (Arch Linux 2024-12-19)
Debug : false
Triple : x86_64-unknown-linux-gnu (linux-x86_64)
Rustc : 1.83.0 (90b35a62 2024-11-26)
Ya
Version: 0.4.1 (Arch Linux 2024-12-19)
Emulator
Brand.from_env : None
Emulator.detect : Emulator { kind: Right(Unknown { kgp: false, sixel: false }), light: false, cell_size: Some((12, 26)) }
Emulator.detect_full: Ok(Emulator { kind: Right(Unknown { kgp: false, sixel: false }), light: false, cell_size: Some((12, 26)) })
Adapter
Adapter.matches: X11
Desktop
XDG_SESSION_TYPE : Some("tty")
WAYLAND_DISPLAY : None
DISPLAY : Some(":0")
SWAYSOCK : None
HYPRLAND_INSTANCE_SIGNATURE: None
WAYFIRE_SOCKET : None
SSH
shared.in_ssh_connection: false
WSL
WSL: false
NVIM
NVIM : false
Neovim version: 0.10.3
Variables
SHELL : Some("/usr/bin/zsh")
EDITOR : Some("nvim")
VISUAL : None
YAZI_FILE_ONE : None
YAZI_CONFIG_HOME: None
YAZI_ZOXIDE_OPTS: None
FZF_DEFAULT_OPTS: Some("--bind=ctrl-k:down,ctrl-i:up")
Text Opener
default : Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
block-create: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
block-rename: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
Multiplexers
TMUX : 2
tmux version : tmux 3.5a
tmux build flags : enable-sixel=Unknown
ZELLIJ_SESSION_NAME: None
Zellij version : No such file or directory (os error 2)
Dependencies
file : 5.46
ueberzugpp : 2.9.6
ffmpeg/ffprobe: 7.1 / 7.1
pdftoppm : 24.11.0
magick : 7.1.1-41
fzf : 0.57.0
fd/fdfind : 10.2.0 / No such file or directory (os error 2)
rg : 14.1.1
chafa : 1.14.5
zoxide : 0.9.6
7z/7zz : 24.09 / No such file or directory (os error 2)
jq : 1.6
Clipboard
wl-copy/paste: No such file or directory (os error 2) / No such file or directory (os error 2)
xclip : 0.13
xsel : 1.2.1
|
@mikavilpas I saw we have different clipboard provider, do you think that might be the factor? |
@mikavilpas Hi thanks for the great work here! Recently I was switching my primary file manager from lf to yazi and currently looking into yazi.nvim as well from lf.nvim.
One of my usually workflows would be open the file manager inside neovim(currently it's yazi.nvim) and jump to another folder by the pre-defined shortcuts and copy the folder path or some filenames inside the folder(by using shortcuts of yazi,
copy path
andcopy-dirname
) then quit the file manager then paste the content in my code.It worked with lf.nvim but when switching to yazi.nvim the content in system clipboard are gone when I exit the window of yazi.nvim.
Do you have any ideas that I could remain the copied content while quitting the yazi.nvim window? Thanks!
EDIT: I also tested with following this reproducing issues guide and the content are still gone to me. https://github.com/mikavilpas/yazi.nvim/blob/main/documentation/reproducing-issues.md
The text was updated successfully, but these errors were encountered: