Commit graph

57 commits

Author SHA1 Message Date
85ec7a407a
feat(icons): add direct nonicons.nvim icon provider
Problem: nonicons.nvim exposes a public get_icon/get_icon_by_filetype
API, but oil.nvim can only use nonicons glyphs indirectly through the
devicons monkey-patch. This couples oil to devicons even when nonicons
is available standalone.

Solution: add a nonicons provider in get_icon_provider() between
mini.icons and devicons. Feature-gated on nonicons.get_icon existing
so old nonicons versions fall through to devicons. Uses OilDirIcon
and OilFileIcon highlight groups.
2026-02-22 21:24:53 -05:00
b0f44d3af6
fix: remove nonicons custom impl
Some checks are pending
luarocks / quality (push) Waiting to run
luarocks / publish (push) Blocked by required conditions
2026-02-22 21:03:56 -05:00
Barrett Ruth
07ae3a8dc3
feat(icons): add nonicons.nvim icon provider support (#30)
* feat(icons): add nonicons.nvim icon provider support

Problem: oil.nvim only recognizes mini.icons and nvim-web-devicons as
icon providers. nonicons.nvim works when paired with devicons (via its
apply() monkey-patch), but has no standalone support.

Solution: add a nonicons.nvim fallback in get_icon_provider(), placed
after devicons so the patched devicons path is preferred when both are
installed. The standalone path handles directories via
nonicons.get('file-directory'), files via filetype/extension lookup with
a generic file icon fallback.

* fix(doc): improve readme phrasing
2026-02-22 20:58:22 -05:00
Barrett Ruth
86f553cd0a
build: replace luacheck with selene, add nix devshell and pre-commit (#20)
* 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.
2026-02-21 23:52:27 -05:00
642f745038
fix: resolve pre-existing LuaLS typecheck warnings
Problem: CI typecheck fails with 13 warnings — 11 need-check-nil in
util.render_text (opts param annotated nil|table but guaranteed non-nil
after tbl_deep_extend), 1 undefined-doc-param in view.render_buffer_async
(annotation says "callback" but param is "caller_callback"), and 1
need-check-nil on opts in the same function.

Solution: add ---@cast opts -nil after the tbl_deep_extend call, fix
the param name in the doc annotation, and add opts = opts or {} guard.
2026-02-20 20:34:59 -05:00
ce64ae18de
feat: add OilFileIcon highlight group for fallback file icons
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
2026-02-20 20:26:08 -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
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
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
bbad9a76b2 fix: scratch preview method (#628) 2025-07-02 09:18:28 -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
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
Steven Arcangeli
548587d68b fix: better detection of oil buffers (#589) 2025-03-04 22:12:47 -08:00
Steven Arcangeli
d7c61c7084 fix: silent handling when buffer has no oil adapter (#573) 2025-03-04 12:57:01 -08:00
Steven Arcangeli
32dd3e378d feat: most moves and copies will copy the undofile (#583) 2025-02-13 09:40:01 -08:00
Anton Janshagen
b594b9a905
feat: can selectively add entries to quickfix (#564)
* bugfix: fix to enable adding or replacing of quickfix entries

* feat: added option to send only matched files to the quickfix list
2025-01-26 09:18:37 -08:00
Steven Arcangeli
81b2c5f04a fix: crash in preview on nvim 0.8 2025-01-24 16:22:21 -08:00
Gustavo Sampaio
78ab7ca107
fix: don't take over the preview window until it's opened for oil (#532) 2024-12-20 23:15:47 -05:00
lucascool12
7a55ede5e7
fix: improper file name escaping (#530) 2024-12-10 08:08:43 -08:00
Steven Arcangeli
5acab3d8a9 fix: image.nvim previews with preview_method=scratch 2024-11-21 17:36:22 -08:00
Jalal El Mansouri
21705a1deb
feat: use scratch buffer for file previews (#467)
* 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>
2024-11-19 17:24:24 -08:00
Steven Arcangeli
4de30256c3 perf: replace vim.endswith and vim.startswith with string.match 2024-11-14 19:29:22 -08:00
Philipp Oeschger
5d2dfae655
feat: config option to customize floating window title (#482)
* 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>
2024-10-15 22:22:31 -04:00
Micah Halter
d5e56574f8
fix: correctly check if mini.icons is actually setup (#441)
This leaves the `pcall` just so (1) we load the plugin if it is lazy
loaded by the user and (2) we get LSP completion/validation with that
type as well.
2024-07-06 16:20:44 -07:00
Micah Halter
a543ea598e
feat: add support for mini.icons (#439) 2024-07-05 15:13:10 -07:00
Steven Arcangeli
b5a1abfde0 fix: cursor sometimes disappears after making changes (#438) 2024-07-03 18:14:52 -07:00
Steven Arcangeli
96f0983e75 fix(windows): file operation preview uses only backslash path separator (#336) 2024-04-23 20:57:22 -07:00
Steven Arcangeli
c86e48407b fix: race condition when entering oil buffer (#321) 2024-04-19 16:31:42 -04:00
Steven Arcangeli
f41d7e7cd8 fix: support visual mode when preview window is open (#315) 2024-04-19 16:31:42 -04:00
Lucas Eras Paiva
bf753c3e3f
feat: do not close preview when switching dirs (#277)
* feat: do not close preview when cd into dir

* refactor: add helper method to run function after oil buffer loads

* Keep preview window open

* Remove some test logic

* Use `run_after_load` when moving to parent directory

* Remove unnecessary update of current window

* refactor: create helper function for updating preview

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-01-21 20:32:02 -08:00
Shihua Zeng
a173b5776c
feat: allow multiple hlgroups inside one column (#240)
* feat: allow multiple hlgroups inside one column

* types: refactor formatting of highlight types

* types: LuaLS can't infer type information from unpack

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
2023-12-07 21:36:52 -08:00
Luka Potočnik
3ffb8309e6
feat: actions for sending oil entries to quickfix (#249)
* Implement actions for sending oil entries to quickfix/location-list

* Use vim.notify instead of vim.notify_once in util quickfix function

* Remove redundant files/directories options for sending to qf

always send just files

* set qflist/loclist with a single call

* Add type annotations and default values for send_to_quickfix

* In visual mode, send only selected items to qf
2023-12-07 21:01:13 -08:00
Steven Arcangeli
6175bd6462
feat: trash support for linux and mac (#165)
* wip: skeleton code for trash adapter

* refactor: split trash implementation for mac and linux

* fix: ensure we create the .Trash/$uid dir

* feat: code complete linux trash implementation

* doc: write up trash features

* feat: code complete mac trash implementation

* cleanup: remove previous, terrible, undocumented trash feature

* fix: always disabled trash

* feat: show original path of trashed files

* doc: add a note about calling actions directly

* fix: bugs in trash implementation

* fix: schedule_wrap in mac trash

* doc: fix typo and line wrapping

* fix: parsing of arguments to :Oil command

* doc: small documentation tweaks

* doc: fix awkward wording in the toggle_trash action

* fix: warning on Windows when delete_to_trash = true

* feat: :Oil --trash can open specific trash directories

* fix: show all trash files in device root

* fix: trash mtime should be sortable

* fix: shorten_path handles optional trailing slash

* refactor: overhaul the UI

* fix: keep trash original path vtext from stacking

* refactor: replace disable_changes with an error filter

* fix: shorten path names in home directory relative to root

* doc: small README format changes

* cleanup: remove unnecessary preserve_undo logic

* test: add a functional test for the freedesktop trash adapter

* test: more functional tests for trash

* fix: schedule a callback to avoid main loop error

* refactor: clean up mutator logic

* doc: some comments and type annotations
2023-11-05 12:40:58 -08:00
Steven Arcangeli
ee813638d2 feat: make gf work in ssh files (#186) 2023-09-30 14:20:28 -07:00
Steven Arcangeli
7aeb239a6a refactor: rename supports_xfer 2023-08-20 21:50:02 +00:00
Steven Arcangeli
8f7807946a fix: remaining type errors 2023-08-13 13:32:35 -07:00
Steven Arcangeli
47c7737618 fix: type annotations and type errors 2023-08-12 20:32:52 -07:00
Steven Arcangeli
a5ff72a8da fix: url-escape paths for scp (#134) 2023-06-30 00:59:08 -07:00
Steven Arcangeli
4a4e0f4013 refactor: small perf win by eliminating string object keys 2023-06-25 22:44:44 -07:00
Andrew Cohen
53dcf6ee49
Escape dollar sign 2023-06-20 11:25:30 -04:00
Steven Arcangeli
6f8bf067c0 fix: stop using vim.wo to set window options
vim.wo also affects the global status of the option. We only want to set
the window-local option.
2023-06-16 18:24:47 -07:00
Steven Arcangeli
d27bfa1f37 refactor: use more modern methods for getting/setting options 2023-05-21 20:40:09 -07:00
Steven Arcangeli
339ade9dc3 fix: escape special characters when editing buffer (#96) 2023-05-05 08:32:44 -07:00
Steven Arcangeli
273c2cecbf feat: can cancel out of progress window 2023-03-29 18:43:56 -07:00
Steven Arcangeli
080dd27474 refactor: clean up duplicate helper method 2023-03-29 18:42:48 -07:00
Steven Arcangeli
b36ba91b7a fix: another case of incorrect alternate buffers (#60) 2023-03-06 00:14:06 -08:00
Steven Arcangeli
2e95b9d424 fix: edge case where opening a file would delete its contents 2023-02-03 13:53:01 -08:00
Steven Arcangeli
716dd8f9cf fix: unexpected behavior from BufReadPost autocmds 2023-01-28 18:07:18 -08:00
Steven Arcangeli
6c6b7673af feat: update preview window when cursor is moved (#42) 2023-01-21 18:46:30 -08:00