Site Tools


wiki:neovim

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
wiki:neovim [August 19, 2026 at 17:29] – created Ivan Janevskiwiki:neovim [August 19, 2026 at 17:30] (current) – external edit 127.0.0.1
Line 1: Line 1:
-nvim+Neovim
  
-## What is Neovim? +**Neovim** is a modal text editor forked from Vim, built to be extensible and embeddable. Modal editingthe keyboard behaves differently depending on modenormal mode keys are commands (move, delete, change), insert mode keys are literal text. This lets almost every key act as command without touching the mouse.
-**Neovim** (`nvim`) is a modal text editor forked from Vim, built to be a more extensible and embeddable base for the same editing model. Modal editing means the keyboard behaves differently depending on the current modenormal mode keys are commands (move, delete, change), insert mode keys are literal text, which lets almost every key on the keyboard act as an editing command without ever touching the mouse.+
  
-The appeal for terminal-heavy work (HPC, embedded, remote development over [[ssh]]) is that Neovim runs entirely inside a terminal, needs no display server, and is fast to start even on resource-constrained remote node. Combined with [[tmux]], it forms a complete development environment that works identically whether you're on a laptop or SSH'd into a compute cluster.+Neovim runs entirely in the terminal, needs no display server, and starts instantly on resource-constrained remote nodes. Combined with [[tmux|Tmux]], it forms a complete development environment that works identically whether you're on a laptop or SSH'd into a compute cluster.
  
-Neovim's main departure from Vim is a built-in Lua runtime and stable plugin API (LSP client, Treesitter parser integrationa proper async job control API), which turned the editor from something configured with a large ad hoc Vimscript file into something configured and extended with a real scripting language. +Neovim's main innovation over Vima built-in Lua runtime and stable plugin API (LSP client, Treesitter, async jobs). Configure and extend with Lua instead of Vimscript, making Neovim a real IDE without bloat.
- +
-## Install +
-On Debian and Ubuntu:+
  
 ```bash ```bash
-sudo apt install neovim+$ nvim file.txt                 # edit file 
 +$ nvim +10 file.txt             # edit file, jump to line 10 
 +$ nvim -c "set number"          # edit with command 
 +$ :q                            # quit (in Neovim)
 ``` ```
  
-Distro packages often lag behind upstream releases significantly. To get a current release directly: +Configuration at `~/.config/nvim/init.lua` (modern) or `init.vim` (legacy Vimscript). Start with minimal config, extend as needed. Plugins transform Neovim into full IDElanguage servers for autocompleteTreesitter for syntaxfuzzy finderslintersformatters.
- +
-```bash +
-curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz +
-tar xzf nvim-linux-x86_64.tar.gz +
-sudo mv nvim-linux-x86_64 /usr/local/nvim +
-sudo ln -s /usr/local/nvim/bin/nvim /usr/local/bin/nvim +
-``` +
- +
-Configuration lives at `~/.config/nvim/init.lua` (or `init.vim` for the legacy Vimscript format). +
- +
-## Example +
-The core interaction model has three modes reached from normal mode: +
- +
-``` +
-i      -- enter insert mode before the cursor +
-Esc    -- return to normal mode +
-v      -- enter visual mode (character selection) +
-:      -- enter command-line mode +
-``` +
- +
-Normal-mode commands compose a verb with a motion`dw` deletes a word`d$` deletes to end of line`3dd` deletes three lines. This compositional grammarrather than a fixed set of keyboard shortcutsis what makes Vim-style editing scale to complex edits without ever leaving the home row. +
- +
-``` +
-dw     -- delete word +
-ciw    -- change inner word +
-3dd    -- delete 3 lines +
-/foo   -- search for "foo" +
-:%s/a/b/ -- substitute a -> b on every line +
-```+
  
 ## Concepts ## Concepts
  
-### The LSP client + 1[[neovim-basics|Basics]] 
-Neovim ships a built-in Language Server Protocol client, which means features like go-to-definition, hover documentation, and inline diagnostics come from a separate `clangd`-style language server process rather than being implemented inside the editor itselfConfiguring a language for Neovim means telling it which LSP server to launch for that filetype, not writing editor-specific completion logic. + 2[[neovim-modes|Modes]] 
- + 3. [[neovim-navigation|Navigation]
-```lua + 4. [[neovim-editing|Editing]] 
-vim.lsp.start({ + 5. [[neovim-operators-and-motions|Operators and motions]] 
-  name = 'clangd', + 6[[neovim-registers-and-copy|Registers and copy]] 
-  cmd = {'clangd'}, + 7[[neovim-searching-and-replacing|Searching and replacing]] 
-  root_dir = vim.fs.dirname(vim.fs.find({'compile_commands.json', '.git'}, { upward = true })[1]), + 8. [[neovim-buffers-windows-tabs|Bufferswindowstabs]] 
-}) + 9. [[neovim-configuration|Configuration]] 
-``` + 10[[neovim-keybindings|Keybindings]] 
- + 11. [[neovim-plugins|Plugins]] 
-See [[clangd]] for the C/C++ language server side of this connection. + 12. [[neovim-lsp|LSP]] 
- + 13[[neovim-lua-scripting|Lua scripting]] 
-### Treesitter + 14. [[neovim-macros-and-automation|Macros and automation]]
-Treesitter is an incremental parsing library that builds an actual syntax tree of the buffer as you type, rather than the regex-based highlighting Vim traditionally used. This is what makes syntax highlighting, indentation, and text objects (like "select the enclosing function") accurate even in languages with complex grammars. +
- +
-```lua +
-require('nvim-treesitter.configs').setup({ +
-  ensure_installed = { "c", "cpp", "python", "lua" }, +
-  highlight = { enable = true }, +
-}) +
-``` +
- +
-### Plugin managers +
-Neovim has no built-in package manager beyond a minimal `:packadd` mechanism, so a dedicated plugin manager (`lazy.nvim` is the current standard) handles fetching, updating, and lazily loading plugins: +
- +
-```lua +
-require("lazy").setup({ +
-  { "neovim/nvim-lspconfig" }, +
-  { "nvim-treesitter/nvim-treesitter"build = ":TSUpdate" }+
-}) +
-``` +
- +
-### Remote editing over SSH +
-Because Neovim is a terminal application with no GUI dependency, editing a file on a remote HPC node is just `ssh` into the node and running `nvim` there, no file syncing, no remote-editing protocol neededPairing this with a [[tmux]] session means the editing session survives a dropped connection+
- +
-```bash +
-ssh cluster-node +
-tmux new -s work +
-nvim my_kernel.cu +
-```+
  
wiki/neovim.1787160544.md.gz · Last modified: by Ivan Janevski