wiki:neovim
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| wiki:neovim [August 19, 2026 at 17:29] – Ivan Janevski | wiki:neovim [August 19, 2026 at 17:30] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| # Neovim | # Neovim | ||
| - | ## What is Neovim? | + | **Neovim** is a modal text editor forked from Vim, built to be extensible and embeddable. Modal editing: the keyboard behaves differently depending on mode—normal mode keys are commands (move, delete, change), insert mode keys are literal text. This lets almost every key act as a command without touching the mouse. |
| - | **Neovim** | + | |
| - | The appeal for terminal-heavy work (HPC, embedded, remote development over [[ssh]]) is that Neovim runs entirely | + | Neovim runs entirely |
| - | Neovim' | + | Neovim' |
| - | + | ||
| - | ## Install | + | |
| - | On Debian and Ubuntu: | + | |
| ```bash | ```bash | ||
| - | sudo apt install neovim | + | $ nvim file.txt |
| + | $ nvim +10 file.txt | ||
| + | $ nvim -c "set number" | ||
| + | $ :q # quit (in Neovim) | ||
| ``` | ``` | ||
| - | Distro packages often lag behind upstream releases significantly. To get a current release directly: | + | Configuration at `~/ |
| - | + | ||
| - | ```bash | + | |
| - | curl -LO https:// | + | |
| - | tar xzf nvim-linux-x86_64.tar.gz | + | |
| - | sudo mv nvim-linux-x86_64 / | + | |
| - | sudo ln -s / | + | |
| - | ``` | + | |
| - | + | ||
| - | Configuration | + | |
| - | + | ||
| - | ## 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 grammar, rather than a fixed set of keyboard shortcuts, is 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 " | + | |
| - | : | + | |
| - | ``` | + | |
| ## 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, | + | 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 = ' | + | 6. [[neovim-registers-and-copy|Registers and copy]] |
| - | cmd = {' | + | 7. [[neovim-searching-and-replacing|Searching and replacing]] |
| - | root_dir = vim.fs.dirname(vim.fs.find({' | + | 8. [[neovim-buffers-windows-tabs|Buffers, windows, tabs]] |
| - | }) | + | 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, | + | |
| - | + | ||
| - | ```lua | + | |
| - | require(' | + | |
| - | | + | |
| - | 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, | + | |
| - | + | ||
| - | ```lua | + | |
| - | require(" | + | |
| - | { "neovim/nvim-lspconfig" | + | |
| - | { "nvim-treesitter/ | + | |
| - | }) | + | |
| - | ``` | + | |
| - | + | ||
| - | ### 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 needed. Pairing 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.md · Last modified: by 127.0.0.1
