aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/vim.lua
Commit message (Collapse)AuthorAge
* fix(notify): Expected 3 arguments error (#13905)notomo2021-02-09
|
* feat: adds vim.notifyMatthieu Coudron2021-01-31
| | | | | | | | | | | | | Adds function to notify the user like this: `:lua vim.notify("hello user")` embeds log levels vim.log.levels. you can then reassign vim.notify to for instance ``` function notify_external(msg, log_level, opts) vim.fn.jobstart({"notify-send", msg }) end ```
* lua: complete methods in metatablesBjörn Linse2021-01-26
|
* Don't show entire context when completingTony Chen2021-01-26
|
* feat: add completion to ':lua'TJ DeVries2021-01-26
|
* Missing argument for package.loadlib()matveyt2021-01-22
| | | | | | Allow for foo.bar.baz module name Make luaopen_module() name compatible with Lua 5.1
* runtime: propagate lua parsing errors while using "require"dm1try2020-12-10
|
* lsp: vim.lsp.diagnostic (#12655)TJ DeVries2020-11-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Breaking Changes: - Deprecated all `vim.lsp.util.{*diagnostics*}()` functions. - Instead, all functions must be found in vim.lsp.diagnostic - For now, they issue a warning ONCE per neovim session. In a "little while" we will remove them completely. - `vim.lsp.callbacks` has moved to `vim.lsp.handlers`. - For a "little while" we will just redirect `vim.lsp.callbacks` to `vim.lsp.handlers`. However, we will remove this at some point, so it is recommended that you change all of your references to `callbacks` into `handlers`. - This also means that for functions like |vim.lsp.start_client()| and similar, keyword style arguments have moved from "callbacks" to "handlers". Once again, these are currently being forward, but will cease to be forwarded in a "little while". - Changed the highlight groups for LspDiagnostic highlight as they were inconsistently named. - For more information, see |lsp-highlight-diagnostics| - Changed the sign group names as well, to be consistent with |lsp-highlight-diagnostics| General Enhancements: - Rewrote much of the getting started help document for lsp. It also provides a much nicer configuration strategy, so as to not recommend globally overwriting builtin neovim mappings. LSP Enhancements: - Introduced the concept of |lsp-handlers| which will allow much better customization for users without having to copy & paste entire files / functions / etc. Diagnostic Enhancements: - "goto next diagnostic" |vim.lsp.diagnostic.goto_next()| - "goto prev diagnostic" |vim.lsp.diagnostic.goto_prev()| - For each of the gotos, auto open diagnostics is available as a configuration option - Configurable diagnostic handling: - See |vim.lsp.diagnostic.on_publish_diagnostics()| - Delay display until after insert mode - Configure signs - Configure virtual text - Configure underline - Set the location list with the buffers diagnostics. - See |vim.lsp.diagnostic.set_loclist()| - Better performance for getting counts and line diagnostics - They are now cached on save, to enhance lookups. - Particularly useful for checking in statusline, etc. - Actual testing :) - See ./test/functional/plugin/lsp/diagnostic_spec.lua - Added `guisp` for underline highlighting NOTE: "a little while" means enough time to feel like most plugins and plugin authors have had a chance to refactor their code to use the updated calls. Then we will remove them completely. There is no need to keep them, because we don't have any released version of neovim that exposes these APIs. I'm trying to be nice to people following HEAD :) Co-authored: [Twitch Chat 2020](https://twitch.tv/teej_dv)
* lua: make vim.inspect available early so it can be used for path debuggingBjörn Linse2020-11-05
|
* startup: handle autoload and lua packages during startupBjörn Linse2020-11-02
| | | | ¡NO HAY BANDA!
* lua: add vim.register_keystroke_callback (#12536)TJ DeVries2020-08-14
| | | | | | | | | | | | | | | * feat: Add vim.register_keystroke_callback * fixup: Forgot to remove mention of old option * fixup: Answer jamessan comments * fixup: Answer norcalli comments * fixup: portability * Update runtime/doc/lua.txt Co-authored-by: Ashkan Kiani <ashkan.k.kiani@gmail.com>
* lua: Add ability to pass lua functions directly to vimLTJ DeVries2020-07-10
|
* doc: mention that defer_fn applies schedule_wrap (#12601)Christian Clason2020-07-07
|
* lua: add options to highlight.on_yank (#12549)Christian Clason2020-07-05
| | | | | NOTE: Configuration options have changed for highlight.on_yank. Check help for |:help highlight.on_yank()|
* doc: fix scripts and regenerate (#12506)TJ DeVries2020-07-02
| | | | | | | | | | | | | | | | | * Fix some small doc issues * doc: fixup * doc: fixup * Fix lint and rebase * Remove bad advice * Ugh, stupid mpack files... * Don't let people include these for now until they specifically want to * Prevent duplicate tag
* lua: Add highlight.on_yank (#12279)Christian Clason2020-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add lua function to highlight yanked region * extract namespace, better naming, default values * add default for event argument * free timer * factor out mark to position calculation * d'oh * make sure timer stops before callback (cf. luv example) * factor out timer, more documentation * fixup * validate function argument for schedule * fix block selection past eol * correct handling of multibyte characters * move arguments around, some cleanup * move utility functions to vim.lua * use anonymous namespaces, avoid local api * rename function * add test for schedule_fn * fix indent * turn hl-yank into proper (hightlight) module * factor out position-to-region function mark extraction now part of highlight.on_yank * rename schedule_fn to defer_fn * add test for vim.region * todo: handle double-width characters * remove debug printout * do not shadow arguments * defer also callable table * whitespace change * move highlight to vim/highlight.lua * add documentation * add @return documentation * test: add check before vim.defer fires * doc: fixup
* lua: Add buffer, window and tab accessors (#12268)TJ DeVries2020-05-07
| | | | | * Add buffer, window and tab accessors * Fix deletion and add tests
* paste: support replace mode (#11945)Jesse2020-05-05
| | | | | | * paste: support replace mode * Clean up Co-authored-by: Jesse Bakker <git@jessebakker.com>
* lua: metatable for empty dict valueBjörn Linse2020-01-01
|
* Fix access on vim.wo (#11517)Ashkan Kiani2019-12-07
| | | * Add more tests for vim.wo
* Add vim.cmd as an alias for nvim_command (#11446)Ashkan Kiani2019-12-01
|
* Return nil instead of NIL for vim.env (#11486)Ashkan Kiani2019-12-01
|
* lua: make vim.wo and vim.bo used nested indexing for specified handleBjörn Linse2019-11-26
| | | | | Also missing option should be an error. Options are functionality, not arbitrary variable names (as for vim.g)
* Lua: vim.env, vim.{g,v,w,bo,wo} #11442Ashkan Kiani2019-11-24
| | | | | | | | - Add vim variable meta accessors: vim.env, vim.{g,v,w,bo,wo} - Redo gen_char_blob to generate multiple blobs instead of just one so that multiple Lua modules can be inlined. - Reorder vim.lua inclusion so that it can use previously defined C functions and utility functions like vim.shared and vim.inspect things. - Inline shared.lua into nvim, but also keep it available in runtime.
* doc: Lua [ci skip] #11378Justin M. Keyes2019-11-17
| | | | - Rework :help lua-commands - Rename if_lua.txt => lua.txt
* lua LSP client: initial implementation (#11336)Ashkan Kiani2019-11-13
| | | | | | Mainly configuration and RPC infrastructure can be considered "done". Specific requests and their callbacks will be improved later (and also served by plugins). There are also some TODO:s for the client itself, like incremental updates. Co-authored by at-tjdevries and at-h-michael, with many review/suggestion contributions.
* Lua: mark some functions as "private"Justin M. Keyes2019-11-11
| | | | | | Problem: scripts/gen_vimdoc.py gets confused and tries to generate docs for `fn_index` and `func`. Solution: Rename them to be private.
* paste: Select-mode, Visual-mode #11360Justin M. Keyes2019-11-09
| | | fix #11344
* doc: vim.fn, vim.call(), vim.api [ci skip]Justin M. Keyes2019-11-06
|
* lua: add vim.fn.{func} for direct access to vimL functionBjörn Linse2019-10-27
| | | | | | | | compared to vim.api.|nvim_call_function|, this fixes some typing issues due to the indirect conversion via the API. float values are preserved as such (fixes #9389) as well as empty dicts/arrays. Ref https://github.com/norcalli/nvim.lua for the call syntax
* tree-sitter: rename tree_sitter => treesitter for consistencyBjörn Linse2019-09-28
|
* tree-sitter: add basic testing on ciBjörn Linse2019-09-28
| | | | build tree-sitter c parser on ci for testing purposes
* paste: fix handling of "<" in cmdline (#11094)Daniel Hahler2019-09-25
| | | Fixes https://github.com/neovim/neovim/issues/11088.
* Merge #10995 'paste: fix paste in terminal mode'Justin M. Keyes2019-09-11
|\
| * paste: fix paste in terminal modeBjörn Linse2019-09-11
|/
* docJustin M. Keyes2019-09-11
| | | | | fix #10127 fix #5972
* doc: |api-fast| [ci skip]Justin M. Keyes2019-09-09
|
* paste: fix normal-mode paste by different approach #10976Justin M. Keyes2019-09-09
| | | | | | | | Forcing insert-mode after the first paste-chunk seems to work, as an alternative to a9e2bae0eb69 (insert-before-cursor). NB: Dot-repeat needs to match the original action. Since a9e2bae0eb69 changed paste to insert-before-cursor, dot-repeat must also. But that makes dot-repeat unpleasant/unusual.
* paste: insert before cursor alwaysJustin M. Keyes2019-09-08
| | | | | | | | | Inserting "after" the cursor in Normal-mode, for big paste-streams, is not reliable: sometimes the text "after" the cursor ends up in the middle of the pasted text. Maybe the cursor position is not updated? To avoid weird behavior, always paste "before". Maybe nvim_put() or vim.paste() can be fixed more properly later.
* paste: do not clobber msg area for small pastesJustin M. Keyes2019-09-08
|
* paste/cmdline: discard all chunks after first lineJustin M. Keyes2019-09-08
| | | | | | Problem: If multiple paste "chunks" are streamed, chunks after the first line are pasted into the buffer. Solution: Check for cmdline-mode for all chunks in a paste-stream.
* paste: reset 'paste' option immediately #10974Justin M. Keyes2019-09-08
| | | | | | - Workaround #10966: 'paste' option is not always reset. - In any case there's not much reason to wait until phase=3, because pasting in cmdline-mode skips lines after the first line (thus the `:set paste .. :set nopaste` dance happens only ~once).
* paste: redraw at endJustin M. Keyes2019-09-02
| | | | | | | | | | | | | | | | | | | | | | | Attempt to fix test failure since 976c6667e140 removed per-chunk redraw: ERROR test/functional/terminal/tui_spec.lua: TUI paste: cmdline-mode inserts 1 line test/functional/terminal/tui_spec.lua:367: in function <test/functional/terminal/tui_spec.lua:360 Expected: |*foo | |* | |{4:~ }| |{4:~ }| |{5:[No Name] [+] }| |:"line 1{1:"} | |{3:-- TERMINAL --} | Actual: |* | |*{4:~ }| |{4:~ }| |{4:~ }| |{5:[No Name] [+] }| |:"line 1{1:"} | |{3:-- TERMINAL --} |
* paste: one undo-block per streamJustin M. Keyes2019-09-02
| | | | | | - All "chunks" in a paste-stream should form a single undo-block. Side effect of 7a8579288424 was to create an undo-block for each chunk. - Also: remove old :redraw force logic, irrelevant after 7a8579288424.
* paste: make vim.paste() "public"Justin M. Keyes2019-08-27
|
* paste: implement redo (AKA dot-repeat)Justin M. Keyes2019-08-27
| | | | | | - Normal-mode redo idiom(?): prepend "i" and append ESC. - Insert-mode only needs AppendToRedobuffLit(). - Cmdline-mode: only paste the first line.
* paste: insert text "before" cursor in Insert-modeJustin M. Keyes2019-08-27
|
* API: nvim_pasteJustin M. Keyes2019-08-27
|
* paste: phases, dotsJustin M. Keyes2019-08-27
| | | | | | - Send `phase` parameter to the paste handler. - Redraw at intervals and when paste terminates. - Show "..." throbber during paste to indicate activity.
* API: nvim_put: "follow" parameterJustin M. Keyes2019-08-27
|