Skip to content

[mini.files]: Enable Window Picker for Splits #1456

Closed Answered by echasnovski
willdavidow asked this question in Q&A
Discussion options

You must be logged in to vote

Sure, this is possible via making custom buffer-local mappings (similar to this code, for example). Something like this should work:

require('mini.files').setup({ mappings = { go_in = '', go_in_plug = '' } })
local pick_win_and_go_in = function(close_on_file)
  if MiniFiles.get_fs_entry().fs_type == 'file' then
    local picked_win_id = require('window-picker').pick_window()
    MiniFiles.set_target_window(picked_win_id)
  end
  MiniFiles.go_in({ close_on_file = close_on_file })
end

vim.api.nvim_create_autocmd('User', {
  pattern = 'MiniFilesBufferCreate',
  callback = function(args)
    local buf_id = args.data.buf_id
    vim.keymap.set('n', 'l', function() pick_win_and_go_in(false) end,…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by echasnovski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested mini.files
2 participants