summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/_defaults.lua
AgeCommit message (Collapse)AuthorFiles
2025-12-30build: ship "_core/*" as bytecode (built-into Nvim binary)Justin M. Keyes1
Problem: We want to encourage implementing core features in Lua instead of C, but it's clumsy because: - Core Lua code (built into `nvim` so it is available even if VIMRUNTIME is missing/invalid) requires manually updating CMakeLists.txt, or stuffing it into `_editor.lua`. - Core Lua modules are not organized similar to C modules, `_editor.lua` is getting too big. Solution: - Introduce `_core/` where core Lua code can live. All Lua modules added there will automatically be included as bytecode in the `nvim` binary. - Move these core modules into `_core/*`: ``` _defaults.lua _editor.lua _options.lua _system.lua shared.lua ``` TODO: - Move `_extui/ => _core/ui2/`
2025-12-29feat(terminal): include sequence terminator in TermRequest event (#37152)Kyle1
Problem: Terminals should respond with the terminator (either BEL or ST) used in the query so that clients can reliably parse the responses. The `TermRequest` autocmd used to handle background color requests in the terminal does not have access to the original sequence terminator, so it always uses BEL. #37018 Solution: Update vterm parsing to include the terminator type, then forward this data into the emitted `TermRequest` events for OSC/DCS/APC sequences. Update the foreground/background `TermRequest` callback to use the same terminator as the original request. Details: I didn't add the terminator to the `TermResponse` event. However, I assume the `TermResponse` event doesn't care about the terminator because the sequence is already parsed. I also didn't update any of the functions in `src/nvim/vterm/state.c` that write out responses. It looked like those all pretty much used ST, and it would be a much larger set of changes. In that same file, there's also logic for 8 bit ST sequences, but from what I can tell, 8 bit doesn't really work (see `:h xterm-8bit`), so I didn't use the 8 bit ST at all.
2025-12-08fix(exrc): ensure consistent 'exrc' loading sequence #35148€šm̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰̰�Ř§Ů Â£╟©舐æØ¢£ðsÞ¥¿—1
Problem: The execution of startup scripts in parent directories are too late compared to scripts in current direcctory. Solution: Execute all startup scripts with `lua/_core/exrc.lua`. closes: #35147
2025-11-25refactor(defaults): deduplicate selection_range() mappings #36686Riley Bruins1
We don't need to specify the timeout ms here anymore, because the implementation was changed to use it by default.
2025-11-24feat(lsp): incremental-selection operator-pending mode #36575Branden Call1
Problem: LSP incremental selection provides default visual-mode keymaps for `an` and `in`. Operator-pending mode is not supported, so `dan` and `can` do not apply the operation. Solution: Modify selection_range() to be synchronous. Add operator-pending mappings.
2025-10-25fix(terminal): adjust marks when deleting scrollback lines (#36294)zeertzjq1
This also fixes inconsistent scrolling behavior on terminal output when cursor is in the middle of the buffer and the scrollback is full.
2025-10-24fix(terminal): wrong row in TermRequest with full scrollback (#36298)zeertzjq1
Problem: Wrong row in TermRequest with full scrollback. Solution: Subtract by the number of lines deleted from scrollback.
2025-10-02feat(tui): native progress bars for Progress events #35973Gregory Anders1
2025-09-16docs: small fixes (#35791)zeertzjq1
Close #34938 Close #35030 Close #35233 Close #35259 Close #35290 Close #35433 Close #35541 Close #35766 Close #35792 Co-authored-by: huylg <45591413+huylg@users.noreply.github.com> Co-authored-by: Jason Del Ponte <961963+jasdel@users.noreply.github.com> Co-authored-by: sooriya <74165167+thuvasooriya@users.noreply.github.com> Co-authored-by: Andrew Braxton <andrewcbraxton@gmail.com> Co-authored-by: Enric Calabuig <enric.calabuig@gmail.com> Co-authored-by: Augusto César Dias <augusto.c.dias@gmail.com> Co-authored-by: David Sierra DiazGranados <davidsierradz@gmail.com> Co-authored-by: Stepan Nikitin <90522882+vectravox@users.noreply.github.com> Co-authored-by: Emilien Breton <bricktech2000@gmail.com>
2025-08-22feat(tui): add nvim_ui_send (#35406)Gregory Anders1
This function allows the Nvim core to write arbitrary data to a TTY connected to a UI's stdout.
2025-07-19fix(treesitter): ":EditQuery [lang]" with injected languages #34914Peter Cardenas1
Problem: `:EditQuery` command accepts a language argument, but it doesn't highlight properly for injected languages. Solution: - Fully parse with the root language and then filter the query on the child trees that are of the language requested. - Also support completion (`EditQuery <tab>`).
2025-06-29fix(exrc): exrc knows its own location (#34638)Yochem van Rosmalen1
fix(exrc): lua exrc files know their location Problem: 'exrc' files are inherently bound to their location / workspace and therefore require to "know" their location on the filesystem. However, currently using `debug.getinfo(1, 'S')` returns `"<nvim>"`. Solution: Include the filepath as chunkname in `loadstring()` and `nlua_exec()`.
2025-06-26feat(defaults): map "grt" to LSP type_definition #34642Caleb White1
2025-06-18docs: api, miscJustin M. Keyes1
2025-06-17fix(lsp): support v:count in selection_range() #34551Riley Bruins1
Co-authored-by: Yi Ming <ofseed@foxmail.com>
2025-06-12feat(lsp): incremental selection via "textDocument/selectionRange" #34011Riley Bruins1
Select outwards with "an" and inwards with "in" in Visual mode. Ranges are reset when leaving Visual mode.
2025-06-06fix: type fixesLewis Russell1
Type fixes caught by emmylua
2025-05-20feat(exrc): stop searching in parent directories by unsetting 'exrc'Yochem van Rosmalen1
Problem: No way for a user to limit 'exrc' search in parent directories (compare editorconfig.root). Solution: A configuration file can unset 'exrc', disabling the search for its parent directories.
2025-05-19fix(defaults): start exrc search from parent directoryYochem van Rosmalen1
Problem: The exrc file in the current directory is executed twice, here and in `do_exrc_initalization()`. Solution: Start search from parent directory. Let core handle exrc in current directory.
2025-05-11feat(exrc): search in parent directories (#33889)Yochem van Rosmalen1
feat(exrc): search exrc in parent directories Problem: `.nvim.lua` is only loaded from current directory, which is not flexible when working from a subfolder of the project. Solution: Also search parent directories for configuration file.
2025-03-31fix(defaults): enable :terminal [[,]] motion in operator-pending mode #33217Ghjuvan Lacambre1
This enables y]] to copy a command and its output.
2025-03-30fix(defaults): visual-mode [[,]] for :terminal shell prompts #33201msaher1
Problem: :terminal shell prompt jump mappings ]]/[[ don't work in visual mode. Solution: Also define them for in visual mode.
2025-03-14feat(snippet): set snippet keymaps permanent instead of dynamic (#31887)Mathias Fußenegger1
Problem: Given that `vim.snippet.expand()` sets temporary `<tab>`/`<s-tab>` keymaps there is no way to build "smart-tab" functionality where `<tab>` chooses the next completion candidate if the popup menu is visible. Solution: Set the keymap permanent in `_defaults`. The downside of this approach is that users of multiple snippet engine's need to adapt their keymaps to handle all their engines that are in use. For example: vim.keymap.set({ 'i', 's' }, "<Tab>", function() if foreign_snippet.active() then return "<Cmd>lua require('foreign_snippet').jump()<CR>" elseif vim.snippet.active({ direction = 1 }) then return "<Cmd>lua vim.snippet.jump(1)<CR>" else return key end end, { expr = true }) Upside is that using `vim.keymap.set` to override keymaps is a well established pattern and `vim.snippet.expand` calls made by nvim itself or plugins have working keymaps out of the box. Co-authored-by: Maria José Solano <majosolano99@gmail.com>
2025-03-12feat(treesitter): allow passing lang to InspectTreeMaria José Solano1
2025-03-07feat(defaults): jump between :terminal shell prompts with ]]/[[ #32736Gregory Anders1
2025-03-05fix(tui): remove DCS escaping in tmux (#32723)Gregory Anders1
Per https://github.com/tmux/tmux/issues/4386, tmux does not support DCS responses, even if the initial request was escaped.
2025-03-05feat(terminal)!: include cursor position in TermRequest event data (#31609)Gregory Anders1
When a plugin registers a TermRequest handler there is currently no way for the handler to know where the terminal's cursor position was when the sequence was received. This is often useful information, e.g. for OSC 133 sequences which are used to annotate shell prompts. Modify the event data for the TermRequest autocommand to be a table instead of just a string. The "sequence" field of the table contains the sequence string and the "cursor" field contains the cursor position when the sequence was received. To maintain consistency between TermRequest and TermResponse (and to future proof the latter), TermResponse's event data is also updated to be a table with a "sequence" field. BREAKING CHANGE: event data for TermRequest and TermResponse is now a table
2025-02-20vim-patch:c729d6d: runtime: decouple Open and Launch commands and gx mapping ↵Luca Saccarola1
from netrw (#32506) closes: vim/vim#16494 fixes: #vim/vim#16486 https://github.com/vim/vim/commit/c729d6d154e097b439ff264b9736604824f4a5f4
2025-02-10refactor(defaults): cleanup enable_ctx_menu #32391Siddhant Agarwal1
The ctx parameter is not needed since various refactors.
2025-02-09fix(defaults): improve visual search mappings #32378neeshy1
Problem: The behavior of the visual search mappings aren't consistent with their normal mode counterparts. - The count isn't considered - Searching with an empty selection will match every character in the buffer - Searching backwards only jumps back when the cursor is positioned at the start of the selection. Solution: - Issue `n` `v:count1` times - Error out and exit visual mode when the selection is empty - Detect when the cursor is not at the start of the selection, and adjust the count accordingly Also, use the search register instead of the more error-prone approach of feeding the entire search string as an expression
2025-02-09feat(defaults): "Show Diagnostics" in mouse popupmenu #32122Siddhant Agarwal1
Problem: No obvious way to see diagnostics without configuring it first. Solution: Add `Show Diagnostics`, `Show All Diagnostics` and `Configure Diagnostics` buttons to the context menu.
2025-01-30docs: miscdundargoc1
Co-authored-by: Dustin S. <dstackmasta27@gmail.com> Co-authored-by: Ferenc Fejes <fejes@inf.elte.hu> Co-authored-by: Maria José Solano <majosolano99@gmail.com> Co-authored-by: Yochem van Rosmalen <git@yochem.nl> Co-authored-by: brianhuster <phambinhanctb2004@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-01-14refactor: use nvim.foo.bar format for autocommand groupsMaria José Solano1
2025-01-09feat(api): deprecate nvim_out/err_write(ln)Luuk van Baal1
2024-12-19feat(jobs): jobstart(…,{term=true}), deprecate termopen() #31343Justin M. Keyes1
Problem: `termopen` has long been a superficial wrapper around `jobstart`, and has no real purpose. Also, `vim.system` and `nvim_open_term` presumably will replace all features of `jobstart` and `termopen`, so centralizing the logic will help with that. Solution: - Introduce `eval/deprecated.c`, where all deprecated eval funcs will live. - Introduce "term" flag of `jobstart`. - Deprecate `termopen`.
2024-12-06feat(defaults): disable 'foldcolumn' in terminal buffers (#31480)Micah Halter1
2024-12-05fix(defaults): don't replace keycodes in Visual search mappings (#31460)zeertzjq1
Also remove "silent" to be more consistent with Normal mode search.
2024-12-04defaults: disable 'number', 'relativenumber', and 'signcolumn' in terminal ↵Gregory Anders1
buffers (#31443)
2024-11-26feat(tui): update 'background' on theme change events (#31350)Gregory Anders1
Enabling private DEC mode 2031 tells the terminal to notify Nvim whenever the OS theme changes (i.e. light mode to dark mode or vice versa) or the terminal emulator's palette changes. When we receive one of these notifications we query the terminal color's background color again to see if it has changed and update the value of 'background' if it has. We only do this though if the user has not explicitly set the value of 'bg' themselves. The help text is updated slightly to hint to users that they probably shouldn't set this value: on modern terminal emulators Nvim is able to completely determine this automatically.
2024-11-25fix(defaults): omit empty line from unimpaired mapping messages (#31347)Marcus Caisey1
Problem: The default unimpaired mappings display an empty line after the command's output. This results (with default configuration) in the `Press ENTER or type command to continue` prompt to be displayed, like so: ``` (2 of 16): item2 Press ENTER or type command to continue ``` Solution: The cause is that we're checking the second return value from `pcall(vim.api.nvim_cmd, opts, {})` to determine whether the call was successful. `nvim_cmd` returns an empty string on success, so this value is an empty string in the successful path which we then display. The fix is simple: check the first return value instead which is the "status code" of the call.
2024-11-17feat(defaults): dot-repeat [<Space> #31186Peter Aronoff1
Problem: `[<Space>` and `]<Space>` do not support repetition. Solution: use `operatorfunc` and `g@l` to make these mappings dot repeatable.
2024-11-15feat(default): bind `vim.lsp.buf.signature_help` in select mode (#31223)Yi Ming1
2024-11-04feat(defaults): unimpaired empty line below/above cursor #30984Yochem van Rosmalen1
2024-10-29fix(defaults): omit extraneous info from unimpaired mapping errors (#30983)Gregory Anders1
2024-10-28feat(defaults): map gO to LSP document_symbol #30781Nikita Revenco1
2024-10-25fix(defaults): missing ]Q/[Q unimpaired mappings #30943Maria José Solano1
2024-10-23fix(defaults): error messages UX for unimpaired mappings #30884Maria José Solano1
2024-10-11feat(defaults): map gri to vim.lsp.buf.implementation() (#30764)Gregory Anders1
Continuing the default LSP maps under the "gr" prefix. Mnemonic: "i" for "implementation".
2024-10-04fix(defaults): use "range" instead of "count" for some mappings (#30642)Gregory Anders1
Some commands don't accept "count" and only work with "range". It's not clear why. The issue is tracked at [1], but this is a workaround for now. [1]: https://github.com/neovim/neovim/issues/30641
2024-10-03fix(defaults): properly pass count to quickfix commands (#30632)zeertzjq1