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

BufferMove* using Keys not working for me , #466

Closed
NormTurtle opened this issue Apr 22, 2023 · 11 comments
Closed

BufferMove* using Keys not working for me , #466

NormTurtle opened this issue Apr 22, 2023 · 11 comments
Assignees
Labels
question Further information from project maintainers was requested. upstream Caused by code barbar.nvim depends on
Milestone

Comments

@NormTurtle
Copy link

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
Copy link
Collaborator

Iron-E commented Apr 22, 2023

If you do :BufferMoveNext manually, does that work?

@NormTurtle
Copy link
Author

If you do :BufferMoveNext manually, does that work?

yes yes , does work

@Iron-E Iron-E added the question Further information from project maintainers was requested. label Apr 22, 2023
@Iron-E
Copy link
Collaborator

Iron-E commented Apr 22, 2023

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

vim.keymap.set('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', {})

@NormTurtle
Copy link
Author

NormTurtle commented Apr 22, 2023

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
Copy link
Collaborator

Iron-E commented Apr 22, 2023

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
Copy link
Author

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 Iron-E added the downstream Caused by code depending on barbar.nvim label Apr 22, 2023
@Iron-E
Copy link
Collaborator

Iron-E commented Apr 22, 2023

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
Copy link
Author

what is binary search?

@Iron-E
Copy link
Collaborator

Iron-E commented Apr 22, 2023

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
Copy link
Author

@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
Copy link
Collaborator

Iron-E commented Apr 23, 2023

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

@Iron-E Iron-E closed this as completed Apr 23, 2023
@Iron-E Iron-E added upstream Caused by code barbar.nvim depends on and removed downstream Caused by code depending on barbar.nvim labels Apr 30, 2023
@Iron-E Iron-E self-assigned this Apr 30, 2023
@Iron-E Iron-E modified the milestones: 1.6, unplanned Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information from project maintainers was requested. upstream Caused by code barbar.nvim depends on
Projects
None yet
Development

No branches or pull requests

2 participants