Problem: oil sets buftype='acwrite' inside view.initialize(), which runs
in an async finish() callback after adapter.normalize_url(). BufEnter
fires before finish() completes, so user autocmds that check buftype on
oil buffers see an empty string instead of 'acwrite'.
Solution: set buftype='acwrite' early in load_oil_buffer() alongside the
existing early filetype='oil' assignment, before the async gap. The
redundant set in view.initialize() is harmless (idempotent).
Closes: stevearc/oil.nvim#710
Problem: when nvim-web-devicons returns no highlight for an unrecognized
file extension, the icon gets nil for its highlight group. Directories
have OilDirIcon as a targetable fallback, but files have nothing.
Solution: define OilFileIcon (linked to nil, matching OilFile) and use
it as the fallback in the devicons provider when get_icon returns a nil
highlight. The mini.icons provider already returns highlights for all
files so only the devicons path needs this.
Resolves: stevearc/oil.nvim#690
Problem: the rendering code constructs "OilExecutable" .. "Hidden" for
hidden executables, but that group was never defined. Hidden executables
silently lose all highlighting instead of being dimmed like every other
hidden entry type.
Solution: add OilExecutableHidden linked to OilHidden, consistent with
OilFileHidden, OilDirHidden, and all other hidden variants.
Based on: stevearc/oil.nvim#698
Problem: executable files were visually indistinguishable from regular
files in oil buffers.
Solution: add OilExecutable highlight group (linked to DiagnosticOk)
that detects executables via Unix permission bits (S_IXUSR|S_IXGRP|
S_IXOTH) and Windows executable extensions (.exe, .bat, .cmd, .com,
.ps1). Applied to both regular files and symlink targets.
Based on: stevearc/oil.nvim#698Closesstevearc/oil.nvim#679
Problem: the is_hidden_file and is_always_hidden config callbacks
only received (name, bufnr), making it impossible to filter by entry
type, permissions, or other metadata without reimplementing entry
lookup.
Solution: pass the full oil.Entry as a third argument to both
callbacks. Existing configs that only accept (name, bufnr) are
unaffected since Lua silently ignores extra arguments. The internal
should_display function signature changes from (name, bufnr) to
(bufnr, entry) to reflect its new contract.
Cherry-picked from: stevearc/oil.nvim#644
Problem: when close() is triggered from visual or operator-pending
mode (e.g. pressing q after d in an oil buffer), the buffer closes
instead of canceling the pending operation. This happens because
keymaps without an explicit mode default to "" which covers normal,
visual, select, and operator-pending modes.
Solution: check the current mode at the top of close() and send
<Esc> to cancel the mode instead of proceeding with the close. The
check covers all visual modes (v, V, CTRL-V), select modes (s, S,
CTRL-S), and operator-pending submodes (no, nov, noV, noCTRL-V).
Based on: stevearc/oil.nvim#495
Problem: the BufAdd autocmd that hijacks directory buffers was always
created, even when default_file_explorer was false. The guard inside
maybe_hijack_directory_buffer made it a no-op, but the autocmd still
fired on every BufAdd event.
Solution: wrap the BufAdd autocmd creation and initial buffer hijack
in a config.default_file_explorer conditional. The guard inside
maybe_hijack_directory_buffer is kept as defense-in-depth.
Based on: stevearc/oil.nvim#720
* feat: `toggle_float` now takes the same params as `open_float`
* docs: update `toggle_float` docs for `opts` and `cb` params
* fix: ensure cb is always called
---------
Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
* feat: copy/paste to system clipboard on macOS
* stylua
* feat: copy/paste to system clipboard on linux
* force mime type
* fix string.gsub
* vim.uv or vim.loop
* fix stylua
* support gnome directly
* support wayland
* refactor: extract clipboard actions into separate file
* fix: copy/paste in KDE
* refactor: simplify file loading
* fix: copy/paste on x11
* fix: better error message when clipboard command not found
* fix: paste on mac
* fix: pasting in Gnome
* feat: support pasting multiple files
* feat: support copying multiple files to clipboard
---------
Co-authored-by: Steve Walker <65963536+etherswangel@users.noreply.github.com>
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
* fix bug of disable_preview
file should not loaded if disable_preview is true
* refeactor function open_preview about disable_preview
switch the condition checking `disable_preview` of `if`
move the longer condition to the `elseif`
swap their repective code blocks to maintain the same functionality
* refactor: simplify conditionals
* fix: missing then
---------
Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
* feat: hidden highlights
* feat: OilHidden for hidden highlights instead of Comment
* fix: add the new combinatoric highlight groups
* perf: get rid of a call to is_hidden_file
* fix: tweak the default highlight group links
* fix: update function call in unit tests
---------
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
* feat: auto-quit vim if oil is closed as last buffer
* rename auto_close_vim to auto_close_last_buffer
* rework actions.close to be more like actions.cd
* fix: configure close action correctly
* add type annotation, future proofing
* fix: typo
* fix: typo
* refactor: better type annotations and backwards compatibility
---------
Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
* Initial implementation of scratch based preview
* Fix call to buf is valid in loop
* Fixing call to be made only from the main event loop
* Improve handling of large files from @pkazmier
* Better error handling and simplifying the code
* Default to old behavior
* Add documentation
* Fix readfile
* Fix the configuration
* refactor: single config enum and load real buffer on BufEnter
* doc: regenerate documentation
---------
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
* replace cwd path in actual path
* move get_title to utils
* add documentation
* rename
* add method doc
* add comment
* fallback to 0 for winid
* add missing property definition for relative_win_title
* only replace when at the start of the path
* simplify
* minor change
* add entry point to customize floating window title for oil-buffer
* remove config parameter
* cleanup
* add documentation
* move get_win_title to top and pass winid as parameter
* add get_win_title to type definition for oil.setup
* remove empty line
* adjust comment
---------
Co-authored-by: Philipp Oeschger <philippoeschger@Philipps-Air.fritz.box>
This allows for using get_current_dir in cases where currently hovered
buffer is not the desired Oil buffer (e.g. displaying directories for
multiple different Oil buffers)
* fix: set floating window win_options when buffer changes
* fix: set win options even when float border is "none"
---------
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
* implement floating window
* reset width on closing window
* use gap from new config parameter
* use minimal style for preview in floating
* lower z-index
* add configuration of preview position in floating window
* fix in verions earlier than nvim 0.10
* close preview on opening floating window
Close the any existing preview because otherwise strange errors happen when the preview is open and the floating window is opened at the same time.
* reset formatting changes
* remove empty line
* change z-index of preview window to floating window z-index
* add configurations to oil.txt
* formatting
* add auto configuration
* update oil doc
* refactor: move logic into layout.lua and eliminate flicker
* fix: floating preview window title is file name
* doc: clarify default_file_explorer
* refactor: don't need a preview_gap option
* refactor: only find preview win in current tabpage
---------
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
* Fixed drive browsing on windows
* Fixed naming
* fix: Uppercase drive letter only
* updated: Filter out network drives on windows
* Update files.lua
* Update files.lua
* fixed: mapped drives
* addslash to check for double slash
* Fixed indents
* Reverted addslash change
* Fixed windows initial buffer name
* Reverted formatting
* Cleaned up callback
* Fix addslash to handle \ too
* Allow running tests workflow from fork
* Fix workflow
* Test
* Tests
* refactor: readability and comments
* fix: convert buffer name to posix when hijacking directory
---------
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>