diff --git a/doc/oil.txt b/doc/oil.txt index 8f93f40..15c484e 100644 --- a/doc/oil.txt +++ b/doc/oil.txt @@ -1468,6 +1468,29 @@ buffers on |BufRead|: >lua }) < +Open file in a picked window ~ + *oil-recipe-pick-window* + +Open the entry under the cursor in a window chosen via +https://github.com/s1n7ax/nvim-window-picker. Add to `after/ftplugin/oil.lua`: >lua + vim.keymap.set("n", "", function() + local oil = require("oil") + local entry = oil.get_cursor_entry() + if not entry or entry.type ~= "file" then + return + end + local dir = oil.get_current_dir() + oil.close({ exit_if_last_buf = false }) + local win = require("window-picker").pick_window({ + filter_rules = { autoselect_one = true, include_current_win = true }, + }) + if win then + vim.api.nvim_set_current_win(win) + vim.cmd.edit(vim.fs.joinpath(dir, entry.name)) + end + end, { buffer = true, desc = "Open file in picked window" }) +< + -------------------------------------------------------------------------------- EVENTS *oil-events* diff --git a/doc/upstream.md b/doc/upstream.md index 7fdb383..2702b51 100644 --- a/doc/upstream.md +++ b/doc/upstream.md @@ -18,8 +18,8 @@ issues against this fork. | [#722](https://github.com/stevearc/oil.nvim/pull/722) | Fix freedesktop trash URL | cherry-picked | | [#723](https://github.com/stevearc/oil.nvim/pull/723) | Emit `OilReadPost` event after render | cherry-picked | | [#725](https://github.com/stevearc/oil.nvim/pull/725) | Normalize keymap keys before config merge | cherry-picked | -| [#727](https://github.com/stevearc/oil.nvim/pull/727) | Clarify `get_current_dir` nil + Telescope recipe | cherry-picked | -| [#739](https://github.com/stevearc/oil.nvim/pull/739) | macOS FreeDesktop trash recipe | cherry-picked | +| [#727](https://github.com/stevearc/oil.nvim/pull/727) | Clarify `get_current_dir` nil + Telescope recipe | cherry-picked — see `oil-recipe-telescope` | +| [#739](https://github.com/stevearc/oil.nvim/pull/739) | macOS FreeDesktop trash recipe | cherry-picked — see `oil-recipe-macos-freedesktop-trash` | | [#488](https://github.com/stevearc/oil.nvim/pull/488) | Parent directory in a split | not actionable — empty PR | | [#493](https://github.com/stevearc/oil.nvim/pull/493) | UNC paths on Windows | not actionable — superseded by [#686](https://github.com/stevearc/oil.nvim/pull/686) | | [#686](https://github.com/stevearc/oil.nvim/pull/686) | Windows path conversion fix | not actionable — Windows-only | @@ -47,7 +47,7 @@ issues against this fork. | [#254](https://github.com/stevearc/oil.nvim/issues/254) | Buffer modified highlight group | tracked in [#129](https://github.com/barrettruth/canola.nvim/issues/129) | | [#263](https://github.com/stevearc/oil.nvim/issues/263) | Diff mode | open | | [#276](https://github.com/stevearc/oil.nvim/issues/276) | Archives manipulation | not actionable — nvim has builtin zip support | -| [#280](https://github.com/stevearc/oil.nvim/issues/280) | vim-projectionist support | not actionable — `OilFileCreated` event provides the correct hook; recipe added to docs | +| [#280](https://github.com/stevearc/oil.nvim/issues/280) | vim-projectionist support | not actionable — `OilFileCreated` event provides the correct hook; see `oil-recipe-file-templates` | | [#288](https://github.com/stevearc/oil.nvim/issues/288) | Oil failing to load | not actionable — no reliable repro, likely lazy.nvim timing | | [#289](https://github.com/stevearc/oil.nvim/issues/289) | Show absolute path toggle | not actionable — display solved by `get_win_title`, editing consolidated into [#32](https://github.com/barrettruth/canola.nvim/issues/32) | | [#294](https://github.com/stevearc/oil.nvim/issues/294) | Can't handle emojis in filenames | not actionable — libuv bug ([nodejs/node#49042](https://github.com/nodejs/node/issues/49042)) | @@ -61,7 +61,7 @@ issues against this fork. | [#349](https://github.com/stevearc/oil.nvim/issues/349) | Parent directory as column/vsplit | not actionable — different navigation paradigm, use [mini.files](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-files.md) | | [#351](https://github.com/stevearc/oil.nvim/issues/351) | Paste deleted file from register | not actionable — workflow issue (move before saving), confirmation prompt and `delete_to_trash` cover recovery | | [#359](https://github.com/stevearc/oil.nvim/issues/359) | Parse error on filenames differing by space | not actionable — parser uses whitespace as column delimiter | -| [#360](https://github.com/stevearc/oil.nvim/issues/360) | Pick window to open file into | open | +| [#360](https://github.com/stevearc/oil.nvim/issues/360) | Pick window to open file into | not actionable — user-land workaround covers it; see `oil-recipe-pick-window` | | [#362](https://github.com/stevearc/oil.nvim/issues/362) | "Could not find oil adapter for scheme" | not actionable — no repro, old nvim (0.9.5) | | [#363](https://github.com/stevearc/oil.nvim/issues/363) | `prompt_save_on_select_new_entry` wrong prompt | fixed | | [#371](https://github.com/stevearc/oil.nvim/issues/371) | Constrain cursor in insert mode | fixed ([#93](https://github.com/barrettruth/canola.nvim/pull/93)) | @@ -96,7 +96,7 @@ issues against this fork. | [#533](https://github.com/stevearc/oil.nvim/issues/533) | `constrain_cursor` bug | not actionable — needs repro | | [#570](https://github.com/stevearc/oil.nvim/issues/570) | Improve c0/d0 for renaming | not actionable — blocked on Neovim extmark API | | [#571](https://github.com/stevearc/oil.nvim/issues/571) | Callback before `highlight_filename` | not actionable — solved by existing extensions ([oil-git-status.nvim](https://github.com/refractalize/oil-git-status.nvim), [oil-git.nvim](https://github.com/malewicz1337/oil-git.nvim)) | -| [#578](https://github.com/stevearc/oil.nvim/issues/578) | Hidden file dimming recipe | fixed — added recipe to disable hidden file dimming | +| [#578](https://github.com/stevearc/oil.nvim/issues/578) | Hidden file dimming recipe | fixed — see `oil-recipe-no-hidden-dimming` | | [#587](https://github.com/stevearc/oil.nvim/issues/587) | Alt+h keymap | not actionable — user config issue | | [#599](https://github.com/stevearc/oil.nvim/issues/599) | user:group display and manipulation | consolidated into [#126](https://github.com/barrettruth/canola.nvim/issues/126) | | [#607](https://github.com/stevearc/oil.nvim/issues/607) | Per-host SCP args | fixed ([#171](https://github.com/barrettruth/canola.nvim/pull/171)) |