robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
aa1d8a2702
master
1*deprecated.txt* Nvim 2 3 4 NVIM REFERENCE MANUAL 5 6 7Nvim *deprecated* 8 9The items listed below are deprecated: they will be removed in the future. 10They should not be used in new scripts, and old scripts should be updated. 11 12============================================================================== 13Deprecated features 14 15------------------------------------------------------------------------------ 16DEPRECATED IN 0.13 *deprecated-0.13* 17 18API 19 20• *nvim_win_set_height()* Use |nvim_win_resize()| instead. 21• *nvim_win_set_width()* Use |nvim_win_resize()| instead. 22• The "buffer" key accepted and/or returned by these functions, was renamed to 23 "buf": 24 • |nvim_create_autocmd()| 25 • |nvim_get_autocmds()| 26 • |nvim_exec_autocmds()| 27 • |nvim_clear_autocmds()| 28 29EVENTS 30• *BufModifiedSet* Use |OptionSet| with pattern "modified" instead. 31 32HIGHLIGHTS 33 34• vim.hl.on_yank() Use |vim.hl.hl_op()| instead. 35 36LUA 37 38• vim.F.if_nil() Renamed to |vim.nonnil()| 39• vim.F.ok_or_nil() 40• vim.F.npcall() Renamed to |vim.npcall()| 41• vim.F.nil_wrap() Use |vim.npcall()| instead 42 43TREESITTER 44 45• *vim.treesitter.get_captures_at_pos()* Use |vim.treesitter.get_captures()| 46 with `(buf, { row, col })` instead. 47 48UI 49 50• |v:echospace| Its purpose to avoid a "Press ENTER" prompt 51 no longer applies with |ui2|. 52 53LSP 54 55• vim.lsp.util.character_offset() Use to |vim.str_utfindex()| instead 56 57VIMSCRIPT 58• ctxget(), ctxpop(), ctxpush(), ctxset(), ctxsize(). Use 59 |nvim_get_context()| and |nvim_load_context()| instead. 60 61------------------------------------------------------------------------------ 62DEPRECATED IN 0.12 *deprecated-0.12* 63 64API 65 66• nvim_set_decoration_provider `on_line` Use `on_range` instead. 67 68DIAGNOSTICS 69 70• "float" in |vim.diagnostic.JumpOpts|. Use `on_jump` instead. 71• "float" in |vim.diagnostic.Opts.Jump|. Use `on_jump` instead. 72 73HIGHLIGHTS 74 75• *:ownsyntax* *w:current_syntax* Use 'winhighlight' instead. 76 77LSP 78 79• *vim.lsp.client_is_stopped()* Use |vim.lsp.get_client_by_id()| instead. 80• *vim.lsp.util.stylize_markdown()* Use |vim.treesitter.start()| with 81 `vim.wo.conceallevel = 2`. 82• *vim.lsp.log.should_log()* Use |vim.lsp.log.set_format_func()| instead 83 and return `nil` to omit entries from the logfile. 84• *vim.lsp.semantic_tokens.start()* Use `vim.lsp.semantic_tokens.enable(true)` instead 85• *vim.lsp.semantic_tokens.stop()* Use `vim.lsp.semantic_tokens.enable(false)` instead 86• *vim.lsp.set_log_level()* Use `vim.lsp.log.set_level()` instead 87• *vim.lsp.get_log_path()* Use `vim.lsp.log.get_filename()` instead 88• *vim.lsp.get_buffers_by_client_id()* Use `vim.lsp.get_client_by_id(id).attached_buffers` 89 instead 90• *vim.lsp.stop_client()* Use |Client:stop()| instead 91• *vim.lsp.codelens.refresh()* Use `vim.lsp.codelens.enable(true)` instead 92• *vim.lsp.codelens.clear()* Use `vim.lsp.codelens.enable(false)` instead 93• *vim.lsp.codelens.display()* 94• *vim.lsp.codelens.save()* 95• *vim.lsp.codelens.on_codelens()* 96 97LUA 98 99• *vim.diff()* Renamed to |vim.text.diff()| 100• "buffer" in `vim.keymap.set.Opts` and `vim.keymap.del.Opts` Renamed to "buf" 101 102UI 103 104• *hit-enter* *hit-enter-prompt* With |ui2|, the legacy "Press ENTER" 105 *press-enter* prompt is never triggered. 106 107------------------------------------------------------------------------------ 108DEPRECATED IN 0.11 *deprecated-0.11* 109 110API 111• nvim_notify() Use |nvim_echo()| or `nvim_exec_lua("vim.notify(...)", ...)` instead. 112• nvim_subscribe() Plugins must maintain their own "multicast" channels list. 113• nvim_unsubscribe() Plugins must maintain their own "multicast" channels list. 114• nvim_out_write() Use |nvim_echo()|. 115• nvim_err_write() Use |nvim_echo()| with `{err=true}`. 116• nvim_err_writeln() Use |nvim_echo()| with `{err=true}`. 117• nvim_buf_add_highlight() Use |vim.hl.range()| or |nvim_buf_set_extmark()| 118 119DIAGNOSTICS 120• *vim.diagnostic.goto_next()* Use |vim.diagnostic.jump()| with `{count=1, float=true}` instead. 121• *vim.diagnostic.goto_prev()* Use |vim.diagnostic.jump()| with `{count=-1, float=true}` instead. 122• *vim.diagnostic.get_next_pos()* Use the "lnum" and "col" fields from the 123 return value of |vim.diagnostic.get_next()| instead. 124• *vim.diagnostic.get_prev_pos()* Use the "lnum" and "col" fields from the 125 return value of |vim.diagnostic.get_prev()| instead. 126• The "win_id" parameter used by various functions is deprecated in favor of 127 "winid" |winid| 128• |vim.diagnostic.JumpOpts| renamed its "cursor_position" field to "pos". 129 130HIGHLIGHTS 131• *TermCursorNC* Unfocused |terminal| windows do not have a cursor. 132 133LSP 134• *vim.lsp.util.jump_to_location* Use |vim.lsp.util.show_document()| with 135 `{focus=true}` instead. 136• *vim.lsp.buf.execute_command* Use |Client:exec_cmd()| instead. 137• *vim.lsp.buf.completion* Use |vim.lsp.completion.get()| instead. 138• vim.lsp.buf_request_all The `error` key has been renamed to `err` inside 139 the result parameter of the handler. 140• *vim.lsp.with()* Pass configuration to equivalent 141 functions in `vim.lsp.buf.*`. 142• |vim.lsp.handlers| Does not support client-to-server response handlers. Only 143 supports server-to-client requests/notification handlers. 144• *vim.lsp.handlers.signature_help()* Use |vim.lsp.buf.signature_help()| instead. 145• `client.request()` Use |Client:request()| instead. 146• `client.request_sync()` Use |Client:request_sync()| instead. 147• `client.notify()` Use |Client:notify()| instead. 148• `client.cancel_request()` Use |Client:cancel_request()| instead. 149• `client.stop()` Use |Client:stop()| instead. 150• `client.is_stopped()` Use |Client:is_stopped()| instead. 151• `client.supports_method()` Use |Client:supports_method()| instead. 152• `client.on_attach()` Use |Client:on_attach()| instead. 153• `vim.lsp.start_client()` Use |vim.lsp.start()| instead. 154 155LUA 156• vim.region() Use |getregionpos()| instead. 157• *vim.highlight* Renamed to |vim.hl|. 158• vim.validate(opts: table) Use form 1. See |vim.validate()|. 159 160VIMSCRIPT 161• *termopen()* Use |jobstart()| with `{term: v:true}`. 162 163------------------------------------------------------------------------------ 164DEPRECATED IN 0.10 *deprecated-0.10* 165 166API 167• *nvim_buf_get_option()* Use |nvim_get_option_value()| instead. 168• *nvim_buf_set_option()* Use |nvim_set_option_value()| instead. 169• *nvim_call_atomic()* Use |nvim_exec_lua()| instead. 170• *nvim_get_option()* Use |nvim_get_option_value()| instead. 171• *nvim_set_option()* Use |nvim_set_option_value()| instead. 172• *nvim_win_get_option()* Use |nvim_get_option_value()| instead. 173• *nvim_win_set_option()* Use |nvim_set_option_value()| instead. 174 175CHECKHEALTH 176• *health#report_error* *vim.health.report_error()* Use |vim.health.error()| instead. 177• *health#report_info* *vim.health.report_info()* Use |vim.health.info()| instead. 178• *health#report_ok* *vim.health.report_ok()* Use |vim.health.ok()| instead. 179• *health#report_start* *vim.health.report_start()* Use |vim.health.start()| instead. 180• *health#report_warn* *vim.health.report_warn()* Use |vim.health.warn()| instead. 181 182DIAGNOSTICS 183• Configuring |diagnostic-signs| using |:sign-define| or |sign_define()|. Use 184 the "signs" key of |vim.diagnostic.config()| instead. 185• vim.diagnostic functions: 186 • vim.diagnostic.disable() Use |vim.diagnostic.enable()| 187 • vim.diagnostic.is_disabled() Use |vim.diagnostic.is_enabled()| 188 • Legacy signature: `vim.diagnostic.enable(buf:number, namespace:number)` 189 190LSP 191• *vim.lsp.util.get_progress_messages()* Use |vim.lsp.status()| instead. 192• *vim.lsp.get_active_clients()* Use |vim.lsp.get_clients()| instead. 193• *vim.lsp.for_each_buffer_client()* Use |vim.lsp.get_clients()| instead. 194• *vim.lsp.util.trim_empty_lines()* Use |vim.split()| with `trimempty` instead. 195• *vim.lsp.util.try_trim_markdown_code_blocks()* 196• *vim.lsp.util.set_lines()* 197• *vim.lsp.util.extract_completion_items()* 198• *vim.lsp.util.parse_snippet()* 199• *vim.lsp.util.text_document_completion_list_to_complete_items()* 200• *vim.lsp.util.lookup_section()* Use |vim.tbl_get()| instead: > 201 local keys = vim.split(section, '.', { plain = true }) 202 local vim.tbl_get(table, unpack(keys)) 203 204LUA 205• *vim.loop* Use |vim.uv| instead. 206• *vim.tbl_add_reverse_lookup()* 207• *vim.tbl_flatten()* Use |IterArray:flatten()| instead. 208• *vim.tbl_islist()* Use |vim.islist()| instead. 209 210OPTIONS 211• The "term_background" UI option |ui-ext-options| is deprecated and no longer 212 populated. Background color detection is now performed in Lua by the Nvim 213 core, not the TUI. 214 215TREESITTER 216• *LanguageTree:for_each_child()* Use |LanguageTree:children()| (non-recursive) instead. 217 218 219------------------------------------------------------------------------------ 220DEPRECATED IN 0.9 *deprecated-0.9* 221 222API 223• *nvim_get_hl_by_name()* Use |nvim_get_hl()| instead. 224• *nvim_get_hl_by_id()* Use |nvim_get_hl()| instead. 225 226TREESITTER 227• *vim.treesitter.language.require_language()* Use |vim.treesitter.language.add()| instead. 228• *vim.treesitter.get_node_at_pos()* Use |vim.treesitter.get_node()| instead. 229• *vim.treesitter.get_node_at_cursor()* Use |vim.treesitter.get_node()| 230 and |TSNode:type()| instead. 231• The following top level Treesitter functions have been moved: 232 • *vim.treesitter.inspect_language()* -> |vim.treesitter.language.inspect()| 233 • *vim.treesitter.get_query_files()* -> |vim.treesitter.query.get_files()| 234 • *vim.treesitter.set_query()* -> |vim.treesitter.query.set()| 235 • *vim.treesitter.query.set_query()* -> |vim.treesitter.query.set()| 236 • *vim.treesitter.get_query()* -> |vim.treesitter.query.get()| 237 • *vim.treesitter.query.get_query()* -> |vim.treesitter.query.get()| 238 • *vim.treesitter.parse_query()* -> |vim.treesitter.query.parse()| 239 • *vim.treesitter.query.parse_query()* -> |vim.treesitter.query.parse()| 240 • *vim.treesitter.add_predicate()* -> |vim.treesitter.query.add_predicate()| 241 • *vim.treesitter.add_directive()* -> |vim.treesitter.query.add_directive()| 242 • *vim.treesitter.list_predicates()* -> |vim.treesitter.query.list_predicates()| 243 • *vim.treesitter.list_directives()* -> |vim.treesitter.query.list_directives()| 244 • *vim.treesitter.query.get_range()* -> |vim.treesitter.get_range()| 245 • *vim.treesitter.query.get_node_text()* -> |vim.treesitter.get_node_text()| 246 247LUA 248 • *nvim_exec()* Use |nvim_exec2()| instead. 249 • *vim.pretty_print()* Use |vim.print()| instead. 250 251 252------------------------------------------------------------------------------ 253DEPRECATED IN 0.8 OR EARLIER 254 255API 256• *nvim_buf_clear_highlight()* Use |nvim_buf_clear_namespace()| instead. 257• *nvim_buf_set_virtual_text()* Use |nvim_buf_set_extmark()| instead. 258• *nvim_command_output()* Use |nvim_exec2()| instead. 259• *nvim_execute_lua()* Use |nvim_exec_lua()| instead. 260• *nvim_get_option_info()* Use |nvim_get_option_info2()| instead. 261 262COMMANDS 263• *:rv* *:rviminfo* Deprecated alias to |:rshada| command. 264• *:wv* *:wviminfo* Deprecated alias to |:wshada| command. 265 266ENVIRONMENT VARIABLES 267• *$NVIM_LISTEN_ADDRESS* 268 • Deprecated way to: 269 • set the server name (use |--listen| or |serverstart()| instead) 270 • get the server name (use |v:servername| instead) 271 • detect a parent Nvim (use |$NVIM| instead) 272 • Ignored if --listen is given. 273 • Unset at startup (after |v:servername| is initialized). Can be explicitly 274 provided to |terminal| and |jobstart()| by the "env" option. Example: >vim 275 call jobstart(['foo'], { 'env': { 'NVIM_LISTEN_ADDRESS': v:servername } }) 276< 277 278EVENTS 279• *BufCreate* Use |BufAdd| instead. 280• *EncodingChanged* Never fired; 'encoding' is always "utf-8". 281• *FileEncoding* Never fired; equivalent to |EncodingChanged|. 282• *GUIEnter* Never fired; use |UIEnter| instead. 283• *GUIFailed* Never fired. 284 285KEYCODES 286• *<MouseDown>* Use <ScrollWheelUp> instead. 287• *<MouseUp>* Use <ScrollWheelDown> instead. 288 289HIGHLIGHTS 290• *hl-VertSplit* Use |hl-WinSeparator| instead. 291 292LSP DIAGNOSTICS 293For each of the functions below, use the corresponding function in 294|vim.diagnostic| instead (unless otherwise noted). For example, use 295|vim.diagnostic.get()| instead of vim.lsp.diagnostic.get(). 296 297• vim.lsp.diagnostic.clear() Use |vim.diagnostic.hide()| instead. 298• vim.lsp.diagnostic.disable() Use |vim.diagnostic.enable()| instead. 299• vim.lsp.diagnostic.display() Use |vim.diagnostic.show()| instead. 300• vim.lsp.diagnostic.enable() 301• vim.lsp.diagnostic.get() 302• vim.lsp.diagnostic.get_all() Use |vim.diagnostic.get()| instead. 303• vim.lsp.diagnostic.get_count() Use |vim.diagnostic.count()| instead. 304• vim.lsp.diagnostic.get_line_diagnostics() Use |vim.diagnostic.get()| instead. 305• vim.lsp.diagnostic.get_next() 306• vim.lsp.diagnostic.get_next_pos() 307• vim.lsp.diagnostic.get_prev() 308• vim.lsp.diagnostic.get_prev_pos() 309• vim.lsp.diagnostic.get_virtual_text_chunks_for_line() No replacement. Use 310 options provided by |vim.diagnostic.config()| to customize virtual text. 311• vim.lsp.diagnostic.goto_next() 312• vim.lsp.diagnostic.goto_prev() 313• vim.lsp.diagnostic.redraw() Use |vim.diagnostic.show()| instead. 314• vim.lsp.diagnostic.save() Use |vim.diagnostic.set()| instead. 315• vim.lsp.diagnostic.set_loclist() Use |vim.diagnostic.setloclist()| instead. 316• vim.lsp.diagnostic.set_qflist() Use |vim.diagnostic.setqflist()| instead. 317• vim.lsp.diagnostic.show_line_diagnostics() Use |vim.diagnostic.open_float()| instead. 318• vim.lsp.diagnostic.show_position_diagnostics() Use |vim.diagnostic.open_float()| instead. 319 320The following are deprecated without replacement. These functions are moved 321internally and are no longer exposed as part of the API. Instead, use 322|vim.diagnostic.config()| and |vim.diagnostic.show()|. 323 324• vim.lsp.diagnostic.set_signs() 325• vim.lsp.diagnostic.set_underline() 326• vim.lsp.diagnostic.set_virtual_text() 327 328LSP FUNCTIONS 329• *vim.lsp.buf.server_ready()* 330 Use |LspAttach| instead, depending on your use-case. "Server ready" is not 331 part of the LSP spec, so the Nvim LSP client cannot meaningfully implement 332 it. "Ready" is ambiguous because: 333 • Language servers may finish analyzing the workspace, but edits can always 334 re-trigger analysis/builds. 335 • Language servers can serve some requests even while processing changes. 336• *vim.lsp.buf.range_code_action()* Use |vim.lsp.buf.code_action()| with 337 the `range` parameter. 338• *vim.lsp.util.diagnostics_to_items()* Use |vim.diagnostic.toqflist()| instead. 339• *vim.lsp.util.set_qflist()* Use |setqflist()| instead. 340• *vim.lsp.util.set_loclist()* Use |setloclist()| instead. 341• *vim.lsp.buf_get_clients()* Use |vim.lsp.get_clients()| with 342 {buffer=bufnr} instead. 343• *vim.lsp.buf.formatting()* Use |vim.lsp.buf.format()| with 344 {async=true} instead. 345• *vim.lsp.buf.formatting_sync()* Use |vim.lsp.buf.format()| with 346 {async=false} instead. 347• *vim.lsp.buf.range_formatting()* Use |vim.lsp.formatexpr()| 348 or |vim.lsp.buf.format()| instead. 349 350LUA 351• vim.register_keystroke_callback() Use |vim.on_key()| instead. 352 353NORMAL COMMANDS 354• *]f* *[f* Same as "gf". 355 356OPTIONS 357• *cpo-<* *:menu-<special>* *:menu-special* *:map-<special>* *:map-special* 358 `<>` notation is always enabled. 359• *'fe'* 'fenc'+'enc' before Vim 6.0; no longer used. 360• *'gdefault'* boolean (default off) Enables the :substitute "/g" 361 flag by default. See |complex-change|. 362 command 'gdefault' on 'gdefault' off ~ 363 :s/// subst. all subst. one 364 :s///g subst. one subst. all 365 :s///gg subst. all subst. one 366 WARNING: Setting this breaks plugins, because "/g" 367 will have the opposite effect. |:s_g| 368• *'highlight'* *'hl'* Names of builtin |highlight-groups| cannot be changed. 369• *'isprint* *'isp'* Printability of ASCII or Unicode chars cannot be changed. 370• *'langnoremap'* Deprecated alias to 'nolangremap'. 371• *'magic'* *'nomagic'* boolean (default on) Changes the special characters in 372 search |pattern|s. 373 WARNING: Disabling this breaks plugins, because most 374 patterns assume it's on. See also |/\M|. 375• *'paste'* *'nopaste'* Just Paste It.™ The 'paste' option is obsolete: 376 |paste| is handled automatically when you paste text 377 using your terminal's or GUI's paste feature 378 (CTRL-SHIFT-v, CMD-v (macOS), middle-click, …). 379 Enables "paste mode": 380 • Disables mappings in Insert, Cmdline mode. 381 • Disables abbreviations. 382 • Resets 'autoindent' 'expandtab' 'revins' 'ruler' 383 'showmatch' 'smartindent' 'smarttab' 'softtabstop' 384 'textwidth' 'wrapmargin'. 385 • Treats 'formatoptions' as empty. 386 • Disables the effect of these options: 387 • 'cindent' 388 • 'indentexpr' 389 • 'lisp' 390• 'sessionoptions' Flags "unix", "slash" are ignored and always enabled. 391• *'vi'* 392• 'viewoptions' Flags "unix", "slash" are ignored and always enabled. 393• *'viminfo'* Deprecated alias to 'shada' option. 394• *'viminfofile'* Deprecated alias to 'shadafile' option. 395 396UI EXTENSIONS 397• *ui-wildmenu* Use |ui-cmdline| with |ui-popupmenu| instead. Enabled 398 by the `ext_wildmenu` |ui-option|. Emits these events: 399 • `["wildmenu_show", items]` 400 • `["wildmenu_select", selected]` 401 • `["wildmenu_hide"]` 402• *term_background* Unused. The terminal background color is now detected 403 by the Nvim core directly instead of the TUI. 404 405VIMSCRIPT 406• *<sfile>* Use |<script>| or |<stack>| instead. 407• *b:terminal_job_pid* Use `jobpid(&channel)` instead. 408• *b:terminal_job_id* Use `&channel` instead. To access in non-current buffer: 409 • Lua: `vim.bo[bufnr].channel` 410 • Vimscript: `getbufvar(bufnr, '&channel')` 411• *buffer_exists()* Obsolete name for |bufexists()|. 412• *buffer_name()* Obsolete name for |bufname()|. 413• *buffer_number()* Obsolete name for |bufnr()|. 414• *file_readable()* Obsolete name for |filereadable()|. 415• *highlight_exists()* Obsolete name for |hlexists()|. 416• *highlightID()* Obsolete name for |hlID()|. 417• *inputdialog()* Use |input()| instead. 418• *jobclose()* Obsolete name for |chanclose()| 419• *jobsend()* Obsolete name for |chansend()| 420• *last_buffer_nr()* Obsolete name for bufnr("$"). 421• *rpcstart()* Use |jobstart()| with `{'rpc': v:true}` instead. 422• *rpcstop()* Use |jobstop()| instead to stop any job, or 423 `chanclose(id, "rpc")` to close RPC communication 424 without stopping the job. Use chanclose(id) to close 425 any socket. 426 427 428 vim:noet:tw=78:ts=8:ft=help:norl: