2017-03-22 01:13:51 +01:00
|
|
|
*nvim.txt* Nvim
|
2015-07-21 15:06:17 +03:00
|
|
|
|
|
|
|
|
|
2022-10-09 08:21:52 -04:00
|
|
|
NVIM REFERENCE MANUAL
|
2015-07-21 15:06:17 +03:00
|
|
|
|
|
|
|
|
|
2022-10-09 08:21:52 -04:00
|
|
|
Nvim *nvim* *nvim-intro*
|
2015-07-21 15:06:17 +03:00
|
|
|
|
2017-07-15 18:13:49 +02:00
|
|
|
Nvim is based on Vim by Bram Moolenaar.
|
|
|
|
|
|
2019-02-04 13:21:35 +01:00
|
|
|
If you already use Vim see |nvim-from-vim| for a quickstart.
|
2022-11-22 18:41:00 +01:00
|
|
|
If you are new to Vim, try the 30-minute tutorial: >vim
|
2018-10-11 19:14:20 +02:00
|
|
|
|
2019-02-04 13:21:35 +01:00
|
|
|
:Tutor<Enter>
|
2015-07-21 15:06:17 +03:00
|
|
|
|
2019-02-04 13:21:35 +01:00
|
|
|
Nvim is emphatically a fork of Vim, not a clone: compatibility with Vim
|
2022-10-09 08:21:52 -04:00
|
|
|
(especially editor and Vimscript features) is maintained where possible. See
|
2019-02-04 13:21:35 +01:00
|
|
|
|vim-differences| for the complete reference of differences from Vim.
|
2016-06-15 21:33:47 -04:00
|
|
|
|
2022-10-09 08:21:52 -04:00
|
|
|
Type |gO| to see the table of contents.
|
2017-05-01 17:09:29 +02:00
|
|
|
|
2016-06-15 21:33:47 -04:00
|
|
|
==============================================================================
|
2022-10-09 08:21:52 -04:00
|
|
|
Transitioning from Vim *nvim-from-vim*
|
2016-06-15 21:33:47 -04:00
|
|
|
|
2022-11-22 18:41:00 +01:00
|
|
|
1. To start the transition, create your |init.vim| (user config) file: >vim
|
2018-04-20 13:04:30 -04:00
|
|
|
|
2018-08-05 03:17:08 +02:00
|
|
|
:exe 'edit '.stdpath('config').'/init.vim'
|
2022-12-11 21:41:26 -05:00
|
|
|
:write ++p
|
2018-04-20 13:04:30 -04:00
|
|
|
|
2022-11-22 18:41:00 +01:00
|
|
|
2. Add these contents to the file: >vim
|
2018-04-20 13:04:30 -04:00
|
|
|
|
2017-05-06 16:47:30 +00:00
|
|
|
set runtimepath^=~/.vim runtimepath+=~/.vim/after
|
|
|
|
|
let &packpath = &runtimepath
|
2017-04-25 10:04:32 +01:00
|
|
|
source ~/.vimrc
|
2018-08-05 03:17:08 +02:00
|
|
|
|
|
|
|
|
3. Restart Nvim, your existing Vim config will be loaded.
|
|
|
|
|
|
2016-06-15 21:33:47 -04:00
|
|
|
See |provider-python| and |provider-clipboard| for additional software you
|
|
|
|
|
might need to use some features.
|
|
|
|
|
|
2022-10-09 08:21:52 -04:00
|
|
|
Your Vim configuration might not be entirely Nvim-compatible (see
|
|
|
|
|
|vim-differences|). For example the |'ttymouse'| option was removed from Nvim,
|
|
|
|
|
because mouse support is always enabled if possible. If you use the same
|
|
|
|
|
|vimrc| for Vim and Nvim you could guard |'ttymouse'| in your configuration
|
|
|
|
|
like so:
|
2022-11-22 18:41:00 +01:00
|
|
|
>vim
|
2016-06-15 21:33:47 -04:00
|
|
|
if !has('nvim')
|
|
|
|
|
set ttymouse=xterm2
|
|
|
|
|
endif
|
2022-10-09 08:21:52 -04:00
|
|
|
|
|
|
|
|
And for Nvim-specific configuration, you can do this:
|
2022-11-22 18:41:00 +01:00
|
|
|
>vim
|
2016-06-15 21:33:47 -04:00
|
|
|
if has('nvim')
|
|
|
|
|
tnoremap <Esc> <C-\><C-n>
|
|
|
|
|
endif
|
2022-10-09 08:21:52 -04:00
|
|
|
|
2016-06-15 21:33:47 -04:00
|
|
|
For a more granular approach use |exists()|:
|
2022-11-22 18:41:00 +01:00
|
|
|
>vim
|
2016-06-15 21:33:47 -04:00
|
|
|
if exists(':tnoremap')
|
|
|
|
|
tnoremap <Esc> <C-\><C-n>
|
|
|
|
|
endif
|
2022-10-09 08:21:52 -04:00
|
|
|
|
2016-06-15 21:33:47 -04:00
|
|
|
Now you should be able to explore Nvim more comfortably. Check |nvim-features|
|
|
|
|
|
for more information.
|
2015-07-21 15:06:17 +03:00
|
|
|
|
2022-10-09 08:21:52 -04:00
|
|
|
*portable-config*
|
|
|
|
|
Because Nvim follows the XDG |base-directories| standard, configuration on
|
|
|
|
|
Windows is stored in ~/AppData instead of ~/.config. But you can still share
|
|
|
|
|
the same Nvim configuration on all of your machines, by creating
|
2022-11-22 18:41:00 +01:00
|
|
|
~/AppData/Local/nvim/init.vim containing just this line: >vim
|
2022-10-09 08:21:52 -04:00
|
|
|
source ~/.config/nvim/init.vim
|
|
|
|
|
|
2015-07-21 15:06:17 +03:00
|
|
|
==============================================================================
|
2022-10-09 08:21:52 -04:00
|
|
|
vim:tw=78:ts=8:et:ft=help:norl:
|