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

Integration with Mini.files #37

Open
shubham-cpp opened this issue Aug 1, 2024 · 1 comment
Open

Integration with Mini.files #37

shubham-cpp opened this issue Aug 1, 2024 · 1 comment

Comments

@shubham-cpp
Copy link

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

PS: #29 this didn't work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant