Problem: the codebase still used the upstream \`oil\` naming everywhere —
URL schemes, the \`:Oil\` command, highlight groups, user events, module
paths, filetypes, buffer/window variables, LuaCATS type annotations,
vimdoc help tags, syntax groups, and internal identifiers.
Solution: mechanical rename of every reference. URL schemes now use
\`canola://\` (plus \`canola-ssh://\`, \`canola-s3://\`, \`canola-sss://\`,
\`canola-trash://\`, \`canola-test://\`). The \`:Canola\` command replaces
\`:Oil\`. All highlight groups, user events, augroups, namespaces,
filetypes, require paths, type annotations, help tags, and identifiers
follow suit. The \`upstream\` remote to \`stevearc/oil.nvim\` has been
removed and the \`vim.g.oil\` deprecation shim dropped.
* build: replace luacheck with selene
Problem: luacheck is unmaintained (last release 2018) and required
suppressing four warning classes to avoid false positives. It also
lacks first-class vim/neovim awareness.
Solution: switch to selene with std='vim' for vim-aware linting.
Replace the luacheck CI job with selene, update the Makefile lint
target, and delete .luacheckrc.
* build: add nix devshell and pre-commit hooks
Problem: oil.nvim had no reproducible dev environment. The .envrc
set up a Python venv for the now-removed docgen pipeline, and there
were no pre-commit hooks for local formatting checks.
Solution: add flake.nix with stylua, selene, and prettier in the
devshell. Replace the stale Python .envrc with 'use flake'. Add
.pre-commit-config.yaml with stylua and prettier hooks matching
other plugins in the repo collection.
* fix: format with stylua
* build(selene): configure lints and add inline suppressions
Problem: selene fails on 5 errors and 3 warnings from upstream code
patterns that are intentional (mixed tables in config API, unused
callback parameters, identical if branches for readability).
Solution: globally allow mixed_table and unused_variable (high volume,
inherent to the codebase design). Add inline selene:allow directives
for the 8 remaining issues: if_same_then_else (4), mismatched_arg_count
(1), empty_if (2), global_usage (1). Remove .envrc from tracking.
* build: switch typecheck action to mrcjkb/lua-typecheck-action
Problem: oil.nvim used stevearc/nvim-typecheck-action, which required
cloning the action repo locally for the Makefile lint target. All
other plugins in the collection use mrcjkb/lua-typecheck-action.
Solution: swap to mrcjkb/lua-typecheck-action@v0 for consistency.
Remove the nvim-typecheck-action git clone from the Makefile and
.gitignore. Drop LuaLS from the local lint target since it requires
a full language server install — CI handles it.
Problem: when the preview window opens a directory that already has a
loaded oil buffer with unsaved edits, open_preview() unconditionally
calls load_oil_buffer() on it. This re-initializes the buffer via
view.initialize() -> render_buffer_async(), which re-fetches the
directory listing from disk and replaces all buffer lines, destroying
the user's pending edits. The mutation parser then can't see the
deleted entry in the source buffer, so it produces a COPY action
instead of a MOVE.
Solution: guard the load_oil_buffer() call in open_preview() with a
check for vim.b[filebufnr].oil_ready. Buffers that are already
initialized and rendered are not re-loaded, preserving any unsaved
modifications the user has made.
Closes: stevearc/oil.nvim#632
Problem: when neovim is opened with multiple directory arguments
(e.g. nvim dir1/ dir2/), only the first directory gets handled by oil.
The BufAdd autocmd that renames directory buffers to oil:// URLs is
registered inside setup(), but neovim creates all argument buffers
before setup() runs. The initial hijack block only processes
nvim_get_current_buf(), so additional directory buffers are never
renamed and remain as plain empty buffers.
Solution: iterate all existing buffers at setup time instead of only
the current one. Each directory buffer gets renamed to an oil:// URL
so that BufReadCmd fires when the user switches to it.
Closes: stevearc/oil.nvim#670
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>