Commit graph

402 commits

Author SHA1 Message Date
ca834cf703
fix(view): suppress W10 warning when nvim is launched with -R
Problem: when Neovim is started with -R (read-only), all buffers get
readonly=true. Oil's render_buffer toggles modifiable to write directory
listings, which triggers "W10: Warning: Changing a readonly file" on
every directory navigation.

Solution: clear readonly on oil buffers during initialization. Oil
buffers are buftype=acwrite — readonly has no meaning for them since
writes go through BufWriteCmd, not the filesystem.

Resolves: stevearc/oil.nvim#642
2026-02-20 20:26:07 -05:00
c6b4a7a07b
feat: add configurable file and directory creation permissions
Problem: files were always created with mode 0644 and directories
with 0755, hardcoded in fs.touch and uv.fs_mkdir. Users who need
different defaults (e.g. 0600 for security) had no config option.

Solution: add new_file_mode (default 420 = 0644) and new_dir_mode
(default 493 = 0755) config options, passed through to fs.touch and
uv.fs_mkdir in the files and mac trash adapters. The fs.touch
signature accepts an optional mode parameter with backwards
compatibility (detects function argument to support old callers).
Local cache directories (SSH, S3) continue using standard system
permissions rather than the user-configured mode.

Based on: stevearc/oil.nvim#537
2026-02-20 20:26:07 -05:00
ded17258cd
feat(icon): add opt-in filetype detection via file contents
Problem: files without standard extensions (e.g. scripts with
shebangs, Makefile, Dockerfile) got incorrect or default icons since
icon providers match by filename or extension only.

Solution: add use_slow_filetype_detection option to the icon column
config. When enabled, reads the first 16 lines of each file and
passes them to vim.filetype.match for content-based detection. The
detected filetype is forwarded to mini.icons or nvim-web-devicons as
a trailing parameter, preserving backwards compatibility with
existing icon provider implementations.

Based on: stevearc/oil.nvim#618
2026-02-20 20:26:07 -05:00
41556ec87f
feat: add highlight for executable files
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#698
Closes stevearc/oil.nvim#679
2026-02-20 20:26:07 -05:00
4ab4765a84 feat: pass entry to is_hidden_file and is_always_hidden callbacks
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
2026-02-20 16:29:08 -05:00
16f3d7bfa9 fix: cancel visual/operator-pending mode instead of closing buffer
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
2026-02-20 16:28:26 -05:00
29239d56fb feat: emit OilReadPost user event after each buffer render
Problem: third-party plugins like oil-git-status.nvim had no way to
know when an oil buffer was re-rendered after a filesystem change,
causing their decorations to be cleared with no signal to refresh.

Solution: emit a User OilReadPost autocmd after every successful
render_buffer_async call. Also document all oil user events
(OilEnter, OilReadPost, OilMutationComplete) in oil.txt since none
were previously documented.

Cherry-picked from: stevearc/oil.nvim#723
2026-02-20 16:27:09 -05:00
2228f80196 refactor: only create BufAdd autocmd when default_file_explorer is true
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
2026-02-20 16:26:24 -05:00
723145c9fb fix: normalize keymap keys before merging user config
Problem: user keymap overrides like <c-t> failed to replace the
default <C-t> because the keys were compared as raw strings during
merge, leaving both entries in the table.

Solution: use nvim_replace_termcodes to compare keymap keys by their
internal representation, removing any default entry that normalizes
to the same key as the user-provided one before inserting it.

Closes #692
Cherry-picked from: stevearc/oil.nvim#725
2026-02-20 16:26:03 -05:00
eed6697ce2 docs: clarify get_current_dir nil return and add telescope recipe
Problem: get_current_dir returns nil in several cases that were not
documented, causing confusion when used in keymaps that open pickers
like Telescope (#682). Also, posix_to_os_path could crash on Windows
when no drive letter is found.

Solution: expand get_current_dir docs to explain nil return cases, add
a Telescope recipe with nil guards, and add a defensive nil check in
posix_to_os_path.

Cherry-picked from: stevearc/oil.nvim#727
2026-02-20 16:16:02 -05:00
b92ecb04ee fix(trash): update freedesktop trash specification url
Problem: the old URL specifications.freedesktop.org/trash-spec/1.0/ is
dead and redirects or 404s.

Solution: update to the current URL trash/1.0/ in docs, source, and
the generation script.

Cherry-picked from: stevearc/oil.nvim#722
2026-02-20 16:15:27 -05:00
zeta-squared
7a09f0b000
fix: add open_float params to toggle_float (#716)
* 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>
2026-01-16 21:01:02 -08:00
malewicz1337
6b59a6cf62
feat: add support for column text alignment (#711)
* feat: add support for column text alignment

* refactor(util): replace rpad with pad_align

* refactor(columns): whitespace handling in parse_col

* refactor: small changes

* doc: add align option to doc generation

* refactor: replace lpad with pad_align

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2026-01-13 21:28:16 -08:00
Sebastian Oberhoff
d278dc40f9
fix: propagate errors in recursive_delete and recursive_copy (#712)
The `complete` callback checks `err` instead of `err2`, but `err` is
always nil inside the `elseif entries` branch. This silently ignores
child operation errors, causing misleading "directory not empty" failures.
2026-01-11 13:55:32 -08:00
Ross
24055701b7
feat: add horizontal scrolling actions (#709)
* feat: add horizontal scrolling actions

* refactor(actions): remove unnecessary use of `nvim_replace_termcodes`

* lint: apply stylua

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
2026-01-11 13:53:17 -08:00
Steven Arcangeli
81b8a91735 cleanup: remove deprecated trash_command 2026-01-01 00:22:58 -05:00
jake-stewart
78ed0cf7d9
fix: multicursor when opened with --preview (#701) 2025-12-31 12:50:39 -08:00
Dominic Della Valle
963c8d2c55
fix: handle empty LSP glob patterns (#702)
* fix: handle empty LSP glob patterns

* fix: use non-greedy pattern matching

* lint: fix shadowed variable

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
2025-12-29 12:27:20 -08:00
Muhammad Imaduddin
634049414b
fix: open files under cwd with relative name (#693) 2025-12-29 10:15:58 -08:00
phanium
bbfa7cba85
fix: args.count of 0 is not used as size (#695) 2025-12-27 13:27:37 -08:00
jake-stewart
756dec855b
feat: support multicursor.nvim (#696)
* support multicursor.nvim

* lint: apply stylua

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2025-12-21 12:26:10 -08:00
Steven Arcangeli
09a4e4f460 ci: fix type error 2025-12-21 15:14:45 -05:00
Sebastian Lyng Johansen
15a2b21eda
fix: use g~ instead of overriding the builtin ~ mapping (#694) 2025-12-20 12:03:07 -08:00
phanium
cbcb3f997f
fix: command modifiers for :Oil (#691)
* Support command mods `:belowright hor 10Oil`
* Fix `:tab Oil` only work on the first tab
2025-11-30 14:01:40 -08:00
Siggsy
b9ab05fe5a
feat: add OilEmpty highlight group (#689)
* Add OilEmpty highlight

* Add OilEmpty to doc
2025-11-30 13:42:00 -08:00
Daniel Kongsgaard
e5bd931edb
feat: new adapter for S3 buckets (#677)
* Added s3 support

* Save work

* Various bug fixes

* Minor cleanup

* Minor bug fixes

* Fix typo

* Update following feedback + minor bug fix

* Fix CI

* Cleanup and remove bucket entry_type

* Make suggested changes

* Better aws existence check

* Fix typo

* refactor: don't bother caching aws executable status

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
2025-11-30 12:41:37 -08:00
Zijian
01cb3a8ad7
fix: send_to_quickfix opens loclist when specified (#687)
* fix `send_to_quickfix` opening qf when the target is `loclist`

* fix indentation
2025-11-21 17:45:13 -08:00
Steven Arcangeli
7e1cd7703f fix: don't apply oil window options to non-directory oil buffers 2025-10-19 15:39:26 -07:00
Steven Arcangeli
71948729cd lint: use more specific type for internal entries 2025-10-15 10:42:52 -07:00
Steve Walker
f55ebb0079
feat(clipboard): pasting from system clipboard can delete original (cut) (#649)
* feat: cut_from_system_clipboard

* refactor: shuffle some code around

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2025-10-15 10:36:37 -07:00
John Winston
dfb09e87bf
feat: add callback for handling buffer opening (#638) 2025-10-15 10:03:09 -07:00
Sebastian Lyng Johansen
200df01e4b
fix: change default border config to nil (#643)
Neovim 0.11 introduced the winborder option, which serves the same purpose. By defaulting the border to nil, we will use whatever value the user has configured with winborder.

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
2025-10-14 22:30:41 -07:00
XeroOl
07f80ad645
fix: support natural ordering for numbers with >12 digits (#652)
* fix: support natural ordering for numbers with >12 digits

Changes the column ordering code when `view_options.natural_order`
is enabled, so that it can support larger numbers.

The previous 12-digit padding approach breaks for numbers above 12
digits.

This length-prefixed approach can scale to much higher numbers.
I picked %03 (padding 3 digits) because most filesystems don't allow
more than 255 bytes in a path segment, and "255" is 3 digits long.

* add memoization to natural order sorting

* remove call to unpack
2025-08-20 18:22:30 -07:00
Steven Arcangeli
bbad9a76b2 fix: scratch preview method (#628) 2025-07-02 09:18:28 -07:00
jiz4oh
1498d2fccf
fix: ssh adapter supports iso8601 dates (#635)
* fix: add iso8601 format compatibility

* Update sshfs.lua

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
2025-06-30 16:54:22 -07:00
kaerum
08c2bce8b0
fix: glob formatting on windows in neovim nightly (#631)
* fix: makes workaround conditional as it is no longer needed for 0.12

* fix: formatted with proper stylua version
2025-06-04 15:40:16 -07:00
Steven Arcangeli
5b6068aad7 fix: clean up empty buffer when opening in new tab (#616) 2025-06-01 11:02:23 -07:00
Alexandros Alexiou
685cdb4ffa
fix: prevent E565 error when opening directories with nvim . (#608) 2025-04-20 10:35:57 -07:00
Steven Arcangeli
5b38bfe279 doc: fix typecheck errors in nvim 0.11 2025-03-30 21:56:41 -07:00
Steven Arcangeli
ba1f50a9a8 fix: file time column escapes ()[] chars in parser (#603) 2025-03-30 15:14:11 -07:00
Shihua Zeng
ab887d926c
fix: indexing nil when env vars does not exist (#601) 2025-03-20 16:40:24 -07:00
Steve Walker
4c9bdf0d83
feat: copy/paste to system clipboard (#559)
* 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>
2025-03-20 08:19:18 -07:00
Luis Calle
8649818fb2
fix(trash-win): don't hang when shellslash is enabled (#592) 2025-03-19 15:10:58 -07:00
Steven Arcangeli
548587d68b fix: better detection of oil buffers (#589) 2025-03-04 22:12:47 -08:00
skshetry
54fe7dca36
fix: pass bufnr to constrain_cursor (#574)
* pass bufnr to the constrain_cursor

* return early if the oil buffer is not the current buffer

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
2025-03-04 16:44:26 -08:00
Steven Arcangeli
d7c61c7084 fix: silent handling when buffer has no oil adapter (#573) 2025-03-04 12:57:01 -08:00
forestchen1224
7cde5aab10
fix: disable_preview respected when preview_method != "load" (#577)
* 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>
2025-02-13 14:22:54 -08:00
Steven Arcangeli
32dd3e378d feat: most moves and copies will copy the undofile (#583) 2025-02-13 09:40:01 -08:00
Steven Arcangeli
5313690956 fix: more robust parsing of custom column timestamp formats (#582) 2025-02-12 22:12:24 -08:00
Ian Wright
8abc58b038
feat: add support for bufnr in column rendering functions (#575)
This is primarily for user-defined custom columns, which may want access
to the current path or similar information
2025-02-12 16:49:43 -08:00