# Haelnorr's NeoVim config This is a list of all the plugins I use and what they do, along with some documentation on keybinds and other usage. ## Contents - [Plugins](#plugins) - [Language server](#language-server) - [Keymappings](#keymappings) ## Plugins Plugins are managed using [lazy.nvim](https://github.com/folke/lazy.nvim) - [Aerial](#aerial) - [Comment](#comment) - [Conform](#conform) - [Feline](#feline) - [Fugitive](#fugitive) - [Gitsigns](#gitsigns) - [Harpoon](#harpoon) - [Markdown Preview](#markdown-preview) - [NVIM Web Devicons](#nvim-web-devicons) - [SUDA](#suda) - [Surround](#surround) - [Telescope](#telescope) - [TMUXNav](#tmuxnav) - [TODO Comments](#todo-comments) - [Treesitter](#treesitter) - [Trouble](#trouble) - [Undotree](#undotree) - [Vim be good](#vim-be-good) - [Windows](#windows) --- #### [Aerial](https://github.com/stevearc/aerial.nvim) A code outline window for skimming and quick navigation | Keybind | Functionality | Mode | |---------|---------------|------| | `pa` | Toggle Aerial outline for current window | Normal | | `{` | Cycle previous item | Inside Aerial | | `}` | Cycle next item | Inside Aerial | --- #### [Comment](https://github.com/numToStr/Comment.nvim) Smart and powerful commenting plugin for NeoVim | Keybind | Functionality | Mode | |---------|---------------|------| | `gcc` | Toggles comment on current line using linewise comment | Normal | | `gbc` | Toggles comment on current line using blockwise comment | Normal | | `[count]gcc` | Toggles the number of line given as a prefix-count using linewise | Normal | | `[count]gbc` | Toggles the number of line given as a prefix-count using blockwise | Normal | | `gc[count]{motion}` | (Op-pending) Toggles the region using linewise comment | Normal | | `gb[count]{motion}` | (Op-pending) Toggles the region using blockwise comment | Normal | | `gc` | Toggles region using linewise comment | Visual | | `gb` | Toggles region using blockwise comment | Visual | | `gco` | Insert comment to next line and enter insert mode | Normal | | `gcO` | Insert comment to previous line and enter insert mode | Normal | | `gcA` | Insert comment to end of the current line and enter insert mode | Normal | --- #### [Conform](https://github.com/stevearc/conform.nvim) Lightweight yet powerful formatter plugin | Keybind | Functionality | Mode | |---------|---------------|------| | `f` | Formats entire file | Normal | | `f` | Formats selection | Visual + Select | --- #### [Feline](https://github.com/freddiehaddad/feline.nvim) Customizable status line --- #### [Fugitive](https://github.com/tpope/vim-fugitive) Git integration | Keybind | Functionality | Mode | |---------|---------------|------| |`gs` | Opens fugitive window | Normal | | `gu` | `diffget //2` | Normal | | `gh` | `diffget //3` | Normal | | `s` | `:Git add -A` | (inside fugitive) | | `c` | `:Git commit` | (inside fugitive) | | `p` | `:Git push` | (inside fugitive) | | `P` | `:Git pull --rebase` | (inside fugitive) | | `t` | `:Git push -u origin ` | (inside fugitive) | --- #### [Gitsigns](https://github.com/lewis6991/gitsigns.nvim) Customizable git diff decorators --- #### [Harpoon](https://github.com/ThePrimeagen/harpoon/tree/harpoon2) Quick swap between files | Keybind | Functionality | Mode | |---------|---------------|------| | `a` | Add current file | Normal | | `Alt + e` | Toggle quick menu | Normal | | `Alt + h` | Swap to file 1 | Normal | | `Alt + j` | Swap to file 2 | Normal | | `Alt + k` | Swap to file 3 | Normal | | `Alt + l` | Swap to file 4 | Normal | | ` Alt + h` | Replace file 1 with current file | Normal | | ` Alt + j` | Replace file 2 with current file | Normal | | ` Alt + k` | Replace file 3 with current file | Normal | | ` Alt + l` | Replace file 4 with current file | Normal | --- #### [Markdown Preview](https://github.com/iamcco/markdown-preview.nvim) Live preview of markdown files in browser, with synced scrolling **Usage:** `:MarkdownPreview` - Opens preview window in new tab of browser --- #### [NVIM Web Devicons](https://github.com/nvim-tree/nvim-web-devicons) Provides Nerd font icons for other plugins to use --- #### [SUDA](https://github.com/lambdalisue/vim-suda) Write files using sudo inside NeoVim **Usage:** `:SudaRead` - Reread current file using sudo `:SudaWrite` - Write current file using sudo --- #### [Surround](https://github.com/kylechui/nvim-surround) Add delete or remove surrounding pairs with Vim shortcuts **Usage:** The three "core" operations of add/delete/change can be done with the keymaps ys{motion}{char}, ds{char}, and cs{target}{replacement}, respectively. For the following examples, * will denote the cursor position: ```help Old text Command New text -------------------------------------------------------------------------------- surr*ound_words ysiw) (surround_words) *make strings ys$" "make strings" [delete ar*ound me!] ds] delete around me! remove HTML t*ags dst remove HTML tags 'change quot*es' cs'" "change quotes" or tag* types csth1

or tag types

delete(functi*on calls) dsf function calls ``` --- #### [Telescope](https://github.com/nvim-telescope/telescope.nvim) Extensible fuzzy finder for NeoVim | Keybind | Functionality | Mode | |---------|---------------|------| | `pf` | Find files | Normal | | `Ctrl + p` | Find git files | Normal | | `pws` | Search files for `` (word the cursor is on) | Normal | | `pWs` | Search files for `` (WORD the cursor is on) | Normal | | `ps` | Search files with grep | Normal | | `vh` | Search builtin documentation | Normal | --- #### [TMUXNav](https://github.com/christoomey/vim-tmux-navigator) Integrated commands for navigating between tmux panes | Keybind | Functionality | Mode | |---------|---------------|------| | `Ctrl + h` | Navigate left | Normal | | `Ctrl + j` | Navigate down | Normal | | `Ctrl + k` | Navigate up | Normal | | `Ctrl + l` | Navigate right | Normal | | `Ctrl + \` | Navigate previous | Normal | --- #### [TODO Comments](https://github.com/folke/todo-comments.nvim) Decorate code with comment highlighting **Usage:** `KEYWORD: comment` e.g. in Python: (**NOTE:** the highlighting wont appear in the code snippet below) ```python ## List of available keywords # TODO: this needs implementing # HACK: hmmm, this looks a bit funky # WARN: probably want to fix this soon # PERF: perfectly optimised # NOTE: this is a clever use of an example :) # TEST: just making sure ``` ![Tue Jan 21 08:37:48 PM AEDT 2025](https://github.com/user-attachments/assets/8d776498-e9f2-44ad-a908-94f8f1546009) `:TodoTelescope` - search project todos with Telescope --- #### [Treesitter](https://github.com/nvim-treesitter/nvim-treesitter) Syntax highlighting, the best way --- #### [Trouble](https://github.com/folke/trouble.nvim) Error diagnostics | Keybind | Functionality | Mode | |---------|---------------|------| | `tt` | Toggle diagnostics tab | Normal | | `tq` | Toggle quickfix list | Normal | --- #### [Undotree](https://github.com/mbbill/undotree) Undotree for NeoVim | Keybind | Functionality | Mode | |---------|---------------|------| | `u` | Open undotree | Normal | --- #### [Vim be good](https://github.com/ThePrimeagen/vim-be-good) Games for praciticing Vim motions **Usage:** `:VimBeGood` --- #### [Windows](https://github.com/anuvyklack/windows.nvim) Automatically minimise and maximise windows when focused --- ## Language Server #### [NVIM-LSPConfig](https://github.com/neovim/nvim-lspconfig) LSP has been setup with the following dependencies: - williamboman/mason.nvim - williamboman/mason-lspconfig.nvim - hrsh7th/cmp-nvim-lsp - hrsh7th/cmp-buffer - hrsh7th/cmp-path - hrsh7th/cmp-cmdline - hrsh7th/nvim-cmp - L3MON4D3/LuaSnip - saadparwaiz1/cmp_luasnip - j-hui/fidget.nvim Language servers configured in `ensure_installed`: - lua_ls - bashls - css_variables - cssls - cssmodules_ls - docker_compose_language_service - dockerls - html - jsonls - pyright | Keybind | Functionality | Mode | |---------|---------------|------| | `Ctrl + p` | auto-complete select prev item | Normal | | `Ctrl + n` | auto-complete select next item | Normal | | `Ctrl + y` | auto-complete confirm selected item | Normal | | `Ctrl + space` | invoke auto-complete | Normal | | `gd` | jumps to the definition of the symbol under the cursor | Normal | | `K` | displays hover information about the symbol under the cursor | Normal | | `vws` | lists all symbols in the current workspace matching {query} | Normal | | `vd` | show diagnostics in a floating window | Normal | | `vca` | selects a code action available at the current cursor (?) | Normal | | `vrr` | lists all references to the symbol under the cursor | Normal | | `vrn` | rename all references to the symbol under the cursor | Normal | | `Ctrl + h` | displays signature information about the symbol under the cursor | Insert | | `[d` | next diagnostic | Normal | | `]d` | prev diagnostic | Normal | ## Keymappings #### Leader key: `` | Keybind | Behaviour | Normal | Visual | Select | |---------|-----------|--------|--------|--------| | `pv` | View directory of current file | ✓ | ✗ | ✗ | | `J` | Move selection down and autoindent | ✗ | ✓ | ✓ | | `K` | Move selection up and autoindent | ✗ | ✓ | ✓ | | `J` | Moves line below current line into sameline | ✓ | ✗ | ✗ | | `Ctrl + d` | Jump down page, keeping cursor centered (zz) | ✓ | ✗ | ✗ | | `Ctrl + u` | Jump up page, keeping cursor centered (zz) | ✓ | ✗ | ✗ | | `n` | (in search) Next item, keeping cursor centered | ✓ | ✗ | ✗ | | `N` | (in search) Prev item, keeping cursor centered | ✓ | ✗ | ✗ | | `p` | Replaces selection with buffer without overriding buffer | ✗ | ✓ | ✗ | | `y` | Yanks selection to system clipboard | ✓ | ✓ | ✓ | | `Y` | Yanks line to system clipboard | ✓ | ✗ | ✗ | | `d` | Deletes without replacing buffer, can be used with dd to delete line | ✓ | ✓ | ✓ | | `Ctrl + k` | Quickfix next | ✓ | ✗ | ✗ | | `Ctrl + j` | Quickfix prev | ✓ | ✗ | ✗ | | `k` | QF Location next | ✓ | ✗ | ✗ | | `j` | QF Location prev | ✓ | ✗ | ✗ | | `s` | search in file for symbol under cursor, and refactor | ✓ | ✗ | ✗ | | `x` | make file executable | ✓ | ✗ | ✗ | | `o` | Add new line below current line | ✓ | ✗ | ✗ | | `Ctrl + Q` | Toggle page right divider (colorcolumn) | ✓ | ✗ | ✗ |