- Lua 100%
| lua | ||
| .gitignore | ||
| .stylua.toml | ||
| init.lua | ||
| lazy-lock.json | ||
| LICENSE | ||
| README.md | ||
James' Neovim Configuration
This is James' Neovim configuration. It's heavily based on Clemens' Neovim configuration, which in turn is based on NVChad. It has installed various plugins for AI integration. By default, it's setup to work with a Mistral subscription, but can work with other adapters and models as well. It has a note-taking system with Telekasten, with various plugins for making markdown look nice.
What's written below is documentation generated by AI based on the lua-scripts in the configuration.
Summary
This configuration includes:
Interface
- Customized Catppuccin theme
- File navigation with nvim-tree and Oil.nvim
- Fuzzy finding with Telescope
AI Assistance
- GitHub Copilot for code completion
- CodeCompanion default setup with Devstral 2 through Mistral.
- MCPHub for Model Context Protocol tools
- Tavily web search
Note-Taking & Writing
- Telekasten for Zettelkasten notes with daily notes and backlinks
- Markview for Markdown rendering
- image.nvim for image preview (requires Kitty terminal)
- VimTeX for LaTeX editing with continuous compilation and PDF preview
Development
- LSP support via Mason (TeXLab pre-configured)
- Conjure for REPL development (JavaScript/Node.js, Clojure, Fennel, etc.)
- Code formatting with conform.nvim
- Git integration with gitsigns and LazyGit
- TreeSitter syntax highlighting
Editing
- Flash.nvim for quick navigation
- nvim-surround for text objects
- Auto-pairing brackets and quotes
- Undo history with undotree
- Wrapped line navigation
Security
- marbles.nvim for file encryption/decryption with OpenSSL
Other
- Cross-platform (macOS and Linux)
- Plugin management with Lazy.nvim
Requirements
- Neovim >= 0.11.0
- NVChad (base configuration framework)
- Git
- A Nerd Font (for icons)
- ripgrep (for telescope grep)
- Node.js (for Copilot)
- OpenSSL (for marbles.nvim encryption)
- Language-specific tools (LSP servers, formatters, linters)
- LaTeX distribution (for VimTeX)
- PDF viewer:
- macOS: Preview (built-in)
- Linux: Sioyek
Optional
- Kitty terminal (for image rendering in Markdown files)
Installation
1. Install Neovim
macOS
# Using Homebrew
brew install neovim
# Or download from GitHub releases
# https://github.com/neovim/neovim/releases
Linux (Ubuntu/Debian)
# Using apt (might not be latest version)
sudo apt install neovim
# For latest stable version, use AppImage or build from source:
# https://github.com/neovim/neovim/releases
Verify installation
nvim --version # Should show >= 0.11.0
2. Install dependencies
macOS
brew install git ripgrep node
Linux (Ubuntu/Debian)
sudo apt install git ripgrep nodejs npm
3. Install a Nerd Font
Download and install a Nerd Font (e.g., JetBrains Mono Nerd Font, Hack Nerd Font) and configure your terminal to use it.
4. Backup existing Neovim configuration
mv ~/.config/nvim ~/.config/nvim.backup
mv ~/.local/share/nvim ~/.local/share/nvim.backup
5. Clone this repository
git clone https://github.com/cklokmose/nvim-config ~/.config/nvim
6. Clean any existing Neovim data
(Important for cross-platform setup)
rm -rf ~/.local/share/nvim ~/.cache/nvim
7. Start Neovim
nvim
NVChad and all plugins will install automatically on first launch. This may take a few minutes.
8. Set up GitHub Copilot
:Copilot setup
9. Optional: Install additional dependencies
LaTeX Support (for VimTeX)
macOS:
# Install MacTeX (full distribution)
brew install --cask mactex
# Or BasicTeX (minimal distribution)
brew install --cask basictex
# Install neovim-remote for forward search
pip3 install neovim-remote
Linux (Ubuntu/Debian):
# Install TeX Live
sudo apt install texlive-full
# Or minimal installation
sudo apt install texlive-latex-base texlive-latex-extra
# Install PDF viewer (Sioyek)
sudo apt install sioyek
# Install neovim-remote for forward search
pip3 install neovim-remote
Git Integration (LazyGit)
macOS:
brew install lazygit
Linux (Ubuntu/Debian):
# Add PPA for latest version
sudo add-apt-repository ppa:lazygit-team/release
sudo apt update
sudo apt install lazygit
# Or download from GitHub releases:
# https://github.com/jesseduffield/lazygit/releases
Notes Setup (Telekasten)
Create a notes directory (default location expected by Telekasten):
mkdir -p ~/notes/dailies
You can change the notes location by editing lua/plugins/telekasten.lua and modifying the home path.
Web Search (Tavily)
For web search functionality in CodeCompanion, you need a Tavily API key:
- Get a free API key from Tavily
- Configure it in MCPHub's servers file at
~/.config/mcphub/servers.json:
{
"mcpServers": {
"tavily": {
"command": "npx",
"args": ["-y", "tavily-mcp"],
"env": {
"TAVILY_API_KEY": "your-api-key-here"
}
}
}
}
Note: Always clean ~/.local/share/nvim and ~/.cache/nvim when moving this config between different operating systems (e.g., Linux ↔ macOS). This ensures all binaries and cache files are rebuilt for your current platform.
Core Features
- Base: NVChad v2.5
- Theme: Catppuccin with custom highlights
- LSP: Language Server Protocol support (TeXLab for LaTeX)
- AI Assistance:
- GitHub Copilot for code completion
- CodeCompanion with Claude Sonnet 4.5 and GPT-4.1
- MCPHub integration for MCP tools
- LaTeX: VimTeX with LuaLaTeX (Preview on macOS, Sioyek on Linux)
- Navigation: Flash.nvim for quick jumps, Oil.nvim for file management
- Editing: nvim-surround, nvim-autopairs, undotree
- File Explorer: nvim-tree and Oil.nvim
- Fuzzy Finder: Telescope
- Git Integration: gitsigns, LazyGit
Installed Plugins
Note-taking & Knowledge Management
- telekasten.nvim - Zettelkasten note-taking with daily notes and backlinks
- markview.nvim - Markdown preview and rendering in Neovim
AI & Completion
- copilot.vim - GitHub Copilot integration
- codecompanion.nvim - AI coding assistant with Claude through Copilot
- mcphub.nvim - MCP (Model Context Protocol) hub integration
- nvim-cmp - Autocompletion engine
- LuaSnip - Snippet engine
LSP & Language Support
- nvim-lspconfig - LSP configuration (TeXLab enabled)
- mason.nvim - LSP/DAP/linter/formatter installer
- vimtex - LaTeX editing and compilation
- conjure - Interactive REPL for JavaScript (Node.js), Clojure, Fennel, and other languages
Navigation & Motion
- flash.nvim - Quick navigation with labels
- oil.nvim - File explorer as a buffer
- telescope.nvim - Fuzzy finder
- nvim-tree.lua - Traditional file explorer
Editing
- nvim-surround - Surround text objects with quotes, brackets, etc.
- nvim-autopairs - Auto close brackets, quotes, etc.
- undotree - Visualize undo history
- conform.nvim - Code formatting
Security
- marbles.nvim - File encryption/decryption using OpenSSL (AES-256-CBC)
UI & Visual
- indent-blankline.nvim - Indentation guides
- gitsigns.nvim - Git decorations
- which-key.nvim - Keybinding hints
- nvim-web-devicons - File icons
- mini.icons - Additional icons
Syntax
- nvim-treesitter - Advanced syntax highlighting and parsing
Keybindings Cheatsheet
General (NVChad Defaults)
| Key | Mode | Description |
|---|---|---|
<Space> |
N | Leader key |
<C-s> |
N/I/V | Save file |
<C-c> |
N/I/V | Copy whole file |
<C-h/j/k/l> |
N | Navigate windows |
<Tab> |
N | Next buffer |
<S-Tab> |
N | Previous buffer |
<leader>x |
N | Close buffer |
Custom general Keybindings
| Key | Mode | Description |
|---|---|---|
<leader>a |
N | Toggle completion |
Flash Navigation
| Key | Mode | Description |
|---|---|---|
s |
N/X/O | Flash jump |
S |
N/X/O | Flash Treesitter |
r |
O | Remote Flash |
R |
O/X | Treesitter Search |
<C-s> |
C | Toggle Flash Search |
Wrapped Line Navigation
| Key | Mode | Description |
|---|---|---|
<Alt-h> |
N/V/I | Move left one character |
<Alt-j> |
N/V/I | Move down one display line |
<Alt-k> |
N/V/I | Move up one display line |
<Alt-l> |
N/V/I | Move right one character |
<Alt-Left> |
N/V/I | Move left one character |
<Alt-Down> |
N/V/I | Move down one display line |
<Alt-Up> |
N/V/I | Move up one display line |
<Alt-Right> |
N/V/I | Move right one character |
File Management
| Key | Mode | Description |
|---|---|---|
<C-n> |
N | Toggle nvim-tree |
<leader>e |
N | Focus nvim-tree |
. |
N | Re-roots the nvim-tree to the current directory |
<leader>o |
N | Open Oil.nvim (working directory) |
- |
N | Open Oil.nvim (parent directory) |
Git
| Key | Mode | Description |
|---|---|---|
<leader>lg |
N | Open LazyGit |
Telekasten (Note-taking)
| Key | Mode | Description |
|---|---|---|
<leader>td |
N | Go to today's daily note |
<leader>tn |
N | Create new note |
<leader>tb |
N | Show backlinks |
<leader>tf |
N | Find notes |
<leader>tl |
N | Follow link under cursor |
<leader>cal |
N | Open calendar in vertical split |
<leader>caL |
N | Open calendar in horisontal split |
Markview (Markdown Preview)
| Key | Mode | Description |
|---|---|---|
<leader>mt |
N | Toggle Markview |
<leader>ms |
N | Toggle Markview Split |
Telescope (NVChad Defaults)
| Key | Mode | Description |
|---|---|---|
<leader>ff |
N | Find files |
<leader>fa |
N | Find all files |
<leader>fw |
N | Live grep |
<leader>fb |
N | Find buffers |
<leader>fh |
N | Help tags |
<leader>fo |
N | Old files |
<leader>fz |
N | Current buffer fuzzy find |
<leader>cm |
N | Git commits |
<leader>gt |
N | Git status |
AI Assistants (CodeCompanion & Copilot)
CodeCompanion Chat Window
| Key | Mode | Description |
|---|---|---|
<leader>cc |
N | Open CodeCompanion chat |
gh |
CodeCompanion Chat | Open chat history (CodeCompanion-History) |
sc |
CodeCompanion Chat | Save current chat |
? |
CodeCompanion Chat | Show all keymaps |
<CR> or <C-s> |
CodeCompanion Chat | Send message to LLM |
q |
CodeCompanion Chat | Stop current request |
<C-c> |
CodeCompanion Chat | Close chat buffer |
ga |
CodeCompanion Chat | Change adapter (model) |
gc |
CodeCompanion Chat | Insert codeblock |
gd |
CodeCompanion Chat | View/debug chat contents |
gD |
CodeCompanion Chat | View super diff |
gr |
CodeCompanion Chat | Regenerate last response |
gR |
CodeCompanion Chat | Go to file under cursor |
gx |
CodeCompanion Chat | Clear chat buffer |
gy |
CodeCompanion Chat | Yank last codeblock |
[[ / ]] |
CodeCompanion Chat | Move to prev/next header |
{ / } |
CodeCompanion Chat | Move to prev/next chat |
Copilot
| Key | Mode | Description |
|---|---|---|
<Tab> |
I | Accept Copilot suggestion |
<leader>ct |
N | Toggle auto completion (disabled by default) |
:Copilot |
N | Copilot commands |
LaTeX (VimTeX)
| Key | Mode | Description |
|---|---|---|
<leader>ll |
N | Start/toggle compilation |
<leader>lv |
N | View PDF |
<leader>lk |
N | Stop compilation |
Note: These keymaps only work in .tex files
Conjure (JavaScript & REPL)
| Key | Mode | Description |
|---|---|---|
,ee |
N | Evaluate current form under cursor |
,er |
N | Evaluate root form |
,ew |
N | Evaluate word under cursor |
,e! |
N | Evaluate and replace form with result |
,ef |
N | Evaluate file from disk |
,eb |
N | Evaluate entire buffer |
,em{mark} |
N | Evaluate form at mark (e.g., æemF) |
,E |
V | Evaluate visual selection |
,E{motion} |
N | Evaluate motion (e.g., æE2j) |
,ece |
N | Eval current form, insert result as comment |
,ecr |
N | Eval root form, insert result as comment |
,ecw |
N | Eval word, insert result as comment |
,ls |
N | Open log in horizontal split |
,lv |
N | Open log in vertical split |
,lt |
N | Open log in new tab |
,le |
N | Open log in current window |
,lq |
N | Close all visible log windows |
,ll |
N | Jump to latest result in log |
,lr |
N | Soft reset log (clear contents) |
,lR |
N | Hard reset log (delete buffer) |
,cr |
N | Restart the REPL |
K |
N | Look up documentation |
,gd |
N | Go to definition |
:ConjureSchool |
N | Start interactive tutorial |
:ConjureEval |
N | Evaluate code (accepts range) |
:ConjureConnect |
N | Connect to REPL |
Note: , is the localleader key. These keymaps work in JavaScript (.js), Clojure, Fennel, and other supported files
LSP (NVChad Defaults)
| Key | Mode | Description |
|---|---|---|
gD |
N | Go to declaration |
gd |
N | Go to definition |
K |
N | Hover documentation |
gi |
N | Go to implementation |
<leader>D |
N | Type definition |
<leader>ra |
N | Rename symbol |
<leader>ca |
N | Code action |
gr |
N | References |
[d |
N | Previous diagnostic |
]d |
N | Next diagnostic |
Undo History
| Key | Mode | Description |
|---|---|---|
<leader>u |
N | Toggle undotree |
Marbles (Encryption)
| Key | Mode | Description |
|---|---|---|
<leader>s |
N | Open Marbles menu |
Surround (nvim-surround)
| Key | Mode | Description |
|---|---|---|
ys{motion}{char} |
N | Add surrounding |
ds{char} |
N | Delete surrounding |
cs{old}{new} |
N | Change surrounding |
S{char} |
V | Surround selection |
Examples: ysiw" - surround word with quotes, ds" - delete quotes, cs"' - change quotes to single quotes
Commenting (NVChad)
| Key | Mode | Description |
|---|---|---|
<leader>/ |
N/V | Toggle comment |
AI Configuration
CodeCompanion
CodeCompanion is configured with:
- Chat Strategy: Claude Sonnet 4.5 (via Copilot)
- Inline Strategy: GPT-4.1 (via Copilot)
- Agent Strategy: Claude Sonnet 4.5 (via Copilot)
- MCPHub Integration: Enabled with variables, slash commands, and chat output
- Web Search: Tavily provider with advanced search depth
GitHub Copilot
- Active in all buffers (including CodeCompanion chat)
- Integrated with CodeCompanion for model access
MCPHub
MCP (Model Context Protocol) integration for extending AI capabilities with tools and resources.
Commands:
:MCPHub- Open MCPHub interface:MCPServers- List MCP servers:MCPTools- List available MCP tools
LSP Configuration
Configured Servers
- TeXLab - LaTeX language server (automatically enabled)
Install additional servers via :Mason
LaTeX Workflow
- Open a
.texfile - Press
<leader>llto start continuous compilation - Press
<leader>lvto open PDF in Sioyek - Edit your document - PDF updates automatically
- Press
<leader>lkto stop compilation when done
VimTeX Configuration
- Compiler: XeLaTeX (via latexmk)
- Viewer:
- macOS: Preview (built-in)
- Linux: Sioyek
- Features: Word wrap and line break enabled for
.texfiles
Conjure Workflow (JavaScript & REPL)
JavaScript (Node.js)
- Open a JavaScript file (
.js) - Conjure automatically starts a Node.js REPL in the background
- Use
æeeto evaluate code under your cursor - Results appear in the log buffer (open with
æls) or HUD - Evaluate selections with
æEin visual mode
Example workflow:
// Evaluate this line with æee
const result = 1 + 2;
// Evaluate this function with æee
function hello(name) {
return `Hello, ${name}!`;
}
// Evaluate and see result: æew
hello("World");
// Evaluate entire file: æef
Other Languages (Clojure, Fennel, etc.)
- Open a supported file (
.clj,.fnl, etc.) - Conjure automatically connects to your REPL
- Use
æeeto evaluate forms - Results appear in log or HUD
Quick Start
- Evaluate code: Place cursor on code and press
æee - See results: Press
ælsto open log in split, or results show in HUD - Evaluate selection: Select code in visual mode and press
æE - Evaluate file: Press
æefto load entire file into REPL - Interactive tutorial: Run
:ConjureSchool
Conjure Configuration
- Localleader:
,(Danish keyboard friendly) - Log: HUD (floating window) by default, persistent log available
- Supported languages: JavaScript (Node.js), Clojure, Fennel, Janet, Hy, Scheme, Racket, Common Lisp, Python, Lua, Rust, and more
- REPL: Automatically starts Node.js for JavaScript, connects to nREPL for Clojure, or stdio REPLs for other languages
UI Configuration
Theme: Catppuccin
- Primary theme: Catppuccin
- Toggle theme: Catppuccin ↔ One Dark (
:Telescope themes) - Custom highlights:
- Current line number: Lavender
- Line numbers: Surface2
- Base05 override: Lavender
UI Settings
- Completion style: Default
- Telescope style: Borderless
- Window border: Rounded (MCPHub)
Directory Structure
~/.config/nvim/
├── init.lua # Entry point, loads NVChad and plugins
├── lazy-lock.json # Plugin version lock file
├── README.md # This file
├── lua/
│ ├── chadrc.lua # NVChad UI configuration
│ ├── options.lua # General Neovim options
│ ├── nvchad/ # NVChad core files (managed)
│ │ ├── autocmds.lua
│ │ ├── mappings.lua
│ │ ├── options.lua
│ │ ├── configs/ # NVChad plugin configs
│ │ │ ├── cmp.lua
│ │ │ ├── gitsigns.lua
│ │ │ ├── lspconfig.lua
│ │ │ ├── luasnip.lua
│ │ │ ├── mason.lua
│ │ │ ├── nvimtree.lua
│ │ │ ├── telescope.lua
│ │ │ └── treesitter.lua
│ │ └── plugins/
│ │ └── init.lua
│ └── plugins/ # Custom plugin configurations
│ ├── init.lua # Plugin loader
│ ├── codecompanion.lua # AI assistant config
│ ├── conjure.lua # JavaScript/Clojure REPL
│ ├── copilot.lua # GitHub Copilot
│ ├── flash.lua # Navigation plugin
│ ├── image.lua # Image preview
│ ├── lazygit.lua # LazyGit integration
│ ├── lspconfig.lua # LSP setup (TeXLab)
│ ├── markview.lua # Markdown preview
│ ├── mcphub.lua # MCP hub config
│ ├── nvim-tree.lua # File tree explorer
│ ├── oil.lua # Buffer-based file explorer
│ ├── surround.lua # Surround plugin
│ ├── telekasten.lua # Zettelkasten note-taking
│ ├── telescope.lua # Telescope config
│ ├── undotree.lua # Undo history visualizer
│ ├── vimtex.lua # LaTeX support
│ └── marbles.lua # File encryption
Customization
Adding Plugins
Create a new file in lua/plugins/ with the plugin spec:
return {
"username/repo",
lazy = true,
config = function()
-- your config
end,
}
Adding LSP Servers
- Install via Mason:
:Mason - Add to
lua/plugins/lspconfig.lua:
vim.lsp.config("servername", {})
vim.lsp.enable("servername")
Custom Keymaps
Add to individual plugin configs in lua/plugins/ using the keys table or create autocmds.
Useful Commands
Plugin Management
:Lazy- Open Lazy.nvim plugin manager:Lazy sync- Update all plugins:Lazy clean- Remove unused plugins
LSP
:LspInfo- Show LSP server status:Mason- Open Mason installer:MasonUpdate- Update Mason packages
LaTeX
:VimtexInfo- Show VimTeX information:VimtexCompile- Start compilation:VimtexClean- Clean auxiliary files:VimtexView- Open PDF viewer
Conjure (REPL)
:ConjureSchool- Interactive tutorial:ConjureEval <code>- Evaluate code string:ConjureConnect [host] [port]- Connect to REPL:ConjureClientState- Get/set client state:help conjure- Full Conjure documentation
AI
:Copilot status- Check Copilot status:Copilot setup- Setup Copilot authentication:CodeCompanionChat- Open AI chat:MCPHub- Open MCP hub
File Management
:Oil- Open Oil file explorer:NvimTreeToggle- Toggle nvim-tree
Resources
- NVChad Documentation
- Neovim Documentation
- VimTeX Documentation
- Conjure Documentation
- CodeCompanion Documentation
- Flash.nvim Documentation
- Mason Registry
Troubleshooting
LSP Issues
- Run
:LspInfoto check server status - Check
:Masonfor installed servers - Review
:checkhealthfor system issues
Copilot Not Working
- Run
:Copilot status - Authenticate with
:Copilot setup - Check Node.js is installed:
node --version
LaTeX Compilation Fails
- Verify LaTeX installation:
lualatex --version - Check
:VimtexInfofor configuration - Ensure
nvris installed:pip install neovim-remote
Plugin Errors
- Run
:Lazy syncto update plugins - Check
:checkhealth lazyfor issues - Review lazy-lock.json for version conflicts
Theme/UI Issues
- Run
:NvChadUpdateto update base46 - Clear cache:
rm -rf ~/.local/share/nvim/nvchad/base46 - Restart Neovim
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Dependencies
This configuration uses NVChad (GPL-3.0) as a plugin dependency and is based on the NVChad starter template (Unlicense). Individual plugins have their own licenses.
Built with: NVChad v2.5 • Neovim 0.11+ • Lazy.nvim