-
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
Better handling of <esc>
#126
Comments
Hmm, interesting idea. This is definitely hacky and could be improved. However, I tried this out a bit and ran into some issues. Can you see if it works for you on this branch I added instructions on how this could be tried out to https://github.com/mikavilpas/yazi.nvim/blob/master/documentation/for-developers/setting-up.md#managing-your-development-code |
#127 works fine! |
For me, running 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 = ' '
-- install the following plugins
---@type LazySpec
local plugins = {
'folke/tokyonight.nvim',
{
'mikavilpas/yazi.nvim',
branch = 'better-handling-of-esc-idea',
dependencies = {
'nvim-lua/plenary.nvim',
},
event = 'VeryLazy',
keys = {
{
-- 👇 choose your own keymapping
'<leader>fy',
function()
require('yazi').yazi()
end,
{ desc = 'Open the file manager' },
},
},
---@type YaziConfig
opts = {
open_for_directories = false,
},
},
}
require('lazy').setup(plugins, {
root = root .. '/plugins',
})
vim.cmd.colorscheme('tokyonight')
-- add anything else here |
You have set |
Oops, you're right. My bad. I'll look into it more. |
Something seems to conflict in lazyvim: esc.movDetails
-- 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 = {
'folke/tokyonight.nvim',
{ 'LazyVim/LazyVim', import = 'lazyvim.plugins' },
{
'mikavilpas/yazi.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
},
branch = 'better-handling-of-esc-idea',
event = 'VeryLazy',
keys = {
{
-- 👇 choose your own keymapping
'<leader>fy',
function()
require('yazi').yazi()
end,
{ desc = 'Open the file manager' },
},
},
---@type YaziConfig
opts = {
open_for_directories = true,
},
},
{
'nvim-neo-tree/neo-tree.nvim',
opts = {
filesystem = {
hijack_netrw_behavior = 'disabled',
},
},
},
}
require('lazy').setup(plugins, {
root = root .. '/plugins',
})
vim.cmd.colorscheme('tokyonight')
-- add anything else here I like this idea a lot though. If you can resolve this issue, I would like to merge it. |
The issue is: On pressing I do not have this issue with your config, but in the video your status line is modified, while mine is vanilla, so I would guess there is a conflict with a plugin. |
That's it exactly. Can you reproduce the behaviour with the reproduction script in my previous message? |
Nope, works also fine with the updated repro script. Maybe you are running in this issue again:
Maybe try deleting the |
Just tried deleting the I think it should effectively start over from scratch in that case. |
LazyVim has in the Terminal mode a mapping for
|
<#126> Co-authored-by: BonaBeavis <[email protected]>
Ooh I see, nice find! I was able to shadow that binding for yazi.nvim only, so that issue goes away as far as I can tell. Would you have time to review #127? Let me know if you would prefer not being included as the co-author. |
<#126> Co-authored-by: BonaBeavis <[email protected]>
Just merged the refactor in. Thanks again for the idea and help! |
Neovim captures the first
<esc>
when in a yazi buffer.As a fix I added
vim.keymap.set('t', '<esc>', '<esc>', { buffer = yazi_buffer })
in theset_keymappings_function
.Then this hack is not needed anymore:
yazi.nvim/lua/yazi/window.lua
Lines 93 to 100 in 1efb488
The text was updated successfully, but these errors were encountered: