aboutsummaryrefslogtreecommitdiff
path: root/runtime/plugin
Commit message (Collapse)AuthorAge
* Merge remote-tracking branch 'upstream/master' into mix_20240309HEADrahmJosh Rahm2025-02-05
|\
| * vim-patch:9cfdabb: runtime(netrw): change netrw maintainerChristian Clason2025-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Dr. Chip retired some time ago and is no longer maintaining the netrw plugin. However as a runtime plugin distributed by Vim, it important to maintain the netrw plugin in the future and fix bugs as they are reported. So, split out the netrw plugin as an additional package, however include some stubs to make sure the plugin is still loaded by default and the documentation is accessible as well. closes: vim/vim#16368 https://github.com/vim/vim/commit/9cfdabb074feefc9848e9f7a4538f201e28c7f06 Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
| * refactor: use nvim.foo.bar format for autocommand groupsMaria José Solano2025-01-14
| |
| * fix(runtime): let matchit and matchparen skips fallback on treesitter capturesEmilia Simmons2025-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When treesitter is enabled, by default syntax groups are not defined, but these groups are used to identify where to skip matches in matchit and matchparen. This patch does three things: 1. If syntax is enabled regardless of treesitter (`vim.bo.syntax='on'`): Use original implementation. 2. If treesitter is enabled and syntax is not: Match the syntax groups (i.e. `comment\|string`) against treesitter captures to check for skipped groups. 3. Add an explicit treesitter syntax for marking captures to skip: matchit uses `b:match_skip` to determine what counts as skippable Where 's:comment\|string' uses a match of the named syntax groups against a regex match of comment\|string, 't:comment\|string' now uses vim regex to match against the names of the treesitter capture groups.
| * feat(clipboard)!: use OSC 52 as fallback clipboard provider (#31730)Gregory Anders2024-12-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently enable the OSC 52 clipboard provider by setting g:clipboard when a list of conditions are met, one of which is that $SSH_TTY must be set. We include this condition because often OSC 52 is not the best clipboard provider, so if there are "local" providers available Nvim should prefer those over OSC 52. However, if no other providers are available, Nvim should use OSC 52 even when $SSH_TTY is not set. When a user is in an SSH session then the checks for the other clipboard providers will still (typically) fail, so OSC 52 continues to be enabled by default in SSH sessions. This is marked as a breaking change because there are some cases where OSC 52 wasn't enabled before and is now (or vice versa).
| * vim-patch:c363ca1: runtime(netrw): change indent size from 1 to 2 (#31648)zeertzjq2024-12-20
| | | | | | | | | | | | | | closes: vim/vim#16248 https://github.com/vim/vim/commit/c363ca1ecd1f8db03663ef98dcf41eeacc3c22c7 Co-authored-by: Luca Saccarola <github.e41mv@aleeas.com>
| * refactor(man.lua): various changesLewis Russell2024-12-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replace all uses of vim.regex with simpler Lua patterns. - Replace all uses of vim.fn.substitute with string.gsub. - Rework error handling so expected errors are passed back via a return. - These get routed up an passed to `vim.notify()` - Any other errors will cause a stack trace. - Reworked the module initialization of `localfile_arg` - Updated all type annotations. - Refactored CLI completion by introduction a parse_cmdline() function. - Simplified `show_toc()` - Refactor highlighting - Inline some functions - Fix completion on MacOS 13 and earlier. - Prefer `manpath -q` over `man -w` - Make completion more efficient by avoiding vim.fn.sort and vim.fn.uniq - Reimplement using a single loop
* | Merge remote-tracking branch 'upstream/master' into mix_20240309Josh Rahm2024-11-25
|\|
| * vim-patch:59834ba: runtime(matchparen): Add matchparen_disable_cursor_hl ↵Christian Clason2024-11-05
| | | | | | | | | | | | | | | | | | | | | | | | | | config option Set the "matchparen_disable_cursor_hl" config variable to disable highlighting the cursor with the MatchParen highlighting group. closes: vim/vim#15984 https://github.com/vim/vim/commit/59834ba6df10dc48565bf55ac6c8e8a4aa40210b Co-authored-by: Matteo Landi <matteo@matteolandi.net>
| * vim-patch:8b0fa7a: runtime(netrw): make :Launch/Open autoloadablezeertzjq2024-10-31
| | | | | | | | | | | | | | | | | | | | fixes: vim/vim#15959 closes: vim/vim#15962 https://github.com/vim/vim/commit/8b0fa7a565d8aec306e5755307d182fa7d81e65f Co-authored-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
| * vim-patch:d69ffbe: runtime(netrw): add missing change for s:redir()zeertzjq2024-10-31
| | | | | | | | | | | | | | | | Somehow, that change got lost in commit 70197885 https://github.com/vim/vim/commit/d69ffbe4bc2196c4fc2b9377167a9a194213a686 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * vim-patch:7019788: runtime(netrw): improve netrw's open-handling furtherzeertzjq2024-10-31
| | | | | | | | | | | | | | | | closes: vim/vim#15956 https://github.com/vim/vim/commit/70197885a8957071e4ab6816141ce6e8026635c6 Co-authored-by: Enno <Konfekt@users.noreply.github.com>
| * vim-patch:7c96776: runtime(netrw): fix syntax error in netrwPlugin.vimzeertzjq2024-10-31
| | | | | | | | | | | | https://github.com/vim/vim/commit/7c96776729a671b7c5f6be81bc29d860920ea1c1 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * vim-patch:3d7e567: runtime(netrw): simplify gx file handlingzeertzjq2024-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It did not work very well, at least on Debian 12, and I am not sure Git Bash and WSL, for example, were taken care of as maintenance stalled. The whole logic was somewhat convoluted with some parts repeatedly invoking failed commands. The file handling was outdated, for example, nowadays Netscape is rarely used, and also opinionated, for example mainly Microsoft Paint and Gimp for Image files. Instead, let's use (xdg-)open and similar commands on other systems which respects the user's preferences. closes: vim/vim#15721 https://github.com/vim/vim/commit/3d7e567ea7392e43a90a6ffb3cd49b71a7b59d1a Co-authored-by: Konfekt <Konfekt@users.noreply.github.com> Co-authored-by: Luca Saccarola <96259932+saccarosium@users.noreply.github.com>
* | Merge remote-tracking branch 'upstream/master' into mix_20240309Josh Rahm2024-11-19
|\|
| * vim-patch:9.1.0694: matchparen is slow on a long line (#30134)zeertzjq2024-08-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The matchparen plugin is slow on a long line. Solution: Don't use a regexp to get char at and before cursor. (zeertzjq) Example: ```vim call setline(1, repeat(' foobar', 100000)) runtime plugin/matchparen.vim normal! $hhhhhhhh ``` closes: vim/vim#15568 https://github.com/vim/vim/commit/81e7513c86459c40676bd983f73c2722096d67a9
| * fix(tohtml): support ranges againaltermo2024-07-16
| |
* | Merge remote-tracking branch 'upstream/master' into mix_20240309Josh Rahm2024-05-24
|\|
| * vim-patch:94043780196c (#28831)zeertzjq2024-05-18
| | | | | | | | | | | | | | runtime(matchparen): fix :NoMatchParen not working (vim/vim#14797) fixes: neovim/neovim#28828 https://github.com/vim/vim/commit/94043780196cc66d23eeec10e2c722c6552324e0
| * vim-patch:1e34b95e4402Christian Clason2024-05-09
| | | | | | | | | | | | | | | | | | | | runtime(netrw): Remove and cleanup Win9x legacy from netrw closes: vim/vim#14732 https://github.com/vim/vim/commit/1e34b95e4402fd8964ea4bcee0d2b6ffa6677aab Co-authored-by: Nir Lichtman <nir@lichtman.org>
| * feat(defaults): add :Inspect to right-click menu (#28181)zeertzjq2024-04-05
| | | | | | | | | | | | | | Ref #21393 - Move default user commands to _defaults.lua as that now contains all kinds of defaults rather than just default mappings and menus. - Remove the :aunmenu as there are no menus when _defaults.lua is run.
| * vim-patch:9.1.0167: Changing buffer in another window causes it to show ↵zeertzjq2024-03-12
| | | | | | | | | | | | | | | | | | | | | | | | matchparen (#27820) Problem: Changing buffer in another window using win_execute() causes it to show matchparen (after 9.0.0969). Solution: Delay highlighting with SafeState in BufWinEnter. (zeertzjq) closes: vim/vim#14177 https://github.com/vim/vim/commit/49ffb6b428e1e053446ec0209558a8f9d0963ae7
* | Merge remote-tracking branch 'upstream/master' into userregJosh Rahm2024-03-09
|\|
| * fix(tohtml): set filetype of generated HTML to `html`Christian Clason2024-02-28
| | | | | | | | | | | | | | Problem: `:TOhtml` opens the generated HTML code in a split, meaning it inherits the `help` filetype if a help buffer is to be converted. Solution: Explicitly set the filetype to `html`.
| * feat!: rewrite TOhtml in luaaltermo2024-02-28
| | | | | | | | | | | | Co-authored-by: wookayin <wookayin@gmail.com> Co-authored-by: clason <c.clason@uni-graz.at> Co-authored-by: Lewis Russell <me@lewisr.dev>
| * vim-patch:f9ca139e3aa1 (#27554)zeertzjq2024-02-21
| | | | | | | | | | | | | | runtime(misc): announce adoption of various runtime files https://github.com/vim/vim/commit/f9ca139e3aa12dd03177ebba5eedcee4f0836f27 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * fix(osc52): do not use 'vim.iter' (#27218)Evgeni Chasnovski2024-01-26
| | | | | | | | | | Problem: Using 'vim.iter' loads it during startup. Solution: Do not use 'vim.iter'.
| * vim-patch:3a5b3df7764d (#26956)dundargoc2024-01-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | runtime(tar): fix a few problems with the tar plugin From: vim/vim#138331: - Updating .tar.zst files was broken. Fixes vim/vim#12639. - Extracting files from .tar.zst / .tzs files was also broken and works now. From: vim/vim#12637: - Fixes variable assignment and typo From: vim/vim#8109: - Rename .tzs to the more standard .tzst fixes: vim/vim#12639 fixes: vim/vim#8105 closes: vim/vim#8109 closes: vim/vim#12637 closes: vim/vim#13831 https://github.com/vim/vim/commit/3a5b3df7764daa058a3e779183e8f38a8418b164 Co-authored-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Martin Rys <martin@rys.pw> Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com> Co-authored-by: Carlo Teubner <carlo@cteubner.net>
| * feat(defaults): enable 'termguicolors' by default when supported by terminalGregory Anders2023-12-06
| | | | | | | | | | | | | | | | | | | | | | | | Enable 'termguicolors' automatically when Nvim can detect that truecolor is supported by the host terminal. If $COLORTERM is set to "truecolor" or "24bit", or the terminal's terminfo entry contains capabilities for Tc, RGB, or setrgbf and setrgbb, then we assume that the terminal supports truecolor. Otherwise, the terminal is queried (using both XTGETTCAP and SGR + DECRQSS). If the terminal's response to these queries (if any) indicates that it supports truecolor, then 'termguicolors' is enabled.
* | Merge remote-tracking branch 'upstream/master' into userreguserregJosh Rahm2023-11-29
|\|
| * fix(man): set the nested flag for the BufReadCmd autocommand (#26285)Gregory Anders2023-11-28
| | | | | | | | The nested flag must be set so that other autocommands can fire while the BufReadCmd is still executing.
| * fix(rplugin): dont create data dir if it's a broken symlink #25726Samuel (ThinLinc team)2023-11-28
| | | | | | | | | | | | | | | | | | | | | | | | Checking if it's non-empty and not a directory gets us quite far, but not all the way. While a working symlink would trigger the earlier checks, a broken symlink does not. This commit fixes the special case where ~/.local/share/nvim already exists but is a broken symlink. Thus, it fixes the following error on startup: E739: Cannot create directory /home/samuel/.local/share/nvim: file already exists
| * fix(osc52): enable OSC 52 by default in tmux sessions (#26072)Gregory Anders2023-11-16
| | | | | | | | | | tmux has a set-clipboard option which, when set to 'on', allows applications to set the system clipboard using the usual OSC 52 escape sequence.
| * feat(clipboard): enable OSC 52 clipboard provider by default (#26064)Gregory Anders2023-11-16
| | | | | | | | | | | | | | | | | | | | | | | | | | Use the XTGETTCAP sequence to determine if the host terminal supports the OSC 52 sequence and, if it does, enable the OSC 52 clipboard provider by default. This is only done automatically when all of the following are true: 1. Nvim is running in the TUI 2. 'clipboard' is not set to unnamed or unnamedplus 3. g:clipboard is unset 4. Nvim is running in an SSH connection ($SSH_TTY is set) 5. Nvim is not running inside tmux ($TMUX is unset)
| * vim-patch:9.0.2102: matchparen highlight not cleared in completion mode (#26019)zeertzjq2023-11-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: matchparen highlight not cleared in completion mode Solution: Clear matchparen highlighting in completion mode Remove hard-coded hack in insexpand.c to clear the :3match before displaying the completion menu. Add a test for matchparen highlighting. While at it, move all test tests related to the matchparen plugin into a separate test file. closes: vim/vim#13493 closes: vim/vim#13524 https://github.com/vim/vim/commit/9588666360e94de3ff58d4bc79aa9148fbf5fc44 Co-authored-by: Christian Brabandt <cb@256bit.org>
| * fix(man): make :Man with a range work (#25922)zeertzjq2023-11-07
| |
| * vim-patch:d3e277f279ed (#25734)zeertzjq2023-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | matchparen: do not use hard-coded match id (vim/vim#13393) * matchparen: do not use hard-coded match id Instead of using the hard-coded match id 3, which may also be used by other plugins, let the matchparen plugin use whatever ids are automatically returned when calling matchaddpos(). For backwards-compatibility, keep the `:3match` call, which will still use the hard-coded id 3 (as mentioned in :h :3match). closes: vim/vim#13381 https://github.com/vim/vim/commit/d3e277f279ed628809eb6857ea3ebcfca566ca2a Co-authored-by: Christian Brabandt <cb@256bit.org>
| * feat(treesitter): add lang parameter to the query editor (#25181)Maria José Solano2023-09-16
| |
| * refactor(treesitter): rename "preview" => "edit" #25161Maria José Solano2023-09-15
| | | | | | | | | | | | "Edit" more closely describes the generic application than "Preview", though the buffer contents don't (yet) map to an actual file on disk. https://github.com/neovim/neovim/pull/24703#discussion_r1321719133
| * vim-patch:86cfb39030ebChristian Clason2023-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | runtime(tohtml): Update TOhtml to version 9.0v2 (vim/vim#13050) Modified behavior: - Change default value of g:html_use_input_for_pc from "fallback" to "none". This means with default settings, only the standards-based method to make special text unselectable is used. The old method relying on unspecified browser behavior for <input> tags is now only used if a user specifically enables it. - Officially deprecate g:use_xhtml option (in favor of g:html_use_xhtml) by issuing a warning message when used. Bugfixes: - Fix issue vim/vim#8547: LineNr and other special highlight groups did not get proper style rules defined when using "hi link". - Fix that diff filler was not properly added for deleted lines at the end of a buffer. Other: - Refactored function definitions from long lists of strings to use :let-heredoc variable assignment instead. - Corrected deprecated "." string concatenation operator to ".." operator in more places. https://github.com/vim/vim/commit/86cfb39030eb557e1a1c7804f9c147556ca5dbf1 Co-authored-by: fritzophrenic <fritzophrenic@gmail.com>
| * feat(treesitter): add a query editor (#24703)Maria José Solano2023-08-25
| |
| * vim-patch:e978b4534a5e (#24697)Sean Dewar2023-08-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Farewell to Bram and dedicate upcoming Vim 9.1 to him (vim/vim#12749) https://github.com/vim/vim/commit/e978b4534a5e10471108259118c0ef791106fd92 Also update the header for the following files that were converted to Vim9 script upstream: - autoload/ccomplete.lua (vim9jitted) - ftplugin.vim - ftplugof.vim - indent.vim - indent/vim.vim - makemenu.vim This also updates the "Last Change" dates, even if some changes (due to rewrites to Vim9 script) were not ported. There's still a few other places where Bram is still mentioned as a maintainer in the files we and Vim have: - ftplugin/bash.vim - indent/bash.vim - indent/html.vim - indent/mail.vim - macros/accents.vim - macros/editexisting.vim - syntax/bash.vim - syntax/shared/typescriptcommon.vim - syntax/tar.vim - syntax/typescript.vim - syntax/typescriptreact.vim - syntax/zimbu.vim Maybe future patches will address that. Also exclude changes to .po files that didn't apply automatically (the `:messages` maintainer string isn't used in Nvim anyway). Co-authored-by: Christian Brabandt <cb@256bit.org>
| * fix(gx): move to to _init_default_mappings #24420marshmallow2023-07-24
| | | | | | | | | | | | | | | | Problem: netrw may conflict with the Nvim default "gx" mapping. Solution: Initialize keymapping earlier by moving it to vim._init_default_mappings(). That also avoids needing to check maparg().
| * fix(runtime): don't set gx mapping if already mapped (#24262)zeertzjq2023-07-05
| | | | | | This matches netrw's use of maparg().
| * fix(vim.ui.open): return (don't show) error messageJustin M. Keyes2023-07-05
| | | | | | | | | | | | | | | | | | | | Problem: Showing an error via vim.notify() makes it awkward for callers such as lsp/handlers.lua to avoid showing redundant errors. Solution: Return the message instead of showing it. Let the caller decide whether and when to show the message.
| * fix(gx): visual selection, expand env varsJustin M. Keyes2023-07-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --- Rejected experiment: move vim.ui.open() to vim.env.open() Problem: `vim.ui` is where user-interface "providers" live, which can be overridden. It would also be useful to have a "providers" namespace for platform-specific features such as "open", clipboard, python, and the other providers listed in `:help providers`. We could overload `vim.ui` to serve that purpose as the single "providers" namespace, but `vim.ui.nodejs()` for example seems awkward. Solution: `vim.env` currently has too narrow of a purpose. Overload it to also be a namespace for `vim.env.open`. diff --git a/runtime/lua/vim/_meta.lua b/runtime/lua/vim/_meta.lua index 913f1fe20348..17d05ff37595 100644 --- a/runtime/lua/vim/_meta.lua +++ b/runtime/lua/vim/_meta.lua @@ -37,8 +37,28 @@ local options_info = setmetatable({}, { end, }) -vim.env = setmetatable({}, { - __index = function(_, k) +vim.env = setmetatable({ + open = setmetatable({}, { + __call = function(_, uri) + print('xxxxx'..uri) + return true + end, + __tostring = function() + local v = vim.fn.getenv('open') + if v == vim.NIL then + return nil + end + return v + end, + }) + }, + { + __index = function(t, k, ...) + if k == 'open' then + error() + -- vim.print({...}) + -- return rawget(t, k) + end local v = vim.fn.getenv(k) if v == vim.NIL then return nil
| * feat(vim.ui): vim.ui.open, "gx" without netrwmarshmallow2023-07-04
| | | | | | | | | | | | Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com> Co-authored-by: Justin M. Keyes <justinkz@gmail.com> Co-authored-by: ii14 <59243201+ii14@users.noreply.github.com>
| * vim-patch:b7398fe41c9e (#23627)Christian Clason2023-05-15
| | | | | | | | | | | | | | Update runtime files https://github.com/vim/vim/commit/b7398fe41c9e1e731d058105a34158871ee83e3f Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * vim-patch:71badf9547e8 (#23285)Christian Clason2023-04-23
| | | | | | | | | | | | | | Update runtime files https://github.com/vim/vim/commit/71badf9547e8f89571b9a095183671cbb333d528 Co-authored-by: Bram Moolenaar <Bram@vim.org>
| * refactor: remove :CheckHealthdundargoc2023-04-12
| | | | | | | | | | Using :CheckHealth invokes an error, and many of the features from :checkhealth doesn't even work such as calling only a specific check. Users should use :checkhealth instead.