Skip to content
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

Entering the yazi window, navigation breaks #543

Open
raoulg opened this issue Oct 31, 2024 · 4 comments
Open

Entering the yazi window, navigation breaks #543

raoulg opened this issue Oct 31, 2024 · 4 comments

Comments

@raoulg
Copy link

raoulg commented Oct 31, 2024

I start up nvim, and enter yazi.
I can see the files, but doing jk i go up and down, but fully left aligned.

The hl keys dont work for sideways navigation, enter does not select.

yazi works fine outside nvim.

@mikavilpas
Copy link
Owner

Can you reproduce the error with these instructions? https://github.com/mikavilpas/yazi.nvim/blob/main/documentation/reproducing-issues.md

@therealyo
Copy link

I can reproduce this too with following config

-- 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 = " "

-- 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
				"<leader>e",
				"<cmd>Yazi toggle<cr>",
				desc = "Resume the last yazi session",
			},
		},
		---@type YaziConfig
		opts = {
			open_for_directories = false,
			log_level = vim.log.levels.DEBUG,
		},
	},
	{
		"max397574/better-escape.nvim",
		config = function()
			require("better_escape").setup()
		end,
	}

	
}
require("lazy").setup(plugins, {
	root = root .. "/plugins",
	install = { colorscheme = { "catppuccin" } },
})

vim.cmd.colorscheme("catppuccin")
-- add anything else here

@mikavilpas
Copy link
Owner

It looks like adding better-escape causes some issues. You could see e.g. max397574/better-escape.nvim#48 and disable all/some/??? mappings when vim.bo.filetype == "yazi", which is how yazi.nvim buffers should be recognizable.

@raoulg
Copy link
Author

raoulg commented Nov 5, 2024

I will try to reproduce it later, too busy now; but i already know that I dont have better-escape installed, without testing, so that might not be the only cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants