Commit graph

153 commits

Author SHA1 Message Date
phanium
bbfa7cba85
fix: args.count of 0 is not used as size (#695) 2025-12-27 13:27:37 -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
Steven Arcangeli
7e1cd7703f fix: don't apply oil window options to non-directory oil buffers 2025-10-19 15:39:26 -07:00
John Winston
dfb09e87bf
feat: add callback for handling buffer opening (#638) 2025-10-15 10:03:09 -07:00
Steven Arcangeli
5b6068aad7 fix: clean up empty buffer when opening in new tab (#616) 2025-06-01 11:02:23 -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
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
6f9e1057c5 lint: rename shadowed variable 2025-01-24 16:00:44 -08:00
Steven Arcangeli
57528bf9c5 feat: API to automatically open preview window after opening oil (#339) 2025-01-24 15:16:54 -08:00
Peeranut Pongpakatien
83ac5185f7
fix: open files in correct window from floating oil (#560) 2025-01-23 22:08:06 -08:00
Steven Arcangeli
8615e7da20 cleanup: remove open({preview = true}) shim 2025-01-22 21:17:21 -08:00
Steven Arcangeli
1488f0d96b fix: preview sometimes causes oil buffers to be stuck in unloaded state (#563) 2025-01-22 16:53:10 -08:00
Steven Arcangeli
62c5683c2e lint: fix typecheck errors 2025-01-22 08:54:47 -08:00
David Marchante
c5f7c56644
fix: set alternate when using floating windows (#526) 2024-12-20 23:18:49 -05: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
Ezekiel Warren
60e68967e5
feat: highlight groups for hidden files (#459)
* 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>
2024-11-22 08:55:55 -08:00
Foo-x
740b8fd425
feat: add highlight group for orphaned links (#502)
* feat: add highlight for orphan links

Closes #501

* feat: add OilOrphanLinkTarget highlight group

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-11-22 08:17:50 -08:00
Steven Arcangeli
3fa3161aa9 feat: config option to disable previewing a file 2024-11-21 17:36:40 -08:00
Steven Arcangeli
5acab3d8a9 fix: image.nvim previews with preview_method=scratch 2024-11-21 17:36:22 -08:00
cdmill
81cc9c3f62
feat: option to quite vim if oil is closed as last buffer (#491)
* 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>
2024-11-20 21:06:09 -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
Micah Halter
bbeed86bde
feat: add win_options to preview_win (#514) 2024-11-12 10:38:35 -08:00
Steve Walker
c23fe08e05
feat: disable preview for large files (#511)
* feat: disable preview for large files

fix: update oil.PreviewWindowConfig

* refactor: remove unnecessary shim in config.lua

* refactor: revert changes to shim

---------

Co-authored-by: Steve Walker <65963536+etherswangel@users.noreply.github.com>
Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
2024-11-12 08:24:39 -08:00
Steven Arcangeli
2f5d4353ee doc: improve type annotations for oil.open_preview 2024-11-10 16:07:29 -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
Steven Arcangeli
1fe476daf0 doc: more and better type annotations 2024-08-30 17:50:09 -07:00
sleeptightAnsiC
cc2332599f
feat: allow bufnr optional parameter for get_current_dir function (#440)
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)
2024-07-06 16:24:33 -07:00
icefed
b0a6cf9898
fix: set floating window win_options when buffer changes (#432)
* 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>
2024-07-02 10:03:08 -07:00
Philipp Oeschger
59b3dab6f7
feat: support preview from floating window (#403)
* 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>
2024-06-19 21:23:30 -04:00
Steven Arcangeli
d3a365c950 doc: improve documentation for set_sort (#401) 2024-06-02 17:45:22 -07:00
Steven Arcangeli
15e071f203 ci: typechecking no longer requires neodev 2024-06-01 16:38:11 -07:00
Steven Arcangeli
2cb39e838e doc: more detailed type annotations for setup() call 2024-05-22 13:46:11 -07:00
Steven Arcangeli
259b1fbc84 doc: better type annotations for API methods 2024-05-21 19:39:37 -07:00
Steven Arcangeli
06a19f77f1 fix: error opening command window from oil float (#378) 2024-05-17 12:02:35 -07:00
Steven Arcangeli
27d9f37161 ci: run tests against Neovim v0.10.0 2024-05-16 11:09:15 -07:00
Matthew Wilding
f3a31eba24
fix(windows): navigating into drive letter root directories (#341)
* 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>
2024-04-23 22:06:59 -07:00
Steven Arcangeli
2bc56ad68a fix: error when opening files from floating oil window (#355) 2024-04-21 07:37:54 -07:00
Steven Arcangeli
f41d7e7cd8 fix: support visual mode when preview window is open (#315) 2024-04-19 16:31:42 -04:00
Steven Arcangeli
fa3820ebf1 feat: can restore Oil progress window when minimized 2024-04-19 16:31:42 -04:00
Steven Arcangeli
2bd71dda88 lint: fix typechecking 2024-04-19 10:44:16 -04:00
Steven Arcangeli
6c48ac7dc6 fix: output suppressed when opening files (#348) 2024-04-19 10:40:35 -04:00
Steven Arcangeli
0de8e60e3d fix: correctly reset bufhidden for formerly previewed buffers (#291) 2024-03-12 20:41:23 -07:00
Steven Arcangeli
17d71eb3d8 fix: window options sometimes not set in oil buffer (#287) 2024-03-12 20:06:02 -07:00
Steven Arcangeli
f259347d4d cleanup: remove old unused logic for transferring window variables 2024-03-12 19:37:57 -07:00
Steven Arcangeli
e045ee3b4e fix: spurious exits from faulty :wq detection (#221)
The previous mechanism used histget() to get the last command or
expression to detect if the user issued a `:wq` or similar. This had the
issue where if a user issued a `:wq`, started vim again, then entered
oil and saved via some mechanism that is _not_ a command (e.g. a
keymap), we would incorrectly detect that `:wq` and exit after saving.
The new mechanism tracks all keypresses and may end up with false
negatives (e.g. ":wqaff<backspace><backspace>ll"), but those are less
frustrating than false positives.
2024-03-12 15:57:57 -07:00
Lucas Eras Paiva
132b4ea074
fix: close preview window when leaving oil buffer (#296)
* fix: close preview window when leaving oil buffer

* refactor: try different approach for closing the preview window

* fix: use util.is_oil_bufnr

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
2024-02-22 22:11:32 -08: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
TheLeoP
553b7a0ac1
feat(trash): support for deleting to windows recycle bin (#243)
* feat(windows-trash): support for deleting to windows trash

* feat(windows-trash): add support for view, restore and purge

* fix(windows-trash): undefined path on M.list

* chore(windows-trash): modify comments

* fix(windows-trash): show correct original_path

* fix(windows-trash): add self to powershell_date_grammar

* fix(windows-trash-support): parse deleted date as number

* fix(fs): do not add innecesary \\ on Windows

* feat: extend windows trash adapter

* perf(windows-trash): powershell -> libuv (move, purge and copy)

* fix: don't prompt to save when opening trashed file

* lint: fix luacheck error

* lint: fix luacheck errors

* lint: luacheck error

---------

Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
2024-01-02 22:05:01 -08:00