antosha417 / nvim-lsp-file-operations

Neovim plugin that adds support for file operations using built-in LSP
Apache License 2.0
269 stars 16 forks source link

Integration with Mini.files #37

Open shubham-cpp opened 1 month ago

shubham-cpp commented 1 month ago

Hello, I would like to request a little help with integrating with mini.files which is part of mini.nvim. mini.files is similar to something like oil.nvim

I've somewhat managed to setup this with renaming file but for moving files/removing files

mini.files setup ```lua ---@type LazySpec return { 'echasnovski/mini.files', dependencies = { 'nvim-tree/nvim-web-devicons', { 'antosha417/nvim-lsp-file-operations', dependencies = { 'nvim-lua/plenary.nvim' } }, }, version = '*', enabled = true, config = function() require('mini.files').setup({ options = { permanent_delete = false, use_as_default_explorer = true }, windows = { preview = true, width_preview = 45 }, }) require('lsp-file-operations').setup() end } ```
local au_group = vim.api.nvim_create_augroup('__mini', { clear = true })
vim.api.nvim_create_autocmd('User', {
  pattern = 'MiniFilesActionRename', -- :h MiniFiles-events
  group = au_group,
  desc = 'LSP Rename file',
  callback = function(event)
    local ok, rename = pcall(require, 'lsp-file-operations.did-rename')
    if not ok then
      return
    end
    rename.callback({ old_name = event.data.from, new_name = event.data.to })
  end,
})
shubham-cpp commented 1 month ago

PS: https://github.com/antosha417/nvim-lsp-file-operations/pull/29 this didn't work for me