Deprecated features
Rustvim :help pages, generated
from source
using the tree-sitter-vimdoc parser.
The items listed below are deprecated: they will be removed in the future.
They should not be used in new scripts, and old scripts should be updated.
DEPRECATED IN 0.13
API
nvim_win_set_height() Use nvim_win_resize() instead.
nvim_win_set_width() Use nvim_win_resize() instead.
The "buffer" key accepted and/or returned by these functions, was renamed to
"buf":
EVENTS
BufModifiedSet Use OptionSet with pattern "modified" instead.
HIGHLIGHTS
vim.hl.on_yank() Use vim.hl.hl_op() instead.
LUA
vim.F.if_nil() Renamed to vim.nonnil()
vim.F.ok_or_nil()
vim.F.npcall() Renamed to vim.npcall()
vim.F.nil_wrap() Use vim.npcall() instead
vim.uri_decode() Renamed to vim.uri.decode()
vim.uri_encode() Renamed to vim.uri.encode()
vim.uri_from_bufnr() Renamed to vim.uri.from_buf()
vim.uri_from_fname() Renamed to vim.uri.from_fname()
vim.uri_to_bufnr() Renamed to vim.uri.to_buf()
vim.uri_to_fname() Renamed to vim.uri.to_fname()
TREESITTER
vim.treesitter.get_captures_at_pos() Use vim.treesitter.get_captures()
with
(buf, { row, col }) instead.
UI
v:echospace Its purpose to avoid a "Press ENTER" prompt
no longer applies with ui2.
LSP
vim.lsp.util.character_offset() Use to vim.str_utfindex() instead
VIMSCRIPT
ctxget(), ctxpop(), ctxpush(), ctxset(), ctxsize(). Use
nvim_get_context() and nvim_load_context() instead.
rpcnotify() Use vim.rpcnotify() instead.
rpcrequest() Use vim.rpcrequest() instead.
DEPRECATED IN 0.12
API
nvim_set_decoration_provider
on_line Use on_range instead.
DIAGNOSTICS
"float" in vim.diagnostic.JumpOpts. Use
on_jump instead.
"float" in vim.diagnostic.Opts.Jump. Use
on_jump instead.
HIGHLIGHTS
LSP
vim.lsp.client_is_stopped() Use vim.lsp.get_client_by_id() instead.
vim.lsp.log.should_log() Use vim.lsp.log.set_format_func() instead
and return
nil to omit entries from the logfile.
vim.lsp.semantic_tokens.start() Use
vim.lsp.semantic_tokens.enable(true) instead
vim.lsp.semantic_tokens.stop() Use
vim.lsp.semantic_tokens.enable(false) instead
vim.lsp.set_log_level() Use
vim.lsp.log.set_level() instead
vim.lsp.get_log_path() Use
vim.lsp.log.get_filename() instead
vim.lsp.get_buffers_by_client_id() Use
vim.lsp.get_client_by_id(id).attached_buffers
instead
vim.lsp.stop_client() Use Client:stop() instead
vim.lsp.codelens.refresh() Use
vim.lsp.codelens.enable(true) instead
vim.lsp.codelens.clear() Use
vim.lsp.codelens.enable(false) instead
LUA
vim.diff() Renamed to vim.text.diff()
"buffer" in
vim.keymap.set.Opts and vim.keymap.del.Opts Renamed to "buf"
UI
hit-enter hit-enter-prompt With ui2, the legacy "Press ENTER"
press-enter prompt is never triggered.
DEPRECATED IN 0.11
API
nvim_notify() Use nvim_echo() or
nvim_exec_lua("vim.notify(...)", ...) instead.
nvim_subscribe() Plugins must maintain their own "multicast" channels list.
nvim_unsubscribe() Plugins must maintain their own "multicast" channels list.
nvim_out_write() Use nvim_echo().
nvim_err_write() Use nvim_echo() with
{err=true}.
nvim_err_writeln() Use nvim_echo() with
{err=true}.
nvim_buf_add_highlight() Use vim.hl.range() or nvim_buf_set_extmark()
DIAGNOSTICS
vim.diagnostic.get_next_pos() Use the "lnum" and "col" fields from the
return value of vim.diagnostic.get_next() instead.
vim.diagnostic.get_prev_pos() Use the "lnum" and "col" fields from the
return value of vim.diagnostic.get_prev() instead.
The "win_id" parameter used by various functions is deprecated in favor of
"winid" winid
vim.diagnostic.JumpOpts renamed its "cursor_position" field to "pos".
HIGHLIGHTS
TermCursorNC Unfocused terminal windows do not have a cursor.
LSP
vim.lsp.buf.execute_command Use Client:exec_cmd() instead.
vim.lsp.buf.completion Use vim.lsp.completion.get() instead.
vim.lsp.buf_request_all The
error key has been renamed to err inside
the result parameter of the handler.
vim.lsp.with() Pass configuration to equivalent
functions in
vim.lsp.buf.*.
vim.lsp.handlers Does not support client-to-server response handlers. Only
supports server-to-client requests/notification handlers.
client.request() Use Client:request() instead.
client.request_sync() Use Client:request_sync() instead.
client.notify() Use Client:notify() instead.
client.cancel_request() Use Client:cancel_request() instead.
client.stop() Use Client:stop() instead.
client.is_stopped() Use Client:is_stopped() instead.
client.supports_method() Use Client:supports_method() instead.
client.on_attach() Use Client:on_attach() instead.
vim.lsp.start_client() Use vim.lsp.start() instead.
LUA
vim.region() Use getregionpos() instead.
vim.highlight Renamed to vim.hl.
vim.validate(opts: table) Use form 1. See vim.validate().
VIMSCRIPT
DEPRECATED IN 0.10
API
nvim_buf_get_option() Use nvim_get_option_value() instead.
nvim_buf_set_option() Use nvim_set_option_value() instead.
nvim_call_atomic() Use nvim_exec_lua() instead.
nvim_get_option() Use nvim_get_option_value() instead.
nvim_set_option() Use nvim_set_option_value() instead.
nvim_win_get_option() Use nvim_get_option_value() instead.
nvim_win_set_option() Use nvim_set_option_value() instead.
CHECKHEALTH
DIAGNOSTICS
Configuring diagnostic-signs using :sign-define or sign_define(). Use
the "signs" key of vim.diagnostic.config() instead.
vim.diagnostic functions:
vim.diagnostic.disable() Use vim.diagnostic.enable()
vim.diagnostic.is_disabled() Use vim.diagnostic.is_enabled()
Legacy signature:
vim.diagnostic.enable(buf:number, namespace:number)
LSP
vim.lsp.util.get_progress_messages() Use vim.lsp.status() instead.
vim.lsp.get_active_clients() Use vim.lsp.get_clients() instead.
vim.lsp.for_each_buffer_client() Use vim.lsp.get_clients() instead.
vim.lsp.util.lookup_section() Use vim.tbl_get() instead:
local keys = vim.split(section, '.', { plain = true })
local vim.tbl_get(table, unpack(keys))LUA
vim.tbl_flatten() Use IterArray:flatten() instead.
vim.tbl_islist() Use vim.islist() instead.
OPTIONS
The "term_background" UI option ui-ext-options is deprecated and no longer
populated. Background color detection is now performed in Lua by the Nvim
core, not the TUI.
TREESITTER
LanguageTree:for_each_child() Use LanguageTree:children() (non-recursive) instead.
DEPRECATED IN 0.9
TREESITTER
The following top level Treesitter functions have been moved:
DEPRECATED IN 0.8 OR EARLIER
API
nvim_buf_clear_highlight() Use nvim_buf_clear_namespace() instead.
nvim_buf_set_virtual_text() Use nvim_buf_set_extmark() instead.
nvim_command_output() Use nvim_exec2() instead.
nvim_execute_lua() Use nvim_exec_lua() instead.
nvim_get_option_info() Use nvim_get_option_info2() instead.
COMMANDS
ENVIRONMENT VARIABLES
Deprecated way to:
set the server name (use --listen or serverstart() instead)
get the server name (use v:servername instead)
detect a parent Nvim (use $NVIM instead)
Ignored if --listen is given.
Unset at startup (after v:servername is initialized). Can be explicitly
provided to terminal and jobstart() by the "env" option. Example:
call jobstart(['foo'], { 'env': { 'NVIM_LISTEN_ADDRESS': v:servername } })
EVENTS
EncodingChanged Never fired; 'encoding' is always "utf-8".
FileEncoding Never fired; equivalent to EncodingChanged.
GUIFailed Never fired.
HIGHLIGHTS
hl-VertSplit Use hl-WinSeparator instead.
LSP DIAGNOSTICS
For each of the functions below, use the corresponding function in vim.diagnostic instead (unless otherwise noted). For example, use vim.diagnostic.get() instead of vim.lsp.diagnostic.get(). vim.lsp.diagnostic.clear() Use vim.diagnostic.hide() instead.
vim.lsp.diagnostic.disable() Use vim.diagnostic.enable() instead.
vim.lsp.diagnostic.display() Use vim.diagnostic.show() instead.
vim.lsp.diagnostic.enable()
vim.lsp.diagnostic.get()
vim.lsp.diagnostic.get_all() Use vim.diagnostic.get() instead.
vim.lsp.diagnostic.get_count() Use vim.diagnostic.count() instead.
vim.lsp.diagnostic.get_line_diagnostics() Use vim.diagnostic.get() instead.
vim.lsp.diagnostic.get_next()
vim.lsp.diagnostic.get_next_pos()
vim.lsp.diagnostic.get_prev()
vim.lsp.diagnostic.get_prev_pos()
vim.lsp.diagnostic.get_virtual_text_chunks_for_line() No replacement. Use
options provided by vim.diagnostic.config() to customize virtual text.
vim.lsp.diagnostic.goto_next()
vim.lsp.diagnostic.goto_prev()
vim.lsp.diagnostic.redraw() Use vim.diagnostic.show() instead.
vim.lsp.diagnostic.save() Use vim.diagnostic.set() instead.
vim.lsp.diagnostic.set_loclist() Use vim.diagnostic.setloclist() instead.
vim.lsp.diagnostic.set_qflist() Use vim.diagnostic.setqflist() instead.
vim.lsp.diagnostic.show_line_diagnostics() Use vim.diagnostic.open_float() instead.
vim.lsp.diagnostic.show_position_diagnostics() Use vim.diagnostic.open_float() instead.
The following are deprecated without replacement. These functions are moved
internally and are no longer exposed as part of the API. Instead, use
vim.diagnostic.config() and vim.diagnostic.show().
vim.lsp.diagnostic.set_signs()
vim.lsp.diagnostic.set_underline()
vim.lsp.diagnostic.set_virtual_text()
LSP FUNCTIONS
vim.lsp.buf.server_ready()
Use LspAttach instead, depending on your use-case. "Server ready" is not
part of the LSP spec, so the Nvim LSP client cannot meaningfully implement
it. "Ready" is ambiguous because:
Language servers may finish analyzing the workspace, but edits can always
re-trigger analysis/builds.
Language servers can serve some requests even while processing changes.
vim.lsp.util.set_qflist() Use setqflist() instead.
vim.lsp.util.set_loclist() Use setloclist() instead.
LUA
vim.register_keystroke_callback() Use vim.on_key() instead.
OPTIONS
'gdefault' boolean (default off) Enables the :substitute "/g"
flag by default. See complex-change.
command 'gdefault' on 'gdefault' off ~
:s/// subst. all subst. one
:s///g subst. one subst. all
:s///gg subst. all subst. one
WARNING: Setting this breaks plugins, because "/g"
will have the opposite effect. :s_g
'langnoremap' Deprecated alias to 'nolangremap'.
'magic' 'nomagic' boolean (default on) Changes the special characters in
search patterns.
WARNING: Disabling this breaks plugins, because most
patterns assume it's on. See also /\M.
'paste' 'nopaste' Just Paste It.™ The 'paste' option is obsolete:
paste is handled automatically when you paste text
using your terminal's or GUI's paste feature
(
CTRL-SHIFT-v, CMD-v (macOS), middle-click, …).
Enables "paste mode":
Disables mappings in Insert, Cmdline mode.
Disables abbreviations.
Resets 'autoindent' 'expandtab' 'revins' 'ruler'
'showmatch' 'smartindent' 'smarttab' 'softtabstop'
'textwidth' 'wrapmargin'.
Treats 'formatoptions' as empty.
Disables the effect of these options:
'sessionoptions' Flags "unix", "slash" are ignored and always enabled.
'viewoptions' Flags "unix", "slash" are ignored and always enabled.
'viminfofile' Deprecated alias to 'shadafile' option.
UI EXTENSIONS
Use ui-cmdline with ui-popupmenu instead. Enabled
by the
ext_wildmenu ui-option. Emits these events:
["wildmenu_show", items]
["wildmenu_select", selected]
["wildmenu_hide"]
term_background Unused. The terminal background color is now detected
by the Nvim core directly instead of the TUI.
VIMSCRIPT
b:terminal_job_pid Use
jobpid(&channel) instead.
b:terminal_job_id Use
&channel instead. To access in non-current buffer:
Lua:
vim.bo[bufnr].channel
Vimscript:
getbufvar(bufnr, '&channel')
buffer_exists() Obsolete name for bufexists().
buffer_name() Obsolete name for bufname().
buffer_number() Obsolete name for bufnr().
file_readable() Obsolete name for filereadable().
highlight_exists() Obsolete name for hlexists().
highlightID() Obsolete name for hlID().
inputdialog() Use input() instead.
jobclose() Obsolete name for chanclose()
jobsend() Obsolete name for chansend()
last_buffer_nr() Obsolete name for bufnr("$").