deprecated.txt 15 KB

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