Skip to content

charVim Wiki

CtrlUserKnown edited this page Jun 18, 2026 · 5 revisions

A personal Neovim configuration running on Neovim 0.12+, managed by lazy.nvim.


Directory Structure

Charvim/
├── nvim/
│   ├── after/
│   │   └── ftplugin/
│   │       ├── cobol.lua           # COBOL-specific settings
│   │       └── make.lua            # Makefile-specific settings
│   ├── colors/
│   │   └── noir-cat.lua            # Custom noir-cat colorscheme
│   ├── lua/
│   │   ├── img/
│   │   │   └── charVim.txt         # ASCII art for the dashboard
│   │   ├── alpha-config.lua        # Dashboard configuration
│   │   ├── autoclose.lua           # Auto-closing brackets and quotes
│   │   ├── completion-config.lua   # nvim-cmp completion config
│   │   ├── dap-config.lua          # Debugger configuration
│   │   ├── harpoon-config.lua      # Harpoon keymaps and setup
│   │   ├── keymaps.lua             # Custom keybindings
│   │   ├── lint-config.lua         # Linter configuration (nvim-lint)
│   │   ├── lsp-config.lua          # LSP settings and handlers
│   │   ├── options.lua             # General Neovim options
│   │   ├── plugins.lua             # Plugin definitions via lazy.nvim
│   │   ├── statusline.lua          # Custom mode-aware statusline
│   │   ├── theme-switcher.lua      # Runtime theme cycling
│   │   └── treesitter-config.lua   # Treesitter setup
│   └── init.lua                    # Main entry point

Leader Keys

Key Value
<leader> Space
<localleader> \

Leader key timeout: 500ms


Keybindings

Tip

This section covers custom keybindings. For standard Neovim motions (like h/j/k/l, w, b, etc.), please refer to the HOME.md file.

General

Keys Mode Action
jk Insert Escape to normal mode
<leader>w Normal Save file (:w)
<leader>q Normal Save and quit (:wq)
<leader>qq Normal Quit without saving (:q!)
; Normal Shortcut to shell command (:!)

Navigation

Keys Mode Action
[[ Normal Go to beginning of file (gg)
]] Normal Go to end of file (G)
H Normal/Visual Custom: Go to beginning of line (0)
L Normal/Visual Custom: Go to end of line ($)
Alt+[ Normal/Visual Previous paragraph ({)
Alt+] Normal/Visual Next paragraph (})
Ctrl+h/j/k/l Normal Navigate splits (also integrates with tmux panes)

Line Manipulation

Keys Mode Action
Alt+k / Alt+j Normal Move line up / down
Alt+k / Alt+j Visual Move selection up / down
Ctrl+k / Ctrl+j Insert Move line up / down
Ctrl+Shift+k / Ctrl+Shift+j Normal Copy (duplicate) line up / down
Ctrl+Shift+k / Ctrl+Shift+j Visual Copy selection up / down

File Explorer (Telescope File Browser)

Keys Mode Action
<leader>e Normal Open file browser at current file's directory
<leader>v Normal Open file browser (same as above)
:E or :Tree Command Open file browser

Telescope

Keys Context Action
Ctrl+. Telescope insert mode Toggle hidden files
Dashboard f Alpha Find file
Dashboard g Alpha Live grep
Dashboard r Alpha Recent files

Hidden files are shown by default. .git/ directories are always ignored.

Harpoon 2

Keys Mode Action
<leader>a Normal Add current file to Harpoon list
<leader>ar Normal Remove current file from Harpoon list
<leader>ac Normal Clear all Harpoon marks
<leader>h Normal Toggle Harpoon quick menu
Alt+1 through Alt+5 Normal Jump to Harpoon file 1–5
Alt+n / Alt+p Normal Next / previous Harpoon file

Runners

Keys Mode Action
<leader>ob Normal Open HTML file in browser
<leader>rp Normal Run current Python file in split terminal
<leader>rj Normal Compile and run current Java file in split terminal

LSP

Keys Mode Action
K Normal Hover documentation
gd Normal Go to definition
gD Normal Go to declaration
gi Normal Go to implementation
go Normal Go to type definition
gr Normal Show references
gs Normal Signature help
<leader>lr Normal Rename symbol
<leader>ca Normal Code action
<leader>e Normal Open diagnostic float (when LSP attached)
[d / ]d Normal Previous / next diagnostic
<leader>ih Normal Toggle inlay hints
<leader>ig Normal Add word under cursor to dictionary
<leader>di Normal Inspect diagnostics at cursor

Java (buffer-local, active in .java files)

Keys Mode Action
<leader>jb Normal Build project (Maven/Gradle/Ant auto-detected)
<leader>jt Normal Run tests
<leader>jc Normal Clean project
<leader>jw Normal Clean JDTLS workspace cache

Completion (nvim-cmp)

Keys Mode Action
Tab / Shift+Tab Insert Cycle through completion items
Ctrl+Space Insert Trigger completion manually
Enter Insert Confirm selected completion
Ctrl+e Insert Abort completion
Ctrl+b / Ctrl+f Insert Scroll documentation up / down

AI (avante.nvim)

Keys Mode Action
Shift+Tab Insert Accept inline suggestion
Alt+] Insert Next suggestion
Ctrl+] Insert Dismiss suggestion

Linting

Keys Mode Action
Auto BufWritePost/BufEnter Lint file on save and entry

Theme Cycling

Keys Mode Action
<leader>t Normal Open theme picker via :ThemeSelect
:Theme <name> Command Switch to a specific theme by name

Tree-sitter Incremental Selection

Keys Mode Action
gnn Normal Init selection
grn Normal Expand to next node
grc Normal Expand to scope
grm Normal Shrink selection

Which-Key Groups

Prefix Group
<leader>r Run (Python/Java)

Other

Keys Mode Action
<leader>d Normal Go to Alpha dashboard

Plugins

Plugin Manager

  • lazy.nvim — Lazy-loading plugin manager. Clone depth set to 1 with 120s timeout for reliable installs.

Themes

  • rose-pine (default) — Transparent background, gold cursor line number.
  • tokyonight (night style) — Transparent, available via theme switcher.
  • catppuccin (mocha flavour) — Transparent, available via theme switcher.
  • gruvbox — Transparent mode, available via theme switcher.
  • noir-cat — Custom dark colorscheme defined in nvim/colors/noir-cat.lua.
  • theme-switcher (custom module) — Cycle between all themes at runtime via :ThemeSelect or :Theme <name>.

UI

  • noice.nvim — Replaces the command line with a centered popup. Popupmenu backend disabled in favour of nvim-cmp.
  • alpha-nvim — Dashboard/start screen with ASCII art logo, quick-access buttons (find file, new file, recent files, live grep, config, themes, Lazy, quit).
  • which-key.nvim — Displays available keybindings in a popup (modern preset).

Navigation & File Management

  • telescope.nvim + telescope-file-browser.nvim — Fuzzy finder and file browser. Replaces netrw. Shows hidden files by default.
  • harpoon (v2) — Quick file bookmarking and navigation. Saves on toggle, syncs on UI close.
  • vim-tmux-navigator — Seamless navigation between Neovim splits and tmux panes with Ctrl+h/j/k/l.

Editing

  • nvim-surround — Add, change, and delete surrounding pairs (quotes, brackets, tags, etc.).
  • vim-visual-multi — Multi-cursor support.
  • autoclose (custom module) — Auto-closes brackets, quotes, and backticks. Handles escape-through-closing-char, backspace-deletes-pair, and enter-opens-block. Also works in command mode and visual mode (wrap selection).

LSP & Diagnostics

  • nvim-lspconfig — Base LSP client configurations. LSP servers are managed directly (no mason-lspconfig).
  • mason.nvim — LSP server, linter, and DAP installer. Servers installed: lua_ls, pyright, ts_ls, jdtls.
  • sourcekit-lsp — Configured natively via vim.lsp.config() for Swift/C/C++/Objective-C.
  • Inlay hints enabled by default (toggle with <leader>ih).

Configured LSP Servers

Server Languages Notes
lua_ls Lua Auto-installed via Mason
pyright Python Auto-installed via Mason
ts_ls TypeScript/JavaScript Auto-installed via Mason
jdtls Java Per-project workspace dirs via jdtls_workspace(), Maven/Gradle/Ant auto-detect, code lens enabled
gopls Go Unused param + shadow analysis, gofumpt, full inlay hints
tinymist Typst Exports PDF on save
sourcekit-lsp Swift, C, C++, Obj-C Uses new vim.lsp.config() API

Completion

  • nvim-cmp — Completion engine with sources:
    • nvim_lsp — LSP completions
    • nvim_lua — Neovim Lua API completions
    • luasnip — Snippet completions
    • buffer — Buffer word completions
    • path — File path completions (fallback)
  • LuaSnip — Snippet engine.

AI

  • avante.nvim — Local AI-assisted code completion and chat using Ollama with Qwen 2.5 Coder (3B model). Inline suggestions with 75ms debounce, auto-suggestions enabled. Replaces the previous GitHub Copilot integration.

Linting

  • nvim-lint — Configurable linting via lint-config.lua. Auto-lints on BufWritePost and BufEnter. Supported linters: luacheck (Lua), staticcheck (Go), ruff (Python), eslint_d (JS/TS), checkstyle (Java).

Debugging

  • nvim-dap + nvim-dap-ui — Debug Adapter Protocol for Python, Java, C/C++, and Swift. Opens UI automatically on session start.

Syntax & Parsing

  • nvim-treesitter — Syntax highlighting, indentation, and incremental selection. Auto-installs missing parsers. Disables highlighting for files > 100KB.
  • Installed parsers: c, crystal, lua, vim, vimdoc, query, javascript, typescript, python, rust, go, html, css, json, markdown, bash, yaml, toml.
  • Crystal files (.cr) fall back to Ruby syntax if Tree-sitter highlighting fails.

Document Authoring

  • typst-preview.nvim — Live browser preview for Typst files. Custom commands: :TP (start), :TS (stop), :TU (update).

Editor Options

Option Value
Line numbers On (absolute)
Relative numbers Off
Tab width 4 spaces (expandtab)
Smart indent On
Swap files Off
Backup files Off
Clipboard System clipboard (unnamedplus)
Scroll offset 10 lines
Encoding UTF-8
Cursor line Highlighted (number only, gold color)
Cursor shape Block in normal/visual, vertical bar in insert, horizontal bar in replace
Command line height 0 (hidden)
Whitespace chars Visible (tab , trail ·, extends », precedes «, nbsp , leading )
Background Transparent (both Normal and NormalFloat)

Statusline

Custom-built statusline (no plugin). Displays:

  • Left: V indicator + filename + modified flag [+]
  • Right: Save confirmation (flash for 2s) + current mode name + percentage + column

Mode names: NORMAL, INSERT, VISUAL, V-LINE, V-BLOCK, COMMAND, SELECT, REPLACE, SHELL, TERMINAL.

Highlight colours dynamically adapt to the active colorscheme.


Filetype-Specific Settings

COBOL (after/ftplugin/cobol.lua)

  • Tab width: 8 spaces
  • Color columns at 7 and 73 (traditional fixed-format margins)
  • Text width: 72
  • Absolute line numbers, no relative numbers

Makefile (after/ftplugin/make.lua)

  • Makefile-specific settings and options.

Crystal

  • .cr files mapped to crystal filetype
  • Custom Tree-sitter parser from crystal-lang-tools/tree-sitter-crystal
  • Falls back to Ruby syntax highlighting if Tree-sitter fails

Java

  • Build system auto-detected (Maven pom.xml, Gradle build.gradle, Ant build.xml)
  • JDTLS workspace directories stored in ~/.cache/nvim/jdtls/<project_name> via jdtls_workspace()
  • LSP server resolved from Mason path or system jdtls binary
  • Code lens enabled, GoogleStyle format profile

Custom Commands

Command Action
:E Open Telescope file browser
:Tree Open Telescope file browser
:TP Start Typst preview
:TS Stop Typst preview
:TU Update Typst preview
:ThemeSelect Open interactive theme picker
:Theme <name> Switch to a specific theme
:OpenInBrowser Open current HTML file in browser
:RunPython Run current Python file
:RunJava Run current Java file

Notes

  • Plugin versions are locked in nvim/lazy-lock.json. Run :Lazy update to update and :Lazy restore to roll back.
  • Mason-managed tools are stored in Neovim's data directory (~/.local/share/nvim/mason/).
  • The autoclose module is a custom implementation (not a plugin), located at nvim/lua/autoclose.lua.
  • Ollama with qwen2.5-coder is required for local AI completions (optional — editing works without it).

Clone this wiki locally