nvim-tree / nvim-web-devicons

lua `fork` of vim-web-devicons for neovim
MIT License
1.93k stars 182 forks source link

Rename `:NvimWebDeviconsHiTest` to anything else like `WebDeviconsHiTest` #412

Closed Zeioth closed 3 months ago

Zeioth commented 3 months ago

Distros often reserve the command prefix :Nvim for their own stuff, so it would be a good idea to leave it free.

alex-courtis commented 3 months ago

I see, it looks like we might be the only ones doing this. From my setup:

NvimTreeClipboard
NvimTreeClose
NvimTreeCollapse
NvimTreeCollapseKeepBuffers
NvimTreeFindFile
NvimTreeFindFileToggle
NvimTreeFocus
NvimTreeHiTest
NvimTreeOpen
NvimTreeRefresh
NvimTreeResize
NvimTreeToggle
NvimWebDeviconsHiTest

What do you mean by distro? Something like lunar vim?

gegoune commented 3 months ago

We cannot tiptoe around every possible set of configurations, sorry. Commands from this and nvim-tree repositories are prefixed by their respective names to avoid clashes. There isn't anything special about Nvim and if some disteos choose to use such generic name rather than their name (like, for example Lvim, but I am not sure, never used any of those) it's kind a on them.

Zeioth commented 3 months ago

That is not a good thing. We should change the border cases like this where it happens.

Zeioth commented 3 months ago

alex-courtis we distribute 100 plugins in our distro and you don't have a single one that do that. So if you see it in a plugin, report it like I did.

Plus, the naming convention for neovim plugins is <name-of-the-plugin>.nvim, so this doesn't happen.

alex-courtis commented 3 months ago

That is not a good thing. We should change the border cases like this where it happens.

Unfortunately that's not something we can do - it will break users.

You could change nvim-tree commands via API: :help nvim-tree-api.commands

This will break nvim-tree users of your distribution as readme, help, wiki will not be correct.

local api = require("nvim-tree.api")

-- retrieve all nvim-tree commands
local commands = api.commands.get()
print(vim.inspect(commands))

local open = commands[1]

-- create command with a different name
vim.api.nvim_create_user_command("FooNvimTreeOpen", open.command, open.opts)

-- remove old command
vim.api.nvim_del_user_command(open.name)
alex-courtis commented 3 months ago

What exactly is the problem here? What does the Nvim command prefix break?

gegoune commented 3 months ago

It doesn't break anything. They maintain configuration called NormalNvim and supposedly have bunch of commands starting with Nvim (https://github.com/NormalNvim/NormalNvim?tab=readme-ov-file#commands). I guess having non-related commands in completion items is an issue. This really is an no-op. Sorry.

alex-courtis commented 3 months ago

Myself and my colleagues really don't understand nvim distributions; why do they exist?

The issue is that new neovim users don't understand the basics like buffers and windows and tabs. It's difficult to know what's built in functionality vs provided by plugins. Most of the issues that lunarvim users raise here are not a plugin issue, but an issue with their understanding.

In our #vim slack channel: "I'm new to vim, what plugins should I use?" The answer was a resounding NONE.