deprecated.txt 12 KB

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