[!NOTE|label:references:]
- vimcast 71 : Meet Neovim
- XDG Base Directory Specification
- The Best Neovim GUI | neovide/neovide | #neovim-guis
- different between nvim and vim
- migration
- init.vim
- HiPhish/nvim-config/init.vim
- osx/linux:
~/.config/nvim/init.vim
- windows:
%LOCALAPPDATA%\nvim\init.vim
install
[!NOTE]
dependencies
osx
gettext
: GNU internationalization (i18n) and localization (l10n) librarylibtermkey
: Library for processing keyboard entry from the terminallibuv
: Multi-platform support library with a focus on asynchronous I/Olibvterm
: C99 library which implements a VT220 or xterm terminal emulatorluajit
: Just-In-Time Compiler (JIT) for the Lua programming languageluv
: Bare libuv bindings for luamsgpack
: Library for a binary-based efficient data interchange formattree-sitter
: Parser generator tool and incremental parsing libraryunibilium
: 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
- osx: avoid
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]
- Transitioning from Vim
- vim学习
- 学习 Neovim 全 lua 配置
- My Neovim setup for React, TypeScript, Tailwind CSS, etc
- NeoVim for Java Development (COC)
- nanotee/nvim-lua-guide
- nshen/learn-neovim-lua
- nshen/InsisVim
- fanxy1/nvim-dotfile
- Java in Neovim
- Integralist/dotfiles
- m4xshen/dotfiles/nvim/nvim
- Neovim for Beginners — LSP Inlay Hints
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}
- or
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