Skip to content

Chiarandini/nvimDotfiles

Repository files navigation

🚀 My Neovim Configuration

A Neovim configuration built with Lua and the Lazy.nvim plugin manager. This is my personal setup that focuses on my text-editing needs which primarily includes latex, markdown, lua, python, typescript, and a few other programming languages I occasionally use.

✨ Features

  • Search & Navigation: Telescope/snack-picker integration with fuzzy finding, project search, and file navigation
  • Advanced LSP: Full Language Server Protocol integration with auto-completion, diagnostics, and code actions
  • Custom UI: Custom statusline, tabline, and colorscheme, including toggle-able animations.
  • Academic Writing: Comprehensive LaTeX support with VimTeX, custom snippets, and PDF compilation
  • Developer Tools: Integrated debugging, terminal, git workflow, and project management
  • Performance Optimized: Fast startup with lazy loading and disabled unnecessary providers

🗂️ Configuration Structure

nvim/
├── lua/
│   ├── configs/         # Plugin configuration files
│   ├── core-plugins/    # Plugin installation and setup (Lazy.nvim specs)
│   ├── plugins/         # optional additional bundles
│   ├── settings/        # Core Neovim settings, keymaps, and autocommands
│   ├── sources/         # Custom completion sources
│   └── utils/           # Helper functions and utilities
├── LuaSnip/            # Custom LuaSnip snippets (Lua-based, not VSCode format)
├── ftplugin/           # Filetype-specific configurations
├── preamble/           # LaTeX preamble templates and chunks
├── queries/            # Custom Tree-sitter queries
├── spell/              # Custom dictionary words for spellchecker
└── session/            # Session management files (auto-generated)

⌨️ Key Concepts

Leader Keys

  • \ - Main Leader: Actions and commands
  • <Space> - Navigation Leader: Search, find, and navigation
  • , - Local Leader: Filetype-specific actions (LaTeX, Markdown, debugging, etc.)

Core Principles

  • q closes windows where macro recording isn't needed
  • <Esc> dismisses notifications and clears search highlighting
  • WhichKey provides contextual help with 1.5s delay
  • ; is remapped to :.
  • Extensive use of toggle mappings via [/] and ']o'/']o' for quick option changes

📊 Statusline Features

The statusline displays comprehensive information:

  • LSP Status: Active language server with color coding
  • Git Integration: Current branch and change indicators
  • LaTeX Compilation: Document size and compilation progress/status
  • File Information: Name and optional path from project root
  • Macro Recording: Shows q<key> when recording
  • Debug Information: Active debugging session details

⌨️ Keyboard Shortcuts

Main Leader (\) - Actions

Key Action
r Refactor code
R Run/execute
b Box text formatting
d Debug operations
o Obsidian integration
f Format code
h Git hunk operations
S Spotify controls
s Case conversion (camelCase/snake_case)
t Toggle windows

Navigation/Pairs ([ and ])

Key Action
s Previous/next misspelled word
b Previous/next buffer
d Previous/next diagnostic
e Swap lines up/down
<Space> Add blank line above/below
h Previous/next git hunk
j Join/unjoin lines
m/M Method start/end
[/] Block or heading navigation
t Previous/next TODO comment
z Previous/next fold

Option Toggles ([o/]o)

Key Toggle
a Auto-chdir
b Light/dark background
B Code block visualization
c Cursorline
d Diff mode
h Search highlighting
I Illuminate plugin
i Ignore case
l Show trailing characters
L LSP start/stop
s Spell checking
S Scroll binding
T Tree-sitter
u Cursor column
v Virtual edit
w Line wrapping
W Window animations
x Cursor crosshair

Window Management (<C-w>)

Key Action
<C-g> LazyGit
<C-o> Oil file manager
<C-r> Multi-replace
<C-s> Spectre search/replace
<C-t> open terminal
<C-u> Undo tree
<C-m> Mason package manager
<C-l> LSP info
<c-e> File explorer toggle
d Debug UI
h Harpoon
o Outline/symbols
l Lazy plugin manager

Navigation Leader (<Space>) - Search & Find

Key Action
/ Fuzzy search in current file
<Space> Browse current directory
C Select colorscheme
P Plugin management
q Quickfix list (Trouble)
r Resume last Telescope search
T Terminal selector
t Table of contents
d Diagnostics menu
D Debug menu
e Editor files
g Grep/search
l LSP menu
w Wiki/notes
f Find submenu
c Config submenu

Find Submenu (<Space>f)

Key Action
B Bookmarks
b Open buffers
c Available commands
f Files in current directory
G Git changes
h Help documentation
k Keymaps
m Marks
n Notifications
o Recent files
p Project files
t TODO comments
u Undo history

Config Submenu (<Space>c)

Key Action
c Neovim config files
C All config files
f Ftplugin files
p Plugin configurations
P LaTeX preambles
s Snippets

Other Important Bindings

Key Action Mode
| Temporary vertical split Normal
+ Edit in new tab Normal
_ Temporary horizontal split Normal
J/K Move up/down keeping cursor position Normal
L LSP hover Normal
; Command mode (:) Normal
U Redo Normal
<C-t> Buffer file stack navigation Normal
<C-s> Show file in tree Normal
<C-/> Toggle comment Normal
<C-;> Open terminal Normal
>>/<< Move function parameters Normal
<C-l> Auto-fix spelling Insert
T Tabularize selection Visual
c Search/replace selection Visual

🔌 Key Plugins

Core Functionality

  • Lazy.nvim: Plugin manager with lazy loading
  • Telescope: Fuzzy finder and search interface
  • WhichKey: Contextual keybinding help
  • LuaSnip: Snippet engine with custom Lua snippets

Language Support

UI & Visual Enhancements

  • Heirline: Custom statusline configuration
  • Alpha: Customizable start screen
  • Neo-tree: File explorer sidebar
  • Noice: Enhanced UI for messages and notifications

Development Tools

  • nvim-dap: Debug Adapter Protocol integration
  • Gitsigns: Git integration with line-level changes
  • LazyGit: Terminal-based Git UI
  • Trouble: Enhanced diagnostics and quickfix list

Writing & Productivity

  • Obsidian: Note-taking and knowledge management
  • Neorg: Organized note-taking and task management
  • Comment: Smart code commenting
  • Flash: Enhanced navigation and jumping (optional, disabled by default)

🚀 Installation

Prerequisites

  • Neovim 0.10+ (latest stable recommended)
  • Git for plugin management
  • Node.js for LSP servers and tools
  • Python 3 with pynvim for Python integration
  • LaTeX distribution (for LaTeX support)
  • Ripgrep for faster searching
  • A Nerd Font for icon support

Quick Start

  1. Backup your existing config (if any):

    mv ~/.config/nvim ~/.config/nvim.backup
  2. Clone this configuration:

    git clone <your-repo-url> ~/.config/nvim
  3. Launch Neovim:

    nvim
  4. Install plugins: Lazy.nvim will automatically install all plugins on first launch.

  5. Install LSP servers: Use :Mason to install language servers for your languages.

Post-Installation

  • Review lua/settings/options.lua for personal preferences
  • Customize colorschemes in lua/plugins/colorschemes.lua
  • Add personal snippets to the LuaSnip/ directory
  • Configure LSP servers in lua/configs/lsp.lua

⚙️ Customization

File-type Specific Features

  • LaTeX: Custom snippets, compilation shortcuts, and preamble templates
  • Markdown: Enhanced editing with live preview and table formatting
  • Python: REPL integration with Iron.nvim and debugging setup
  • TypeScript/React: Completion and refactoring tools

Custom Sources & Utilities

  • Custom CMP Sources: Located in lua/sources/
  • Helper Functions: Utility functions in lua/utils/
  • LaTeX Preambles: Template chunks in preamble/
  • Spell Checking: Custom dictionary words in spell/

Local Leader Mappings

The local leader (,) provides filetype-specific functionality:

LaTeX (,)

  • Compilation and viewing commands
  • Citation and reference tools
  • Custom environment insertion

Markdown (,)

  • Table formatting and navigation
  • Preview and export options
  • Link management

Debugging (,)

  • Breakpoint management
  • Step execution controls
  • Variable inspection

Neorg (,)

  • Task management
  • Journal entries
  • Note linking and organization

🎯 Philosophy

This configuration prioritizes:

  • Efficiency: Minimal keystrokes for common operations
  • Consistency: Logical keybinding patterns across contexts
  • Performance: Fast startup and responsive editing
  • Academic Workflow: Strong support for LaTeX and research writing
  • Extensibility: Easy customization and plugin integration

📚 Learning Resources

  • WhichKey Help: Press any leader key and wait 1.5s for contextual help
  • Telescope Commands: <Space>fk to browse all keymaps
  • Plugin Documentation: :help <plugin-name> for specific plugins

⚠️ Requirements & Assumptions

This configuration assumes familiarity with:

  • Vim/Neovim concepts (modes, buffers, windows, tabs)
  • Basic Lua scripting
  • Command-line tools and development workflows
  • LaTeX for academic writing features

Note: This is a personal configuration optimized for specific workflows. While comprehensive, it may require customization for your specific needs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published