aboutsummaryrefslogtreecommitdiff
path: root/runtime/plugin
Commit message (Collapse)AuthorAge
* fix(lua): enable param-type-mismatch diagnosticLewis Russell2026-09-28
| | | | | | | | | Problem: Argument type mismatches are excluded from EmmyLua checks. Solution: Correct runtime annotations and calls, document local checker workarounds, and enable the diagnostic. AI-assisted
* build: replace LuaLS with EmmyLuaLewis Russell2026-09-07
| | | | | | | | | | | | | | | Problem: LuaLS struggles with the generics used in Nvim's runtime, requiring broad diagnostic suppressions. Indexing is also slow. Solution: Use EmmyLua for type checks in the build and CI. It offers more sophisticated type checking, substantially better support for generics, and much better flow analysis. Correct the affected annotations. Use `@internal`, supported directly by EmmyLua, instead of `@nodoc` for shared internal declarations, and support it in the help parser. AI-assisted
* refactor(defaults): edit global cwd on "1-" #41254Nathan Zeng2026-08-11
| | | | | | | | | Problem: `1-` does nothing from a directory buffer, because we are already in the buffer-local CWD. It's also unintuitive that this mapping behaves differently based on the resolved CWD. Solution: Have `1-` open the global CWD.
* fix(dir): preserve alternate file #41177Barrett Ruth2026-08-05
|
* refactor(zip)!: address entries with zip:// pathsBarrett Ruth2026-08-03
| | | | | | | | | | | | | | | | | | Problem: `zipfile://{archive}::{entry}` is ambiguous: `::` is legal in both an archive path and an entry path, so the separator cannot be identified. Splitting at the last `::` reads archives correctly but breaks entries that contain it, and the plugin then emits buffer names it cannot read back. Solution: Address entries as `zip://{archive}/{entry}`, joining the two paths. Resolve the split by walking components: the first one that is a regular file is the archive, because a regular file cannot have children on disk. Entry paths may then contain any character, and no escaping is needed. zipPlugin.vim keeps its own scheme, so the Java ftplugin emits whichever form matches the active plugin until the legacy package is removed.
* feat(zip): extract archive membersBarrett Ruth2026-07-29
|
* refactor(zip)!: builtin zip.lua plugin #40846Barrett Ruth2026-07-29
| | | | | | | | | | Problem: The bundled `zip` plugin is implemented in Vimscript, making it harder to maintain and build on with Nvim's Lua runtime infrastructure. Solution: Add an opt-out `zip.lua` browser backed by `nvim.dir`, and disable the legacy Vimscript implementation by moving it to `pack/dist/opt/zip/`. Load it with `:packadd zip`.
* feat(dir): open cwd with `1-` #40948Barrett Ruth2026-07-27
|
* feat(dir): support counts for parent navigation #40927Barrett Ruth2026-07-24
|
* fix(dir): user/plugin can override default "-" mapping #40676Barrett Ruth2026-07-10
|
* fix(man.lua): cache pages until width changes #40607Barrett Ruth2026-07-06
| | | | | | | Problem: :Man unloads hidden buffers, so reopening large pages reruns rendering even when the width is unchanged. Solution: keep regular man buffers loaded and refresh them only when the effective width changes.
* fix(dir): define "-" (up/parent) mapping earlier #40531Barrett Ruth2026-07-02
| | | | | | | | | | Problem: The dir.lua "-" mapping cannot be easily overridden (because of autocmd ordering). Solution: - Move it to defaults.lua. - Also to be extra polite: fall back to builtin `-` motion if the user disabled the `dir.lua` plugin.
* fix(dir): restore loaded plugin guard #40528Barrett Ruth2026-07-01
|
* fix(dir): use `nvim.dir` augroup #40507Barrett Ruth2026-06-30
|
* fix(dir): remove loaded plugin guard #40489Barrett Ruth2026-06-30
|
* fix(shada): plugin/shada.lua does not respect 'cpoptions' "+" flag #40412Dmytro Meleshko2026-06-27
| | | | | | | | | | | Problem: plugin/shada.lua does not respect the `+` flag of 'cpoptions' when writing a *.shada buffer into a different file. Solution: Check the presence of `+` in 'cpoptions' and whether the buffer is written to a different file in BufWriteCmd for *.shada before resetting the 'modified' option of the buffer. This little defect appeared after plugin/shada.vim was rewritten into Lua in #34725.
* feat(dir.lua): global "-" default mapping #40426Barrett Ruth2026-06-26
|
* feat(runtime): replace netrw with a very small script #39723Barrett Ruth2026-06-25
| | | | | | | | | | | | | | Problem: `:edit <dir>` and `nvim <dir>` currently rely on netrw to show local directory contents. Solution: - Provide `filetype=directory`. - Introduce dir.lua, a small plugin that provides directory listing, opening items, parent navigation, and refresh. - `netrw` remains available for `:Explore`, remote paths, archives, and file operations. To continue Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* feat(autoread): use filewatchers for OS-driven change detection #37971Oleksandr Chekhovskyi2026-06-12
| | | | | | | | | | | | | | | Problem: The 'autoread' option only checks for file changes reactively — on FocusGained, :checktime, CmdlineEnter, etc. — by polling timestamps. External changes are not detected until the user interacts with Neovim. Solution: Add a core module (runtime/lua/nvim/autoread.lua) enabled from runtime/plugin/autoread.lua that watches each buffer's file using vim._watch.watch() (libuv fs_event). On change detection it calls :checktime, which invokes the existing buf_check_timestamp() logic for reload/prompt handling. Watchers are managed via autocmds tied to buffer lifecycle events and respect the 'autoread' option (global and buffer-local).
* fix(net): set buftype=nofile (again) #39930Justin M. Keyes2026-05-21
| | | redux 24e00f2844bc
* fix(net): `:edit <uri>` should set buftype=nofile #39915Justin M. Keyes2026-05-20
|
* docs: misc, custom text-object #39877Justin M. Keyes2026-05-20
| | | | | text-object-define is a pattern I found in tpope's plugins (e.g. https://github.com/tpope/vim-jdaddy) which shows an elegant way to define a text-object. (Any mistakes in the example are my fault.)
* vim-patch:591db92: runtime(zip,tar): Add support for compressed .cbz and ↵zeertzjq2026-05-16
| | | | | | | | | | | | | .cbt files *.cbz and *.cbt files are just zip and tar files for comic books. https://en.wikipedia.org/wiki/Comic_book_archive closes: vim/vim#20206 https://github.com/vim/vim/commit/591db923bae1657e788f6bb0e6d4527448c72041 Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
* fix(matchparen): remove redundant vimscript shimChristian Clason2026-05-09
| | | | | | | | | | Problem: #39625 retained `matchparen.vim` as a shim that sources the new `matchparen.lua` entrypoint, which is redundant since Lua runtime/plugin files are sourced automatically and incurs startuptime cost solely for the sake of not touching the tests. Solution: Remove the shim and `source` the Lua plugin in directly in tests.
* refactor(matchparen): rewrite matchparen plugin in LuaYi Ming2026-05-08
| | | | AI-assisted: Codex
* feat(lua)!: vim.isnil, vim.nonnil, deprecate vim.F #39495Olivia Kinnear2026-05-06
|
* refactor(tty): tty.request() #39489Justin M. Keyes2026-04-30
| | | | | | | | Problem: - Various `TermRequest` handlers which all do similar things. - `tty.query` is specific to `XTGETTCAP DCS`, can't be reused for other kinds of terminal queries. Solution: Provide `tty.request()`.
* fix(net): handle remote archive URLs via tar/zip browse #38744Tom Ampuero2026-04-05
| | | | | | | | | Problem: Opening .tar.gz or .zip URLs shows raw binary instead of using the archive plugins. Solution: Similar to the original netrw implementation, the autocmd should detect archive URLs, download them to a temp file and the open them with tar/zip handlers already bundled as vim plugins.
* feat(net): vim.net.request(outbuf) writes response to buffer #36164Yochem van Rosmalen2026-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Non-trivial to write output of vim.net.request to buffer. Requires extra code in plugin/net.lua which can't be reused by other plugin authors. ``` vim.net.request('https://neovim.io', {}, function(err, res) if not err then local buf = vim.api.nvim_create_buf(true, false) if res then local lines = vim.split(res.body, '\n', { plain = true }) vim.api.nvim_buf_set_lines(buf, 0, -1, true, lines) end end end) ``` Solution: Accept an optional `outbuf` argument to indicate the buffer to write output to, similar to `outpath`. vim.net.request('https://neovim.io', { outbuf = buf }) Other fixes / followups: - Make plugin/net.lua smaller - Return objection with close() method - vim.net.request.Opts class - vim.validate single calls - Use (''):format(...) instead of `..`
* refactor: rename termcap.lua -> tty.lua #38437Justin M. Keyes2026-03-23
| | | | | | | | | Problem: The `termcap.lua` module is too narrowly named. We may need a place for tty-related functionality in the future. https://github.com/neovim/neovim/pull/31399#discussion_r1882598297 Solution: This isn't a public/documented interface, so just rename it.
* fix(runtime)!: move "tohtml" to pack/dist/opt/ #34557Justin M. Keyes2026-03-23
| | | | | | | | | | | Problem: The "tohtml" plugin is loaded by default. Solution: - Move it to `pack/dist/opt/nvim.tohtml/`, it is an "opt-in" plugin now. - Document guidelines. - Also revert the `plugin/` locations of `spellfile.lua` and `net.lua`. That idea was not worth the trouble, it will be too much re-education for too little gain.
* docs: use "ev" convention in event-handlersJustin M. Keyes2026-03-12
| | | | | | | | | Problem: In autocmd examples, using "args" as the event-object name is vague and may be confused with a user-command. Solution: Use "ev" as the conventional event-object name.
* feat(cmdline): completion for :TOhtml #37045Eric Wong2025-12-20
|
* fix(vim.net): filetype detection, mark unmodified #36297Michele Sorcinelli2025-11-19
| | | | | | | | | | | | | | | | | | Problem: When running ":edit <url>", filetype detection is not triggered. Solution: Run the autocmds in the filetypedetect group after loading the content. Problem: After fetching remote content from a URL and adding it to the buffer, the buffer is marked as modified. This is inconsistent with the original netrw behavior, and it causes problems with `:e` to refresh or `:q` as it prompts for saving the file even if the user hasn't touched the content at all. Solution: Mark the buffer as unmodified right after adding the remote content to the buffer.
* refactor(spellfile): config() interface, docs #36481Yochem van Rosmalen2025-11-09
| | | | | | | | | | | | Problem: - Exposing the raw config as table is a pattern not seen anywhere else in the Nvim codebase. - Old spellfile.vim docs still available, no new documentation Solution: - Exposing a `config()` function that both acts as "getter" and "setter" is a much more common idiom (e.g. vim.lsp, vim.diagnostic). - Add new documentation and link old docs to |spellfile.lua| instead of |spellfile.vim|.
* refactor(spell): cleanupJustin M. Keyes2025-10-26
| | | | | - prefer `stdpath(data)/site/spell` instead of looking for random dirs in 'runtimepath'. - drop unused functions `choose_directory`, `setup`, etc.
* refactor(spell): migrate to Lua, drop netrw dependencyTom Ampuero2025-10-26
| | | | | | | | | | | | | Problem: Spell file downloads relied on Vimscript and netrw (:Nread). If netrw is disabled, downloads fail. Solution: Port the logic to Lua as `nvim.spellfile` and wire it via a Lua plugin that handles `SpellFileMissing`. Use `vim.net.request()` with a timeout for HTTP, prompt via `vim.fn.input` and report via `vim.notify`. Closes #7189
* vim-patch:8824526: runtime(zip): add *.pkpass to list of zip extensions (#36061)zeertzjq2025-10-07
| | | | | | | | | | | Similar to a359c9c25e5c3c1e543fc720223aa7256e6f72cf. See https://developer.apple.com/documentation/walletpasses/building-a-pass#Sign-the-Pass-and-Create-the-Bundle, which explicitly mentions that pkpasses are just renamed ZIPs. closes: vim/vim#18501 https://github.com/vim/vim/commit/882452644cd3258c887a09de856e4c59eb284a92 Co-authored-by: MultisampledNight <contact@multisamplednight.com>
* feat(tui): add nvim_ui_send (#35406)Gregory Anders2025-08-22
| | | | This function allows the Nvim core to write arbitrary data to a TTY connected to a UI's stdout.
* fix(shada): check return value is 0Yochem van Rosmalen2025-07-23
| | | | | | | | | Problem: Vimscript functions return number to signal ok/error. Lua doesn't convert these to be falsey. Solution: Explicitly check if the return value is 0.
* refactor(shada): switch plugin/shada.vim to Lua #34725Yochem van Rosmalen2025-07-23
|
* vim-patch:9.1.1552: [security]: path traversal issue in tar.vimzeertzjq2025-07-18
| | | | | | | | | | | | | | | | | | | | | | | | Problem: [security]: path traversal issue in tar.vim (@ax) Solution: warn the user for such things, drop leading /, don't forcefully overwrite files when writing temporary files, refactor autoload/tar.vim tar.vim: drop leading / in path names A tar archive containing files with leading `/` may cause confusions as to where the content is extracted. Let's make sure we drop the leading `/` and use a relative path instead. Also while at it, had to refactor it quite a bit and increase the minimum supported Vim version to v9. Also add a test for some basic tar functionality closes: vim/vim#17733 https://github.com/vim/vim/commit/87757c6b0a4b2c1f71c72ea8e1438b8fb116b239 Co-authored-by: Christian Brabandt <cb@256bit.org>
* Merge pull request #34860 from gpanders/push-lorwmnmtysntGregory Anders2025-07-17
|\ | | | | feat(tui): use DA1 response to determine OSC 52 support
| * feat(tui): use DA1 response to determine OSC 52 supportGregory Anders2025-07-09
| | | | | | | | | | | | Many terminals now include support for OSC 52 in their Primary Device Attributes (DA1) response. This is preferable to using XTGETTCAP because DA1 is _much_ more broadly supported.
* | feat(net): vim.net.request(), :edit [url] #34140Tom Ampuero2025-07-13
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Nvim depends on netrw to download/request URL contents. Solution: - Add `vim.net.request()` as a thin curl wrapper: - Basic GET with --silent, --show-error, --fail, --location, --retry - Optional `opts.outpath` to save to a file - Operates asynchronously. Pass an `on_response` handler to get the result. - Add integ tests (requires NVIM_TEST_INTEG to be set) to test success and 404 failure. - Health check for missing `curl`. - Handle `:edit https://…` using `vim.net.request()`. API Usage: 1. Asynchronous request: vim.net.request('https://httpbingo.org/get', { retry = 2 }, function(err, response) if err then print('Fetch failed:', err) else print('Got body of length:', #response.body) end end) 2. Download to file: vim.net.request('https://httpbingo.org/get', { outpath = 'out_async.txt' }, function(err) if err then print('Error:', err) end end) 3. Remote :edit integration (in runtime/plugin/net.lua) fetches into buffer: :edit https://httpbingo.org/get
* fix: use nvim namespace convention #34010Yochem van Rosmalen2025-05-22
|
* vim-patch:9.1.1384: still some problem with the new tutors filetype pluginbrianhuster2025-05-13
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: still some problem with the new tutors filetype plugin Solution: refactor code to enable/disable tutor mode into tutor#EnableInteractive() function, include a test (Phạm Bình An) I find it annoying that Tutor's interactive mode is always on (or debug mode is off) even when I open a tutor file with :edit command. I think it makes more sense to make this "interactive mode": - Always on when it is opened with :Tutor command - Off otherwise For more references, see `:help` feature, it is a much better than :Tutor, since I don't have to run `:let g:help_debug = 1` just to be able to edit and save a help file Therefore, I remove `g:tutor_debug` closes: vim/vim#17299 https://github.com/vim/vim/commit/13bea589a25707c8f9e29b2920410bdcccd79bc5 Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
* vim-patch:3704b5b: runtime(tutor): improve tutor.vim plugin and filetype pluginbrianhuster2025-05-13
| | | | | | | | | | | | | - Set g:tutor_debug on startup if it doesn't exist so that users can get cmdline completion when interactively setting it. - set b:undo_ftplugin in filetype plugin - set default runtime file headers closes: vim/vim#17274 https://github.com/vim/vim/commit/3704b5b58ace1163522188e3228996c15e56820e Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
* fix(man.lua): noisy "ENOENT" error on Windows #33409Emanuel Krollmann2025-04-12
| | | | | | | Problem: :Man shows noisy "ENOENT: no such file or directory" error on Windows. Solution: Do some checks before calling `vim.system`.
* vim-patch:9.1.1289: tests: no test for matchparen plugin with WinScrolled ↵zeertzjq2025-04-10
| | | | | | | | | | | | event (#33411) Problem: tests: no test for matchparen plugin with WinScrolled event Solution: add missing test closes: vim/vim#10942 https://github.com/vim/vim/commit/96a0b2a6d5107580398435e263bd529d4ba3df49 Co-authored-by: Christian Brabandt <cb@256bit.org>