Neovim Setup
This document describes the Neovim configuration, optimized for performance, clarity, and efficiency.
Core Configuration
- Enabled via Nix: Neovim is managed declaratively through Nix, ensuring reproducibility and ease of updates.
- Aliases & Defaults:
nvimis set as the default editor, with aliases forvi,vim, andvimdifffor convenience. - Performance-optimized settings: Configured for responsiveness with options like
updatetime,timeoutlen, andttyfast. - Enhanced UI: Features like
number,relativenumber,cursorline, and a persistentsigncolumnprovide improved navigation and visual cues.
Theme & Appearance
This Neovim setup integrates seamlessly with the global Juna theming system. The colorscheme automatically synchronizes with your active system-wide theme, ensuring a consistent look and feel across all applications.
Key Features:
- Dynamic Theming: Your Neovim theme will always match your selected Juna theme.
- Automatic Reloading: When you change your system theme using the
toggle-themescript, all running Neovim instances will automatically update their colorscheme. - Default Theme: By default, the setup uses Nord for its clean and focused aesthetic.
Example Theme Settings (for Nord)
Juna automatically applies theme-specific settings. Here is an example of the settings applied for the Nord theme:
g:nord_contrast = true— enhanced contrast for better readabilityg:nord_borders = false— minimal borders for clean UIg:nord_disable_background = false— keep the backgroundg:nord_italic = false— no italics to avoid distractionsg:nord_uniform_diff_background = true— consistent diff backgroundsg:nord_bold = false— subtle bold text
Juna Integration
The integration with Juna is configured in the themes/juna.nix file and provides several options:
installAllThemes: Set totrueto install all available Neovim themes from Juna, allowing for instant theme switching within Neovim.themeAutoReload: Enabled by default, this feature ensures that any theme change at the system level is immediately reflected in all running Neovim instances without requiring a restart.
Plugins & Features
I use a curated set of plugins to enhance coding and navigation:
UI Enhancements
mini-icons: File icons for aesthetics.mini-notify: Enhanced notification system.mini-statusline: Minimalist and informative status line.mini-tabline: Clean tab line for buffer management.nvim-web-devicons: Adds file type icons to Neovim.
LSP & Completion
nvim-cmp&cmp-nvim-lsp: For smart autocompletion with LSP.cmp-path: Path completion source fornvim-cmp.cmp_luasnip&friendly-snippets&luasnip: For powerful snippet support.nvim-lspconfig: Easy Neovim LSP configuration.
Editing Enhancements
conform-nvim: Opinionated code formatting.mini-clue: Shows keybindings on demand.mini-pairs: Auto-pairs for brackets, quotes, etc.mini-surround: Quickly add/delete/change surroundings.vim-illuminate: Highlights word under cursor and its occurrences.vim-visual-multi: Multi-cursor editing capabilities.
Notes & Markdown
markdown-preview-nvim: Live markdown preview.render-markdown-nvim: Renders markdown in Neovim.todo-comments-nvim: Highlights and lists TODO comments.
Navigation & Search
telescope-nvim: Extensible fuzzy finder.mini-files: Simple and fast file explorer.
NixOS Specific
nix-develop-nvim: Integration for Nix development environments.
Treesitter
nvim-treesitter: Improved syntax highlighting and code parsing.nvim-treesitter-context: Shows context of the current code block.- Parsers: Bash, C, C++, Dockerfile, Go, Go-mod, HTML, JSON, Lua, Markdown, Markdown-inline, Nix, PHP, Python, Todotxt, YAML, Zig.
Quality of Life
conform-nvim— formatting support
Keybindings
<leader>r: Run the current file in a floating terminal. This keybinding supports a wide range of languages including Python, JavaScript, TypeScript, Lua, Zig, Rust, Go, C, C++, Java, Shell scripts, Ruby, Perl, PHP, R, Julia, Dart, and Swift.<leader>td: List TODOs using Telescope.<leader>tq: List TODOs using Quickfix.<leader>tt: Openmini.filesexplorer.gh: For C/C++ development, switches between source and header files.<Esc>: Clears search highlights.
Extra Packages
The configuration extends Neovim’s power with language servers and tools installed at the system level, providing:
- Robust language support for C, C++, Go, Lua, Python, TypeScript, and more
- Language servers:
clang-tools,gopls,lua-language-server,pyright,typescript-language-server,vscode-langservers-extracted,zls - Linters/Formatters:
ruff(for Python),stylua(for Lua) - Tools like
nixdfor Nix language support
Why This Setup?
- Reproducible & Portable: Configured declaratively through Nix to keep your setup consistent across machines.
- Performance Focused: Lua-based config with minimal overhead, optimized for smooth operation.
- Balanced Look & Feel: Clean, distraction-free UI with powerful features always within reach.
- Developer Productivity: All essential tools and workflows integrated seamlessly.
Refer to the lua directory for complete configuration details.