j-morano / buffer_manager.nvim

A simple plugin to easily manage Neovim buffers.
MIT License
232 stars 12 forks source link

short_file_names cannot hide all path #32

Open Jaehaks opened 5 months ago

Jaehaks commented 5 months ago

Thank you for you effort. I'm windows 10 user with nvim-qt.

I installed this plugin and set short_file_names = true to show only filename + extension. But the behavior is the same with short_file_names = false. All lists show their path. If files are in subdirectory of current path, relative path is shown. If files are in parent directory of current path, absolute path is shown. Is It normal?

image

this is my configuraiton

bm.setup({
  select_menu_item_commands = {
    edit = {
      key = '<CR>',
      command = 'edit'
    },
    v = {
      key = '<C-v>',
      command = 'vsplit'
    },
    h = {
      key = '<C-h>',
      command = 'split'
    },
  },
  short_file_names = true, -- show shorten filename
  short_term_names = true,
  loop_nav = true,
})

one more question.,. The vsplit / split mapping doesn't work. works as visual block only

j-morano commented 4 months ago

Hello. Thanks for the feedback. This feature does not work on Windows yet. As for the vsplit/split mappings, you should not have any problems. Maybe those mappings are overridden somewhere in normal mode.

Jaehaks commented 4 months ago

@j-morano
I see. I think the reason is that buffer_manager.nvim deals path wiht '/' as delimiter only.

Jaehaks commented 4 months ago

@j-morano I thought that this problem is caused by windows path delimiter.

I checked the M.toggle_quick_menu() and found that config.short_file_names is always false although I set this option in configuration.

bdemirtas commented 4 months ago

I'm having the same issue in Fedora. Short_file_names doesn't work, shows me the full path.

j-morano commented 4 months ago

I'm having the same issue in Fedora. Short_file_names doesn't work, shows me the full path.

I am using Fedora, and it is working. Can you provide more details? So I can try to reproduce it.

j-morano commented 4 months ago

I created the branch windows-separator and added a commit to try to solve this issue. Can you give it a try to check if the problem perists?

bdemirtas commented 4 months ago

I'm having the same issue in Fedora. Short_file_names doesn't work, shows me the full path.

I am using Fedora, and it is working. Can you provide more details? So I can try to reproduce it.

When I have multiple nested folders, it become very long and continue on the second line. My config it's pretty much what's in the README.md.

config

{
        "j-morano/buffer_manager.nvim",
        dependencies = "nvim-lua/plenary.nvim",
        lazy = false,
        keys = {
            { "<leader>db", ":Bdelete<CR>", desc = "Delete Buffer" },
        },
        config = function()
            require("buffer_manager").setup({
                vim.keymap.set(
                    { "t", "n" },
                    "<leader>fb",
                    require("buffer_manager.ui").toggle_quick_menu,
                    { noremap = true, desc = "Buffers List" }
                ),

                select_menu_item_commands = {
                    v = {
                        key = "<C-v>",
                        command = "vsplit",
                    },
                    h = {
                        key = "<C-h>",
                        command = "split",
                    },
                },
                focus_alternate_buffer = false,
                short_file_names = true,
        order_buffers = "filename",
                loop_nav = true,
                highlight = "Normal:BufferManagerBorder",
                win_extra_options = {
                    winhighlight = "Normal:BufferManagerNormal",
                },
            })
        end,
    },

Screenshot from 2024-05-24 05-51-39

Jaehaks commented 4 months ago

I created the branch windows-separator and added a commit to try to solve this issue. Can you give it a try to check if the problem perists?

@j-morano I tested the commit 2b0e03e of branch 'windows-separator'

It does not work like I thoght it would.
This is result of the commit. it still does not apply the configuraiton.
It shows backslash at first region of path. but change to slash after USER directory image

It is the result of adding get_config() in toggle_quick_menu() It recognize the short_file_names feature. but cannot change to short name entirely. image

j-morano commented 4 months ago

Thank you for your effort. I do not have access to a Windows machine, so I welcome any help to solve this issue.