nvim.txt (3695B)
1 *nvim.txt* Nvim 2 3 4 NVIM REFERENCE MANUAL 5 6 7 Nvim *nvim* *neovim* *nvim-intro* 8 9 Nvim is based on Vim by Bram Moolenaar. Nvim is emphatically a fork of Vim, 10 not a clone: compatibility with Vim (especially editor and Vimscript features, 11 except |Vim9script|) is maintained where possible. See |vim-differences| for 12 the complete reference. 13 14 - If you already use Vim, see |nvim-from-vim| for a quickstart. 15 - If you have never used Vim or Nvim before, see below. 16 17 Type |gO| to see the table of contents. 18 19 ============================================================================== 20 What now? *nvim-quickstart* 21 22 To learn how to use Vim in 30 minutes, try the tutorial: >vim 23 24 :Tutor<Enter> 25 < 26 Or watch this 10-minute video: https://youtu.be/TQn2hJeHQbM . 27 28 To customize Nvim, you will need a config file. Create your |init.lua| by 29 copying the "example_init.lua" file: >vim 30 31 :exe 'edit' stdpath('config') .. '/init.lua' 32 :read $VIMRUNTIME/example_init.lua 33 < 34 See |lua-guide| for practical notes on using Lua to configure Nvim. 35 36 "IDE" features in Nvim are provided by |LSP|. 37 38 If you are just trying out Nvim for a few minutes, and want to see the 39 extremes of what it can do, try one of these popular "extension packs" or 40 "distributions" (Note: Nvim is not affiliated with these projects, and does 41 not support them): 42 43 - *lazyvim* https://www.lazyvim.org/ 44 - *nvchad* https://nvchad.com/ 45 - *kickstart* https://github.com/nvim-lua/kickstart.nvim 46 - Not recommended; use `$VIMRUNTIME/example_init.lua` instead. 47 48 However, we recommend (eventually) taking time to learn Nvim from its stock 49 configuration, and incrementally setting options and adding plugins to your 50 |config| as you discover a need. 51 52 ============================================================================== 53 Transitioning from Vim *nvim-from-vim* 54 55 1. To start the transition, create your |init.vim| (user config) file: >vim 56 57 :exe 'edit '.stdpath('config').'/init.vim' 58 :write ++p 59 60 2. Add these contents to the file: >vim 61 62 set runtimepath^=~/.vim runtimepath+=~/.vim/after 63 let &packpath = &runtimepath 64 source ~/.vimrc 65 66 3. Restart Nvim, your existing Vim config will be loaded. >vim 67 68 :restart 69 70 See |provider-python| and |provider-clipboard| for additional software you 71 might need to use some features. 72 73 Your Vim configuration might not be entirely Nvim-compatible (see 74 |vim-differences|). For example the 'ttymouse' option was removed from Nvim, 75 because mouse support is always enabled if possible. If you use the same 76 |vimrc| for Vim and Nvim you could guard 'ttymouse' in your configuration 77 like so: 78 >vim 79 if !has('nvim') 80 set ttymouse=xterm2 81 endif 82 83 And for Nvim-specific configuration, you can do this: 84 >vim 85 if has('nvim') 86 tnoremap <Esc> <C-\><C-n> 87 endif 88 89 For a more granular approach use |exists()|: 90 >vim 91 if exists(':tnoremap') 92 tnoremap <Esc> <C-\><C-n> 93 endif 94 95 Now you should be able to explore Nvim more comfortably. Check |nvim-features| 96 for more information. 97 98 *portable-config* 99 Because Nvim follows the XDG |base-directories| standard, configuration on 100 Windows is stored in ~/AppData instead of ~/.config. But you can still share 101 the same Nvim configuration on all of your machines, by creating 102 ~/AppData/Local/nvim/init.vim containing just this line: >vim 103 source ~/.config/nvim/init.vim 104 < 105 106 ============================================================================== 107 vim:tw=78:ts=8:et:ft=help:norl: