Closed sanka047 closed 2 years ago
I'm personally not interested in this change.
Since all directory buffers have their filetype set to dirbuf
, imo it's cleaner and more understandable to use ftplugin files or FileType autocmds to do this kind of user-configuration. And since you can emulate the behavior of on_attach
pretty easily, I'd rather avoid the extra configuration option.
vim.api.nvim_create_autocmd("FileType", {
pattern = "dirbuf",
callback = my_on_attach,
})
That’s fair. I only mentioned since I figured it would be an easy change to make within the plugin since you already have an ftplugin
that creates mappings where you could just toss in a call to the hook
without much change.
Admittedly, I haven’t been using custom ftplugin
s so it didn’t cross my mind. I’ll take a deeper look into setting those up for some of my configuration. Thanks!
Instead of relying on autocmds, it would be nice to be able to setup custom keymaps using a hook that is always run once the
dirbuf
buffer is created. This is a nice-to-have and not completely necessary since we can use autocmds to do the same thing. Just curious if there would be interest in making this change.