aboutsummaryrefslogtreecommitdiff
path: root/runtime/plugin
Commit message (Collapse)AuthorAge
* 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.
* feat!: remove vimballs (#22402)dundargoc2023-04-11
| | | | | | | | Vimball is an outdated feature that is rarely used these days. It is not a maintenance burden on its own, but it is nonetheless dead weight and something we'd need to tell users to ignore when they inevitably ask what it is. See: https://github.com/neovim/neovim/pull/21369#issuecomment-1347615173
* feat(lua): allow vim.F.if_nil to take multiple arguments (#22903)Gregory Anders2023-04-07
| | | | | | | | | | | | The first argument which is non-nil is returned. This is useful when using nested default values (e.g. in the EditorConfig plugin). Before: local enable = vim.F.if_nil(vim.b.editorconfig, vim.F.if_nil(vim.g.editorconfig, true)) After: local enable = vim.F.if_nil(vim.b.editorconfig, vim.g.editorconfig, true)
* fix(treesitter): InspectTree does not respect 'splitright' #22692Yochem van Rosmalen2023-03-17
| | | | | | | | | | Problem: vim.treesitter.inspect_tree() and :InspectTree does not respect 'splitright'. Solution: - Change the default `command` from `topleft 60vnew` to `60vnew`. - Change :InspectTree to respect command mods (`:vertical`, count, etc.). Closes #22656
* refactor!: rename vim.pretty_print => vim.printJustin M. Keyes2023-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The function name `vim.pretty_print`: 1. is verbose, which partially defeats its purpose as sugar 2. does not draw from existing precedent or any sort of convention (except external projects like penlight or python?), which reduces discoverability, and degrades signaling about best practices. Solution: - Rename to `vim.print`. - Change the behavior so that 1. strings are printed without quotes 2. each arg is printed on its own line 3. tables are indented with 2 instead of 4 spaces - Example: :lua ='a', 'b', 42, {a=3} a b 42 { a = 3 } Comparison of alternatives: - `vim.print`: - pro: consistent with Lua's `print()` - pro: aligns with potential `nvim_print` API function which will replace nvim_echo, nvim_notify, etc. - con: behaves differently than Lua's `print()`, slightly misleading? - `vim.echo`: - pro: `:echo` has similar "pretty print" behavior. - con: inconsistent with Lua idioms. - `vim.p`: - pro: very short, fits with `vim.o`, etc. - con: not as discoverable as "echo" - con: less opportunity for `local p = vim.p` because of potential shadowing.
* feat(treesitter): add :InspectTree command (#22477)Christian Clason2023-03-02
|
* vim-patch:partial:dd60c365cd26 (#22437)Christian Clason2023-02-28
| | | | | | | | | | | vim-patch:partial:dd60c365cd26 Update runtime files https://github.com/vim/vim/commit/dd60c365cd2630794be84d63c4fe287124a30b97 Co-authored-by: Bram Moolenaar <Bram@vim.org> Skip: eval.txt, repeat.txt (needs `getscriptinfo()`)
* vim-patch:be4e01637e71 (#22103)Christian Clason2023-02-03
| | | | | | | Update runtime files. https://github.com/vim/vim/commit/be4e01637e71c8d5095c33b9861fd70b41476732 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* refactor(editorconfig)!: change editorconfig_enable to editorconfigGregory Anders2023-01-07
|
* feat(editorconfig): allow editorconfig to be toggled dynamicallyGregory Anders2023-01-07
| | | | | | | | | Rather than only check `editorconfig_enable` when the plugin is loaded, check it each time the autocommand fires, so that users may enable or disable it dynamically. Also check for a buffer local version of the variable, so that editorconfig can be enabled or disabled per-buffer.
* feat(editorconfig): add builtin EditorConfig supportGregory Anders2023-01-03
|
* feat: `vim.inspect_pos`, `vim.show_pos`, `:Inspect`Folke Lemaitre2022-12-17
|
* vim-patch:86b4816766d9 (#21314)Christian Clason2022-12-08
| | | | | | | | | | | | | | Update runtime files https://github.com/vim/vim/commit/86b4816766d976a7ecd4403eca1f8bf6b4105800 vim-patch:9.0.1029: autoload directory missing from distribution Problem: Autoload directory missing from distribution. Solution: Add the autoload/zig directory to the list of distributed files. https://github.com/vim/vim/commit/84dbf855fb2d883481f74ad0ccf3df3f8837e6bf Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.0969: matchparen highlight is not updated when switching ↵zeertzjq2022-11-29
| | | | | | | | | | | buffers (#21227) Problem: Matchparen highlight is not updated when switching buffers. Solution: Listen to the BufLeave and the BufWinEnter autocmd events. (closes vim/vim#11626) https://github.com/vim/vim/commit/28a896f54d4b2f2b4bef8ef4144dde1673c9d6e7 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* feat(Man): port to Lua (#19912)Lewis Russell2022-09-02
| | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* vim-patch:fd999452adaf (#19929)Christian Clason2022-08-25
| | | | Update runtime files https://github.com/vim/vim/commit/fd999452adaf529a30d78844b5fbee355943da29
* fix(startup): nvim with --clean should not load user rpluginsbfredl2022-06-04
| | | | | runtime rplugins such like legacy script providers are not affected by this change.
* vim-patch:519cc559b08b (#16340)Christian Clason2021-11-17
| | | | Update runtime files https://github.com/vim/vim/commit/519cc559b08b800edc429688aece7ad6a00d41eb
* refactor: define diagnostic highlights in syntax.cGregory Anders2021-10-03
|
* fix(diagnostic): remove useless highlight links (#15683)Gregory Anders2021-09-17
| | | | | | | | | | | | | | | | | | These links were actually defined backwards: the highlight groups actually being used for display are the new "Diagnostic*" groups, so linking the old "LspDiagnostics*" groups to these does absolutely nothing, since there is nothing actually being highlighted with the LspDiagnostics* groups. These links were made in an attempt to preserve backward compatibility with existing colorschemes. We could reverse the links to maintain this preservation, but then that disallows us from actually defining default values for the new highlight groups. Instead, just remove the links and be done with the old LspDiagnostics* highlight groups. This is not technically a breaking change: the breaking change already happened in #15585, but this PR just makes that explicit.
* fix(diagnostic): don't override existing highlight groups #15682Gregory Anders2021-09-16
| | | | | Use the 'default' keyword to prevent overriding existing highlight groups. ref #15585
* refactor: move vim.lsp.diagnostic to vim.diagnosticGregory Anders2021-09-15
| | | | | | | | | | | This generalizes diagnostic handling outside of just the scope of LSP. LSP clients are now a specific case of a diagnostic producer, but the diagnostic subsystem is decoupled from the LSP subsystem (or will be, eventually). More discussion at [1]. [1]: https://github.com/neovim/neovim/pull/15585
* vim-patch:6c391a74fe90 (#15654)Christian Clason2021-09-13
| | | | | | | | | | | Update runtime files https://github.com/vim/vim/commit/6c391a74fe90190796ca0b0c010112948a6e75d7 omit autoload/getscript.vim skip doc/eval.txt (needs 8.2.2468) skip doc/various.txt (needs 8.2.3400) (typofixes courtesy of @dundargoc)
* vim-patch:89a9c159f23f #15641Christian Clason2021-09-13
| | | | | | | | | | | | | | | | | Update runtime files https://github.com/vim/vim/commit/89a9c159f23fb7b3e24e6d09068adfc24a73afcb Omit: nsis/lang/turkish.nsi pixmaps/gen-inline-pixbufs.sh doc/popup.txt doc/terminal.txt tutor/tutor* src/[g]vimtutor CONTRIBUTING.md Skip: doc/eval.txt (needs 8.1.2342) doc/testing.txt (needs 8.2.0299)
* fix(man.vim): use -addr=other instead of -range=-1 #15172zeertzjq2021-08-26
| | | | | -range=-1 requires the current file to have at least <count> lines, whereas -addr=other doesn't. -addr=other also sets <count> to -1 by default when it is not specified, though this feature seems undocumented.
* fix(man.vim): filetype=man is too eager #15488Justin M. Keyes2021-08-26
| | | | | | | | | | | | | | | Problem: "set filetype=man" assumes the user wants :Man features, this does extra stuff like renaming the buffer as "man://". Solution: - old entrypoint was ":set filetype=man", but this is too presumptuous #15487 - make the entrypoints more explicit: 1. when the ":Man" command is run 2. when a "man://" buffer is opened - remove the tricky b:man_sect checks in ftplugin/man.vim and syntax/man.vim - MANPAGER is supported via ":Man!", as documented. fixes #15487
* vim-patch:56994d215815Jan Edmund Lazo2021-05-02
| | | | | Update runtime files. https://github.com/vim/vim/commit/56994d215815139207f3c5ce02a1720e44e93c09
* vim-patch:130cbfc31235Jan Edmund Lazo2021-05-02
| | | | | Update runtime files https://github.com/vim/vim/commit/130cbfc31235c6cb52ffe718ea0a5bb50fbbc9fd
* vim-patch:cb80aa2d53e5Jan Edmund Lazo2021-05-01
| | | | | | | | | | | Update runtime files. https://github.com/vim/vim/commit/cb80aa2d53e56d3aba3b3c439fb467f29a750c5e Omit runtime/doc/tabpage.txt. Patch v8.2.1401 is not ported yet. Port optwin.vim changes without gettext(). Patch v8.2.1544 is not ported yet.
* vim-patch:1d59aa1fdfb1Jan Edmund Lazo2021-05-01
| | | | | Update runtime files. https://github.com/vim/vim/commit/1d59aa1fdfb191d9872ff87eb94652acd374b293
* vim-patch:73fef33014dbJan Edmund Lazo2021-04-28
| | | | | | | Update runtime files https://github.com/vim/vim/commit/73fef33014dbf21fc59e7e47fb091117868d82fb Omit usr_46.txt.