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