# romanzy neovim config Inspirations: - [illya](https://codeberg.org/42nerds/nvim) - [nolan](https://github.com/Hrumble/sneaky-nvim-config) - [mats](https://github.com/BeerB34r/dotfiles) # Neovim Notes See custom keymaps with short descriptions with `h`. Split shortcuts: - `sv` open a vertical split - `sh` open a horizontal split - `se` equalize split sizes - `sc` close the current window Resize shortcuts: - `rh` make the current window narrower - `rl` make the current window wider - `rj` make the current window shorter - `rk` make the current window taller - `re` equalize split sizes Buffer shortcuts: - `bp` previous buffer - `bn` next buffer - `bd` delete the current buffer Telescope shortcuts: - `ff` find files - `fg` live grep - `fb` list buffers - `fh` browse help tags Oil usage: - `dl` opens the file browser - `` opens a file or enters a directory - `-` goes to the parent directory - `` also goes to the parent directory - `` also goes to the parent directory - `` opens the selected file or enters the selected directory - `` previews the selected entry ## Window Navigation Move between windows with: ```vim left down up right ``` Cycle through windows: ```vim w ``` ## Terminal Leave terminal mode and return to normal mode: ```vim ``` ## LSP Mason is installed through `vim.pack` together with `mason-lspconfig.nvim` and `nvim-lspconfig`. This config automatically installs and enables the managed language servers on first start. The current managed set is `bashls`, `clangd`, `jsonls`, `lua_ls`, `marksman`, `taplo`, `ts_ls`, and `yamlls`. Useful Mason commands: ```vim :Mason :MasonLog :checkhealth mason ``` `ts_ls` provides TypeScript and JavaScript language server support after Mason installs `typescript-language-server`. When an LSP server is attached to the current buffer: - `gd` go to definition - `gD` go to declaration - `grd` list references - `grn` rename symbol - `` trigger completion Diagnostics: - `g.` open diagnostic float - `gl` send diagnostics to the location list - `gle` display error information - `gie` toggle inline errors - `gve` toggle virtual line errors - `g]` jump to next error - `g[` jump to previous error ## Tree-sitter Tree-sitter is managed with `nvim-treesitter` via `vim.pack`. `tree-sitter-cli` and a C compiler is required to be installed. Useful commands: ```vim :TSUpdate :TSInstall lua bash json :TSInstallInfo :InspectTree :checkhealth vim.treesitter ```