1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332
|
*vim_diff.txt* For Nvim. {Nvim}
NVIM REFERENCE MANUAL
Differences between Nvim and Vim *vim-differences*
Throughout the help files, differences between Nvim and Vim are indicated via
the "{Nvim}" tag. This document is a complete and centralized list of all
these differences.
1. Configuration |nvim-configuration|
2. Defaults |nvim-defaults|
3. New features |nvim-features|
4. Changed features |nvim-features-changed|
5. Missing legacy features |nvim-features-missing|
6. Removed features |nvim-features-removed|
==============================================================================
1. Configuration *nvim-configuration*
- Use `$XDG_CONFIG_HOME/nvim/init.vim` instead of `.vimrc` for storing
configuration.
- Use `$XDG_CONFIG_HOME/nvim` instead of `.vim` to store configuration files.
- Use `$XDG_DATA_HOME/nvim/shada/main.shada` instead of `.viminfo` for persistent
session information.
==============================================================================
2. Defaults *nvim-defaults*
- Syntax highlighting is enabled by default
- ":filetype plugin indent on" is enabled by default
- 'autoindent' is set by default
- 'autoread' is set by default
- 'backspace' defaults to "indent,eol,start"
- 'backupdir' defaults to .,~/.local/share/nvim/backup (|xdg|)
- 'complete' doesn't include "i"
- 'directory' defaults to ~/.local/share/nvim/swap// (|xdg|), auto-created
- 'display' defaults to "lastline"
- 'formatoptions' defaults to "tcqj"
- 'history' defaults to 10000 (the maximum)
- 'hlsearch' is set by default
- 'incsearch' is set by default
- 'langnoremap' is set by default
- 'laststatus' defaults to 2 (statusline is always shown)
- 'listchars' defaults to "tab:> ,trail:-,nbsp:+"
- 'mouse' defaults to "a"
- 'nocompatible' is always set
- 'nrformats' defaults to "bin,hex"
- 'sessionoptions' doesn't include "options"
- 'smarttab' is set by default
- 'tabpagemax' defaults to 50
- 'tags' defaults to "./tags;,tags"
- 'ttyfast' is always set
- 'undodir' defaults to ~/.local/share/nvim/undo (|xdg|), auto-created
- 'viminfo' includes "!"
- 'wildmenu' is set by default
==============================================================================
3. New Features *nvim-features*
MAJOR COMPONENTS ~
Embedded terminal emulator |terminal-emulator|
RPC API |RPC|
Shared data |shada|
XDG base directories |xdg|
Job control |job-control|
Remote plugins |remote-plugin|
Python plugins |provider-python|
Clipboard integration |provider-clipboard|
USER EXPERIENCE ~
A major goal of Nvim is to work intuitively and consistently. For example,
Nvim does not have `-X`, a platform-specific option available in some Vim
builds (with potential surprises: http://stackoverflow.com/q/14635295). Nvim
avoids features that cannot be provided on all platforms--instead that is
delegated to external plugins/extensions.
ARCHITECTURE ~
External plugins run in separate processes. |remote-plugin| This improves
stability and allows those plugins to perform tasks without blocking the
editor. Even "legacy" Python and Ruby plugins which use the old Vim interfaces
(|if_py| and |if_ruby|) run out-of-process.
FEATURES ~
|bracketed-paste-mode| is built-in and enabled by default.
|META| (ALT) chords are recognized, even in the terminal. Any |<M-| mapping
will work. Some examples: <M-1>, <M-2>, <M-BS>, <M-Del>, <M-Ins>, <M-/>,
<M-\>, <M-Space>, <M-Enter>, <M-=>, <M-->, <M-?>, <M-$>, ...
META chords are case-sensitive: <M-a> and <M-A> are two different keycodes.
Some `CTRL-SHIFT-...` key chords are distinguished from `CTRL-...` variants
(even in the terminal). Specifically, the following are known to work:
<C-Tab>, <C-S-Tab>, <C-BS>, <C-S-BS>, <C-Enter>, <C-S-Enter>
Options:
'inccommand' shows results while typing a |:substitute| command
'statusline' supports unlimited alignment sections
'tabline' %@Func@foo%X can call any function on mouse-click
Variables:
|v:event|
|v:windowid| is always available (for use by external UIs)
Commands:
|:CheckHealth|
|:drop| is available on all platforms
|:Man| is available by default, with many improvements such as completion
Functions:
|dictwatcheradd()| notifies a callback whenever a |Dict| is modified
|dictwatcherdel()|
|execute()| works with |:redir|
|msgpackdump()|, |msgpackparse()| provide msgpack de/serialization
Events:
|TabNewEntered|
|TermClose|
|TermOpen|
|TextYankPost|
Highlight groups:
|hl-QuickFixLine|
|hl-Substitute|
|hl-TermCursor|
|hl-TermCursorNC|
==============================================================================
4. Changed features *nvim-features-changed*
Nvim always builds with all features, in contrast to Vim which may have
certain features removed/added at compile-time. This is like if Vim's "HUGE"
build was the only Vim release type (except Nvim is smaller than Vim's "HUGE"
build).
If a Python interpreter is available on your `$PATH`, |:python| and |:python3|
are always available and may be used simultaneously in separate plugins. The
`neovim` pip package must be installed to use Python plugins in Nvim (see
|provider-python|).
|:!| does not support "interactive" commands. Use |:terminal| instead.
(GUI Vim has a similar limitation, see ":help gui-pty" in Vim.)
|system()| does not support writing/reading "backgrounded" commands. |E5677|
Nvim may throttle (skip) messages from shell commands (|:!|, |:grep|, |:make|)
if there is too much output. No data is lost, this only affects display and
makes things faster. |:terminal| output is never throttled.
|mkdir()| behaviour changed:
1. Assuming /tmp/foo does not exist and /tmp can be written to
mkdir('/tmp/foo/bar', 'p', 0700) will create both /tmp/foo and /tmp/foo/bar
with 0700 permissions. Vim mkdir will create /tmp/foo with 0755.
2. If you try to create an existing directory with `'p'` (e.g. mkdir('/',
'p')) mkdir() will silently exit. In Vim this was an error.
3. mkdir() error messages now include strerror() text when mkdir fails.
'encoding' is always "utf-8".
|string()| and |:echo| behaviour changed:
1. No maximum recursion depth limit is applied to nested container
structures.
2. |string()| fails immediately on nested containers, not when recursion limit
was exceeded.
2. When |:echo| encounters duplicate containers like >
let l = []
echo [l, l]
<
it does not use "[...]" (was: "[[], [...]]", now: "[[], []]"). "..." is
only used for recursive containers.
3. |:echo| printing nested containers adds "@level" after "..." designating
the level at which recursive container was printed: |:echo-self-refer|.
Same thing applies to |string()| (though it uses construct like
"{E724@level}"), but this is not reliable because |string()| continues to
error out.
4. Stringifyed infinite and NaN values now use |str2float()| and can be evaled
back.
5. (internal) Trying to print or stringify VAR_UNKNOWN in Vim results in
nothing, |E908|, in Neovim it is internal error.
|json_decode()| behaviour changed:
1. It may output |msgpack-special-dict|.
2. |msgpack-special-dict| is emitted also in case of duplicate keys, while in
Vim it errors out.
3. It accepts only valid JSON. Trailing commas are not accepted.
|json_encode()| behaviour slightly changed: now |msgpack-special-dict| values
are accepted, but |v:none| is not.
*v:none* variable is absent. In Vim it represents “no value” in “js” strings
like "[,]" parsed as "[v:none]" by |js_decode()|.
*js_encode()* and *js_decode()* functions are also absent.
Viminfo text files were replaced with binary (messagepack) ShaDa files.
Additional differences:
- |shada-c| has no effect.
- |shada-s| now limits size of every item and not just registers.
- When reading ShaDa files items are merged according to the timestamp.
|shada-merging|
- 'viminfo' option got renamed to 'shada'. Old option is kept as an alias for
compatibility reasons.
- |:wviminfo| was renamed to |:wshada|, |:rviminfo| to |:rshada|. Old
commands are still kept.
- When writing (|:wshada| without bang or at exit) it merges much more data,
and does this according to the timestamp. Vim merges only marks.
|shada-merging|
- ShaDa file format was designed with forward and backward compatibility in
mind. |shada-compatibility|
- Some errors make ShaDa code keep temporary file in-place for user to decide
what to do with it. Vim deletes temporary file in these cases.
|shada-error-handling|
- Vim keeps no timestamps at all, neither in viminfo file nor in the instance
itself.
- ShaDa file keeps search direction (|v:searchforward|), viminfo does not.
==============================================================================
5. Missing legacy features *nvim-features-missing*
*if_lua* *if_perl* *if_mzscheme* *if_tcl*
These legacy Vim features may be implemented in the future, but they are not
planned for the current milestone.
- vim.bindeval() (new feature in Vim 7.4 Python interface)
- |if_lua|
- |if_perl|
- |if_mzscheme|
- |if_tcl|
==============================================================================
6. Removed features *nvim-features-removed*
These features are in Vim, but have been intentionally removed from Nvim.
*'cp'* *'nocompatible'* *'nocp'* *'compatible'*
Nvim is always "non-compatible" with Vi.
":set nocompatible" is ignored
":set compatible" is an error
*'ed'* *'edcompatible'* *'noed'* *'noedcompatible'*
Ed-compatible mode:
":set noedcompatible" is ignored
":set edcompatible" is an error
'ttyfast':
":set ttyfast" is ignored
":set nottyfast" is an error
Encryption support:
*'cryptmethod'* *'cm'*
*'key'*
MS-DOS support:
'bioskey'
'conskey'
Highlight groups:
|hl-VisualNOS|
Other options:
'antialias'
'cpoptions' ("g", "w", "H", "*", "-", "j", and all POSIX flags were removed)
'encoding' ("utf-8" is always used)
'guioptions' "t" flag was removed
*'guipty'* (Nvim uses pipes and PTYs consistently on all platforms.)
*'imactivatefunc'* *'imaf'*
*'imactivatekey'* *'imak'*
*'imstatusfunc'* *'imsf'*
*'macatsui'*
*'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
'shelltype'
*'shortname'* *'sn'* *'noshortname'* *'nosn'*
*'swapsync'* *'sws'*
*'term'* *E529* *E530* *E531*
*'termencoding'* *'tenc'* (Vim 7.4.852 also removed this for Windows)
'textauto'
'textmode'
*'toolbar'* *'tb'*
*'toolbariconsize'* *'tbis'*
*'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'*
*'ttymouse'* *'ttym'*
*'ttyscroll'* *'tsl'*
*'ttytype'* *'tty'*
'weirdinvert'
Other commands:
:Print
:fixdel
:helpfind
:mode (no longer accepts an argument)
:open
:shell
:smile
:tearoff
Other compile-time features:
EBCDIC
Emacs tags support
X11 integration (see |x11-selection|)
Nvim does not have a built-in GUI and hence the following aliases have been
removed: gvim, gex, gview, rgvim, rgview
"Easy mode" (eview, evim, nvim -y)
"(g)vimdiff" (alias for "(g)nvim -d" |diff-mode|)
"Vi mode" (nvim -v)
The ability to start nvim via the following aliases has been removed in favor
of just using their command line arguments:
ex nvim -e
exim nvim -E
view nvim -R
rvim nvim -Z
rview nvim -RZ
==============================================================================
vim:tw=78:ts=8:noet:ft=help:norl:
|