Compare commits

...
Sign in to create a new pull request.

9 commits

Author SHA1 Message Date
50f1ade92c
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.
2026-02-21 23:26:39 -05:00
364b787578
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.
2026-02-21 23:25:42 -05:00
Barrett Ruth
0f8b084e4a
Docs/centralize helpdoc (#18)
* feat: support vim.g.oil declarative configuration

Problem: oil.nvim requires an imperative require("oil").setup(opts)
call to initialize. The Neovim ecosystem is moving toward vim.g.plugin
as a declarative config source that works without explicit setup calls.

Solution: fall back to vim.g.oil in config.setup() when no opts are
passed, and add plugin/oil.lua to auto-initialize when vim.g.oil is
set. Explicit setup(opts) calls still take precedence. Update docs
and add tests for the new resolution order.

Closes: barrettruth/oil.nvim#1

* doc: minor phrasing "improvements"

* fix(doc): restore Q/A format in FAQ and close lua block
2026-02-21 23:10:59 -05:00
Barrett Ruth
856716e6dc
feat: support vim.g.oil configuration + remove release-please (#17)
* feat: support vim.g.oil declarative configuration

Problem: oil.nvim requires an imperative require("oil").setup(opts)
call to initialize. The Neovim ecosystem is moving toward vim.g.plugin
as a declarative config source that works without explicit setup calls.

Solution: fall back to vim.g.oil in config.setup() when no opts are
passed, and add plugin/oil.lua to auto-initialize when vim.g.oil is
set. Explicit setup(opts) calls still take precedence. Update docs
and add tests for the new resolution order.

Closes: barrettruth/oil.nvim#1

* build: remove release-please pipeline

Problem: the release-please action creates automated releases that
are not needed for this fork's workflow.

Solution: remove the release job from tests.yml and the
release-please branch exclusion from the review request workflow.

* fix(doc): improve readme phrasing

* doc: minor phrasing "improvements"

* ci: add luarocks release on tag push

Problem: there is no automated way to publish oil.nvim to luarocks
when a new version is tagged.

Solution: add a luarocks workflow that triggers on v* tag pushes,
runs the test suite via workflow_call, then publishes via
luarocks-tag-release. Add workflow_call trigger to tests.yml so it
can be reused.
2026-02-21 22:38:38 -05:00
Barrett Ruth
3b930636e3
docs: centralize documentation into helpdoc (#15)
* docs: centralize documentation into helpdoc

Problem: documentation was spread across four files (README.md,
doc/oil.txt, doc/api.md, doc/recipes.md) with duplication and gaps.
User events were undocumented, and adapter docs only lived in the
README.

Solution: expand doc/oil.txt with five new sections (introduction,
requirements, adapters, recipes, events) from existing content. Trim
README to a landing page pointing to :help oil. Delete doc/api.md
and doc/recipes.md since their content now lives in the helpdoc.

Closes: barrettruth/oil.nvim#6

* build: remove docgen pipeline

Problem: the Python docgen pipeline (scripts/generate.py,
scripts/main.py, nvim_doc_tools) was designed for upstream's doc
layout and is incompatible with the centralized helpdoc structure.
It overwrites doc/oil.txt entirely and expects sections in README.md
that no longer exist.

Solution: delete the pipeline scripts (generate.py, main.py,
requirements.txt), remove the update_docs CI job, and clean up the
Makefile and .gitignore references. Linting and typechecking remain
unchanged.
2026-02-21 22:15:53 -05:00
Barrett Ruth
1712b6feb3
docs: upstream tracking in README + daily PR mirror (#13)
* docs: replace changelog with upstream divergence table in README

Problem: fork changes were not documented anywhere user-facing. The
auto-generated CHANGELOG.md tracked upstream releases, not fork
divergence.

Solution: delete CHANGELOG.md and add a collapsed <details> block to
README.md with two tables — cherry-picked PRs (by number, with commit
hashes) and triaged upstream issues (by number, with status and
resolution). This gives users a single place to see what the fork
offers over upstream.

* ci: add daily upstream PR mirror workflow

Problem: new upstream PRs required manual monitoring of
stevearc/oil.nvim to discover.

Solution: add a GitHub Actions workflow that runs daily at 08:00 UTC
and creates issues in the fork for any upstream PRs opened in the last
24 hours. Skips dependabot PRs and deduplicates by title prefix.
Issues are labeled upstream/pr for easy filtering.
2026-02-21 15:53:53 -05:00
Barrett Ruth
fe16993262
fix(preview): prevent preview from re-initializing modified oil buffers (#12)
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
2026-02-21 02:43:59 -05:00
Barrett Ruth
70861e5896
fix: hijack all directory buffers at setup, not just current (#11)
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
2026-02-21 02:22:49 -05:00
Barrett Ruth
01b860ed5c
fix: set buftype before BufEnter fires on oil buffers (#10)
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
2026-02-21 02:22:38 -05:00
24 changed files with 713 additions and 1970 deletions

4
.envrc
View file

@ -1,3 +1 @@
export VIRTUAL_ENV=venv
layout python
python -c 'import pyparsing' 2>/dev/null || pip install -r scripts/requirements.txt
use flake

View file

@ -4,8 +4,6 @@ permissions:
on:
pull_request_target:
types: [opened, reopened, ready_for_review, synchronize]
branches-ignore:
- "release-please--**"
jobs:
# Request review automatically when PRs are opened

21
.github/workflows/luarocks.yaml vendored Normal file
View file

@ -0,0 +1,21 @@
name: luarocks
on:
push:
tags:
- 'v*'
jobs:
quality:
uses: ./.github/workflows/tests.yml
publish:
needs: quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nvim-neorocks/luarocks-tag-release@v7
env:
LUAROCKS_API_KEY: ${{ secrets.LUAROCKS_API_KEY }}

View file

@ -0,0 +1,85 @@
name: Mirror Upstream PRs
on:
schedule:
- cron: "0 8 * * *"
workflow_dispatch:
permissions:
issues: write
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Mirror new upstream PRs
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const upstream = { owner: 'stevearc', repo: 'oil.nvim' };
const fork = { owner: 'barrettruth', repo: 'oil.nvim' };
const since = new Date();
since.setDate(since.getDate() - 1);
const sinceISO = since.toISOString();
const { data: prs } = await github.rest.pulls.list({
...upstream,
state: 'open',
sort: 'created',
direction: 'desc',
per_page: 30,
});
const recentPRs = prs.filter(pr => {
if (new Date(pr.created_at) < since) return false;
if (pr.user.login === 'dependabot[bot]') return false;
if (pr.user.login === 'dependabot-preview[bot]') return false;
return true;
});
if (recentPRs.length === 0) {
console.log('No new upstream PRs in the last 24 hours.');
return;
}
const { data: existingIssues } = await github.rest.issues.listForRepo({
...fork,
state: 'all',
labels: 'upstream/pr',
per_page: 100,
});
const mirroredNumbers = new Set();
for (const issue of existingIssues) {
const match = issue.title.match(/^upstream#(\d+)/);
if (match) mirroredNumbers.add(parseInt(match[1]));
}
for (const pr of recentPRs) {
if (mirroredNumbers.has(pr.number)) {
console.log(`Skipping PR #${pr.number} — already mirrored.`);
continue;
}
const labels = pr.labels.map(l => l.name).join(', ') || 'none';
await github.rest.issues.create({
...fork,
title: `upstream#${pr.number}: ${pr.title}`,
body: [
`Mirrored from [stevearc/oil.nvim#${pr.number}](${pr.html_url}).`,
'',
`**Author:** @${pr.user.login}`,
`**Labels:** ${labels}`,
`**Created:** ${pr.created_at}`,
'',
'---',
'',
pr.body || '*No description provided.*',
].join('\n'),
labels: ['upstream/pr'],
});
console.log(`Created issue for upstream PR #${pr.number}: ${pr.title}`);
}

View file

@ -1,6 +1,7 @@
name: Tests
on:
workflow_call:
push:
branches:
- main
@ -9,21 +10,14 @@ on:
- main
jobs:
luacheck:
name: Luacheck
selene:
name: Selene
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Prepare
run: |
sudo apt-get update
sudo add-apt-repository universe
sudo apt install luarocks -y
sudo luarocks install luacheck
- name: Run Luacheck
run: luacheck lua tests
- uses: NTBBloodbath/selene-action@v1.0.0
with:
args: --display-style quiet .
stylua:
name: StyLua
@ -69,46 +63,3 @@ jobs:
- name: Run tests
run: |
bash ./run_tests.sh
update_docs:
name: Update docs
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Neovim and dependencies
run: |
bash ./.github/workflows/install_nvim.sh
- name: Update docs
run: |
python -m pip install pyparsing==3.0.9
make doc
- name: Check docs are up to date
run: |
git diff --exit-code README.md doc
release:
name: release
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- luacheck
- stylua
- typecheck
- run_tests
- update_docs
runs-on: ubuntu-22.04
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
release-type: simple
- uses: actions/checkout@v4
- uses: rickstaa/action-create-tag@v1
if: ${{ steps.release.outputs.release_created }}
with:
tag: stable
message: "Current stable release: ${{ steps.release.outputs.tag_name }}"
tag_exists_error: false
force_push_tag: true

5
.gitignore vendored
View file

@ -6,9 +6,6 @@ luac.out
*.zip
*.tar.gz
# python bytecode
__pycache__
# Object files
*.o
*.os
@ -44,9 +41,7 @@ __pycache__
.direnv/
.testenv/
venv/
doc/tags
scripts/nvim_doc_tools
scripts/nvim-typecheck-action
scripts/benchmark.nvim
perf/tmp/

View file

@ -1,19 +0,0 @@
max_comment_line_length = false
codes = true
exclude_files = {
"tests/treesitter",
}
ignore = {
"212", -- Unused argument
"631", -- Line is too long
"122", -- Setting a readonly global
"542", -- Empty if branch
}
read_globals = {
"vim",
"a",
"assert",
}

17
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,17 @@
minimum_pre_commit_version: '3.5.0'
repos:
- repo: https://github.com/JohnnyMorganz/StyLua
rev: v2.3.1
hooks:
- id: stylua-github
name: stylua (Lua formatter)
files: \.lua$
pass_filenames: true
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
name: prettier
files: \.(md|toml|yaml|yml|sh)$

View file

@ -1,530 +0,0 @@
# Changelog
## [2.15.0](https://github.com/stevearc/oil.nvim/compare/v2.14.0...v2.15.0) (2025-02-13)
### Features
* add support for bufnr in column rendering functions ([#575](https://github.com/stevearc/oil.nvim/issues/575)) ([8abc58b](https://github.com/stevearc/oil.nvim/commit/8abc58b038f84078121ab1cac6ecad0163fe1635))
* API to automatically open preview window after opening oil ([#339](https://github.com/stevearc/oil.nvim/issues/339)) ([57528bf](https://github.com/stevearc/oil.nvim/commit/57528bf9c58080ca891e8d362d0a578895c136ce))
* can selectively add entries to quickfix ([#564](https://github.com/stevearc/oil.nvim/issues/564)) ([b594b9a](https://github.com/stevearc/oil.nvim/commit/b594b9a9052618669ccf6520b2d0c0d942eb8118))
* floating window max width/height can be percentages ([#553](https://github.com/stevearc/oil.nvim/issues/553)) ([1df90fa](https://github.com/stevearc/oil.nvim/commit/1df90faf927e78f5aacf278abd0bfdcb5f45e825))
* most moves and copies will copy the undofile ([#583](https://github.com/stevearc/oil.nvim/issues/583)) ([32dd3e3](https://github.com/stevearc/oil.nvim/commit/32dd3e378d47673679e76a773451f82f971a66df))
* pass oil bufnr to custom filename highlight function ([#552](https://github.com/stevearc/oil.nvim/issues/552)) ([f5c563a](https://github.com/stevearc/oil.nvim/commit/f5c563a074a38cee5a09f98e98b74dcd2c322490))
### Bug Fixes
* crash in preview on nvim 0.8 ([81b2c5f](https://github.com/stevearc/oil.nvim/commit/81b2c5f04ae24a8c83b20ecbd017fecac15faca0))
* directory rendering with custom highlights ([#551](https://github.com/stevearc/oil.nvim/issues/551)) ([a6a4f48](https://github.com/stevearc/oil.nvim/commit/a6a4f48b14b4a51fded531c86f6c04b4503a2ef8))
* disable_preview respected when preview_method != "load" ([#577](https://github.com/stevearc/oil.nvim/issues/577)) ([7cde5aa](https://github.com/stevearc/oil.nvim/commit/7cde5aab10f564408e9ac349d457d755422d58cd))
* error when non-current oil buffer has validation errors ([#561](https://github.com/stevearc/oil.nvim/issues/561)) ([8d11a2a](https://github.com/stevearc/oil.nvim/commit/8d11a2abf3039b1974d4acd65fbc83ada2ca1084))
* gracefully handle fs_stat failures ([#558](https://github.com/stevearc/oil.nvim/issues/558)) ([7c26a59](https://github.com/stevearc/oil.nvim/commit/7c26a59ac0061b199bf9f44b19d45cfadd9b14f5))
* guard against nil metadata values ([#548](https://github.com/stevearc/oil.nvim/issues/548)) ([254bc66](https://github.com/stevearc/oil.nvim/commit/254bc6635cb3f77e6e9a89155652f368e5535160))
* more consistent cursor position when entering a new directory ([#536](https://github.com/stevearc/oil.nvim/issues/536)) ([c80fa5c](https://github.com/stevearc/oil.nvim/commit/c80fa5c415b882c1c694a32748cea09b7dafc2c5))
* more robust parsing of custom column timestamp formats ([#582](https://github.com/stevearc/oil.nvim/issues/582)) ([5313690](https://github.com/stevearc/oil.nvim/commit/5313690956d27cc6b53d5a2583df05e717c59b16))
* open files in correct window from floating oil ([#560](https://github.com/stevearc/oil.nvim/issues/560)) ([83ac518](https://github.com/stevearc/oil.nvim/commit/83ac5185f79ab8d869bccea792dc516ad02ad06e))
* preview sometimes causes oil buffers to be stuck in unloaded state ([#563](https://github.com/stevearc/oil.nvim/issues/563)) ([1488f0d](https://github.com/stevearc/oil.nvim/commit/1488f0d96b1cb820dd12f05a7bf5283a631a7c4d))
* stat files if fs_readdir doesn't provide a type ([#543](https://github.com/stevearc/oil.nvim/issues/543)) ([c6a39a6](https://github.com/stevearc/oil.nvim/commit/c6a39a69b2df7c10466f150dde0bd23e49c1fba3))
* support permissions checks on windows and virtual filesystems ([#555](https://github.com/stevearc/oil.nvim/issues/555)) ([7041528](https://github.com/stevearc/oil.nvim/commit/7041528bdedb350ad66e650684deec8456e053cc))
* work around incorrect link detection on windows ([#557](https://github.com/stevearc/oil.nvim/issues/557)) ([09fa1d2](https://github.com/stevearc/oil.nvim/commit/09fa1d22f5edf0730824d2b222d726c8c81bbdc9))
## [2.14.0](https://github.com/stevearc/oil.nvim/compare/v2.13.0...v2.14.0) (2024-12-21)
### Features
* add `win_options` to `preview_win` ([#514](https://github.com/stevearc/oil.nvim/issues/514)) ([bbeed86](https://github.com/stevearc/oil.nvim/commit/bbeed86bde134da8d09bed64b6aa0d65642e6b23))
* add highlight group for orphaned links ([#502](https://github.com/stevearc/oil.nvim/issues/502)) ([740b8fd](https://github.com/stevearc/oil.nvim/commit/740b8fd425a2b77f7f40eb5ac155ebe66ff9515c))
* better merging of action desc when overriding keymaps ([f2b3249](https://github.com/stevearc/oil.nvim/commit/f2b324933f4d505cff6f7d445fd61fad02dcd9ae))
* config option to customize filename highlight group ([#508](https://github.com/stevearc/oil.nvim/issues/508)) ([99ce32f](https://github.com/stevearc/oil.nvim/commit/99ce32f4a2ecf76263b72fcc31efb163faa1a941))
* config option to disable previewing a file ([3fa3161](https://github.com/stevearc/oil.nvim/commit/3fa3161aa9515ff6a7cf7e44458b6a2114262870))
* disable preview for large files ([#511](https://github.com/stevearc/oil.nvim/issues/511)) ([c23fe08](https://github.com/stevearc/oil.nvim/commit/c23fe08e0546d9efc242e19f0d829efa7e7b2743))
* highlight groups for hidden files ([#459](https://github.com/stevearc/oil.nvim/issues/459)) ([60e6896](https://github.com/stevearc/oil.nvim/commit/60e68967e51ff1ecd264c29e3de0d52bfff22df3))
* option to quite vim if oil is closed as last buffer ([#491](https://github.com/stevearc/oil.nvim/issues/491)) ([81cc9c3](https://github.com/stevearc/oil.nvim/commit/81cc9c3f62ddbef3687931d119e505643496fa0a))
* use scratch buffer for file previews ([#467](https://github.com/stevearc/oil.nvim/issues/467)) ([21705a1](https://github.com/stevearc/oil.nvim/commit/21705a1debe6d85a53c138ab944484b685432b2b))
### Bug Fixes
* cursor sometimes does not hover previous file ([8ea40b5](https://github.com/stevearc/oil.nvim/commit/8ea40b5506115b6d355e304dd9ee5089f7d78601))
* don't take over the preview window until it's opened for oil ([#532](https://github.com/stevearc/oil.nvim/issues/532)) ([78ab7ca](https://github.com/stevearc/oil.nvim/commit/78ab7ca1073731ebdf82efa474202defa028d5a4))
* handle files with newlines in the name ([#534](https://github.com/stevearc/oil.nvim/issues/534)) ([dba0375](https://github.com/stevearc/oil.nvim/commit/dba037598843973b8c54bc5ce0318db4a0da439d))
* image.nvim previews with preview_method=scratch ([5acab3d](https://github.com/stevearc/oil.nvim/commit/5acab3d8a9bc85a571688db432f2702dd7d901a4))
* improper file name escaping ([#530](https://github.com/stevearc/oil.nvim/issues/530)) ([7a55ede](https://github.com/stevearc/oil.nvim/commit/7a55ede5e745e31ea8e4cb5483221524922294bf))
* set alternate when using floating windows ([#526](https://github.com/stevearc/oil.nvim/issues/526)) ([c5f7c56](https://github.com/stevearc/oil.nvim/commit/c5f7c56644425e2b77e71904da98cda0331b3342))
* work around performance issue with treesitter, folds, and large directories ([da93d55](https://github.com/stevearc/oil.nvim/commit/da93d55e32d73a17c447067d168d80290ae96590))
### Performance Improvements
* change default view_options.natural_order behavior to disable on large directories ([01b0b9d](https://github.com/stevearc/oil.nvim/commit/01b0b9d8ef79b7b631e92f6b5fed1c639262d570))
* only sort entries after we have them all ([792f0db](https://github.com/stevearc/oil.nvim/commit/792f0db6ba8b626b14bc127e1ce7247185b3be91))
* optimize rendering cadence ([c96f93d](https://github.com/stevearc/oil.nvim/commit/c96f93d894cc97e76b0871bec4058530eee8ece4))
* replace vim.endswith and vim.startswith with string.match ([4de3025](https://github.com/stevearc/oil.nvim/commit/4de30256c32cd272482bc6df0c6de78ffc389153))
## [2.13.0](https://github.com/stevearc/oil.nvim/compare/v2.12.2...v2.13.0) (2024-11-11)
### Features
* config option to customize floating window title ([#482](https://github.com/stevearc/oil.nvim/issues/482)) ([5d2dfae](https://github.com/stevearc/oil.nvim/commit/5d2dfae655b9b689bd4017b3bdccd52cbee5b92f))
* config option to disable lsp file methods ([#477](https://github.com/stevearc/oil.nvim/issues/477)) ([f60bb7f](https://github.com/stevearc/oil.nvim/commit/f60bb7f793477d99ef1acf39e920bf2ca4e644de))
### Bug Fixes
* actions.preview accepts options ([#497](https://github.com/stevearc/oil.nvim/issues/497)) ([cca1631](https://github.com/stevearc/oil.nvim/commit/cca1631d5ea450c09ba72f3951a9e28105a3632c))
* add trailing slash to directories on yank_entry ([#504](https://github.com/stevearc/oil.nvim/issues/504)) ([42333bb](https://github.com/stevearc/oil.nvim/commit/42333bb46e34dd47e13927010b1dcd30e6e4ca96))
* don't deep merge keymaps ([#510](https://github.com/stevearc/oil.nvim/issues/510)) ([709403c](https://github.com/stevearc/oil.nvim/commit/709403ccd6f22d859c2e42c780ab558ae89284d9))
* guard against nil keymaps ([621f8ba](https://github.com/stevearc/oil.nvim/commit/621f8ba4fa821724e9b646732a26fb2e795fe008))
* only map ~ for normal mode ([#484](https://github.com/stevearc/oil.nvim/issues/484)) ([ccab9d5](https://github.com/stevearc/oil.nvim/commit/ccab9d5e09e2d0042fbbe5b6bd05e82426247067))
* sort keymap help entries by description ([#506](https://github.com/stevearc/oil.nvim/issues/506)) ([52cc8a1](https://github.com/stevearc/oil.nvim/commit/52cc8a1fb35ea6ce1df536143add7ce7215c63c0)), closes [#376](https://github.com/stevearc/oil.nvim/issues/376)
## [2.12.2](https://github.com/stevearc/oil.nvim/compare/v2.12.1...v2.12.2) (2024-09-10)
### Bug Fixes
* ensure win_options are being set on correct window ([#469](https://github.com/stevearc/oil.nvim/issues/469)) ([30e0438](https://github.com/stevearc/oil.nvim/commit/30e0438ff08f197d7ce4a417445ab97ee72efe2d))
* wrap git rm callback in schedule_wrap ([#475](https://github.com/stevearc/oil.nvim/issues/475)) ([b053744](https://github.com/stevearc/oil.nvim/commit/b05374428e5136d9b6c8e1e8e62a75f82283b1f8))
### Performance Improvements
* **view:** avoid running `is_hidden_file` when `show_hidden` is set ([#471](https://github.com/stevearc/oil.nvim/issues/471)) ([0fcd126](https://github.com/stevearc/oil.nvim/commit/0fcd1263a2e8b6200e2b9fd4ab83d40ed8899c54))
## [2.12.1](https://github.com/stevearc/oil.nvim/compare/v2.12.0...v2.12.1) (2024-08-26)
### Bug Fixes
* gracefully handle trashing file that does not exist ([70337eb](https://github.com/stevearc/oil.nvim/commit/70337eb77f53cbff0b7f54f403d5b2b0a9430935))
* process deletes in dir before moving dir ([349bca8](https://github.com/stevearc/oil.nvim/commit/349bca8c3eae4ab78629ed63ee55cc3458a367c0))
## [2.12.0](https://github.com/stevearc/oil.nvim/compare/v2.11.0...v2.12.0) (2024-08-17)
### Features
* add support for `mini.icons` ([#439](https://github.com/stevearc/oil.nvim/issues/439)) ([a543ea5](https://github.com/stevearc/oil.nvim/commit/a543ea598eaef3363fe253e0e11837c1404eb04d))
* allow bufnr optional parameter for get_current_dir function ([#440](https://github.com/stevearc/oil.nvim/issues/440)) ([cc23325](https://github.com/stevearc/oil.nvim/commit/cc2332599f8944076fba29ff7960729b3fcdd71b))
* disable cursor in preview window ([#433](https://github.com/stevearc/oil.nvim/issues/433)) ([b15e4c1](https://github.com/stevearc/oil.nvim/commit/b15e4c1e647b9ddbb75a31caeb720b3b3ce4db54))
### Bug Fixes
* add compatibility for Lua 5.1 ([#456](https://github.com/stevearc/oil.nvim/issues/456)) ([b39a789](https://github.com/stevearc/oil.nvim/commit/b39a78959f3f69e9c1bf43c2634bbddf0af51c3e))
* correctly check if `mini.icons` is actually setup ([#441](https://github.com/stevearc/oil.nvim/issues/441)) ([d5e5657](https://github.com/stevearc/oil.nvim/commit/d5e56574f896120b78cdf56dc1132e76057f8877))
* cursor sometimes disappears after making changes ([#438](https://github.com/stevearc/oil.nvim/issues/438)) ([b5a1abf](https://github.com/stevearc/oil.nvim/commit/b5a1abfde00eead6814cae3321e4c90ff98cfff1))
* Force standard C locale when getting `ls` input for parsing in SSH ([#455](https://github.com/stevearc/oil.nvim/issues/455)) ([71c972f](https://github.com/stevearc/oil.nvim/commit/71c972fbd218723a3c15afcb70421f67340f5a6d))
* handle rare case where file watcher outlives buffer ([fcca212](https://github.com/stevearc/oil.nvim/commit/fcca212c2e966fc3dec1d4baf888e670631d25d1))
* Handle users and groups with spaces over SSH ([#448](https://github.com/stevearc/oil.nvim/issues/448)) ([a6cea1a](https://github.com/stevearc/oil.nvim/commit/a6cea1a5b9bc9351769fe09a547c62fe4b669abd))
* set floating window win_options when buffer changes ([#432](https://github.com/stevearc/oil.nvim/issues/432)) ([b0a6cf9](https://github.com/stevearc/oil.nvim/commit/b0a6cf98982cdcf82b19b0029b734bbbcd24bcc4))
## [2.11.0](https://github.com/stevearc/oil.nvim/compare/v2.10.0...v2.11.0) (2024-07-01)
### Features
* case insensitive sorting ([#429](https://github.com/stevearc/oil.nvim/issues/429)) ([2077cc3](https://github.com/stevearc/oil.nvim/commit/2077cc3358f327aca16c376cdde6ea0b07f14449))
* rename experimental_watch_for_changes -&gt; watch_for_changes ([c7c7ce5](https://github.com/stevearc/oil.nvim/commit/c7c7ce5bd47030ee9c60a859f25695647610b8bd))
* support preview from floating window ([#403](https://github.com/stevearc/oil.nvim/issues/403)) ([59b3dab](https://github.com/stevearc/oil.nvim/commit/59b3dab6f79e147a0d694ee72c26ae883d323340))
### Bug Fixes
* bug in buffer rendering race condition handling ([f6df58a](https://github.com/stevearc/oil.nvim/commit/f6df58ad370f45dbc18c42ffbaefbcf27df14036))
* correctly check group permissions in unix ([#428](https://github.com/stevearc/oil.nvim/issues/428)) ([65c53db](https://github.com/stevearc/oil.nvim/commit/65c53dbe4f2140236590a7568a5f22a77d16be39))
* increase loading display delay to avoid flicker ([#424](https://github.com/stevearc/oil.nvim/issues/424)) ([4c574cf](https://github.com/stevearc/oil.nvim/commit/4c574cf4a2de736d2662d52ce086d8bdf87c49df))
## [2.10.0](https://github.com/stevearc/oil.nvim/compare/v2.9.0...v2.10.0) (2024-06-16)
### Features
* add copy filename action ([#391](https://github.com/stevearc/oil.nvim/issues/391)) ([bbc0e67](https://github.com/stevearc/oil.nvim/commit/bbc0e67eebc15342e73b146a50d9b52e6148161b))
* keymap actions can be parameterized ([96368e1](https://github.com/stevearc/oil.nvim/commit/96368e13e9b1aaacc570e4825b8787307f0d05e1))
### Bug Fixes
* change unknown action name from error to notification ([e5eb20e](https://github.com/stevearc/oil.nvim/commit/e5eb20e88fc03bf89f371032de77f176158b41d3))
* error opening command window from oil float ([#378](https://github.com/stevearc/oil.nvim/issues/378)) ([06a19f7](https://github.com/stevearc/oil.nvim/commit/06a19f77f1a1da37b675635e6f9c5b5d50bcaacd))
* hack around glob issues in LSP rename operations ([#386](https://github.com/stevearc/oil.nvim/issues/386)) ([e5312c3](https://github.com/stevearc/oil.nvim/commit/e5312c3a801e7274fa14e6a56aa10a618fed80c3))
* incorrect default config actions ([#414](https://github.com/stevearc/oil.nvim/issues/414)) ([c82b26e](https://github.com/stevearc/oil.nvim/commit/c82b26eb4ba35c0eb7ec38d88dd400597fb34883))
* notify when changing the current directory ([#406](https://github.com/stevearc/oil.nvim/issues/406)) ([18272ab](https://github.com/stevearc/oil.nvim/commit/18272aba9d00a3176a5443d50dbb4464acc167bd))
* throw error on vim.has call within the lsp/workspace.lua ([#411](https://github.com/stevearc/oil.nvim/issues/411)) ([61f1967](https://github.com/stevearc/oil.nvim/commit/61f1967222365474c6cf7953c569cc94dbcc7acd))
* vim.notify call error ([76bfc25](https://github.com/stevearc/oil.nvim/commit/76bfc25520e4edc98d089d023b4ed06013639849))
## [2.9.0](https://github.com/stevearc/oil.nvim/compare/v2.8.0...v2.9.0) (2024-05-16)
### Features
* can restore Oil progress window when minimized ([fa3820e](https://github.com/stevearc/oil.nvim/commit/fa3820ebf1e8ccf5c7c0f3626d499b2c1aa8bc50))
* experimental support for git operations ([#290](https://github.com/stevearc/oil.nvim/issues/290)) ([1f05774](https://github.com/stevearc/oil.nvim/commit/1f05774e1c2dbc1940104b5c950d5c7b65ec6e0b))
### Bug Fixes
* duplicate create actions ([#334](https://github.com/stevearc/oil.nvim/issues/334)) ([354c530](https://github.com/stevearc/oil.nvim/commit/354c53080a6d7f4f0b2f0cc12e53bede2480b9e5))
* error when opening files from floating oil window ([#355](https://github.com/stevearc/oil.nvim/issues/355)) ([2bc56ad](https://github.com/stevearc/oil.nvim/commit/2bc56ad68afd092af1b2e77dd5d61e156938564c))
* git mv errors when moving empty directory ([#358](https://github.com/stevearc/oil.nvim/issues/358)) ([6a7a10b](https://github.com/stevearc/oil.nvim/commit/6a7a10b6117aface6a25b54906140ad4f7fdabfc))
* gracefully handle new dirs with trailing backslash on windows ([#336](https://github.com/stevearc/oil.nvim/issues/336)) ([be0a1ec](https://github.com/stevearc/oil.nvim/commit/be0a1ecbf0541692a1b9b6e8ea15f5f57db8747a))
* icon column highlight parameter ([#366](https://github.com/stevearc/oil.nvim/issues/366)) ([752563c](https://github.com/stevearc/oil.nvim/commit/752563c59d64a5764cc0743d4fa0aac9ae4a2640))
* race condition when entering oil buffer ([#321](https://github.com/stevearc/oil.nvim/issues/321)) ([c86e484](https://github.com/stevearc/oil.nvim/commit/c86e48407b8a45f9aa8acb2b4512b384ea1eec84))
* **ssh:** bad argument when editing files over ssh ([#370](https://github.com/stevearc/oil.nvim/issues/370)) ([aa0c00c](https://github.com/stevearc/oil.nvim/commit/aa0c00c7fd51982ac476d165cd021f348cf5ea71))
* **ssh:** config option to pass extra args to SCP ([#340](https://github.com/stevearc/oil.nvim/issues/340)) ([3abb607](https://github.com/stevearc/oil.nvim/commit/3abb6077d7d6b09f5eb794b8764223b3027f6807))
* **ssh:** garbled output when directory has broken symlinks ([bcfc0a2](https://github.com/stevearc/oil.nvim/commit/bcfc0a2e01def5019aa14fac2fc6de20dedb6d3d))
* support visual mode when preview window is open ([#315](https://github.com/stevearc/oil.nvim/issues/315)) ([f41d7e7](https://github.com/stevearc/oil.nvim/commit/f41d7e7cd8e4028b03c35d847b4396790ac8bb2d))
* **windows:** convert posix paths before matching LSP watch globs ([#374](https://github.com/stevearc/oil.nvim/issues/374)) ([f630887](https://github.com/stevearc/oil.nvim/commit/f630887cd845a7341bc16488fe8aaecffe3aaa8a))
* **windows:** file operation preview uses only backslash path separator ([#336](https://github.com/stevearc/oil.nvim/issues/336)) ([96f0983](https://github.com/stevearc/oil.nvim/commit/96f0983e754694e592d4313f583cd31eaebfa80d))
* **windows:** navigating into drive letter root directories ([#341](https://github.com/stevearc/oil.nvim/issues/341)) ([f3a31eb](https://github.com/stevearc/oil.nvim/commit/f3a31eba24587bc038592103d8f7e64648292115))
* **windows:** treat both backslash and frontslash as path separators ([#336](https://github.com/stevearc/oil.nvim/issues/336)) ([3b3a6b2](https://github.com/stevearc/oil.nvim/commit/3b3a6b23a120e69ddc980c9d32840ecd521fbff9))
## [2.8.0](https://github.com/stevearc/oil.nvim/compare/v2.7.0...v2.8.0) (2024-04-19)
### Features
* add user autocmds before and after performing actions ([#310](https://github.com/stevearc/oil.nvim/issues/310)) ([e462a34](https://github.com/stevearc/oil.nvim/commit/e462a3446505185adf063566f5007771b69027a1))
### Bug Fixes
* output suppressed when opening files ([#348](https://github.com/stevearc/oil.nvim/issues/348)) ([6c48ac7](https://github.com/stevearc/oil.nvim/commit/6c48ac7dc679c5694a2c0375a5e67773e31d8157))
* **ssh:** escape all file paths for the ssh adapter ([#353](https://github.com/stevearc/oil.nvim/issues/353)) ([8bb35eb](https://github.com/stevearc/oil.nvim/commit/8bb35eb81a48f14c4a1ef480c2bbb87ceb7cd8bb))
## [2.7.0](https://github.com/stevearc/oil.nvim/compare/v2.6.1...v2.7.0) (2024-03-13)
### Features
* add ability to alter lsp file operation timeout ([#317](https://github.com/stevearc/oil.nvim/issues/317)) ([29a06fc](https://github.com/stevearc/oil.nvim/commit/29a06fcc906f57894c1bc768219ba590e03d1121))
* add border config for SSH and keymaps help window ([#299](https://github.com/stevearc/oil.nvim/issues/299)) ([e27cc4e](https://github.com/stevearc/oil.nvim/commit/e27cc4e13812f96c0851de67015030a823cc0fbd))
* do not close preview when switching dirs ([#277](https://github.com/stevearc/oil.nvim/issues/277)) ([bf753c3](https://github.com/stevearc/oil.nvim/commit/bf753c3e3f8736939ad5597f92329dfe7b1df4f5))
* experimental option to watch directory for changes ([#292](https://github.com/stevearc/oil.nvim/issues/292)) ([bcfe7d1](https://github.com/stevearc/oil.nvim/commit/bcfe7d1ec5bbf41dd78726f579a363028d208c1a))
* use natural sort order by default ([#328](https://github.com/stevearc/oil.nvim/issues/328)) ([71b076b](https://github.com/stevearc/oil.nvim/commit/71b076b3afb40663222564c74162db555aeee62d))
### Bug Fixes
* actions.open_external uses explorer.exe in WSL ([#273](https://github.com/stevearc/oil.nvim/issues/273)) ([6953c2c](https://github.com/stevearc/oil.nvim/commit/6953c2c17d8ae7454b28c44c8767eebede312e6f))
* close preview window when leaving oil buffer ([#296](https://github.com/stevearc/oil.nvim/issues/296)) ([132b4ea](https://github.com/stevearc/oil.nvim/commit/132b4ea0740c417b9d717411cab4cf187e1fd095))
* correctly reset bufhidden for formerly previewed buffers ([#291](https://github.com/stevearc/oil.nvim/issues/291)) ([0de8e60](https://github.com/stevearc/oil.nvim/commit/0de8e60e3d8d3d1ff9378526b4722f1ea326e1cb))
* potential leak in experimental file watcher ([c437f3c](https://github.com/stevearc/oil.nvim/commit/c437f3c5b0da0a9cc6a222d87212cce11b80ba75))
* spurious exits from faulty :wq detection ([#221](https://github.com/stevearc/oil.nvim/issues/221)) ([e045ee3](https://github.com/stevearc/oil.nvim/commit/e045ee3b4e06cafd7a6a2acac10f2558e611eaf8))
* window options sometimes not set in oil buffer ([#287](https://github.com/stevearc/oil.nvim/issues/287)) ([17d71eb](https://github.com/stevearc/oil.nvim/commit/17d71eb3d88a79dbc87c6245f8490853a5c38092))
* **windows:** can delete non-ascii filenames to trash ([#323](https://github.com/stevearc/oil.nvim/issues/323)) ([18dfd24](https://github.com/stevearc/oil.nvim/commit/18dfd2458dc741fea683357a17aaa95870b25a3c))
## [2.6.1](https://github.com/stevearc/oil.nvim/compare/v2.6.0...v2.6.1) (2024-01-16)
### Bug Fixes
* crash when LSP client workspace_folders is nil ([#269](https://github.com/stevearc/oil.nvim/issues/269)) ([c4cc824](https://github.com/stevearc/oil.nvim/commit/c4cc8240f1c71defcb67c45da96e44b968d29e5f))
* diagnostic float would not open if scope=cursor ([#275](https://github.com/stevearc/oil.nvim/issues/275)) ([a1af7a1](https://github.com/stevearc/oil.nvim/commit/a1af7a1b593d8d28581ef0de82a6977721601afa))
* **lsp_rename:** handle absolute path glob filters ([#279](https://github.com/stevearc/oil.nvim/issues/279)) ([ec24334](https://github.com/stevearc/oil.nvim/commit/ec24334471e7ccbfb7488910159245dc7327a07d))
* **trash:** mac error deleting dangling symbolic links to trash ([#251](https://github.com/stevearc/oil.nvim/issues/251)) ([49b2b3f](https://github.com/stevearc/oil.nvim/commit/49b2b3f4a50bcd546decf751e5834de9b6f38d97))
### Performance Improvements
* **windows:** use a single powershell process for trash operations ([#271](https://github.com/stevearc/oil.nvim/issues/271)) ([e71b6ca](https://github.com/stevearc/oil.nvim/commit/e71b6caa95bd29225536df64fdcd8fb0f758bb09))
## [2.6.0](https://github.com/stevearc/oil.nvim/compare/v2.5.0...v2.6.0) (2024-01-03)
### Features
* **trash:** support for deleting to windows recycle bin ([#243](https://github.com/stevearc/oil.nvim/issues/243)) ([553b7a0](https://github.com/stevearc/oil.nvim/commit/553b7a0ac129c0e7a7bbde72f9fbfe7c9f4be6c3))
## [2.5.0](https://github.com/stevearc/oil.nvim/compare/v2.4.1...v2.5.0) (2023-12-26)
### Features
* actions for sending oil entries to quickfix ([#249](https://github.com/stevearc/oil.nvim/issues/249)) ([3ffb830](https://github.com/stevearc/oil.nvim/commit/3ffb8309e6eda961c7edb9ecbe6a340fe9e24b43))
* add 'update_on_cursor_moved' option to preview window ([#250](https://github.com/stevearc/oil.nvim/issues/250)) ([ea612fe](https://github.com/stevearc/oil.nvim/commit/ea612fe926a24ea20b2b3856e1ba60bdaaae9383))
* allow multiple hlgroups inside one column ([#240](https://github.com/stevearc/oil.nvim/issues/240)) ([a173b57](https://github.com/stevearc/oil.nvim/commit/a173b5776c66a31ce08552677c1eae7ab015835f))
* constrain_cursor option (closes [#257](https://github.com/stevearc/oil.nvim/issues/257)) ([71b1ef5](https://github.com/stevearc/oil.nvim/commit/71b1ef5edfcee7c58fe611fdd79bfafcb9fb0531))
* option to auto-save files affected by will_rename_files ([#218](https://github.com/stevearc/oil.nvim/issues/218)) ([48d8ea8](https://github.com/stevearc/oil.nvim/commit/48d8ea8f4a6590ef7339ff0fdb97cef3e238dd86))
* refresh action also clears search highlight ([#228](https://github.com/stevearc/oil.nvim/issues/228)) ([8283457](https://github.com/stevearc/oil.nvim/commit/82834573bbca27c240f30087ff642b807ed1872a))
* support all LSP workspace file operations ([#264](https://github.com/stevearc/oil.nvim/issues/264)) ([250e0af](https://github.com/stevearc/oil.nvim/commit/250e0af7a54d750792be8b1d6165b76b6603a867))
### Bug Fixes
* constrain cursor when entering insert mode ([a60c6d1](https://github.com/stevearc/oil.nvim/commit/a60c6d10fd66de275c1d00451c918104ef9b6d10))
* handle opening oil from buffers with foreign schemes ([#256](https://github.com/stevearc/oil.nvim/issues/256)) ([22ab2ce](https://github.com/stevearc/oil.nvim/commit/22ab2ce1d56832588a634e7737404d9344698bd3))
* **trash:** error deleting dangling symbolic links to trash ([#251](https://github.com/stevearc/oil.nvim/issues/251)) ([5d9e436](https://github.com/stevearc/oil.nvim/commit/5d9e4368d49aec00b1e0d9ea520e1403ad6ad634))
* willRename source path ([#248](https://github.com/stevearc/oil.nvim/issues/248)) ([24027ed](https://github.com/stevearc/oil.nvim/commit/24027ed8d7f3ee5c38cfd713915e2e16d89e79b3))
### Performance Improvements
* speed up session loading ([#246](https://github.com/stevearc/oil.nvim/issues/246)) ([b3c24f4](https://github.com/stevearc/oil.nvim/commit/b3c24f4b3b2d38483241292a330cd6eb00734dac))
## [2.4.1](https://github.com/stevearc/oil.nvim/compare/v2.4.0...v2.4.1) (2023-12-01)
### Bug Fixes
* buffer data cleared when setting buflisted = false ([303f318](https://github.com/stevearc/oil.nvim/commit/303f31895e7ce10df250c88c7a5f7d8d9c56f0fc))
* bug copying file multiple times ([05cb825](https://github.com/stevearc/oil.nvim/commit/05cb8257cb9257144e63f41ccfe5a41ba3d1003c))
* crash in ssh and trash adapter detail columns ([#235](https://github.com/stevearc/oil.nvim/issues/235)) ([e89a8f8](https://github.com/stevearc/oil.nvim/commit/e89a8f8adeef2dfab851fd056d38ee7afc97c249))
* oil.select respects splitbelow and splitright ([#233](https://github.com/stevearc/oil.nvim/issues/233)) ([636989b](https://github.com/stevearc/oil.nvim/commit/636989b603fb95032efa9d3e1b3323c8bb533e91))
* preserve buflisted when re-opening oil buffers ([#220](https://github.com/stevearc/oil.nvim/issues/220)) ([6566f45](https://github.com/stevearc/oil.nvim/commit/6566f457e44498adc6835bed5402b38386fa1438))
## [2.4.0](https://github.com/stevearc/oil.nvim/compare/v2.3.0...v2.4.0) (2023-11-15)
### Features
* display ../ entry in oil buffers ([#166](https://github.com/stevearc/oil.nvim/issues/166)) ([d8f0d91](https://github.com/stevearc/oil.nvim/commit/d8f0d91b10ec53da722b0909697b57c2f5368245))
* trash support for linux and mac ([#165](https://github.com/stevearc/oil.nvim/issues/165)) ([6175bd6](https://github.com/stevearc/oil.nvim/commit/6175bd646272335c8db93264760760d8f2a611d5))
### Bug Fixes
* can view drives on Windows ([126a8a2](https://github.com/stevearc/oil.nvim/commit/126a8a23465312683edf646555b3031bfe56796d))
* don't set buflisted on oil buffers ([#220](https://github.com/stevearc/oil.nvim/issues/220)) ([873d505](https://github.com/stevearc/oil.nvim/commit/873d505e5bfdd65317ea97ead8faa6c56bac04c0))
* line parsing for empty columns ([0715f1b](https://github.com/stevearc/oil.nvim/commit/0715f1b0aacef70573ed6300c12039831fbd81c3))
* previewing and editing files on windows ([#214](https://github.com/stevearc/oil.nvim/issues/214)) ([3727410](https://github.com/stevearc/oil.nvim/commit/3727410e4875ad8ba339c585859a9391d643b9ed))
* quit after mutations when :wq or similar ([#221](https://github.com/stevearc/oil.nvim/issues/221)) ([af13ce3](https://github.com/stevearc/oil.nvim/commit/af13ce333f89c54a47e6772b55fed2438ee6957c))
## [2.3.0](https://github.com/stevearc/oil.nvim/compare/v2.2.0...v2.3.0) (2023-11-04)
### Features
* add support for LSP willRenameFiles ([#184](https://github.com/stevearc/oil.nvim/issues/184)) ([8f3c1d2](https://github.com/stevearc/oil.nvim/commit/8f3c1d2d2e4f7b81d19f353c61cb4ccba6a26496))
* make buffer cleanup delay configurable ([#191](https://github.com/stevearc/oil.nvim/issues/191)) ([a9f7f69](https://github.com/stevearc/oil.nvim/commit/a9f7f6927de2ceab01c9dfddd5a0d96330fe6374))
### Bug Fixes
* call vimL function in main loop ([#206](https://github.com/stevearc/oil.nvim/issues/206)) ([8418e94](https://github.com/stevearc/oil.nvim/commit/8418e94734e2572b422aead6e28d5a4c5b543d1f))
* case handling for LSP willRenameFiles ([deba4db](https://github.com/stevearc/oil.nvim/commit/deba4db1aca6e3970c94499401da001694d01138))
* disable swapfile for oil buffers ([#190](https://github.com/stevearc/oil.nvim/issues/190)) ([2e6996b](https://github.com/stevearc/oil.nvim/commit/2e6996b0757c454a8bbf1eb719d0b0b065442213))
* more correct gf binding for ssh files ([1641357](https://github.com/stevearc/oil.nvim/commit/164135793d893efad9ed6f90ac74a1ab54c4182a))
* parse errors when moving files across adapters ([4088efb](https://github.com/stevearc/oil.nvim/commit/4088efb8ff664b6f1624aab5dac6c3fe11d3962c))
* path shortening does proper subpath detection ([054247b](https://github.com/stevearc/oil.nvim/commit/054247b9c1799edd5874231973db621553062a43))
* restore original window when closing floating win ([#208](https://github.com/stevearc/oil.nvim/issues/208)) ([aea896a](https://github.com/stevearc/oil.nvim/commit/aea896a880e294c97a7c395dd8a6c89bdc93c644))
* shorten path when opening files ([#194](https://github.com/stevearc/oil.nvim/issues/194), [#197](https://github.com/stevearc/oil.nvim/issues/197)) ([3275996](https://github.com/stevearc/oil.nvim/commit/3275996ce65f142d0e96b9fc2658f94e5bd43ad5))
* shorten path when opening files ([#194](https://github.com/stevearc/oil.nvim/issues/194)) ([6cbc8d7](https://github.com/stevearc/oil.nvim/commit/6cbc8d725d3964cb08d679774db67d41fa002647))
## [2.2.0](https://github.com/stevearc/oil.nvim/compare/v2.1.0...v2.2.0) (2023-09-30)
### Features
* action for opening entry in an external program ([#183](https://github.com/stevearc/oil.nvim/issues/183)) ([96a334a](https://github.com/stevearc/oil.nvim/commit/96a334abeb85a26af87585ec3810116c7cb7d172))
* keymaps can specify mode ([#187](https://github.com/stevearc/oil.nvim/issues/187)) ([977da9a](https://github.com/stevearc/oil.nvim/commit/977da9ac6655b4f52bc26f23f584d9553f419555))
* make gf work in ssh files ([#186](https://github.com/stevearc/oil.nvim/issues/186)) ([ee81363](https://github.com/stevearc/oil.nvim/commit/ee813638d2d042e4b8e6e8ffd00dae438bdbd4ca))
### Bug Fixes
* add busybox support for ssh adapter ([#173](https://github.com/stevearc/oil.nvim/issues/173)) ([a9ceb90](https://github.com/stevearc/oil.nvim/commit/a9ceb90a63955c409b6fbac0f5cfc4c2f43093fd))
* correctly resolve new files when selected ([#179](https://github.com/stevearc/oil.nvim/issues/179)) ([83e4d04](https://github.com/stevearc/oil.nvim/commit/83e4d049228233df1870c92e160effb33e314396))
* don't override FloatTitle highlight ([#189](https://github.com/stevearc/oil.nvim/issues/189)) ([5ced687](https://github.com/stevearc/oil.nvim/commit/5ced687ddd08e1f8df27a23884d516a9b24101fc))
* hide swapfile error when editing file ([#188](https://github.com/stevearc/oil.nvim/issues/188)) ([bfc5a4c](https://github.com/stevearc/oil.nvim/commit/bfc5a4c48f4a53b95648e41d91e49b83fb03e919))
## [2.1.0](https://github.com/stevearc/oil.nvim/compare/v2.0.1...v2.1.0) (2023-09-11)
### Features
* api to sort directory contents ([#169](https://github.com/stevearc/oil.nvim/issues/169)) ([879d280](https://github.com/stevearc/oil.nvim/commit/879d280617045d5a00d7a053e86d51c6c80970be))
### Bug Fixes
* allow converting a file to directory and vice-versa ([#117](https://github.com/stevearc/oil.nvim/issues/117)) ([926ae06](https://github.com/stevearc/oil.nvim/commit/926ae067eb9a79817a455d5ab2dc6f420beb53c0))
* change default winblend for floating window to 0 ([#167](https://github.com/stevearc/oil.nvim/issues/167)) ([7033d52](https://github.com/stevearc/oil.nvim/commit/7033d52db012666b85504fe9a678939e49bc14b7))
* lock cursor to first mutable column ([d4eb4f3](https://github.com/stevearc/oil.nvim/commit/d4eb4f3bbf7770d04070707c947655a5426d7f75))
## [2.0.1](https://github.com/stevearc/oil.nvim/compare/v2.0.0...v2.0.1) (2023-08-26)
### Bug Fixes
* data loss bug when move + delete ([#162](https://github.com/stevearc/oil.nvim/issues/162)) ([f86d494](https://github.com/stevearc/oil.nvim/commit/f86d49446ae344ba3762d5705505aa09c1c1d4ee))
## [2.0.0](https://github.com/stevearc/oil.nvim/compare/v1.1.0...v2.0.0) (2023-08-24)
### ⚠ BREAKING CHANGES
* disable netrw by default ([#155](https://github.com/stevearc/oil.nvim/issues/155))
### Bug Fixes
* actions.terminal supports ssh adapter ([#152](https://github.com/stevearc/oil.nvim/issues/152)) ([0ccf95a](https://github.com/stevearc/oil.nvim/commit/0ccf95ae5d0ea731de8d427304f95d384a0664c4))
* errors when writing files over ssh ([#159](https://github.com/stevearc/oil.nvim/issues/159)) ([bfa0e87](https://github.com/stevearc/oil.nvim/commit/bfa0e8705eb83a0724aed6d5dc9d21aa62a8986b))
* fix flaky test ([9509ae0](https://github.com/stevearc/oil.nvim/commit/9509ae0feed5af04e4652375740a0722f2ee1a64))
* remaining type errors ([8f78079](https://github.com/stevearc/oil.nvim/commit/8f7807946a67b5f1a515946f82251e33651bae29))
* set nomodifiable after BufWritePre in ssh adapter ([#159](https://github.com/stevearc/oil.nvim/issues/159)) ([b61bc9b](https://github.com/stevearc/oil.nvim/commit/b61bc9b701a3cfb05cb6668446b0303cda7435e6))
* sometimes use shell to run trash command ([#99](https://github.com/stevearc/oil.nvim/issues/99)) ([ff62fc2](https://github.com/stevearc/oil.nvim/commit/ff62fc28cd7976e49ddff6897a4f870785187f13))
* ssh adapter supports any system with /bin/sh ([#161](https://github.com/stevearc/oil.nvim/issues/161)) ([ebcd720](https://github.com/stevearc/oil.nvim/commit/ebcd720a0987ed39f943c4a5d32b96d42e9cf695))
* type annotations and type errors ([47c7737](https://github.com/stevearc/oil.nvim/commit/47c77376189e4063b4fcc6dc2c4cfe8ffd72c782))
### Performance Improvements
* tweak uv readdir params for performance ([ffb89bf](https://github.com/stevearc/oil.nvim/commit/ffb89bf416a4883cc12e5ed247885d4700b00a0f))
### Code Refactoring
* disable netrw by default ([#155](https://github.com/stevearc/oil.nvim/issues/155)) ([9d90893](https://github.com/stevearc/oil.nvim/commit/9d90893c377b6b75230e4bad177f8d0103ceafe4))
## [1.1.0](https://github.com/stevearc/oil.nvim/compare/v1.0.0...v1.1.0) (2023-08-09)
### Features
* config to remove icon padding ([#145](https://github.com/stevearc/oil.nvim/issues/145)) ([b24380c](https://github.com/stevearc/oil.nvim/commit/b24380c0e17d21271cc04d94827a07397b9fc4dc))
### Bug Fixes
* directory hijacking when oil is lazy loaded ([#149](https://github.com/stevearc/oil.nvim/issues/149)) ([966eaaa](https://github.com/stevearc/oil.nvim/commit/966eaaadbc4d344660f867e41f6b1252459065b2))
* leave netrw autocmds intact when default_file_explorer = false ([#135](https://github.com/stevearc/oil.nvim/issues/135)) ([789b486](https://github.com/stevearc/oil.nvim/commit/789b486fb5cdc9e31abe9b0569b0e316f9d07bfd))
* opening oil from netrw defaults to netrw directory ([#148](https://github.com/stevearc/oil.nvim/issues/148)) ([887bb4a](https://github.com/stevearc/oil.nvim/commit/887bb4a8b6c9d73db9c34352d5363ee6289f733e))
* previewed buffers are deleted once hidden ([#141](https://github.com/stevearc/oil.nvim/issues/141)) ([eaa20a6](https://github.com/stevearc/oil.nvim/commit/eaa20a6aee7c4df89d80ec8208de63ec2fa4d38a))
* url-escape paths for scp ([#134](https://github.com/stevearc/oil.nvim/issues/134)) ([a5ff72a](https://github.com/stevearc/oil.nvim/commit/a5ff72a8da0df1042ee4c7705c301901062fa6d5))
* use standard Directory highlight group ([#139](https://github.com/stevearc/oil.nvim/issues/139)) ([f180a9f](https://github.com/stevearc/oil.nvim/commit/f180a9ffab24946a933621108144e2901533d583))
## 1.0.0 (2023-06-27)
### ⚠ BREAKING CHANGES
* selecting multiple files only opens buffers, not windows ([#111](https://github.com/stevearc/oil.nvim/issues/111))
* make oil buffers unlisted by default ([#45](https://github.com/stevearc/oil.nvim/issues/45))
* change scp:// urls back to oil-ssh://
### Features
* action to copy path to entry under cursor ([#50](https://github.com/stevearc/oil.nvim/issues/50)) ([6581d76](https://github.com/stevearc/oil.nvim/commit/6581d76a74760be5fcc5ca562d5032dcba7e5d9a))
* action to open entry in new tab ([#52](https://github.com/stevearc/oil.nvim/issues/52)) ([48eec8b](https://github.com/stevearc/oil.nvim/commit/48eec8b7ef67a5d7a50869fedf0ebbc82a8183d7))
* action to open the cmdline with current entry as argument ([#38](https://github.com/stevearc/oil.nvim/issues/38)) ([75b710e](https://github.com/stevearc/oil.nvim/commit/75b710e311104bc51eb5d04d1ac5db5193f7e834))
* add `setup.view_options.is_excluded` ([19ab948](https://github.com/stevearc/oil.nvim/commit/19ab948e25825a1b8823a391b733cc461f3010f7))
* add action to open a terminal ([c6a2e3e](https://github.com/stevearc/oil.nvim/commit/c6a2e3e08f1f70e52bbfff2b52093c779b4f24ed))
* add bug_report template ([23d1ca7](https://github.com/stevearc/oil.nvim/commit/23d1ca7327413973bbf7aee09e9f25b6f887f370))
* add override config option to customize float layout ([#132](https://github.com/stevearc/oil.nvim/issues/132)) ([ac72a8d](https://github.com/stevearc/oil.nvim/commit/ac72a8df4afc1a543624c0eb1ebc0bedeb83c1a6))
* add toggle_float function ([#94](https://github.com/stevearc/oil.nvim/issues/94)) ([82c7068](https://github.com/stevearc/oil.nvim/commit/82c706822bb13a8ea7a21e0e3dccc83eaf40bfbc))
* added command ([af59e7b](https://github.com/stevearc/oil.nvim/commit/af59e7b53df66192d18170e56f018cbc736dd67f))
* API to change config.view.is_hidden_file at runtime ([#69](https://github.com/stevearc/oil.nvim/issues/69)) ([12bea0f](https://github.com/stevearc/oil.nvim/commit/12bea0f6466661b89a6293c090a415ad7a32d4c8))
* builtin support for editing files over ssh ([#27](https://github.com/stevearc/oil.nvim/issues/27)) ([ca4da68](https://github.com/stevearc/oil.nvim/commit/ca4da68aaebaebf5cd68151c2b5ad56e00c06126))
* can cancel out of progress window ([273c2ce](https://github.com/stevearc/oil.nvim/commit/273c2cecbfe3ddc9fc19446f59cc6e7ff8981cf2))
* can minimize the progress window ([f28e634](https://github.com/stevearc/oil.nvim/commit/f28e63460ae23d88ecca8ba7bb4201b682692bee))
* **columns:** Add compatibility with previous versions ([98a186e](https://github.com/stevearc/oil.nvim/commit/98a186e8f9bd12621f988e95e8dbc4c67f0f3167))
* **columns:** Change to use custom icons ([6dc65dc](https://github.com/stevearc/oil.nvim/commit/6dc65dcf83dbd68a031d848dde61d104e6209b0c))
* config for floating preview window ([#74](https://github.com/stevearc/oil.nvim/issues/74)) ([3e1affa](https://github.com/stevearc/oil.nvim/commit/3e1affa6c784ce6911895a63232fa6e1a6ff5b70))
* config function to define which files are hidden ([#58](https://github.com/stevearc/oil.nvim/issues/58)) ([e5acff1](https://github.com/stevearc/oil.nvim/commit/e5acff1b77ff4372c94ace7daec21f93810166f7))
* config option for trashing deleted files ([#99](https://github.com/stevearc/oil.nvim/issues/99)) ([496d60f](https://github.com/stevearc/oil.nvim/commit/496d60fcff7af652e67c217aa82ab8d219a3f54e))
* config option to disable directory hijacking ([#76](https://github.com/stevearc/oil.nvim/issues/76)) ([3d3df74](https://github.com/stevearc/oil.nvim/commit/3d3df74532eaea2b071da03079c3a4c8e4fe5aeb))
* config option to skip the disclaimer ([adff3b9](https://github.com/stevearc/oil.nvim/commit/adff3b91541cde52793e41b34338f1f9cc19b3a6))
* **config:** Add custom icons ([bf20bca](https://github.com/stevearc/oil.nvim/commit/bf20bca78ddae7fd98ba98046014f3b06c8352ce))
* **config:** Change custom icons to columns config ([cb54e03](https://github.com/stevearc/oil.nvim/commit/cb54e034905ea67c7dd20008952203f0f7b4ed08))
* convert oil://path/to/file.lua to normal file path ([#77](https://github.com/stevearc/oil.nvim/issues/77)) ([d7805c7](https://github.com/stevearc/oil.nvim/commit/d7805c77515082d9e287feb010b3132dde838b3d))
* dispatch autocmd when oil buffer finishes rendering ([3ac035e](https://github.com/stevearc/oil.nvim/commit/3ac035e5ac448ce898c9aad7158a47378be4e85a))
* display shortened path as title of floating window ([#12](https://github.com/stevearc/oil.nvim/issues/12)) ([9f7c4d7](https://github.com/stevearc/oil.nvim/commit/9f7c4d74e1fefc7d88ff5094027b447eadecd787))
* expose buf_options in config ([#28](https://github.com/stevearc/oil.nvim/issues/28)) ([997d9cd](https://github.com/stevearc/oil.nvim/commit/997d9cd78a512d940e3a329e2746d20d77285189))
* extension for resession.nvim ([2bca582](https://github.com/stevearc/oil.nvim/commit/2bca582d935b723e67a41ec8c2d00684a3d1fc8a))
* first draft ([fefd6ad](https://github.com/stevearc/oil.nvim/commit/fefd6ad5e48ff5fcd04fa76d1410a65c40376964))
* inform user how to disable netrw ([6b10a36](https://github.com/stevearc/oil.nvim/commit/6b10a366414578022165fb1e2effea6362bf8ced))
* more actions for interacting with preview window ([#41](https://github.com/stevearc/oil.nvim/issues/41)) ([b3c4ff3](https://github.com/stevearc/oil.nvim/commit/b3c4ff340bed8bb88dc87f054334d67e47aae492))
* new action open_cmdline_dir ([#44](https://github.com/stevearc/oil.nvim/issues/44)) ([6c4a3da](https://github.com/stevearc/oil.nvim/commit/6c4a3dafcadec5f6818135e11c27250a9bdcbbff))
* Oil command supports split and vert modifiers ([#116](https://github.com/stevearc/oil.nvim/issues/116)) ([f322209](https://github.com/stevearc/oil.nvim/commit/f322209a4a2b4685adeda5df00b29cdfd64db08e))
* oil.select can close oil buffer afterwards ([#121](https://github.com/stevearc/oil.nvim/issues/121)) ([a465123](https://github.com/stevearc/oil.nvim/commit/a4651236594cd7717c9b75c43ede0ed5fd4a7dc9))
* option to disable all default keymaps ([#16](https://github.com/stevearc/oil.nvim/issues/16)) ([28da68a](https://github.com/stevearc/oil.nvim/commit/28da68ac5ca451a1f882ecc1eb720295e8c8fd51))
* prompt user to save changes before editing moved file/dir ([#93](https://github.com/stevearc/oil.nvim/issues/93)) ([6b05c2e](https://github.com/stevearc/oil.nvim/commit/6b05c2e91378960be7f7e73867112cee0b4a408a))
* restore window view in oil.close() ([#65](https://github.com/stevearc/oil.nvim/issues/65)) ([33ee724](https://github.com/stevearc/oil.nvim/commit/33ee724c2d25358917147718c3b108a90b571e20))
* set filetype='oil_preview' for preview buffer ([a587977](https://github.com/stevearc/oil.nvim/commit/a587977edda67fd6f506da11e55e3c27727df646))
* sort symbolic directory links like directories ([98fcc2d](https://github.com/stevearc/oil.nvim/commit/98fcc2d0d77f16941d5aac2e0dcf4cffd3cf699a))
* support custom trash commands ([#110](https://github.com/stevearc/oil.nvim/issues/110)) ([f535c10](https://github.com/stevearc/oil.nvim/commit/f535c1057c8d7ce2865bfff1881cc99aa726a044))
* update preview window when cursor is moved ([#42](https://github.com/stevearc/oil.nvim/issues/42)) ([6c6b767](https://github.com/stevearc/oil.nvim/commit/6c6b7673af1314dd7c8254a95eb8d331f6b76ac6))
* Use &lt;C-l&gt; to refresh directory ([#7](https://github.com/stevearc/oil.nvim/issues/7)) ([d019d38](https://github.com/stevearc/oil.nvim/commit/d019d38a3ef4926308735a00bd919a5666c464b6))
### Bug Fixes
* add autocmd to augroup ([5e2f1ce](https://github.com/stevearc/oil.nvim/commit/5e2f1ced9fae1b1dfec45f11f42d49ac9e299bc2))
* add WinLeave autocmd to augroup ([6a227e9](https://github.com/stevearc/oil.nvim/commit/6a227e932fb5e5cac9d4c0fef2a500cac047e99e))
* allow calling oil.open() with a url ([be695dc](https://github.com/stevearc/oil.nvim/commit/be695dc3502f8fb052a83720f3a4dd9578cacdf0))
* alternate buffer preservation ([#43](https://github.com/stevearc/oil.nvim/issues/43)) ([4e853ea](https://github.com/stevearc/oil.nvim/commit/4e853eabcb002650096ef78f098253fe12ba3d8f))
* always close keymap help window ([#17](https://github.com/stevearc/oil.nvim/issues/17)) ([7b703b4](https://github.com/stevearc/oil.nvim/commit/7b703b42da815fb280c6fd7b73961c2e87bcff07))
* always enter directory entries as a directory ([0d5db08](https://github.com/stevearc/oil.nvim/commit/0d5db08015d41a0e3da727bf70796f3a4abcfa76))
* another case of incorrect alternate buffers ([#60](https://github.com/stevearc/oil.nvim/issues/60)) ([b36ba91](https://github.com/stevearc/oil.nvim/commit/b36ba91b7a4d05ee43617383f68cf6ed6fc2f08e))
* bad interaction with editorconfig-vim ([7371dd2](https://github.com/stevearc/oil.nvim/commit/7371dd220f1d08789cc225846d8cafed938777e9))
* better behaved lazy loading in autocmds ([7f17648](https://github.com/stevearc/oil.nvim/commit/7f176487052a155d43c6b64ef44b6dd775e94f99))
* block quit if changes during :wq ([#98](https://github.com/stevearc/oil.nvim/issues/98)) ([37cb6be](https://github.com/stevearc/oil.nvim/commit/37cb6be6f6f98c4616ca382ad955c709dc38f39d))
* bug when copying saved win options to split ([#89](https://github.com/stevearc/oil.nvim/issues/89)) ([caa65e5](https://github.com/stevearc/oil.nvim/commit/caa65e5bfcc98a1450f6a5659fe0f4d28a311967))
* catch errors opening preview window ([#113](https://github.com/stevearc/oil.nvim/issues/113)) ([64d2f30](https://github.com/stevearc/oil.nvim/commit/64d2f305d30cec13938aa99f8f13bd84c502e020))
* close floating oil window on WinLeave ([#17](https://github.com/stevearc/oil.nvim/issues/17)) ([0f10485](https://github.com/stevearc/oil.nvim/commit/0f104854dab0b9edc9dd90bb70fdd782568283ef))
* copying symlinks ([dc18d06](https://github.com/stevearc/oil.nvim/commit/dc18d06bcbf02d84ed48cfa250582c0bb7aa6a02))
* detect duplicate filenames in buffer ([bcb99ae](https://github.com/stevearc/oil.nvim/commit/bcb99ae95a349d33dac9ea54dff0f8915e567eec))
* don't close floating windows we didn't open ([#64](https://github.com/stevearc/oil.nvim/issues/64)) ([073ecb3](https://github.com/stevearc/oil.nvim/commit/073ecb3d68580cd131cd30d83163576807172a77))
* don't show preview if there are no changes ([#19](https://github.com/stevearc/oil.nvim/issues/19)) ([6d0b6ac](https://github.com/stevearc/oil.nvim/commit/6d0b6ac43ce368e5d7aca1798339b597ef6c9981))
* double callback in mutator ([0046508](https://github.com/stevearc/oil.nvim/commit/00465089cb4fdf2c9fb491cd63e36ca135ac6291))
* edge case where cursor position was not set ([#37](https://github.com/stevearc/oil.nvim/issues/37)) ([64d7763](https://github.com/stevearc/oil.nvim/commit/64d7763ac69c581bf1c28492994567c05ddff28a))
* edge case where opening a file would delete its contents ([2e95b9d](https://github.com/stevearc/oil.nvim/commit/2e95b9d42467168185cc5a505ef4288de4c5670f))
* edge case where window options were not set ([b8eaf88](https://github.com/stevearc/oil.nvim/commit/b8eaf88c127b7807fa3a8b00be881ab94f5168b3))
* error messages opening terminal in dir ([90acbdb](https://github.com/stevearc/oil.nvim/commit/90acbdbbffcb461bc6de3544bf8b695f7abeb168))
* error when editing a dir, and still missing parent window ([#40](https://github.com/stevearc/oil.nvim/issues/40)) ([a688443](https://github.com/stevearc/oil.nvim/commit/a6884431b0d7adccf9f4756ca543bf175052f742))
* error when float border is 'none' ([#125](https://github.com/stevearc/oil.nvim/issues/125)) ([4ad1627](https://github.com/stevearc/oil.nvim/commit/4ad162756b800fee4542726b48e98125fb5d7913))
* Error when saving blank lines and quitting. ([2bc63f7](https://github.com/stevearc/oil.nvim/commit/2bc63f7059050f6b172be6aea0402e8b177bde58))
* error when use_default_keymaps = false ([#56](https://github.com/stevearc/oil.nvim/issues/56)) ([f1ea6e0](https://github.com/stevearc/oil.nvim/commit/f1ea6e0ad03e1d7b1acad4d0796d39c4a82b3463))
* escape special characters when editing buffer ([#96](https://github.com/stevearc/oil.nvim/issues/96)) ([339ade9](https://github.com/stevearc/oil.nvim/commit/339ade9dc387958c714a98741cda9e722a931410))
* expand terminal path ([20e4ff1](https://github.com/stevearc/oil.nvim/commit/20e4ff1838d384141f6252520ae572a63abff2cd))
* float positioning and width calculation ([#32](https://github.com/stevearc/oil.nvim/issues/32)) ([f8ca564](https://github.com/stevearc/oil.nvim/commit/f8ca5648021ac6a59e016d81be594fa98f0705c2))
* guard against invalid buffer ([#90](https://github.com/stevearc/oil.nvim/issues/90)) ([a9556aa](https://github.com/stevearc/oil.nvim/commit/a9556aa872215f5956062f24064ade55cf2baeb9))
* icon column does nil-check of config ([f6d2102](https://github.com/stevearc/oil.nvim/commit/f6d2102e2b671ffe28029c0b4b0915e625c3f09f))
* ignore errors when unlocking buffers ([e58f347](https://github.com/stevearc/oil.nvim/commit/e58f347c674332d2ece6a0ff6da05cf93bf0f0b9))
* invalid filetype of oil buffer ([#47](https://github.com/stevearc/oil.nvim/issues/47)) ([2b0b938](https://github.com/stevearc/oil.nvim/commit/2b0b9382d77c4a9ff471a999bddb2f9cc945a300))
* more detailed information when ssh connection fails ([#27](https://github.com/stevearc/oil.nvim/issues/27)) ([f5961e7](https://github.com/stevearc/oil.nvim/commit/f5961e731f641206727eaded197e5879694c35f7))
* new oil buffers are nomodifiable during mutation processing ([d631d9f](https://github.com/stevearc/oil.nvim/commit/d631d9fc5a958c7c9ee0717b1fe040a3ec951c63))
* no error if opening file that has swapfile ([a60639d](https://github.com/stevearc/oil.nvim/commit/a60639db358c0b40f9fe297b1f52f3eb62c190c6))
* off-by-one errors in tests ([6062ad6](https://github.com/stevearc/oil.nvim/commit/6062ad6737d36e8a1cc10696cf5e870057eba20c))
* oil buffers load properly after loading a session ([#29](https://github.com/stevearc/oil.nvim/issues/29)) ([bb5201c](https://github.com/stevearc/oil.nvim/commit/bb5201c9cd422e7b145699b5dccd8e70e4630a9d))
* oil buffers remain unmodified after saving changes ([931453f](https://github.com/stevearc/oil.nvim/commit/931453fc09085c09537295c991c66637869e97e1))
* oil can open when terminal is focused ([#51](https://github.com/stevearc/oil.nvim/issues/51)) ([0e53d40](https://github.com/stevearc/oil.nvim/commit/0e53d402219c74d351fffb18d97d7e350f87bfd8))
* oil loses track of buffers after refresh ([9871ca9](https://github.com/stevearc/oil.nvim/commit/9871ca9737d4ffd68b40ad68b8f89848d835b286))
* oil-ssh assume target machine's locales ([c72bcb4](https://github.com/stevearc/oil.nvim/commit/c72bcb45b2e824150cbf356c2e13e37d6863369b))
* oil.close doesn't error when no other buffers exist ([#79](https://github.com/stevearc/oil.nvim/issues/79)) ([4b05ebd](https://github.com/stevearc/oil.nvim/commit/4b05ebdf202bf61ce240f40558822fe5564d02ea))
* oil.close() sometimes closes window too ([#64](https://github.com/stevearc/oil.nvim/issues/64)) ([d48fa09](https://github.com/stevearc/oil.nvim/commit/d48fa09c82b133d384c84c98725b722fd06f38af))
* opening with lowercase drive letters ([29808f2](https://github.com/stevearc/oil.nvim/commit/29808f273c817543d049f6d2541a550e233de4ff))
* preserve alternate buffer when using floating window ([#20](https://github.com/stevearc/oil.nvim/issues/20)) ([d8a1e7c](https://github.com/stevearc/oil.nvim/commit/d8a1e7ca4e599c43dda1849a66b19d9fbff12310))
* preserve the alternate buffer ([#20](https://github.com/stevearc/oil.nvim/issues/20)) ([e4c4110](https://github.com/stevearc/oil.nvim/commit/e4c411002272d6eed159afdf4cae2e74dc7fc813))
* prevent double-delete autocmd ids ([#97](https://github.com/stevearc/oil.nvim/issues/97)) ([4107784](https://github.com/stevearc/oil.nvim/commit/41077847b98d6d3b88b6d31864bb20a664e88574))
* preview window renders on top of floating window title ([#72](https://github.com/stevearc/oil.nvim/issues/72)) ([383971b](https://github.com/stevearc/oil.nvim/commit/383971b0cfd8248ec3d00d4a3154d69ebd5e394e))
* renaming buffers doesn't interfere with directory hijack ([#25](https://github.com/stevearc/oil.nvim/issues/25)) ([b4ccc16](https://github.com/stevearc/oil.nvim/commit/b4ccc16944a3678558ab8f73fa803409b38f58d6))
* reposition preview window if vim is resized ([8cbb104](https://github.com/stevearc/oil.nvim/commit/8cbb104e76efee35ca8125da8d441c395e568e23))
* reposition progress window if vim is resized ([092f4b1](https://github.com/stevearc/oil.nvim/commit/092f4b1c7c14633cd58659dc93eed92c5c26810c))
* restore modified state of current buffer if actions are canceled ([#6](https://github.com/stevearc/oil.nvim/issues/6)) ([2e6d684](https://github.com/stevearc/oil.nvim/commit/2e6d68453f98d3d69cd5c36577f7a381aa7399f3))
* restore window options on split windows ([#36](https://github.com/stevearc/oil.nvim/issues/36)) ([fb69775](https://github.com/stevearc/oil.nvim/commit/fb697752b28ecc41ecaab4206b41e61496ab87f2))
* selecting multiple files only opens buffers, not windows ([#111](https://github.com/stevearc/oil.nvim/issues/111)) ([393f0dc](https://github.com/stevearc/oil.nvim/commit/393f0dcf82f04de597e194ec120d8cbe6fe212a8))
* set alternate buffer when inside oil ([#60](https://github.com/stevearc/oil.nvim/issues/60)) ([f1131b5](https://github.com/stevearc/oil.nvim/commit/f1131b5e90ce5cdbbd122e298d62726dfa4b808a))
* set bufhidden = 'hide' by default ([#104](https://github.com/stevearc/oil.nvim/issues/104)) ([19563c3](https://github.com/stevearc/oil.nvim/commit/19563c365800ab519e46a08a0aa59d5677b329b6))
* shortened path for current directory is '.' ([7649866](https://github.com/stevearc/oil.nvim/commit/76498666500c2aee94fd07366222d76c4d13ee2f))
* silence doautocmd errors ([9dbf18a](https://github.com/stevearc/oil.nvim/commit/9dbf18a524df1a563b2a8f46b14645aa47022f9e))
* some autocmds skipped when opening files from oil ([#120](https://github.com/stevearc/oil.nvim/issues/120)) ([61f8655](https://github.com/stevearc/oil.nvim/commit/61f8655e03dea805bb77aad5b4ca99d1176510b7))
* ssh adapter handles character and block files ([aa68ec4](https://github.com/stevearc/oil.nvim/commit/aa68ec4d988be3c898341f65f54c1620986240dd))
* stop using vim.wo to set window options ([6f8bf06](https://github.com/stevearc/oil.nvim/commit/6f8bf067c09e96d6bff548b5e6addb6d9c25a678))
* symbolic link target parsing fails if it has a trailing slash ([#131](https://github.com/stevearc/oil.nvim/issues/131)) ([9be36a6](https://github.com/stevearc/oil.nvim/commit/9be36a648889c37d11bc65e8422049dc33dd6a3f))
* unexpected behavior from BufReadPost autocmds ([716dd8f](https://github.com/stevearc/oil.nvim/commit/716dd8f9cf1ff2b9cda03497025612ce3c366307))
* unlock buffers if we cancel the actions ([#4](https://github.com/stevearc/oil.nvim/issues/4)) ([0d6ee14](https://github.com/stevearc/oil.nvim/commit/0d6ee144d210b8627e9c3fd98dc32ec3e9360aa2))
* update preview window in-place ([#74](https://github.com/stevearc/oil.nvim/issues/74)) ([57451c5](https://github.com/stevearc/oil.nvim/commit/57451c517d96ad856ed418203729f5d3cb200de6))
* url formatting errors when ssh connection specifies port ([9a03af7](https://github.com/stevearc/oil.nvim/commit/9a03af7cb752f46b9efa85fc132d9281f5672f23))
* warning when :tabnew from oil buffer ([#40](https://github.com/stevearc/oil.nvim/issues/40)) ([73c6fcf](https://github.com/stevearc/oil.nvim/commit/73c6fcf519afbd99b8cef00d8663bed20f87a1df))
### Code Refactoring
* change scp:// urls back to oil-ssh:// ([3164537](https://github.com/stevearc/oil.nvim/commit/31645370a105e59270634ec14665149e919f7432))
* make oil buffers unlisted by default ([#45](https://github.com/stevearc/oil.nvim/issues/45)) ([1d54819](https://github.com/stevearc/oil.nvim/commit/1d548190cf4a032d0354c0bf84d042a618152769))

View file

@ -4,19 +4,9 @@ help:
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
## all: generate docs, lint, and run tests
## all: lint and run tests
.PHONY: all
all: doc lint test
venv:
python3 -m venv venv
venv/bin/pip install -r scripts/requirements.txt
## doc: generate documentation
.PHONY: doc
doc: scripts/nvim_doc_tools venv
venv/bin/python scripts/main.py generate
venv/bin/python scripts/main.py lint
all: lint test
## test: run tests
.PHONY: test
@ -25,14 +15,9 @@ test:
## lint: run linters and LuaLS typechecking
.PHONY: lint
lint: scripts/nvim-typecheck-action fastlint
lint: scripts/nvim-typecheck-action
./scripts/nvim-typecheck-action/typecheck.sh --workdir scripts/nvim-typecheck-action lua
## fastlint: run only fast linters
.PHONY: fastlint
fastlint: scripts/nvim_doc_tools venv
venv/bin/python scripts/main.py lint
luacheck lua tests --formatter plain
selene --display-style quiet .
stylua --check lua tests
## profile: use LuaJIT profiler to profile the plugin
@ -51,9 +36,6 @@ benchmark: scripts/benchmark.nvim
nvim --clean -u perf/bootstrap.lua -c 'lua benchmark()'
@cat perf/tmp/benchmark.txt
scripts/nvim_doc_tools:
git clone https://github.com/stevearc/nvim_doc_tools scripts/nvim_doc_tools
scripts/nvim-typecheck-action:
git clone https://github.com/stevearc/nvim-typecheck-action scripts/nvim-typecheck-action
@ -63,4 +45,4 @@ scripts/benchmark.nvim:
## clean: reset the repository to a clean state
.PHONY: clean
clean:
rm -rf scripts/nvim_doc_tools scripts/nvim-typecheck-action venv .testenv perf/tmp profile.json
rm -rf scripts/nvim-typecheck-action .testenv perf/tmp profile.json

505
README.md
View file

@ -4,415 +4,112 @@ A [vim-vinegar](https://github.com/tpope/vim-vinegar) like file explorer that le
https://user-images.githubusercontent.com/506791/209727111-6b4a11f4-634a-4efa-9461-80e9717cea94.mp4
<!-- TOC -->
This is a maintained fork of [stevearc/oil.nvim](https://github.com/stevearc/oil.nvim)
with cherry-picked upstream PRs and original bug fixes that haven't landed
upstream yet.
- [Requirements](#requirements)
- [Installation](#installation)
- [Quick start](#quick-start)
- [Options](#options)
- [Adapters](#adapters)
- [Recipes](#recipes)
- [Third-party extensions](#third-party-extensions)
- [API](#api)
- [FAQ](#faq)
<details>
<summary>Changes from upstream</summary>
<!-- /TOC -->
### PRs
Upstream PRs cherry-picked or adapted into this fork.
| PR | Description | Commit |
|---|---|---|
| [#495](https://github.com/stevearc/oil.nvim/pull/495) | Cancel visual/operator-pending mode on close instead of closing buffer | [`16f3d7b`](https://github.com/barrettruth/oil.nvim/commit/16f3d7b) |
| [#537](https://github.com/stevearc/oil.nvim/pull/537) | Configurable file and directory creation permissions (`new_file_mode`, `new_dir_mode`) | [`c6b4a7a`](https://github.com/barrettruth/oil.nvim/commit/c6b4a7a) |
| [#578](https://github.com/stevearc/oil.nvim/issues/578) | Recipe to disable hidden file dimming by relinking `Oil*Hidden` groups | [`38db6cf`](https://github.com/barrettruth/oil.nvim/commit/38db6cf) |
| [#618](https://github.com/stevearc/oil.nvim/pull/618) | Opt-in filetype detection for icons via `use_slow_filetype_detection` | [`ded1725`](https://github.com/barrettruth/oil.nvim/commit/ded1725) |
| [#644](https://github.com/stevearc/oil.nvim/pull/644) | Pass full entry to `is_hidden_file` and `is_always_hidden` callbacks | [`4ab4765`](https://github.com/barrettruth/oil.nvim/commit/4ab4765) |
| [#645](https://github.com/stevearc/oil.nvim/pull/645) | Add `close_float` action (close only floating oil windows) | [`f6bcdda`](https://github.com/barrettruth/oil.nvim/commit/f6bcdda) |
| [#690](https://github.com/stevearc/oil.nvim/pull/690) | Add `OilFileIcon` highlight group as fallback for unrecognized icons | [`ce64ae1`](https://github.com/barrettruth/oil.nvim/commit/ce64ae1) |
| [#697](https://github.com/stevearc/oil.nvim/pull/697) | Recipe for custom file extension column with sorting | [`dcb3a08`](https://github.com/barrettruth/oil.nvim/commit/dcb3a08) |
| [#698](https://github.com/stevearc/oil.nvim/pull/698) | Executable file highlighting (`OilExecutable`, `OilExecutableHidden`) | [`41556ec`](https://github.com/barrettruth/oil.nvim/commit/41556ec), [`85ed9b8`](https://github.com/barrettruth/oil.nvim/commit/85ed9b8) |
| [#717](https://github.com/stevearc/oil.nvim/pull/717) | Add malewicz1337/oil-git.nvim to third-party extensions | [`582d9fc`](https://github.com/barrettruth/oil.nvim/commit/582d9fc) |
| [#720](https://github.com/stevearc/oil.nvim/pull/720) | Gate `BufAdd` autocmd behind `default_file_explorer` check | [`2228f80`](https://github.com/barrettruth/oil.nvim/commit/2228f80) |
| [#722](https://github.com/stevearc/oil.nvim/pull/722) | Fix dead freedesktop trash specification URL | [`b92ecb0`](https://github.com/barrettruth/oil.nvim/commit/b92ecb0) |
| [#723](https://github.com/stevearc/oil.nvim/pull/723) | Emit `OilReadPost` user event after every buffer render | [`29239d5`](https://github.com/barrettruth/oil.nvim/commit/29239d5) |
| [#725](https://github.com/stevearc/oil.nvim/pull/725) | Normalize keymap keys before config merge (`<c-t>` = `<C-t>`) | [`723145c`](https://github.com/barrettruth/oil.nvim/commit/723145c) |
| [#727](https://github.com/stevearc/oil.nvim/pull/727) | Clarify `get_current_dir` nil return and add Telescope recipe | [`eed6697`](https://github.com/barrettruth/oil.nvim/commit/eed6697) |
### Issues
Upstream issues triaged against this fork.
| Issue | Status | Resolution |
|---|---|---|
| [#446](https://github.com/stevearc/oil.nvim/issues/446) | resolved | Executable highlighting — implemented by PR [#698](https://github.com/stevearc/oil.nvim/pull/698) |
| [#483](https://github.com/stevearc/oil.nvim/issues/483) | not actionable | Spell downloads depend on netrw — fixed in neovim ([neovim#34940](https://github.com/neovim/neovim/pull/34940)) |
| [#492](https://github.com/stevearc/oil.nvim/issues/492) | not actionable | Question — j/k remapping, answered in comments |
| [#533](https://github.com/stevearc/oil.nvim/issues/533) | not actionable | `constrain_cursor` — needs repro from reporter |
| [#587](https://github.com/stevearc/oil.nvim/issues/587) | not actionable | Alt+h keymap — user config issue |
| [#623](https://github.com/stevearc/oil.nvim/issues/623) | not actionable | bufferline.nvim interaction — cross-plugin issue |
| [#624](https://github.com/stevearc/oil.nvim/issues/624) | not actionable | Mutation-in-progress race — no reliable repro |
| [#632](https://github.com/stevearc/oil.nvim/issues/632) | fixed | Preview + move = copy — [`fe16993`](https://github.com/barrettruth/oil.nvim/commit/fe16993) |
| [#642](https://github.com/stevearc/oil.nvim/issues/642) | fixed | W10 warning under `nvim -R` — [`ca834cf`](https://github.com/barrettruth/oil.nvim/commit/ca834cf) |
| [#664](https://github.com/stevearc/oil.nvim/issues/664) | not actionable | Extra buffer on session reload — no repro |
| [#670](https://github.com/stevearc/oil.nvim/issues/670) | fixed | Multi-directory cmdline — [`70861e5`](https://github.com/barrettruth/oil.nvim/commit/70861e5) |
| [#673](https://github.com/stevearc/oil.nvim/issues/673) | fixed | Symlink newlines crash — [`9110a1a`](https://github.com/barrettruth/oil.nvim/commit/9110a1a) |
| [#679](https://github.com/stevearc/oil.nvim/issues/679) | resolved | Executable file sign — implemented by PR [#698](https://github.com/stevearc/oil.nvim/pull/698) |
| [#692](https://github.com/stevearc/oil.nvim/issues/692) | resolved | Keymap normalization — fixed by PR [#725](https://github.com/stevearc/oil.nvim/pull/725) |
| [#710](https://github.com/stevearc/oil.nvim/issues/710) | fixed | buftype empty on BufEnter — [`01b860e`](https://github.com/barrettruth/oil.nvim/commit/01b860e) |
| [#714](https://github.com/stevearc/oil.nvim/issues/714) | not actionable | Support question — already answered |
| [#719](https://github.com/stevearc/oil.nvim/issues/719) | not actionable | Neovim crash on node_modules delete — libuv/neovim bug |
| [#726](https://github.com/stevearc/oil.nvim/issues/726) | not actionable | Meta discussion/roadmap |
</details>
## Requirements
- Neovim 0.8+
- Icon provider plugin (optional)
- [mini.icons](https://github.com/nvim-mini/mini.nvim/blob/main/readmes/mini-icons.md) for file and folder icons
- [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) for file icons
Neovim 0.8+ and optionally [mini.icons](https://github.com/nvim-mini/mini.nvim/blob/main/readmes/mini-icons.md) or [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) for file icons.
## Installation
oil.nvim supports all the usual plugin managers
Install with your favorite package manager or with luarocks:
<details>
<summary>lazy.nvim</summary>
```lua
{
'stevearc/oil.nvim',
---@module 'oil'
---@type oil.SetupOpts
opts = {},
-- Optional dependencies
dependencies = { { "nvim-mini/mini.icons", opts = {} } },
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
lazy = false,
}
```console
luarocks install oil.nvim
```
</details>
<details>
<summary>Packer</summary>
```lua
require("packer").startup(function()
use({
"stevearc/oil.nvim",
config = function()
require("oil").setup()
end,
})
end)
```
</details>
<details>
<summary>Paq</summary>
```lua
require("paq")({
{ "stevearc/oil.nvim" },
})
```
</details>
<details>
<summary>vim-plug</summary>
## Documentation
```vim
Plug 'stevearc/oil.nvim'
:help oil.nvim
```
</details>
<details>
<summary>dein</summary>
```vim
call dein#add('stevearc/oil.nvim')
```
</details>
<details>
<summary>Pathogen</summary>
```sh
git clone --depth=1 https://github.com/stevearc/oil.nvim.git ~/.vim/bundle/
```
</details>
<details>
<summary>Neovim native package</summary>
```sh
git clone --depth=1 https://github.com/stevearc/oil.nvim.git \
"${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/oil/start/oil.nvim
```
</details>
## Quick start
Add the following to your init.lua
```lua
require("oil").setup()
```
Then open a directory with `nvim .`. Use `<CR>` to open a file/directory, and `-` to go up a directory. Otherwise, just treat it like a normal buffer and make changes as you like. Remember to `:w` when you're done to actually perform the actions.
If you want to mimic the `vim-vinegar` method of navigating to the parent directory of a file, add this keymap:
```lua
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
```
You can open a directory with `:edit <path>` or `:Oil <path>`. To open oil in a floating window, do `:Oil --float <path>`.
## Options
```lua
require("oil").setup({
-- Oil will take over directory buffers (e.g. `vim .` or `:e src/`)
-- Set to false if you want some other plugin (e.g. netrw) to open when you edit directories.
default_file_explorer = true,
-- Id is automatically added at the beginning, and name at the end
-- See :help oil-columns
columns = {
"icon",
-- "permissions",
-- "size",
-- "mtime",
},
-- Buffer-local options to use for oil buffers
buf_options = {
buflisted = false,
bufhidden = "hide",
},
-- Window-local options to use for oil buffers
win_options = {
wrap = false,
signcolumn = "no",
cursorcolumn = false,
foldcolumn = "0",
spell = false,
list = false,
conceallevel = 3,
concealcursor = "nvic",
},
-- Send deleted files to the trash instead of permanently deleting them (:help oil-trash)
delete_to_trash = false,
-- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits)
skip_confirm_for_simple_edits = false,
-- Selecting a new/moved/renamed file or directory will prompt you to save changes first
-- (:help prompt_save_on_select_new_entry)
prompt_save_on_select_new_entry = true,
-- Oil will automatically delete hidden buffers after this delay
-- You can set the delay to false to disable cleanup entirely
-- Note that the cleanup process only starts when none of the oil buffers are currently displayed
cleanup_delay_ms = 2000,
lsp_file_methods = {
-- Enable or disable LSP file operations
enabled = true,
-- Time to wait for LSP file operations to complete before skipping
timeout_ms = 1000,
-- Set to true to autosave buffers that are updated with LSP willRenameFiles
-- Set to "unmodified" to only save unmodified buffers
autosave_changes = false,
},
-- Constrain the cursor to the editable parts of the oil buffer
-- Set to `false` to disable, or "name" to keep it on the file names
constrain_cursor = "editable",
-- Set to true to watch the filesystem for changes and reload oil
watch_for_changes = false,
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })
-- Additionally, if it is a string that matches "actions.<name>",
-- it will use the mapping at require("oil.actions").<name>
-- Set to `false` to remove a keymap
-- See :help oil-actions for a list of all available actions
keymaps = {
["g?"] = { "actions.show_help", mode = "n" },
["<CR>"] = "actions.select",
["<C-s>"] = { "actions.select", opts = { vertical = true } },
["<C-h>"] = { "actions.select", opts = { horizontal = true } },
["<C-t>"] = { "actions.select", opts = { tab = true } },
["<C-p>"] = "actions.preview",
["<C-c>"] = { "actions.close", mode = "n" },
["<C-l>"] = "actions.refresh",
["-"] = { "actions.parent", mode = "n" },
["_"] = { "actions.open_cwd", mode = "n" },
["`"] = { "actions.cd", mode = "n" },
["g~"] = { "actions.cd", opts = { scope = "tab" }, mode = "n" },
["gs"] = { "actions.change_sort", mode = "n" },
["gx"] = "actions.open_external",
["g."] = { "actions.toggle_hidden", mode = "n" },
["g\\"] = { "actions.toggle_trash", mode = "n" },
},
-- Set to false to disable all of the above keymaps
use_default_keymaps = true,
view_options = {
-- Show files and directories that start with "."
show_hidden = false,
-- This function defines what is considered a "hidden" file
is_hidden_file = function(name, bufnr)
local m = name:match("^%.")
return m ~= nil
end,
-- This function defines what will never be shown, even when `show_hidden` is set
is_always_hidden = function(name, bufnr)
return false
end,
-- Sort file names with numbers in a more intuitive order for humans.
-- Can be "fast", true, or false. "fast" will turn it off for large directories.
natural_order = "fast",
-- Sort file and directory names case insensitive
case_insensitive = false,
sort = {
-- sort order can be "asc" or "desc"
-- see :help oil-columns to see which columns are sortable
{ "type", "asc" },
{ "name", "asc" },
},
-- Customize the highlight group for the file name
highlight_filename = function(entry, is_hidden, is_link_target, is_link_orphan)
return nil
end,
},
new_file_mode = 420,
new_dir_mode = 493,
-- Extra arguments to pass to SCP when moving/copying files over SSH
extra_scp_args = {},
-- Extra arguments to pass to aws s3 when creating/deleting/moving/copying files using aws s3
extra_s3_args = {},
-- EXPERIMENTAL support for performing file operations with git
git = {
-- Return true to automatically git add/mv/rm files
add = function(path)
return false
end,
mv = function(src_path, dest_path)
return false
end,
rm = function(path)
return false
end,
},
-- Configuration for the floating window in oil.open_float
float = {
-- Padding around the floating window
padding = 2,
-- max_width and max_height can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
max_width = 0,
max_height = 0,
border = nil,
win_options = {
winblend = 0,
},
-- optionally override the oil buffers window title with custom function: fun(winid: integer): string
get_win_title = nil,
-- preview_split: Split direction: "auto", "left", "right", "above", "below".
preview_split = "auto",
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
override = function(conf)
return conf
end,
},
-- Configuration for the file preview window
preview_win = {
-- Whether the preview window is automatically updated when the cursor is moved
update_on_cursor_moved = true,
-- How to open the preview window "load"|"scratch"|"fast_scratch"
preview_method = "fast_scratch",
-- A function that returns true to disable preview on a file e.g. to avoid lag
disable_preview = function(filename)
return false
end,
-- Window-local options to use for preview window buffers
win_options = {},
},
-- Configuration for the floating action confirmation window
confirmation = {
-- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_width and max_width can be a single value or a list of mixed integer/float types.
-- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
max_width = 0.9,
-- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
min_width = { 40, 0.4 },
-- optionally define an integer/float for the exact width of the preview window
width = nil,
-- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_height and max_height can be a single value or a list of mixed integer/float types.
-- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"
max_height = 0.9,
-- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"
min_height = { 5, 0.1 },
-- optionally define an integer/float for the exact height of the preview window
height = nil,
border = nil,
win_options = {
winblend = 0,
},
},
-- Configuration for the floating progress window
progress = {
max_width = 0.9,
min_width = { 40, 0.4 },
width = nil,
max_height = { 10, 0.9 },
min_height = { 5, 0.1 },
height = nil,
border = nil,
minimized_border = "none",
win_options = {
winblend = 0,
},
},
-- Configuration for the floating SSH window
ssh = {
border = nil,
},
-- Configuration for the floating keymaps help window
keymaps_help = {
border = nil,
},
})
```
## Adapters
Oil does all of its filesystem interaction through an _adapter_ abstraction. In practice, this means that oil can be used to view and modify files in more places than just the local filesystem, so long as the destination has an adapter implementation.
Note that file operations work _across adapters_. This means that you can use oil to copy files to/from a remote server using the ssh adapter just as easily as you can copy files from one directory to another on your local machine.
### SSH
This adapter allows you to browse files over ssh, much like netrw. To use it, simply open a buffer using the following name template:
```
nvim oil-ssh://[username@]hostname[:port]/[path]
```
This may look familiar. In fact, this is the same url format that netrw uses.
Note that at the moment the ssh adapter does not support Windows machines, and it requires the server to have a `/bin/sh` binary as well as standard unix commands (`ls`, `rm`, `mv`, `mkdir`, `chmod`, `cp`, `touch`, `ln`, `echo`).
### S3
This adapter allows you to browse files stored in aws s3. To use it, make sure `aws` is setup correctly and then simply open a buffer using the following name template:
```
nvim oil-s3://[bucket]/[path]
```
Note that older versions of Neovim don't support numbers in the url, so for Neovim 0.11 and older the url starts with `oil-sss`.
## Recipes
- [Toggle file detail view](doc/recipes.md#toggle-file-detail-view)
- [Show CWD in the winbar](doc/recipes.md#show-cwd-in-the-winbar)
- [Hide gitignored files and show git tracked hidden files](doc/recipes.md#hide-gitignored-files-and-show-git-tracked-hidden-files)
- [Open Telescope file finder in the current oil directory](doc/recipes.md#open-telescope-file-finder-in-the-current-oil-directory)
- [Add custom column for file extension](doc/recipes.md#add-custom-column-for-file-extension)
- [Disable dimming of hidden files](doc/recipes.md#disable-dimming-of-hidden-files)
## Third-party extensions
These are plugins maintained by other authors that extend the functionality of oil.nvim.
- [oil-git-status.nvim](https://github.com/refractalize/oil-git-status.nvim) - Shows git status of files in statuscolumn
- [oil-git.nvim (benomahony)](https://github.com/benomahony/oil-git.nvim) - Shows git status of files with colour and symbols
- [oil-git.nvim (malewicz1337)](https://github.com/malewicz1337/oil-git.nvim) - Async fork with directory highlighting and debounced updates
- [oil-lsp-diagnostics.nvim](https://github.com/JezerM/oil-lsp-diagnostics.nvim) - Shows LSP diagnostics indicator as virtual text
## API
<!-- API -->
- [get_entry_on_line(bufnr, lnum)](doc/api.md#get_entry_on_linebufnr-lnum)
- [get_cursor_entry()](doc/api.md#get_cursor_entry)
- [discard_all_changes()](doc/api.md#discard_all_changes)
- [set_columns(cols)](doc/api.md#set_columnscols)
- [set_sort(sort)](doc/api.md#set_sortsort)
- [set_is_hidden_file(is_hidden_file)](doc/api.md#set_is_hidden_fileis_hidden_file)
- [toggle_hidden()](doc/api.md#toggle_hidden)
- [get_current_dir(bufnr)](doc/api.md#get_current_dirbufnr)
- [open_float(dir, opts, cb)](doc/api.md#open_floatdir-opts-cb)
- [toggle_float(dir, opts, cb)](doc/api.md#toggle_floatdir-opts-cb)
- [open(dir, opts, cb)](doc/api.md#opendir-opts-cb)
- [close(opts)](doc/api.md#closeopts)
- [open_preview(opts, callback)](doc/api.md#open_previewopts-callback)
- [select(opts, callback)](doc/api.md#selectopts-callback)
- [save(opts, cb)](doc/api.md#saveopts-cb)
- [setup(opts)](doc/api.md#setupopts)
<!-- /API -->
## FAQ
**Q: Why "oil"**?
**Q: How do I migrate from `stevearc/oil.nvim` to `barrettruth/oil.nvim`?**
Replace your `setup()` call with a `vim.g.oil` assignment. For example, with
[lazy.nvim](https://github.com/folke/lazy.nvim):
```lua
-- before
{
'stevearc/oil.nvim',
config = function(_, opts)
require('oil').setup(opts)
end,
opts = {
...
}
}
-- after
{
'barrettruth/oil.nvim',
init = function()
vim.g.oil = {
columns = { "icon", "size" },
delete_to_trash = true,
}
end,
}
```
**Q: Why "oil"?**
**A:** From the [vim-vinegar](https://github.com/tpope/vim-vinegar) README, a quote by Drew Neil:
@ -431,24 +128,18 @@ Plus, I think it's pretty slick ;)
If you don't need those features specifically, check out the alternatives listed below
**Q: Why write another plugin yourself instead of adding functionality to one that already exists**?
**Q: Can oil display files as a tree view?**
**A:** Because I am a _maniac control freak_.
**Q: Can oil display files as a tree view**?
**A:** No. A tree view would require a completely different methodology, necessitating a complete rewrite. I don't use tree views, so I will leave this as a plugin for someone else to write.
**A:** No. A tree view would require a completely different methodology, necessitating a complete rewrite.
**Q: What are some alternatives?**
**A:**
- [mini.files](https://github.com/nvim-mini/mini.nvim/blob/main/readmes/mini-files.md): A newer plugin that also supports cross-directory filesystem-as-buffer edits. It utilizes a unique column view.
- [vim-vinegar](https://github.com/tpope/vim-vinegar): The granddaddy. This made me fall in love with single-directory file browsing. I stopped using it when I encountered netrw bugs and performance issues.
- [defx.nvim](https://github.com/Shougo/defx.nvim): What I switched to after vim-vinegar. Much more flexible and performant, but requires python and the API is a little hard to work with.
- [dirbuf.nvim](https://github.com/elihunter173/dirbuf.nvim): The first plugin I encountered that let you edit the filesystem like a buffer. Never used it because it [can't do cross-directory edits](https://github.com/elihunter173/dirbuf.nvim/issues/7).
- [lir.nvim](https://github.com/tamago324/lir.nvim): What I used prior to writing this plugin. Similar to vim-vinegar, but with better Neovim integration (floating windows, lua API).
- [vim-dirvish](https://github.com/justinmk/vim-dirvish): Never personally used, but well-established, stable, simple directory browser.
- [vidir](https://github.com/trapd00r/vidir): Never personally used, but might be the first plugin to come up with the idea of editing a directory like a buffer.
There's also file trees like [neo-tree](https://github.com/nvim-neo-tree/neo-tree.nvim) and [nvim-tree](https://github.com/nvim-tree/nvim-tree.lua), but they're really a different category entirely.
- [the original](https://github.com/stevearc/oil.nvim): the lesser-maintained but
official `oil.nvim`
- [mini.files](https://github.com/nvim-mini/mini.nvim/blob/main/readmes/mini-files.md): Also supports cross-directory filesystem-as-buffer edits with a column view.
- [vim-vinegar](https://github.com/tpope/vim-vinegar): The granddaddy of single-directory file browsing.
- [dirbuf.nvim](https://github.com/elihunter173/dirbuf.nvim): Edit filesystem like a buffer, but no cross-directory edits.
- [lir.nvim](https://github.com/tamago324/lir.nvim): Similar to vim-vinegar with better Neovim integration.
- [vim-dirvish](https://github.com/justinmk/vim-dirvish): Stable, simple directory browser.

View file

@ -1,205 +0,0 @@
# API
<!-- TOC -->
- [get_entry_on_line(bufnr, lnum)](#get_entry_on_linebufnr-lnum)
- [get_cursor_entry()](#get_cursor_entry)
- [discard_all_changes()](#discard_all_changes)
- [set_columns(cols)](#set_columnscols)
- [set_sort(sort)](#set_sortsort)
- [set_is_hidden_file(is_hidden_file)](#set_is_hidden_fileis_hidden_file)
- [toggle_hidden()](#toggle_hidden)
- [get_current_dir(bufnr)](#get_current_dirbufnr)
- [open_float(dir, opts, cb)](#open_floatdir-opts-cb)
- [toggle_float(dir, opts, cb)](#toggle_floatdir-opts-cb)
- [open(dir, opts, cb)](#opendir-opts-cb)
- [close(opts)](#closeopts)
- [open_preview(opts, callback)](#open_previewopts-callback)
- [select(opts, callback)](#selectopts-callback)
- [save(opts, cb)](#saveopts-cb)
- [setup(opts)](#setupopts)
<!-- /TOC -->
<!-- API -->
## get_entry_on_line(bufnr, lnum)
`get_entry_on_line(bufnr, lnum): nil|oil.Entry` \
Get the entry on a specific line (1-indexed)
| Param | Type | Desc |
| ----- | --------- | ---- |
| bufnr | `integer` | |
| lnum | `integer` | |
## get_cursor_entry()
`get_cursor_entry(): nil|oil.Entry` \
Get the entry currently under the cursor
## discard_all_changes()
`discard_all_changes()` \
Discard all changes made to oil buffers
## set_columns(cols)
`set_columns(cols)` \
Change the display columns for oil
| Param | Type | Desc |
| ----- | ------------------ | ---- |
| cols | `oil.ColumnSpec[]` | |
## set_sort(sort)
`set_sort(sort)` \
Change the sort order for oil
| Param | Type | Desc |
| ----- | ---------------- | ------------------------------------------------------------------------------------- |
| sort | `oil.SortSpec[]` | List of columns plus direction. See :help oil-columns to see which ones are sortable. |
**Examples:**
```lua
require("oil").set_sort({ { "type", "asc" }, { "size", "desc" } })
```
## set_is_hidden_file(is_hidden_file)
`set_is_hidden_file(is_hidden_file)` \
Change how oil determines if the file is hidden
| Param | Type | Desc |
| -------------- | ------------------------------------------------------------------ | -------------------------------------------- |
| is_hidden_file | `fun(filename: string, bufnr: integer, entry: oil.Entry): boolean` | Return true if the file/dir should be hidden |
## toggle_hidden()
`toggle_hidden()` \
Toggle hidden files and directories
## get_current_dir(bufnr)
`get_current_dir(bufnr): nil|string` \
Get the current directory
| Param | Type | Desc |
| ----- | -------------- | ---- |
| bufnr | `nil\|integer` | |
## open_float(dir, opts, cb)
`open_float(dir, opts, cb)` \
Open oil browser in a floating window
| Param | Type | Desc |
| ------------ | ------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| dir | `nil\|string` | When nil, open the parent of the current buffer, or the cwd if current buffer is not a file |
| opts | `nil\|oil.OpenOpts` | |
| >preview | `nil\|oil.OpenPreviewOpts` | When present, open the preview window after opening oil |
| >>vertical | `nil\|boolean` | Open the buffer in a vertical split |
| >>horizontal | `nil\|boolean` | Open the buffer in a horizontal split |
| >>split | `nil\|"aboveleft"\|"belowright"\|"topleft"\|"botright"` | Split modifier |
| cb | `nil\|fun()` | Called after the oil buffer is ready |
## toggle_float(dir, opts, cb)
`toggle_float(dir, opts, cb)` \
Open oil browser in a floating window, or close it if open
| Param | Type | Desc |
| ------------ | ------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| dir | `nil\|string` | When nil, open the parent of the current buffer, or the cwd if current buffer is not a file |
| opts | `nil\|oil.OpenOpts` | |
| >preview | `nil\|oil.OpenPreviewOpts` | When present, open the preview window after opening oil |
| >>vertical | `nil\|boolean` | Open the buffer in a vertical split |
| >>horizontal | `nil\|boolean` | Open the buffer in a horizontal split |
| >>split | `nil\|"aboveleft"\|"belowright"\|"topleft"\|"botright"` | Split modifier |
| cb | `nil\|fun()` | Called after the oil buffer is ready |
## open(dir, opts, cb)
`open(dir, opts, cb)` \
Open oil browser for a directory
| Param | Type | Desc |
| ------------ | ------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| dir | `nil\|string` | When nil, open the parent of the current buffer, or the cwd if current buffer is not a file |
| opts | `nil\|oil.OpenOpts` | |
| >preview | `nil\|oil.OpenPreviewOpts` | When present, open the preview window after opening oil |
| >>vertical | `nil\|boolean` | Open the buffer in a vertical split |
| >>horizontal | `nil\|boolean` | Open the buffer in a horizontal split |
| >>split | `nil\|"aboveleft"\|"belowright"\|"topleft"\|"botright"` | Split modifier |
| cb | `nil\|fun()` | Called after the oil buffer is ready |
## close(opts)
`close(opts)` \
Restore the buffer that was present when oil was opened
| Param | Type | Desc |
| ----------------- | -------------------- | --------------------------------------------------- |
| opts | `nil\|oil.CloseOpts` | |
| >exit_if_last_buf | `nil\|boolean` | Exit vim if this oil buffer is the last open buffer |
## open_preview(opts, callback)
`open_preview(opts, callback)` \
Preview the entry under the cursor in a split
| Param | Type | Desc |
| ----------- | ------------------------------------------------------- | ---------------------------------------------- |
| opts | `nil\|oil.OpenPreviewOpts` | |
| >vertical | `nil\|boolean` | Open the buffer in a vertical split |
| >horizontal | `nil\|boolean` | Open the buffer in a horizontal split |
| >split | `nil\|"aboveleft"\|"belowright"\|"topleft"\|"botright"` | Split modifier |
| callback | `nil\|fun(err: nil\|string)` | Called once the preview window has been opened |
## select(opts, callback)
`select(opts, callback)` \
Select the entry under the cursor
| Param | Type | Desc |
| ----------------------- | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| opts | `nil\|oil.SelectOpts` | |
| >vertical | `nil\|boolean` | Open the buffer in a vertical split |
| >horizontal | `nil\|boolean` | Open the buffer in a horizontal split |
| >split | `nil\|"aboveleft"\|"belowright"\|"topleft"\|"botright"` | Split modifier |
| >tab | `nil\|boolean` | Open the buffer in a new tab |
| >close | `nil\|boolean` | Close the original oil buffer once selection is made |
| >handle_buffer_callback | `nil\|fun(buf_id: integer)` | If defined, all other buffer related options here would be ignored. This callback allows you to take over the process of opening the buffer yourself. |
| callback | `nil\|fun(err: nil\|string)` | Called once all entries have been opened |
## save(opts, cb)
`save(opts, cb)` \
Save all changes
| Param | Type | Desc |
| -------- | ---------------------------- | ------------------------------------------------------------------------------------------- |
| opts | `nil\|table` | |
| >confirm | `nil\|boolean` | Show confirmation when true, never when false, respect skip_confirm_for_simple_edits if nil |
| cb | `nil\|fun(err: nil\|string)` | Called when mutations complete. |
**Note:**
<pre>
If you provide your own callback function, there will be no notification for errors.
</pre>
## setup(opts)
`setup(opts)` \
Initialize oil
| Param | Type | Desc |
| ----- | -------------------- | ---- |
| opts | `oil.setupOpts\|nil` | |
<!-- /API -->

View file

@ -3,17 +3,72 @@
--------------------------------------------------------------------------------
CONTENTS *oil-contents*
1. Config |oil-config|
2. Options |oil-options|
3. Api |oil-api|
4. Columns |oil-columns|
5. Actions |oil-actions|
6. Highlights |oil-highlights|
7. Trash |oil-trash|
1. Introduction |oil-introduction|
2. Requirements |oil-requirements|
3. Config |oil-config|
4. Options |oil-options|
5. Api |oil-api|
6. Columns |oil-columns|
7. Actions |oil-actions|
8. Highlights |oil-highlights|
9. Adapters |oil-adapters|
10. Recipes |oil-recipes|
11. Events |oil-events|
12. Trash |oil-trash|
--------------------------------------------------------------------------------
INTRODUCTION *oil-introduction*
oil.nvim is a file explorer for Neovim in the style of vim-vinegar. It lets
you edit your filesystem like a normal buffer: create files and directories by
typing new lines, delete them by removing lines, rename or move them by
changing the text. When you save the buffer, oil diffs it against the original
listing and performs the corresponding filesystem operations.
Open a directory with `nvim .`, `:edit <path>`, or `:Oil <path>`. Use `<CR>`
to open a file or descend into a directory, and `-` to go up. Treat the
listing like any other buffer — edit freely, then `:w` to apply changes.
To open oil in a floating window, use `:Oil --float <path>`.
To mimic vim-vinegar's parent-directory keymap: >lua
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
<
File operations work across adapters. You can copy files between your local
machine and a remote server over SSH, or between local directories and S3
buckets, using the same buffer-editing workflow.
--------------------------------------------------------------------------------
REQUIREMENTS *oil-requirements*
- Neovim 0.8+
- (optional) mini.icons or nvim-web-devicons for file icons
--------------------------------------------------------------------------------
CONFIG *oil-config*
Oil can be configured in two ways:
1. The traditional `setup()` call: >lua
require("oil").setup({
-- your opts here
})
<
2. Declarative configuration via `vim.g.oil`, which does not require calling
`setup()`: >lua
vim.g.oil = {
-- your opts here
}
<
When `vim.g.oil` is set, oil initializes automatically during plugin
loading. If `setup()` is called with explicit opts, those take precedence
over `vim.g.oil`.
The full list of options with their defaults:
>lua
require("oil").setup({
-- Oil will take over directory buffers (e.g. `vim .` or `:e src/`)
@ -766,6 +821,314 @@ OilTrash *hl-OilTras
OilTrashSourcePath *hl-OilTrashSourcePath*
Virtual text that shows the original path of file in the trash
--------------------------------------------------------------------------------
ADAPTERS *oil-adapters*
Oil performs all filesystem interaction through an adapter abstraction. This
means oil can view and modify files in places beyond the local filesystem, as
long as the destination has an adapter implementation. File operations work
across adapters — you can copy files between local and remote with the same
buffer-editing workflow.
SSH *oil-adapter-ssh*
Browse files over SSH, much like netrw. Open a buffer with: >
nvim oil-ssh://[username@]hostname[:port]/[path]
<
This is the same URL format that netrw uses.
The SSH adapter does not support Windows machines, and it requires the
server to have `/bin/sh` as well as standard unix commands (`ls`, `rm`,
`mv`, `mkdir`, `chmod`, `cp`, `touch`, `ln`, `echo`).
S3 *oil-adapter-s3*
Browse files stored in AWS S3. Make sure `aws` is configured correctly,
then open a buffer with: >
nvim oil-s3://[bucket]/[path]
<
Older versions of Neovim (0.11 and earlier) don't support numbers in the
URL scheme, so use `oil-sss` instead of `oil-s3`.
Trash *oil-adapter-trash*
See |oil-trash| for details on the built-in trash adapter.
--------------------------------------------------------------------------------
RECIPES *oil-recipes*
Toggle file detail view ~
*oil-recipe-toggle-detail-view*
>lua
local detail = false
require("oil").setup({
keymaps = {
["gd"] = {
desc = "Toggle file detail view",
callback = function()
detail = not detail
if detail then
require("oil").set_columns({ "icon", "permissions", "size", "mtime" })
else
require("oil").set_columns({ "icon" })
end
end,
},
},
})
<
Show CWD in the winbar ~
*oil-recipe-cwd-winbar*
>lua
function _G.get_oil_winbar()
local bufnr = vim.api.nvim_win_get_buf(vim.g.statusline_winid)
local dir = require("oil").get_current_dir(bufnr)
if dir then
return vim.fn.fnamemodify(dir, ":~")
else
return vim.api.nvim_buf_get_name(0)
end
end
require("oil").setup({
win_options = {
winbar = "%!v:lua.get_oil_winbar()",
},
})
<
Hide gitignored files and show git tracked hidden files ~
*oil-recipe-git-is-hidden*
>lua
local function parse_output(proc)
local result = proc:wait()
local ret = {}
if result.code == 0 then
for line in vim.gsplit(result.stdout, "\n", { plain = true, trimempty = true }) do
line = line:gsub("/$", "")
ret[line] = true
end
end
return ret
end
local function new_git_status()
return setmetatable({}, {
__index = function(self, key)
local ignore_proc = vim.system(
{ "git", "ls-files", "--ignored", "--exclude-standard", "--others", "--directory" },
{
cwd = key,
text = true,
}
)
local tracked_proc = vim.system({ "git", "ls-tree", "HEAD", "--name-only" }, {
cwd = key,
text = true,
})
local ret = {
ignored = parse_output(ignore_proc),
tracked = parse_output(tracked_proc),
}
rawset(self, key, ret)
return ret
end,
})
end
local git_status = new_git_status()
local refresh = require("oil.actions").refresh
local orig_refresh = refresh.callback
refresh.callback = function(...)
git_status = new_git_status()
orig_refresh(...)
end
require("oil").setup({
view_options = {
is_hidden_file = function(name, bufnr)
local dir = require("oil").get_current_dir(bufnr)
local is_dotfile = vim.startswith(name, ".") and name ~= ".."
if not dir then
return is_dotfile
end
if is_dotfile then
return not git_status[dir].tracked[name]
else
return git_status[dir].ignored[name]
end
end,
},
})
<
Open Telescope file finder in the current oil directory ~
*oil-recipe-telescope*
When using `get_current_dir()` in a keymap that also opens another plugin's UI
(like Telescope), capture the directory in a local variable before the call
that changes the buffer context.
>lua
require("oil").setup({
keymaps = {
["<leader>ff"] = {
desc = "Find files in the current directory",
callback = function()
local dir = require("oil").get_current_dir()
if not dir then
vim.notify("Could not get oil directory", vim.log.levels.WARN)
return
end
require("telescope.builtin").find_files({ cwd = dir })
end,
},
["<leader>fg"] = {
desc = "Live grep in the current directory",
callback = function()
local dir = require("oil").get_current_dir()
if not dir then
vim.notify("Could not get oil directory", vim.log.levels.WARN)
return
end
require("telescope.builtin").live_grep({ cwd = dir })
end,
},
},
})
<
If you need the directory after an operation that might change the current
buffer, pass the buffer number explicitly: >lua
local bufnr = vim.api.nvim_get_current_buf()
-- ... some operation that changes the current buffer ...
local dir = require("oil").get_current_dir(bufnr)
<
Add custom column for file extension ~
*oil-recipe-extension-column*
>lua
local oil_cfg = require "oil.config"
local oil_constant = require "oil.constants"
local oil_column = require "oil.columns"
local FIELD_TYPE = oil_constant.FIELD_TYPE
local FIELD_NAME = oil_constant.FIELD_NAME
local function adjust_number(int)
return string.format("%03d%s", #int, int)
end
local function format(output)
return vim.fn.fnamemodify(output, ":e")
end
oil_column.register("extension", {
render = function(entry, _)
local field_type = entry[FIELD_TYPE]
local name = entry[FIELD_NAME]
if field_type == "file" then
if name then
local extension = format(name)
if not extension:match "%s" then
return extension
end
end
end
end,
parse = function(line, _)
return line:match "^(%S+)%s+(.*)$"
end,
create_sort_value_factory = function(num_entries)
if
oil_cfg.view_options.natural_order == false
or (oil_cfg.view_options.natural_order == "fast" and num_entries > 5000)
then
return function(entry)
return format(entry[FIELD_NAME]:lower())
end
else
local memo = {}
return function(entry)
if memo[entry] == nil and entry[FIELD_TYPE] == "file" then
local name = entry[FIELD_NAME]:gsub("0*(%d+)", adjust_number)
memo[entry] = format(name:lower())
end
return memo[entry]
end
end
end,
})
require("oil").setup({
columns = {
"size",
"extension",
"icon",
},
view_options = {
sort = {
{ "type", "asc" },
{ "extension", "asc" },
{ "name", "asc" },
},
},
})
<
Disable dimming of hidden files ~
*oil-recipe-no-hidden-dimming*
By default, hidden files (toggled with `g.`) are dimmed via the `OilHidden`
highlight group, which links to `Comment`. To make hidden files look identical
to their visible counterparts, relink each hidden group to its non-hidden
variant after calling `setup()`:
>lua
for _, hl in ipairs(require("oil")._get_highlights()) do
local base = hl.name:match("^(Oil.+)Hidden$")
if base then
vim.api.nvim_set_hl(0, hl.name, { link = base })
end
end
<
--------------------------------------------------------------------------------
EVENTS *oil-events*
Oil emits the following |User| autocmd events. Listen for them with
|nvim_create_autocmd|: >lua
vim.api.nvim_create_autocmd("User", {
pattern = "OilEnter",
callback = function(args)
vim.print("Entered oil buffer: " .. args.data.buf)
end,
})
<
OilEnter *OilEnter*
Fired once per oil buffer, after the initial directory listing has been
rendered and the buffer is ready. The `args.data.buf` field contains the
buffer number. Use this event for one-time buffer setup such as setting
keymaps or window options.
OilReadPost *OilReadPost*
Fired after every successful buffer render, including the initial render
and all subsequent re-renders (e.g. after directory changes, refreshes, or
mutations). The `args.data.buf` field contains the buffer number. Use this
event for logic that must run each time the directory listing updates.
OilMutationComplete *OilMutationComplete*
Fired after all pending mutations (create, delete, rename, move, copy)
have been executed and the affected buffers have been re-rendered. No
additional data fields. Use this event for post-mutation side effects such
as refreshing external status indicators.
--------------------------------------------------------------------------------
TRASH *oil-trash*

View file

@ -1,262 +0,0 @@
# Recipes
Have a cool recipe to share? Open a pull request and add it to this doc!
<!-- TOC -->
- [Toggle file detail view](#toggle-file-detail-view)
- [Show CWD in the winbar](#show-cwd-in-the-winbar)
- [Hide gitignored files and show git tracked hidden files](#hide-gitignored-files-and-show-git-tracked-hidden-files)
- [Open Telescope file finder in the current oil directory](#open-telescope-file-finder-in-the-current-oil-directory)
- [Add custom column for file extension](#add-custom-column-for-file-extension)
- [Disable dimming of hidden files](#disable-dimming-of-hidden-files)
<!-- /TOC -->
## Toggle file detail view
```lua
local detail = false
require("oil").setup({
keymaps = {
["gd"] = {
desc = "Toggle file detail view",
callback = function()
detail = not detail
if detail then
require("oil").set_columns({ "icon", "permissions", "size", "mtime" })
else
require("oil").set_columns({ "icon" })
end
end,
},
},
})
```
## Show CWD in the winbar
```lua
-- Declare a global function to retrieve the current directory
function _G.get_oil_winbar()
local bufnr = vim.api.nvim_win_get_buf(vim.g.statusline_winid)
local dir = require("oil").get_current_dir(bufnr)
if dir then
return vim.fn.fnamemodify(dir, ":~")
else
-- If there is no current directory (e.g. over ssh), just show the buffer name
return vim.api.nvim_buf_get_name(0)
end
end
require("oil").setup({
win_options = {
winbar = "%!v:lua.get_oil_winbar()",
},
})
```
## Hide gitignored files and show git tracked hidden files
```lua
-- helper function to parse output
local function parse_output(proc)
local result = proc:wait()
local ret = {}
if result.code == 0 then
for line in vim.gsplit(result.stdout, "\n", { plain = true, trimempty = true }) do
-- Remove trailing slash
line = line:gsub("/$", "")
ret[line] = true
end
end
return ret
end
-- build git status cache
local function new_git_status()
return setmetatable({}, {
__index = function(self, key)
local ignore_proc = vim.system(
{ "git", "ls-files", "--ignored", "--exclude-standard", "--others", "--directory" },
{
cwd = key,
text = true,
}
)
local tracked_proc = vim.system({ "git", "ls-tree", "HEAD", "--name-only" }, {
cwd = key,
text = true,
})
local ret = {
ignored = parse_output(ignore_proc),
tracked = parse_output(tracked_proc),
}
rawset(self, key, ret)
return ret
end,
})
end
local git_status = new_git_status()
-- Clear git status cache on refresh
local refresh = require("oil.actions").refresh
local orig_refresh = refresh.callback
refresh.callback = function(...)
git_status = new_git_status()
orig_refresh(...)
end
require("oil").setup({
view_options = {
is_hidden_file = function(name, bufnr)
local dir = require("oil").get_current_dir(bufnr)
local is_dotfile = vim.startswith(name, ".") and name ~= ".."
-- if no local directory (e.g. for ssh connections), just hide dotfiles
if not dir then
return is_dotfile
end
-- dotfiles are considered hidden unless tracked
if is_dotfile then
return not git_status[dir].tracked[name]
else
-- Check if file is gitignored
return git_status[dir].ignored[name]
end
end,
},
})
```
## Open Telescope file finder in the current oil directory
When using `get_current_dir()` in a keymap that also opens another plugin's UI (like Telescope), always capture the directory in a local variable **before** the call that changes the buffer context. Passing `get_current_dir()` directly as an argument works because Lua evaluates arguments before calling the function, but any subsequent calls will see the new buffer.
```lua
require("oil").setup({
keymaps = {
["<leader>ff"] = {
desc = "Find files in the current directory",
callback = function()
local dir = require("oil").get_current_dir()
if not dir then
vim.notify("Could not get oil directory", vim.log.levels.WARN)
return
end
require("telescope.builtin").find_files({ cwd = dir })
end,
},
["<leader>fg"] = {
desc = "Live grep in the current directory",
callback = function()
local dir = require("oil").get_current_dir()
if not dir then
vim.notify("Could not get oil directory", vim.log.levels.WARN)
return
end
require("telescope.builtin").live_grep({ cwd = dir })
end,
},
},
})
```
If you need the directory after an operation that might change the current buffer, pass the buffer number explicitly:
```lua
local bufnr = vim.api.nvim_get_current_buf()
-- ... some operation that changes the current buffer ...
local dir = require("oil").get_current_dir(bufnr)
```
## Add custom column for file extension
```lua
local oil_cfg = require "oil.config"
local oil_constant = require "oil.constants"
local oil_column = require "oil.columns"
local FIELD_TYPE = oil_constant.FIELD_TYPE
local FIELD_NAME = oil_constant.FIELD_NAME
local function adjust_number(int)
return string.format("%03d%s", #int, int)
end
local function format(output)
return vim.fn.fnamemodify(output, ":e")
end
oil_column.register("extension", {
render = function(entry, _)
local field_type = entry[FIELD_TYPE]
local name = entry[FIELD_NAME]
if field_type == "file" then
if name then
local extension = format(name)
if not extension:match "%s" then
return extension
end
end
end
end,
parse = function(line, _)
return line:match "^(%S+)%s+(.*)$"
end,
create_sort_value_factory = function(num_entries)
if
oil_cfg.view_options.natural_order == false
or (oil_cfg.view_options.natural_order == "fast" and num_entries > 5000)
then
return function(entry)
return format(entry[FIELD_NAME]:lower())
end
else
local memo = {}
return function(entry)
if memo[entry] == nil and entry[FIELD_TYPE] == "file" then
local name = entry[FIELD_NAME]:gsub("0*(%d+)", adjust_number)
memo[entry] = format(name:lower())
end
return memo[entry]
end
end
end,
})
require("oil").setup({
columns = {
"size",
"extension",
"icon",
},
view_options = {
sort = {
{ "type", "asc" },
{ "extension", "asc" },
{ "name", "asc" },
},
},
})
```
## Disable dimming of hidden files
By default, hidden files (toggled with `g.`) are dimmed via the `OilHidden` highlight group, which links to `Comment`. Every typed hidden group (`OilDirHidden`, `OilFileHidden`, etc.) links to `OilHidden`, so all hidden entries resolve to the same dim color regardless of their type.
To make hidden files look identical to their visible counterparts, relink each hidden group to its non-hidden variant after calling `setup()`:
```lua
for _, hl in ipairs(require("oil")._get_highlights()) do
local base = hl.name:match("^(Oil.+)Hidden$")
if base then
vim.api.nvim_set_hl(0, hl.name, { link = base })
end
end
```

43
flake.lock generated Normal file
View file

@ -0,0 +1,43 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1771207753,
"narHash": "sha256-b9uG8yN50DRQ6A7JdZBfzq718ryYrlmGgqkRm9OOwCE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d1c15b7d5806069da59e819999d70e1cec0760bf",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"systems": "systems"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

29
flake.nix Normal file
View file

@ -0,0 +1,29 @@
{
description = "oil.nvim Neovim file explorer: edit your filesystem like a buffer";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
};
outputs =
{
nixpkgs,
systems,
...
}:
let
forEachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
in
{
devShells = forEachSystem (pkgs: {
default = pkgs.mkShell {
packages = [
pkgs.prettier
pkgs.stylua
pkgs.selene
];
};
});
};
}

View file

@ -406,7 +406,7 @@ local M = {}
---@field border? string|string[] Window border
M.setup = function(opts)
opts = opts or {}
opts = opts or vim.g.oil or {}
local new_conf = vim.tbl_deep_extend("keep", opts, default_config)
if not new_conf.use_default_keymaps then

View file

@ -602,7 +602,7 @@ M.open_preview = function(opts, callback)
-- If we called open_preview during an autocmd, then the edit command may not trigger the
-- BufReadCmd to load the buffer. So we need to do it manually.
if util.is_oil_bufnr(filebufnr) then
if util.is_oil_bufnr(filebufnr) and not vim.b[filebufnr].oil_ready then
M.load_oil_buffer(filebufnr)
end
@ -1082,6 +1082,7 @@ M.load_oil_buffer = function(bufnr)
-- (e.g. ssh) because it will set up the filetype keybinds at the *beginning* of the loading
-- process.
vim.bo[bufnr].filetype = "oil"
vim.bo[bufnr].buftype = "acwrite"
keymap_util.set_keymaps(config.keymaps, bufnr)
end
loading.set_loading(bufnr, true)
@ -1446,9 +1447,10 @@ M.setup = function(opts)
end,
})
local bufnr = vim.api.nvim_get_current_buf()
if maybe_hijack_directory_buffer(bufnr) and vim.v.vim_did_enter == 1 then
M.load_oil_buffer(bufnr)
for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
if maybe_hijack_directory_buffer(bufnr) and vim.v.vim_did_enter == 1 then
M.load_oil_buffer(bufnr)
end
end
end
end

3
plugin/oil.lua Normal file
View file

@ -0,0 +1,3 @@
if vim.g.oil ~= nil then
require("oil").setup()
end

View file

@ -1,412 +0,0 @@
import os
import os.path
import re
from dataclasses import dataclass, field
from typing import Any, Dict, List
from nvim_doc_tools import (
LuaParam,
LuaTypes,
Vimdoc,
VimdocSection,
generate_md_toc,
indent,
leftright,
parse_directory,
read_nvim_json,
read_section,
render_md_api2,
render_vimdoc_api2,
replace_section,
wrap,
)
from nvim_doc_tools.vimdoc import format_vimdoc_params
HERE = os.path.dirname(__file__)
ROOT = os.path.abspath(os.path.join(HERE, os.path.pardir))
README = os.path.join(ROOT, "README.md")
DOC = os.path.join(ROOT, "doc")
VIMDOC = os.path.join(DOC, "oil.txt")
def add_md_link_path(path: str, lines: List[str]) -> List[str]:
ret = []
for line in lines:
ret.append(re.sub(r"(\(#)", "(" + path + "#", line))
return ret
def update_md_api():
api_doc = os.path.join(DOC, "api.md")
types = parse_directory(os.path.join(ROOT, "lua"))
funcs = types.files["oil/init.lua"].functions
lines = ["\n"] + render_md_api2(funcs, types, 2) + ["\n"]
replace_section(
api_doc,
r"^<!-- API -->$",
r"^<!-- /API -->$",
lines,
)
toc = ["\n"] + generate_md_toc(api_doc, max_level=1) + ["\n"]
replace_section(
api_doc,
r"^<!-- TOC -->$",
r"^<!-- /TOC -->$",
toc,
)
toc = add_md_link_path("doc/api.md", toc)
replace_section(
README,
r"^<!-- API -->$",
r"^<!-- /API -->$",
toc,
)
def update_readme():
def get_toc(filename: str) -> List[str]:
subtoc = generate_md_toc(os.path.join(DOC, filename))
return add_md_link_path("doc/" + filename, subtoc)
recipes_toc = get_toc("recipes.md")
replace_section(
README,
r"^## Recipes$",
r"^#",
["\n"] + recipes_toc + ["\n"],
)
def update_md_toc(filename: str, max_level: int = 99):
toc = ["\n"] + generate_md_toc(filename, max_level) + ["\n"]
replace_section(
filename,
r"^<!-- TOC -->$",
r"^<!-- /TOC -->$",
toc,
)
def update_config_options():
config_file = os.path.join(ROOT, "lua", "oil", "config.lua")
opt_lines = ['\n```lua\nrequire("oil").setup({\n']
opt_lines.extend(read_section(config_file, r"^\s*local default_config =", r"^}$"))
replace_section(
README,
r"^## Options$",
r"^}\)$",
opt_lines,
)
@dataclass
class ColumnDef:
name: str
adapters: str
editable: bool
sortable: bool
summary: str
params: List["LuaParam"] = field(default_factory=list)
UNIVERSAL = [
LuaParam(
"highlight",
"string|fun(value: string): string",
"Highlight group, or function that returns a highlight group",
),
LuaParam(
"align",
'"left"|"center"|"right"',
"Text alignment within the column",
)
]
TIME = [
LuaParam("format", "string", "Format string (see :help strftime)"),
]
COL_DEFS = [
ColumnDef(
"type",
"*",
False,
True,
"The type of the entry (file, directory, link, etc)",
UNIVERSAL
+ [LuaParam("icons", "table<string, string>", "Mapping of entry type to icon")],
),
ColumnDef(
"icon",
"*",
False,
False,
"An icon for the entry's type (requires nvim-web-devicons)",
UNIVERSAL
+ [
LuaParam(
"default_file",
"string",
"Fallback icon for files when nvim-web-devicons returns nil",
),
LuaParam("directory", "string", "Icon for directories"),
LuaParam(
"add_padding",
"boolean",
"Set to false to remove the extra whitespace after the icon",
),
LuaParam(
"use_slow_filetype_detection",
"boolean",
"Set to true to detect filetypes by reading the first lines of each file (e.g. shebangs).",
),
],
),
ColumnDef("size", "files, ssh, s3", False, True, "The size of the file", UNIVERSAL + []),
ColumnDef(
"permissions",
"files, ssh",
True,
False,
"Access permissions of the file",
UNIVERSAL + [],
),
ColumnDef(
"ctime", "files", False, True, "Change timestamp of the file", UNIVERSAL + TIME + []
),
ColumnDef(
"mtime", "files", False, True, "Last modified time of the file", UNIVERSAL + TIME + []
),
ColumnDef(
"atime", "files", False, True, "Last access time of the file", UNIVERSAL + TIME + []
),
ColumnDef(
"birthtime",
"files, s3",
False,
True,
"The time the file was created",
UNIVERSAL + TIME + [],
),
]
def get_options_vimdoc() -> "VimdocSection":
section = VimdocSection("config", "oil-config")
config_file = os.path.join(ROOT, "lua", "oil", "config.lua")
opt_lines = read_section(config_file, r"^local default_config =", r"^}$")
lines = ["\n", ">lua\n", ' require("oil").setup({\n']
lines.extend(indent(opt_lines, 4))
lines.extend([" })\n", "<\n"])
section.body = lines
return section
def get_options_detail_vimdoc() -> "VimdocSection":
section = VimdocSection("options", "oil-options")
section.body.append(
"""
skip_confirm_for_simple_edits *oil.skip_confirm_for_simple_edits*
type: `boolean` default: `false`
Before performing filesystem operations, Oil displays a confirmation popup to ensure
that all operations are intentional. When this option is `true`, the popup will be
skipped if the operations:
* contain no deletes
* contain no cross-adapter moves or copies (e.g. from local to ssh)
* contain at most one copy or move
* contain at most five creates
prompt_save_on_select_new_entry *oil.prompt_save_on_select_new_entry*
type: `boolean` default: `true`
There are two cases where this option is relevant:
1. You copy a file to a new location, then you select it and make edits before
saving.
2. You copy a directory to a new location, then you enter the directory and make
changes before saving.
In case 1, when you edit the file you are actually editing the original file because
oil has not yet moved/copied it to its new location. This means that the original
file will, perhaps unexpectedly, also be changed by any edits you make.
Case 2 is similar; when you edit the directory you are again actually editing the
original location of the directory. If you add new files, those files will be
created in both the original location and the copied directory.
When this option is `true`, Oil will prompt you to save before entering a file or
directory that is pending within oil, but does not exist on disk.
"""
)
return section
def get_highlights_vimdoc() -> "VimdocSection":
section = VimdocSection("Highlights", "oil-highlights", ["\n"])
highlights = read_nvim_json('require("oil")._get_highlights()')
for hl in highlights:
name = hl["name"]
desc = hl.get("desc")
if desc is None:
continue
section.body.append(leftright(name, f"*hl-{name}*"))
section.body.extend(wrap(desc, 4))
section.body.append("\n")
return section
def load_params(params: Dict[str, Any]) -> List[LuaParam]:
ret = []
for name, data in sorted(params.items()):
ret.append(LuaParam(name, data["type"], data["desc"]))
return ret
def get_actions_vimdoc() -> "VimdocSection":
section = VimdocSection("Actions", "oil-actions", ["\n"])
section.body.append(
"""The `keymaps` option in `oil.setup` allow you to create mappings using all the same parameters as |vim.keymap.set|.
>lua
keymaps = {
-- Mappings can be a string
["~"] = "<cmd>edit $HOME<CR>",
-- Mappings can be a function
["gd"] = function()
require("oil").set_columns({ "icon", "permissions", "size", "mtime" })
end,
-- You can pass additional opts to vim.keymap.set by using
-- a table with the mapping as the first element.
["<leader>ff"] = {
function()
require("telescope.builtin").find_files({
cwd = require("oil").get_current_dir()
})
end,
mode = "n",
nowait = true,
desc = "Find files in the current directory"
},
-- Mappings that are a string starting with "actions." will be
-- one of the built-in actions, documented below.
["`"] = "actions.tcd",
-- Some actions have parameters. These are passed in via the `opts` key.
["<leader>:"] = {
"actions.open_cmdline",
opts = {
shorten_path = true,
modify = ":h",
},
desc = "Open the command line with the current directory as an argument",
},
}
"""
)
section.body.append("\n")
section.body.extend(
wrap(
"""Below are the actions that can be used in the `keymaps` section of config options. You can refer to them as strings (e.g. "actions.<action_name>") or you can use the functions directly with `require("oil.actions").action_name.callback()`"""
)
)
section.body.append("\n")
actions = read_nvim_json('require("oil.actions")._get_actions()')
actions.sort(key=lambda a: a["name"])
for action in actions:
if action.get("deprecated"):
continue
name = action["name"]
desc = action["desc"]
section.body.append(leftright(name, f"*actions.{name}*"))
section.body.extend(wrap(desc, 4))
params = action.get("parameters")
if params:
section.body.append("\n")
section.body.append(" Parameters:\n")
section.body.extend(
format_vimdoc_params(load_params(params), LuaTypes(), 6)
)
section.body.append("\n")
return section
def get_columns_vimdoc() -> "VimdocSection":
section = VimdocSection("Columns", "oil-columns", ["\n"])
section.body.extend(
wrap(
'Columns can be specified as a string to use default arguments (e.g. `"icon"`), or as a table to pass parameters (e.g. `{"size", highlight = "Special"}`)'
)
)
section.body.append("\n")
for col in COL_DEFS:
section.body.append(leftright(col.name, f"*column-{col.name}*"))
section.body.extend(wrap(f"Adapters: {col.adapters}", 4))
if col.sortable:
section.body.extend(
wrap(f"Sortable: this column can be used in view_props.sort", 4)
)
if col.editable:
section.body.extend(wrap(f"Editable: this column is read/write", 4))
section.body.extend(wrap(col.summary, 4))
section.body.append("\n")
section.body.append(" Parameters:\n")
section.body.extend(format_vimdoc_params(col.params, LuaTypes(), 6))
section.body.append("\n")
return section
def get_trash_vimdoc() -> "VimdocSection":
section = VimdocSection("Trash", "oil-trash", [])
section.body.append(
"""
Oil has built-in support for using the system trash. When
`delete_to_trash = true`, any deleted files will be sent to the trash instead
of being permanently deleted. You can browse the trash for a directory using
the `toggle_trash` action (bound to `g\\` by default). You can view all files
in the trash with `:Oil --trash /`.
To restore files, simply move them from the trash to the desired destination,
the same as any other file operation. If you delete files from the trash they
will be permanently deleted (purged).
Linux:
Oil supports the FreeDesktop trash specification.
https://specifications.freedesktop.org/trash/1.0/
All features should work.
Mac:
Oil has limited support for MacOS due to the proprietary nature of the
implementation. The trash bin can only be viewed as a single dir
(instead of being able to see files that were trashed from a directory).
Windows:
Oil supports the Windows Recycle Bin. All features should work.
"""
)
return section
def generate_vimdoc():
doc = Vimdoc("oil.txt", "oil")
types = parse_directory(os.path.join(ROOT, "lua"))
funcs = types.files["oil/init.lua"].functions
doc.sections.extend(
[
get_options_vimdoc(),
get_options_detail_vimdoc(),
VimdocSection("API", "oil-api", render_vimdoc_api2("oil", funcs, types)),
get_columns_vimdoc(),
get_actions_vimdoc(),
get_highlights_vimdoc(),
get_trash_vimdoc(),
]
)
with open(VIMDOC, "w", encoding="utf-8") as ofile:
ofile.writelines(doc.render())
def main() -> None:
"""Update the README"""
update_config_options()
update_md_api()
update_md_toc(README, max_level=1)
update_md_toc(os.path.join(DOC, "recipes.md"))
update_readme()
generate_vimdoc()

View file

@ -1,31 +0,0 @@
#!/usr/bin/env python
import argparse
import os
import sys
HERE = os.path.dirname(__file__)
ROOT = os.path.abspath(os.path.join(HERE, os.path.pardir))
DOC = os.path.join(ROOT, "doc")
def main() -> None:
"""Generate docs"""
sys.path.append(HERE)
parser = argparse.ArgumentParser(description=main.__doc__)
parser.add_argument("command", choices=["generate", "lint"])
args = parser.parse_args()
if args.command == "generate":
import generate
generate.main()
elif args.command == "lint":
from nvim_doc_tools import lint_md_links
files = [os.path.join(ROOT, "README.md")] + [
os.path.join(DOC, file) for file in os.listdir(DOC) if file.endswith(".md")
]
lint_md_links.main(ROOT, files)
if __name__ == "__main__":
main()

View file

@ -1,4 +0,0 @@
pyparsing==3.0.9
black
isort
mypy

1
selene.toml Normal file
View file

@ -0,0 +1 @@
std = 'vim'

27
tests/config_spec.lua Normal file
View file

@ -0,0 +1,27 @@
local config = require("oil.config")
describe("config", function()
after_each(function()
vim.g.oil = nil
end)
it("falls back to vim.g.oil when setup() is called with no args", function()
vim.g.oil = { delete_to_trash = true, cleanup_delay_ms = 5000 }
config.setup()
assert.is_true(config.delete_to_trash)
assert.equals(5000, config.cleanup_delay_ms)
end)
it("uses defaults when neither opts nor vim.g.oil is set", function()
vim.g.oil = nil
config.setup()
assert.is_false(config.delete_to_trash)
assert.equals(2000, config.cleanup_delay_ms)
end)
it("prefers explicit opts over vim.g.oil", function()
vim.g.oil = { delete_to_trash = true }
config.setup({ delete_to_trash = false })
assert.is_false(config.delete_to_trash)
end)
end)