aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/lua-guide.txt
Commit message (Collapse)AuthorAge
* refactor(api): omit optional paramJustin M. Keyes2026-07-13
|
* docs: bufadd(), fnameescape() guidance #40378Justin M. Keyes2026-06-23
|
* docs: misc, lspJustin M. Keyes2026-06-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: This doc on `vim.lsp.completion.get()`: --- Used by the default LSP |omnicompletion| provider |vim.lsp.omnifunc()|, thus |i_CTRL-X_CTRL-O| --- invokes this in LSP-enabled buffers. Use CTRL-Y to select an item from the completion menu. --- |complete_CTRL-Y| ...makes two wrong claims: 1. "Used by the default LSP omnicompletion provider vim.lsp.omnifunc()" - `_omnifunc` does not call `M.get()`, it calls the internal `trigger()` directly. 2. "thus |i_CTRL-X_CTRL-O| invokes this in LSP-enabled buffers" - The two paths use different client sets: - `M.get()` reads `buf_handles[bufnr].clients` (clients explicitly registered via `vim.lsp.completion.enable(true, ...)`). - `_omnifunc` reads `lsp.get_clients({method='textDocument/completion'})` (every completion client, regardless of `enable()`). Solution: Update docs. Co-authored-by: Koichi Shiraishi <zchee.io@gmail.com> Co-authored-by: y9san9 / Alex Sokol <y9san9@gmail.com> Co-authored-by: adv0r <>
* fix(lua): vim.wait(0) does not call loop_poll #39679Justin M. Keyes2026-05-10
| | | | | | | | | | | Problem: Regression from c822a2657c78: `vim.wait(0)` does not call `loop_poll`, so `vim.wait(1)` is needed to "yield" from Lua. Solution: - Ensure that `vim._core.loop_poll()` is always called, even when `time=0`. - Document how to interrupt Lua code (ctrl-c). ref https://github.com/neovim/neovim/issues/6800
* fix(lua): drop support for boolean `buf` in `vim.keymap` #38432skewb1k2026-03-23
| | | | | | | | | | | Problem: `vim.keymap.*.Opts.buf` allows `boolean` aliases for more widely used `integer?` values, `true` -> `0` and `false` -> `nil`. This conversion is unnecessary and can be handled at call sites. Solution: As a follow-up to deprecating the `buffer` option, drop support for boolean values for the new `buf` option. The deprecated `buffer` continues to support booleans for backward compatibility.
* docs: starting.txt new layoutJustin M. Keyes2026-03-22
|
* feat(lua): replace `buffer` with `buf` in vim.keymap.set/del #38360skewb1k2026-03-21
| | | | | | The `buffer` option remains functional but is now undocumented. Providing both will raise an error. Since providing `buf` was disallowed before, there is no code that will break due to using `buffer` alongside `buf`.
* docs: miscJustin M. Keyes2026-03-20
|
* 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(docs): numbered listitemsJustin M. Keyes2025-12-15
|
* docs: optionlinks don't need the bars #35777Yochem van Rosmalen2025-09-15
| | | | | | | | Problem: Options links work even without vertical bars around them due to their single quotes: the bars are unnecessary. Solution: Remove them.
* docs: lsp, miscJustin M. Keyes2025-09-03
| | | | | | | | | - Problem: It's not clear for new plugin developers that `:help` uses a help-tags file for searching the docs, generated by `:helptags`. - Solution: Hint to the |:helptags| docs for regenerating the tags file for their freshly written documentation. Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
* docs: Lua plugin development guideJustin M. Keyes2025-09-01
|
* docs: api, pack, events, developJustin M. Keyes2025-07-10
|
* docs: vim_diff.txt #34502Phạm Bình An2025-06-18
| | | | | | | | | | | Problem: - Missing some important Vim features - Since Nvim 0.5, package.path and package.cpath don't include `'runtimepath'` (thought `require()` can still find modules in `runtimepath`) Closes #33938 Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* docs: provide example_init.lua #33524Phạm Bình An2025-04-27
| | | | | | | | | Problem: There are some "boilerplate" steps for new users. Although we are constantly improving defaults and lifting patterns into core, users eventually want to know how to start their own config, add plugins, etc. Solution: Add `runtime/example_init.lua` and refer to it from docs.
* docs: misc (#33093)dundargoc2025-04-13
| | | | | | | | Co-authored-by: Jx <JxJxxJxJ@github.com> Co-authored-by: Richard Dzenis <richard@dzenis.dev> Co-authored-by: Shixian Sheng <shixian_sheng-2@protonmail.com> Co-authored-by: Sourabh Kumar <sourabh7.tech@gmail.com> Co-authored-by: Yegor Yefremov <yegorslists@googlemail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* docs: miscdundargoc2025-01-11
| | | | | | | | | | | | | | | Co-authored-by: Axel <axelhjq@gmail.com> Co-authored-by: Colin Kennedy <colinvfx@gmail.com> Co-authored-by: Daiki Noda <sys9kdr@users.noreply.github.com> Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: Jean-Jacq du Plessis <1030058+jj-du-plessis@users.noreply.github.com> Co-authored-by: Juan Giordana <juangiordana@gmail.com> Co-authored-by: Lincoln Wallace <locnnil0@gmail.com> Co-authored-by: Matti Hellström <hellstrom@scm.com> Co-authored-by: Steven Locorotondo <steven.locorotondo@justeattakeaway.com> Co-authored-by: Yochem van Rosmalen <git@yochem.nl> Co-authored-by: glepnir <glephunter@gmail.com> Co-authored-by: ifish <fishioon@live.com>
* refactor: rename vim.highlight => vim.hlJustin M. Keyes2024-10-21
| | | | | | | | | | | | Problem: - `vim.highlight` module does not follow `:help dev-name-common`, which documents the name for "highlight" as "hl". - Shorter names are usually preferred. Solution: Rename `vim.highlight` to `vim.hl`. This is not a breaking change until 2.0 (or maybe never).
* docs: misc (#28837)dundargoc2024-06-07
| | | | | | | | | | | | | | | Co-authored-by: Danymat <d.danymat@gmail.com> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Jakub Okoński <jakub@okonski.org> Co-authored-by: John L. Villalovos <john@sodarock.com> Co-authored-by: Maria José Solano <majosolano99@gmail.com> Co-authored-by: Michaili K <git@michaili.dev> Co-authored-by: TheLeoP <eugenio2305@hotmail.com> Co-authored-by: Tobias Schmitz <tobiasschmitz2001@gmail.com> Co-authored-by: W20MC <157727813+W20MC@users.noreply.github.com> Co-authored-by: Will Hopkins <willothyh@gmail.com> Co-authored-by: Yifan Hu <141280278+b0ae989c@users.noreply.github.com> Co-authored-by: glepnir <glephunter@gmail.com> Co-authored-by: prljav <74116121+prljav@users.noreply.github.com>
* docs: small fixes (#26243)dundargoc2023-12-06
| | | | | Co-authored-by: umlx5h <umlx5h21@protonmail.com> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Evan Farrar <evan@evanfarrar.com>
* docs: small fixesdundargoc2023-10-10
| | | | | | Co-authored-by: Wansmer <wansmer@gmail.com> Co-authored-by: Andrew Voynov <andrewvoynov.b@gmail.com> Co-authored-by: David Moberg <david.moberg@mediatek.com>
* docs: luaref cleanup #24541Justin M. Keyes2023-08-03
| | | | - drop "luaref-" prefix in favor of "lua-" or nothing, where possible. - remove redundant "luaref--lang…" and "luaref-api…" tags.
* docs: remove trailing spaces #24455ii142023-07-25
|
* feat(lua): allow vim.wo to be double indexed (#20288)Lewis Russell2023-07-07
| | | | | | | | * feat(lua): allow vim.wo to be double indexed Problem: `vim.wo` does not implement `setlocal` Solution: Allow `vim.wo` to be double indexed Co-authored-by: Christian Clason <c.clason@uni-graz.at>
* fix(docs): ignore_invalid #24174Justin M. Keyes2023-06-27
| | | Regex bug in scripts/gen_help_html.lua:ignore_invalid()
* docs: autocmds, miscJustin M. Keyes2023-06-25
|
* docs: small fixes (#23619)dundargoc2023-06-02
| | | | | | Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: Gustavo Ferreira <gustavo.ferreira@imaginecurve.com> Co-authored-by: Kai Moschcau <mail@kmoschcau.de> Co-authored-by: Lampros <hauahx@gmail.com>
* docs: small fixesdundargoc2023-05-13
| | | | | | | | | Co-authored-by: Christian Clason <c.clason@uni-graz.at> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: HiPhish <hiphish@posteo.de> Co-authored-by: Julio B <julio.bacel@gmail.com> Co-authored-by: T727 <74924917+T-727@users.noreply.github.com> Co-authored-by: camoz <camoz@users.noreply.github.com> Co-authored-by: champignoom <66909116+champignoom@users.noreply.github.com>
* docs: fix typosdundargoc2023-04-04
| | | | | | Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Raphael <glephunter@gmail.com> Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com> Co-authored-by: himanoa <matsunoappy@gmail.com>
* 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.
* docs: fix more treesitter parsing errorsChristian Clason2023-02-23
|
* docs: naming conventions, guidelinesJustin M. Keyes2023-02-22
| | | | close #21063
* docs(lua): lua-guide: <Nop> is for rhs of vim.keymap.set(), not lhs (#21814)Naru2023-01-15
|
* docs: fix typos (#21427)dundargoc2023-01-04
| | | | | | Co-authored-by: Gustavo Sampaio <gbritosampaio@gmail.com> Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com> Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com> Co-authored-by: Tomas Nemec <nemi@skaut.cz>
* docs: clarify line about converse of lua-heredoc (#21592)Sean2022-12-30
| | | Co-authored-by: sean.twie03 <nothankyou@gmail.com>
* docs(lua): add guide to using Lua in Neovim (#21137)dundargoc2022-12-08
Add introductory guide explaining how to use Lua in Neovim: where to put Lua files, how to set variables and options, how to create mappings, autocommands, and user commands. Adapted with kind permission from https://github.com/nanotee/nvim-lua-guide