-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Expand file tree
/
Copy pathnvim.txt
More file actions
110 lines (80 loc) · 3.7 KB
/
Copy pathnvim.txt
File metadata and controls
110 lines (80 loc) · 3.7 KB
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
*nvim.txt* Nvim
NVIM REFERENCE MANUAL
Nvim *nvim* *neovim* *nvim-intro*
Nvim is based on Vim by Bram Moolenaar. Nvim is emphatically a fork of Vim,
not a clone: compatibility with Vim (especially editor and Vimscript features,
except |Vim9script|) is maintained where possible. See |vim-differences| for
the complete reference.
- If you already use Vim, see |nvim-from-vim| for a quickstart.
- If you have never used Vim or Nvim before, see below.
Type |gO| to see the table of contents.
==============================================================================
What now? *nvim-quickstart*
To learn how to use Vim in 30 minutes, try the tutorial: >vim
:Tutor<Enter>
<
Or watch this 10-minute video: https://youtu.be/TQn2hJeHQbM .
*config-example* *example-init*
To customize Nvim, you will need a config file. Create your |init.lua| by
copying the "example_init.lua" file: >vim
:exe 'edit' stdpath('config') .. '/init.lua'
:read $VIMRUNTIME/example_init.lua
:write ++p
:restart
<
See |lua-guide| for practical notes on using Lua to configure Nvim.
"IDE" features in Nvim are provided by |LSP|.
If you are just trying out Nvim for a few minutes, and want to see the
extremes of what it can do, try one of these popular "extension packs" or
"distributions" (Note: Nvim is not affiliated with these projects, and does
not support them):
- *lazyvim* https://www.lazyvim.org/
- *nvchad* https://nvchad.com/
- *kickstart* https://github.com/nvim-lua/kickstart.nvim
- Not recommended; use |example-init| instead.
However, we recommend (eventually) taking time to learn Nvim from its stock
configuration, and incrementally setting options and adding plugins to your
|config| as you discover a need.
==============================================================================
Transitioning from Vim *nvim-from-vim*
1. To start the transition, create your |init.vim| (user config) file: >vim
:exe 'edit' stdpath('config') .. '/init.vim'
:write ++p
2. Add these contents to the file: >vim
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc
3. Restart Nvim, your existing Vim config will be loaded. >vim
:restart
See |provider-python| and |provider-clipboard| for additional software you
might need to use some features.
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:
>vim
if !has('nvim')
set ttymouse=xterm2
endif
And for Nvim-specific configuration, you can do this:
>vim
if has('nvim')
tnoremap <Esc> <C-\><C-n>
endif
For a more granular approach use |exists()|:
>vim
if exists(':tnoremap')
tnoremap <Esc> <C-\><C-n>
endif
Now you should be able to explore Nvim more comfortably. Check |nvim-features|
for more information.
*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
~/AppData/Local/nvim/init.vim containing just this line: >vim
source ~/.config/nvim/init.vim
<
==============================================================================
vim:tw=78:ts=8:et:ft=help:norl: