[!NOTE|label:references:]

install

[!NOTE]

dependencies

  • osx

    • gettext : GNU internationalization (i18n) and localization (l10n) library
    • libtermkey : Library for processing keyboard entry from the terminal
    • libuv : Multi-platform support library with a focus on asynchronous I/O
    • libvterm : C99 library which implements a VT220 or xterm terminal emulator
    • luajit : Just-In-Time Compiler (JIT) for the Lua programming language
    • luv : Bare libuv bindings for lua
    • msgpack : Library for a binary-based efficient data interchange format
    • tree-sitter : Parser generator tool and incremental parsing library
    • unibilium: Very basic terminfo library
    $ brew deps --tree neovim
    neovim
    ├── gettext
    ├── libtermkey
    │   └── unibilium
    ├── libuv
    ├── libvterm
    ├── luajit
    ├── luv
    │   └── libuv
    ├── msgpack
    ├── tree-sitter
    └── unibilium
    

Nvim development (prerelease) build

  • tarball

    [!TIP]

    • osx: avoid unknown developer warning
      $ xattr -c ./nvim-macos.tar.gz
      
    $ curl -fsSL https://github.com/neovim/neovim/releases/download/nightly/nvim-macos.tar.gz | tar xzf - -C /opt/nvim
    $ /opt/nvim/nvim-macos/bin/nvim
    $ sudo ln -sf /opt/nvim/nvim-macos /usr/local/nvim
    
    $ export NVIM_HOME=/usr/local/nvim
    $ export PATH=$NVIM_HOME/bin:$PATH
    

building neovim from source

[!NOTE|label:references:]

package manager

# osx
$ brew install nvim

# ubuntu
$ sudo add-apt-repository ppa:neovim-ppa/unstable
$ sudo add-apt-repository ppa:neovim-ppa/stable
$ sudo apt update
$ sudo apt install neovim
$ apt-cache madison neovim
    neovim | 0.10.0~ubuntu1+git202401142109-310fb2efc-c60402a16-3c3072a0a~ubuntu20.04.1 | https://ppa.launchpadcontent.net/neovim-ppa/unstable/ubuntu focal/main amd64 Packages
    neovim | 0.7.2-3~bpo22.04.1~ppa1 | https://ppa.launchpadcontent.net/neovim-ppa/stable/ubuntu jammy/main amd64 Packages
    neovim | 0.6.1-3 | http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages

# or
$ curl -fsSL -O http://archive.ubuntu.com/ubuntu/pool/universe/n/neovim/neovim_0.7.2-8_amd64.deb
$ sudo dpkg -i neovim_0.7.2-8_amd64.deb

initialize

[!TIP]

provider

:checkhealth

$ python3 -m pip install --user --upgrade pynvim
$ gem install neovim
$ npm install -g neovim

vimrc

  • create init.vim

    :exe 'edit '.stdpath('config').'/init.vim'
    :write ++p
    
  • add content

    -- ~/.config/nvim/init.lua
    vim.cmd( 'set runtimepath^=~/.vim runtimepath+=~/.vim/after' )
    vim.cmd( 'let &packpath = &runtimepath' )
    vim.cmd( 'source ~/.vimrc' )
    vim.cmd( 'autocmd TextYankPost * silent! lua vim.highlight.on_yank {on_visual=false}' )
    
    • or
      # ~/.config/nvim/init.vim
      set runtimepath^=~/.vim runtimepath+=~/.vim/after
      let &packpath = &runtimepath
      source ~/.vimrc
      autocmd TextYankPost * silent! lua vim.highlight.on_yank {on_visual=false}
      
  • config file location

    :echo stdpath('config')
    /Users/marslo/.config/nvim
    

config

[!NOTE|label:references:]

  • check status
    :checkhealth
    

config.lua

[!NOTE|label:references:]

$ cat ~/.config/nvim/lua/config.lua
lua require('config')

lua

[!NOTE|label:references]

lua-intro

:lua vim.print(package.loaded)

lua-commands

:lua print(_VERSION)
Lua 5.1

:lua =jit.version
LuaJIT 2.1.1703358377

Tips

true color

[!NOTE|label:references:]

:echo &termguicolors
1
$ echo $TERM $COLORTERM
xterm-256color truecolor
  • force 16 colors
    $ TERM= COLORTERM= nvim
    

config path

[!NOTE]

  • SYNTAX FILES: ~/.config/nvim/syntax
  • ruby : ~/.config/nvim/ruby
Copyright © marslo 2020-2023 all right reserved,powered by GitbookLast Modified: 2024-03-12 15:01:30

results matching ""

    No results matching ""