romgrk / barbar.nvim

The neovim tabline plugin.
2.17k stars 82 forks source link

`BufferMove*` using `Keys` not working for me , #466

Closed NormTurtle closed 1 year ago

NormTurtle commented 1 year ago

hey, i was just trying the barbar , i copied some keybinds ,however

the <A->> , like commnad or maybe just :BufferMove** command aren't working for me , using keybinds i tried sevral keybinds like <C-.> this this din't wokr too :(

this is my lazy.nvim for barbar image

please show me way to fix this , only

map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', opts)
map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', opts)

aren't working

i dont know how to get log of nvim right now :(

info : OS: win11 GUI: neovide nvim = 9.0

Iron-E commented 1 year ago

If you do :BufferMoveNext manually, does that work?

NormTurtle commented 1 year ago

If you do :BufferMoveNext manually, does that work?

yes yes , does work

Iron-E commented 1 year ago

Try using vim.keymap.set, e.g.

vim.keymap.set('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', {})
NormTurtle commented 1 year ago

no it did not work!

agian this is for clarification vim.keymap.set('n', '<A-<>', 'BufferMovePrevious', {}) this uses key combinaiotn of ALT + SHIFT + , right? !

Iron-E commented 1 year ago

Can you reproduce in nvim --clean?

nvim --clean -u minimal.lua

And in minimal.lua:

-- set rtp
-- setup barbar
-- map command

Edit: example minimal repro. The content will be slightly different for you, but that's a good template

NormTurtle commented 1 year ago

i did as @Iron-E said , CLI: nvim --clean -u minimal.lua content of minimal.lua

local lazypath = vim.fn.stdpath("data") .. "/lazy/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",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup {
  {'romgrk/barbar.nvim',
    dependencies = 'nvim-tree/nvim-web-devicons',
    init = function() vim.g.barbar_auto_setup = false end,
    opts = {
      -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
       animation = true,
       insert_at_start = true,
      -- …etc.
    },
    version = '^1.0.0', -- optional: only update when a new 1.x version is released
  },
}local o = vim.opt
o.background = "dark" --
o.termguicolors = true

local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }

-- Move to previous/next
map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts)
map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts)
-- Re-order to previous/next
map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', opts)
map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', opts)

yes it did work on --clean , :( i dont know why?! what can be done in my config?!

Iron-E commented 1 year ago

There are two approaches to find the issue:

  1. Slowly introduce more from your config into the minimal file, until it breaks.
  2. Comment out info in your config, until it works.
    • If you take this approach, I would start by disabling all plugins except for barbar.nvim and nvim-web-devicons, then use binary search to enable the other plugins.
NormTurtle commented 1 year ago

what is binary search?

Iron-E commented 1 year ago

what is binary search?

The simple explanation is: disable all your plugins, and enable a few at a time until the problem comes back. When the problem comes back, keep disabling/enabling in that few until you find the problem

NormTurtle commented 1 year ago

@Iron-E as u said i did the same , and found out that , setting the BufferPrevious KEYS from <A-,> to somethign else <A-g> worked, i also found out that mostly Neovide is causing problem there is maybe something wrong with neovides. handling of keys related to <A+>>

issue it not at nvim , its at neovide

i Have made issue on neovide regarding's

Iron-E commented 1 year ago

Alright, since it's not a barbar problem I will close this. Good luck getting this resolved with Neovide!