Home Explore Blog CI



neovim

5th chunk of `runtime/doc/faq.txt`
7baf3282b8f424eecef2f99f212006daacb2770bccfd16bb0000000100000948
 to |g:clipboard|, set
|init.vim| as follows.
>vim
    function! s:clipboard_changed(...) abort
      if exists('g:loaded_clipboard_provider')
        unlet g:loaded_clipboard_provider
      endif
      runtime autoload/provider/clipboard.vim
    endfunction

    if !exists('s:loaded")
      call dictwatcheradd(g:, 'clipboard', function('s:clipboard_changed'))
    endif
    let s:loaded = v:true
<

==============================================================================
Build issues                                                    *faq-build*


GENERAL BUILD ISSUES ~

Run `make distclean && make` to rule out a stale build environment causing the
failure.


SETTINGS IN LOCAL.MK DON'T TAKE EFFECT ~

CMake caches build settings, so you might need to run `rm -r build && make`
after modifying `local.mk`.


CMAKE ERRORS ~

`configure_file Problem configuring file`

This is probably a permissions issue, which can happen if you run `make` as the
root user, then later run an unprivileged `make`. To fix this, run
`rm -rf build` and try again.


GENERATING HELPTAGS FAILED ~

If re-installation fails with "Generating helptags failed", try removing the
previously installed runtime directory (if `CMAKE_INSTALL_PREFIX` is not set
during building, the default is `/usr/local/share/nvim`):
>bash
    rm -r /usr/local/share/nvim
<

==============================================================================
Design                                                         *faq-design*


WHY NOT USE JSON FOR RPC? ~

- JSON cannot easily/efficiently handle binary data
- JSON specification is ambiguous: https://seriot.ch/parsing_json.php


WHY EMBED LUA INSTEAD OF X? ~

- Lua is a very small language, ideal for embedding. The biggest advantage of
  Python/Ruby/etc is their huge collection of libraries, but that isn't
  relevant for Nvim, where Nvim is the "batteries included" library:
  introducing another stdlib would be redundant.
- Lua 5.1 is a complete language: the syntax is frozen. This is great for
  backwards compatibility.
- Nvim also uses Lua internally as an alternative to C. Extra performance is
  useful there, as opposed to a slow language like Python or Vim9script.
- LuaJIT is one of the fastest runtimes on the planet, 10x faster than Python
  and "Vim9script" https://vimhelp.org/vim9.txt.html , 100x faster than
  Vimscript.
- Python/JS

Title: Neovim FAQ: Build Issues and Design Choices (JSON vs Lua)
Summary
This section covers build issues, including problems with local.mk, CMake, and helptags generation, and it explains why Neovim uses Lua for RPC and embedding instead of JSON, Python, or other languages, highlighting Lua's small size, complete syntax, performance with LuaJIT, and internal use as an alternative to C.