Skip to content
Discussion options

You must be logged in to vote

Idea is as following: I want to open MiniFiles with MiniFiles.open() (no arguments), so that it opens in the cwd. And I want a keymap to be able to focus the current file in its parent directory.

That is relatively straightforward set_branch() and most effort is spent into getting the data for what is "current file" (i.e. the file for the buffer that is displayed in the window which was current when explorer opened). So something like this:

local focus_target_file = function()
  local target_window = MiniFiles.get_explorer_state().target_window
  local target_buf_id = vim.api.nvim_win_get_buf(target_window)
  local cur_filepath = vim.api.nvim_buf_get_name(target_buf_id)
  if vim.loop.fs…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@echasnovski
Comment options

Answer selected by echasnovski
@B3RR10
Comment options

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