nvim.txt 3.2 KB

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