# Neovim Config This is a vim-plug based Neovim config with: - LSP via `nvim-lspconfig` - Completion via `nvim-cmp` and LuaSnip - Search via Telescope - File browsing via Oil - LaTeX workflow via VimTeX and TexLab - Formatting via LSP, `latexindent`, and `neoformat` fallback ## Main Files - `init.vim`: plugin list and Vimscript globals - `lua/init.lua`: Lua setup, keymaps, completion, LSP, and plugin config ## Plugin Manager This config uses `vim-plug`. Common commands: - `:PlugInstall` - `:PlugUpdate` - `:PlugClean` ## Required External Software ### LSP Servers These are the language servers configured in `lua/init.lua` and the binaries they expect to find on `PATH`. | LSP config | Expected binary or package | | --- | --- | | `ts_ls` | `typescript-language-server` and `typescript` | | `clangd` | `clangd` | | `gopls` | `gopls` | | `pyright` | `pyright` | | `texlab` | `texlab` | | `rust_analyzer` | `rust-analyzer` | | `kotlin-language-server` | `kotlin-language-server` | | `cmake` | `cmake-language-server` | | `html` | `vscode-html-language-server` from `vscode-langservers-extracted` | | `glsl_analyzer` | `glsl_analyzer` | | `lua_ls` | `lua-language-server` | | `zls` | `zls` | ### LaTeX Toolchain These are used by the current LaTeX setup. | Tool | Purpose | | --- | --- | | `pdflatex` | TeX engine | | `latexmk` | Project-aware TeX build runner | | `latexindent` | TeX formatter | | `texlab` | LaTeX LSP | | `zathura` | Optional PDF viewer with SyncTeX support | | `xdg-open` | Generic PDF opener fallback | ### Other Useful Runtime Tools | Tool | Purpose | | --- | --- | | `cargo` | Used here to install `texlab` | | `git` | Required by vim-plug and Telescope git search | ## Leaders - `Leader` = `` - `LocalLeader` = `,` ## Key Shortcuts ## Search And Buffers | Mode | Shortcut | Action | | --- | --- | --- | | Normal | `` | Search tracked git files | | Normal | `` | Search all files | | Normal | `f` | Grep the project | | Normal | `/` | Fuzzy search the current buffer | | Normal | `fh` | Search help tags | | Normal | `fr` | Open recent files | | Normal | `fu` | Open undo history in Telescope | | Normal | `` | Switch buffers | ## File Browsing | Mode | Shortcut | Action | | --- | --- | --- | | Normal | `-` | Open parent directory in Oil | | Normal | `e` | Open Oil file explorer | | Normal | `E` | Open the current file's directory in Oil | ## LSP And Diagnostics | Mode | Shortcut | Action | | --- | --- | --- | | Normal | `gd` | Go to definition | | Normal | `gr` | List references | | Normal | `gi` | List implementations | | Normal | `K` | Show hover documentation | | Normal | `L` | Show diagnostics in a float | | Normal, Visual | `ca` | Run a code action | | Normal | `rn` | Rename symbol | | Normal | `[d` | Jump to previous diagnostic | | Normal | `]d` | Jump to next diagnostic | | Normal | `q` | Send diagnostics to the location list | | Normal | `fm` | Format the current buffer | ## LaTeX Workflow | Mode | Shortcut | Action | | --- | --- | --- | | Normal | `tc` | Compile TeX document | | Normal | `tk` | Stop TeX compilation | | Normal | `tv` | Open or refresh TeX PDF viewer | | Normal | `to` | Show TeX compiler output | | Normal | `tt` | Toggle TeX table of contents | | Normal | `te` | Show TeX errors | | Normal | `tl` | Clean TeX build files | ## Editing And Movement | Mode | Shortcut | Action | | --- | --- | --- | | Normal, Visual | `y` | Yank to system clipboard | | Normal | `u` | Toggle Undotree | | Normal, Visual, Operator-pending | `s` | Jump with Flash | | Normal, Visual, Operator-pending | `S` | Jump to Tree-sitter targets with Flash | ## Completion ### Insert Mode | Shortcut | Action | | --- | --- | | `` | Scroll completion documentation up | | `` | Scroll completion documentation down | | `` | Open completion menu | | `` | Abort completion | | `` | Confirm selected completion item | ### Command Line And Search | Mode | Shortcut | Action | | --- | --- | --- | | `/` command line | `` and completion menu | Complete from current buffer | | `:` command line | `` and completion menu | Complete paths and commands | ## Plugin Defaults Still Enabled ### Comment.nvim | Mode | Shortcut | Action | | --- | --- | --- | | Normal | `gcc` | Toggle comment on current line | | Visual | `gc` | Toggle comment on selection | | Operator-pending | `gc{motion}` | Toggle comment over a motion | ### vim-surround | Mode | Shortcut | Action | | --- | --- | --- | | Normal | `ys{motion}{char}` | Add surrounding characters | | Normal | `yss{char}` | Surround current line | | Normal | `cs{old}{new}` | Change surrounding characters | | Normal | `ds{char}` | Delete surrounding characters | | Visual | `S{char}` | Surround the selection | ### VimTeX Common Defaults | Mode | Shortcut | Action | | --- | --- | --- | | Normal | `ll` | Start or toggle VimTeX compilation | | Normal | `lk` | Stop VimTeX compilation | | Normal | `lc` | Clean auxiliary files | | Normal | `lv` | Open or forward-search the PDF | | Normal | `lo` | Open compiler output | | Normal | `lt` | Open VimTeX table of contents | | Normal | `[[` / `]]` | Move between section boundaries | | Normal | `[m` / `]m` | Move between environment boundaries | | Visual, Operator-pending | `ie` / `ae` | Select inside or around a LaTeX environment | | Visual, Operator-pending | `i$` / `a$` | Select inside or around math | ## Notes - TeX formatting uses `latexindent` when editing `*.tex` files. - The generic format key is still `fm`; it switches to `latexindent` automatically for TeX buffers. - `vimtex` provides many more text objects, motions, and local mappings than listed here. Use `:help vimtex-default-mappings` and `:help vimtex` for the full set.