NeoVim is an [[Apache v2]]/[[Vim License]] licensed modal text editor backend written in [[3. Reference/Software/Programming Languages/C|C]].
- [Website](https://neovim.io/)
- [GitHub](https://github.com/neovim/neovim)
- [AlternativeTo](https://alternativeto.net/software/neovide/about/
> hyperextensible [[Vim]]-based text editor
# Notability
NeoVim is a heavily refactored [[Vim]] with [[Lua]] scripting, first-class [[Inter-Process Communication]], and [[LSP]] support.
I have used it since not long after its original release in 2014.
# Philosophy
NeoVim is a project that seeks to aggressively refactor [Vim](https://www.vim.org/) in order to:
- Simplify maintenance and encourage [contributions](https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md)
- Split the work between multiple developers
- Enable [advanced UIs](https://github.com/neovim/neovim/wiki/Related-projects#gui) without modifications to the core
- Maximize [extensibility](https://github.com/neovim/neovim/wiki/Plugin-UI-architecture)
## Slop
NeoVim, like mainline [[Vim#Slop|Vim]] is all-on on [[Generative AI|Slop]]:
> It is very, very unlikely that we will ban AI assisted contributions (as some of the core maintainers see this -- reasonably so -- as a very useful tool that improve their ability to contribute). There will very likely be an AI policy in the near future, which at the very least will require (detailed) disclosure and prohibit direct agent contributions ("vibe coding"), and possibly prohibit LLM comments and PR descriptions as well.
\- reply by NeoVim maintainer `clason`[^8]
> Using AI for contributions is acceptable
\- NeoVim contributing guidelines
They also hide negative comments and lock threads on the topic.
# OS Support
- [[Linux]]
- [[FreeBSD]]
- [[OpenBSD]]
- [[Android]]
- [[MacOS]]
- [[Windows]]
NeoVim, unlike mainline [[Vim]], does not currently run on `dv:link("Haiku OS")` but there are still some [efforts](https://discuss.haiku-os.org/t/vim-and-haiku/11992/3) being made to port it. Update [[2024-03-02]], efforts seem to have stalled.
# Features
- Modern [GUIs](https://github.com/neovim/neovim/wiki/Related-projects#gui)
- [API access](https://github.com/neovim/neovim/wiki/Related-projects#api-clients) from any language including C/C++, C#, Clojure, D, Elixir, Go, Haskell, Java/Kotlin, JavaScript/Node.js, Julia, Lisp, Lua, Perl, Python, Racket, Ruby, Rust
- Embedded, scriptable [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
- [Shared data (shada)](https://github.com/neovim/neovim/pull/2506) among multiple editor instances
- [XDG base directories](https://github.com/neovim/neovim/pull/3470) support
- Compatible with most Vim plugins, including Ruby and Python plugins
## GUIs
### NeoVide
- Smooth scrolling
- Animated cursor moving to better keep track of its location
- Scary fast - launches instantly, full drawn
#### Platform Support
- Linux
- MacOS
- Windows
# Tips
See also: [[Vim#Tips]]
## Obsidian Integration
Working with [[Obsidian Editor]] vaults and using similar markup and features.
- https://github.com/oflisback/obsidian-bridge.nvim
- https://github.com/epwalsh/obsidian.nvim
## Python Issues
If NeoVim starts up with a Python error, you probably need to install the `pynvim` package in pip:
```sh
python3 -m pip install --user --upgrade pynvim
```
Note that while there *is* a "`neovim`" package, it is deprecated for whatever annoying reason and should be removed when encountered.
- https://github.com/fsharp/zarchive-vim-fsharp/issues/96
## Disable System Config
The only way to fully avoid the system configurations is to set the `$VIM` environment variable to a new directory. NeoVim will expect certain things to be there, like `syntax/syntax.vim` and `autoloads/spellfile.vim` and `doc/*`
## Extract Theme Colors
The format the NeoVim returns colors in is incompatible with many plugins. Instead of returning a hex code, it returns a single raw number.
To convert it back into a usable format, you need to use `sprintf` notation:
```lua
("#%06x"):format(neovim_color_number)
```
- https://www.reddit.com/r/neovim/comments/14p34gt/question_what_is_the_format_of_highlights/
## Using Stdin with External Commands
In nearly every situation *except* NeoVim, a program can explicitly access `stdin` using `/dev/stdin` like this snippet from a [[Bash - Unix Shell|Bash]] script:[^3]
```sh
my_var=$(< /dev/stdin)
```
Somehow, NeoVim's developers broke this and are uninterested in fixing it, calling it a a problem with the external tools.[^2]
The only other portable solution is to use `cat`, which may be slower as it does a lot more work to accomplish the same task, although there may be reasons to use `cat` anyway.[^4]
# Resources
## Preconfigs
See: [[Vim Preconfigs]]
## Docs
- https://neovim.io/doc/user/syntax.html
- https://neovim.io/doc/user/syntax.html#highlight-groups (syntax highlighting, color themes)
- https://neovim.io/doc/user/tui.html#tui-colors
## Plugin Lists
- https://vimawesome.com/?q=neovim
- https://github.com/rockerBOO/awesome-neovim/blob/main/README.md
### Distros
- https://github.com/sontungexpt/stinvim
# Plugins
See also: [[Vim#Plugins]]
- [akinsho/toggleterm.nvim](https://github.com/akinsho/toggleterm.nvim): "A neovim lua plugin to help easily manage multiple terminal windows"
## Metaplugins
Plugins that contain a lot of configurable functionality.
- https://github.com/folke/snacks.nvim `folke/snacks.nvim`
- [[#Pickers]]
## Pickers
- https://github.com/2kabhishek/pickme.nvim
### Mini-Pick
- https://github.com/nvim-mini/mini.pick
- https://github.com/nvim-mini/mini.nvim/blob/main/readmes/mini-extra.md
### FZF-Lua
- https://github.com/ibhagwan/fzf-lua
### Telescope
Telescope is functionally abandoned,[^1] but still mostly working.
- https://github.com/nvim-telescope/telescope.nvim
## Notes and Wiki
- https://github.com/dhananjaylatkar/notes.nvim
- https://github.com/nvim-neorg/neorg
## Completion
- https://github.com/ncm2/ncm2 "a slim, async and hackable completion framework for neovim."
- [numToStr/Comment.nvim](https://github.com/numToStr/Comment.nvim) "Smart and powerful comment plugin for neovim. Supports treesitter, dot repeat, left-right/up-down motions, hooks, and more"
- [windwp/nvim-autopairs](https://github.com/windwp/nvim-autopairs): autopairs for neovim written in Lua
## Status Lines
### sttusline
- [sontungexpt/sttusline](https://github.com/sontungexpt/sttusline/tree/table_version) - "A very lightweight, super fast and lazyloading statusline plugin for Neovim written in lua."
### LuaLine
- https://nickjanetakis.com/blog/modify-lualine-in-neovim-to-show-word-count-and-reading-time
#### Components
- https://github.com/meuter/lualine-so-fancy.nvim
#### Builds
- [examples/slanted-gaps.lua](https://github.com/nvim-lualine/lualine.nvim/blob/master/examples/slanted-gaps.lua)
- [Lazyvim based config with centered filename and nord color scheme](https://github.com/nvim-lualine/lualine.nvim/discussions/1389)
### Incline
Incline is a plugin for creating lightweight floating statuslines. It works great with Neovim's global statusline (`:set laststatus=3`).
#### Builds
- [Diagnostics + Diff + Devicons + Filename + Modification indicator + Colorsheme for focused/unfocused](https://github.com/b0o/incline.nvim/discussions/75)
- [Diagnostics + Git Diff + Filename](https://github.com/b0o/incline.nvim/discussions/32)
### Tabs / Buffers
```cardlink
url: https://github.com/nanozuki/tabby.nvim
title: "GitHub - nanozuki/tabby.nvim: A declarative, highly configurable, and neovim style tabline plugin. Use your nvim tabs as a workspace multiplexer!"
description: "A declarative, highly configurable, and neovim style tabline plugin. Use your nvim tabs as a workspace multiplexer! - nanozuki/tabby.nvim"
host: github.com
favicon: https://github.githubassets.com/favicons/favicon.svg
image: https://opengraph.githubassets.com/6809e78dac4e32634bb9778de80eb96d462be933bb21d1cd12e63912f70f760d/nanozuki/tabby.nvim
```
```cardlink
url: https://github.com/akinsho/bufferline.nvim
title: "GitHub - akinsho/bufferline.nvim: A snazzy bufferline for Neovim"
description: "A snazzy bufferline for Neovim. Contribute to akinsho/bufferline.nvim development by creating an account on GitHub."
host: github.com
favicon: https://github.githubassets.com/favicons/favicon.svg
image: https://opengraph.githubassets.com/f22e6570f180a21d2bb25ed7fbe2a9e4cfbf57798be8c898689fd5f96a8a6f04/akinsho/bufferline.nvim
```
# References
[^1]: https://github.com/nvim-telescope/telescope.nvim/issues/3524
[^2]: https://github.com/neovim/neovim/issues/14049
[^3]: https://stackoverflow.com/a/65065987/1255156
[^4]: https://unix.stackexchange.com/questions/716438/whats-wrong-with-var-dev-stdin-to-read-stdin-into-a-variable