add readme
parent
33b55eb463
commit
bf235db4ce
@ -0,0 +1,191 @@
|
||||
# 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` = `<Space>`
|
||||
- `LocalLeader` = `,`
|
||||
|
||||
## Key Shortcuts
|
||||
|
||||
## Search And Buffers
|
||||
|
||||
| Mode | Shortcut | Action |
|
||||
| --- | --- | --- |
|
||||
| Normal | `<C-p>` | Search tracked git files |
|
||||
| Normal | `<C-f>` | Search all files |
|
||||
| Normal | `<leader>f` | Grep the project |
|
||||
| Normal | `<leader>/` | Fuzzy search the current buffer |
|
||||
| Normal | `<leader>fh` | Search help tags |
|
||||
| Normal | `<leader>fr` | Open recent files |
|
||||
| Normal | `<leader>fu` | Open undo history in Telescope |
|
||||
| Normal | `<leader><Tab>` | Switch buffers |
|
||||
|
||||
## File Browsing
|
||||
|
||||
| Mode | Shortcut | Action |
|
||||
| --- | --- | --- |
|
||||
| Normal | `-` | Open parent directory in Oil |
|
||||
| Normal | `<leader>e` | Open Oil file explorer |
|
||||
| Normal | `<leader>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 | `<leader>ca` | Run a code action |
|
||||
| Normal | `<leader>rn` | Rename symbol |
|
||||
| Normal | `[d` | Jump to previous diagnostic |
|
||||
| Normal | `]d` | Jump to next diagnostic |
|
||||
| Normal | `<leader>q` | Send diagnostics to the location list |
|
||||
| Normal | `<leader>fm` | Format the current buffer |
|
||||
|
||||
## LaTeX Workflow
|
||||
|
||||
| Mode | Shortcut | Action |
|
||||
| --- | --- | --- |
|
||||
| Normal | `<leader>tc` | Compile TeX document |
|
||||
| Normal | `<leader>tk` | Stop TeX compilation |
|
||||
| Normal | `<leader>tv` | Open or refresh TeX PDF viewer |
|
||||
| Normal | `<leader>to` | Show TeX compiler output |
|
||||
| Normal | `<leader>tt` | Toggle TeX table of contents |
|
||||
| Normal | `<leader>te` | Show TeX errors |
|
||||
| Normal | `<leader>tl` | Clean TeX build files |
|
||||
|
||||
## Editing And Movement
|
||||
|
||||
| Mode | Shortcut | Action |
|
||||
| --- | --- | --- |
|
||||
| Normal, Visual | `<leader>y` | Yank to system clipboard |
|
||||
| Normal | `<leader>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 |
|
||||
| --- | --- |
|
||||
| `<C-b>` | Scroll completion documentation up |
|
||||
| `<C-f>` | Scroll completion documentation down |
|
||||
| `<C-Space>` | Open completion menu |
|
||||
| `<C-e>` | Abort completion |
|
||||
| `<Tab>` | Confirm selected completion item |
|
||||
|
||||
### Command Line And Search
|
||||
|
||||
| Mode | Shortcut | Action |
|
||||
| --- | --- | --- |
|
||||
| `/` command line | `<Tab>` and completion menu | Complete from current buffer |
|
||||
| `:` command line | `<Tab>` 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 | `<localleader>ll` | Start or toggle VimTeX compilation |
|
||||
| Normal | `<localleader>lk` | Stop VimTeX compilation |
|
||||
| Normal | `<localleader>lc` | Clean auxiliary files |
|
||||
| Normal | `<localleader>lv` | Open or forward-search the PDF |
|
||||
| Normal | `<localleader>lo` | Open compiler output |
|
||||
| Normal | `<localleader>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 `<leader>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.
|
||||
Loading…
Reference in New Issue