A modern, comprehensive Neovim configuration built with Lua, optimized for Python, Django, and Web Development. Features advanced LSP support, debugging, testing, project management, and professional development workflows.
- Tokyo Night colorscheme with custom transparency support
- Alpha Dashboard with beautiful ASCII art and quick actions
- Lualine status line with file info and git integration
- Bufferline for elegant tab management
- Indent Blankline for visual indentation guides
- Relative line numbers for efficient navigation
- Mason for automatic LSP server management
- nvim-lspconfig with pre-configured servers:
- Python (Pyright + Ruff LSP) - Advanced Python development with type checking
- TypeScript/JavaScript - Full featured development
- Lua (lua_ls) - Neovim configuration optimized
- HTML/CSS - Web development essentials with Django template support
- TailwindCSS - Utility-first CSS framework
- Svelte - Modern web framework support
- GraphQL - API development
- Emmet - HTML/CSS expansion
- Prisma - Database ORM support
- ESLint - JavaScript/TypeScript linting
- Diagnostics with custom icons and error handling
- Go to definition/references with Telescope integration
- nvim-cmp autocompletion with multiple sources:
- LSP completion
- GitHub Copilot integration
- File path completion
- Buffer text completion
- Snippet expansion
- LuaSnip with friendly snippets
- Treesitter syntax highlighting for 20+ languages
- Code actions and smart renaming
- Incremental selection with Treesitter
- Telescope with multiple pickers:
- File finder (
<leader>ff) - Live grep (
<leader>fs) - Recent files (
<leader>fr) - Grep under cursor (
<leader>fc) - Todo comments (
<leader>ft) - Keymaps (
<leader>fk)
- File finder (
- FZF native for improved performance
- Neo-tree modern file explorer with:
- Git integration and status indicators
- Custom icons and advanced UI
- Fuzzy finder integration
- Multiple views (filesystem, buffers, git)
- Project.nvim for intelligent project detection
- Auto-session for project session management
- Overseer task runner for development workflows
- ToggleTerm integrated terminal with custom configurations
- Auto-pairs for bracket completion
- Surround for text object manipulation
- Comment.nvim for smart commenting
- Substitute for improved search/replace
- Todo Comments highlighting and navigation
- Vim Maximizer for window management
- Conform.nvim formatting with:
- Ruff (modern Python formatter/linter)
- Prettier for web technologies
- Stylua for Lua
- Format on save enabled
- nvim-lint with comprehensive linters:
- MyPy for Python type checking
- Flake8 for Python style guide enforcement
- Bandit for Python security analysis
- Auto-linting on file events
- Python Configuration System:
- Smart virtual environment detection
- Project type detection (Django, Flask, FastAPI)
- Python executable resolution
- Django Integration:
- Auto-detection of Django projects
- Django template file type support (
htmldjango) - Model/View/URL generators with keymaps
- Management commands (runserver, migrate, shell, test)
- Virtual Environment Management:
- VenvSelector for easy environment switching
- Swenv alternative environment manager
- Python REPL & Debugging:
- Iron.nvim with Django shell integration
- nvim-dap-python for debugging with breakpoints
- Neotest for running and debugging tests
- Custom configurations for Django, Flask, FastAPI
- Emmet for HTML/CSS expansion
- Auto-tag closing for HTML/JSX/TSX
- Color picker and preview (CCC.nvim)
- Live server (Bracey) for real-time preview
- Package.json management with version info
- REST client for API testing
- Database integration (DadBod UI)
- Markdown preview for documentation
- LazyGit integration for git operations
- Diffview for advanced git diff viewing
- Trouble for diagnostics and quickfix management
- Spectre for advanced search and replace
-
Neovim 0.9+
# macOS brew install neovim # Ubuntu/Debian sudo apt install neovim # Arch Linux sudo pacman -S neovim
-
Git (for plugin management)
-
Node.js 16+ (for LSP servers and web tools)
-
Python 3.8+ (for Python LSP and linting)
-
Ripgrep (for Telescope grep)
# macOS brew install ripgrep # Ubuntu/Debian sudo apt install ripgrep # Arch Linux sudo pacman -S ripgrep
-
Optional but Recommended:
- LazyGit for git operations:
brew install lazygit - FZF for enhanced fuzzy finding:
brew install fzf - fd for faster file finding:
brew install fd
- LazyGit for git operations:
-
Backup existing configuration (if any):
mv ~/.config/nvim ~/.config/nvim.backup
-
Clone this configuration:
git clone https://github.com/yourusername/nvim-config ~/.config/nvim -
Install external dependencies:
# Install Node.js formatters npm install -g prettier eslint # Install Python development tools pip install ruff black isort mypy bandit debugpy # Install Stylua (Lua formatter) # macOS brew install stylua # Ubuntu/Debian sudo apt install stylua # Or download from releases: https://github.com/JohnnyMorganz/StyLua/releases # Optional: Install additional Python tools pip install ipython jupyter # Enhanced Python REPL
-
Launch Neovim:
nvim
-
Plugin installation:
- Lazy.nvim will automatically install all plugins on first launch
- LSP servers will be automatically installed via Mason
- Wait for all installations to complete
| Key | Action | Description |
|---|---|---|
<Space> |
Leader key | Main leader key |
jk |
<ESC> |
Exit insert mode |
<leader>nh |
Clear highlights | Clear search highlights |
<leader>+ |
Increment number | Increment number under cursor |
<leader>- |
Decrement number | Decrement number under cursor |
| Key | Action | Description |
|---|---|---|
<leader>sv |
Split vertically | Split window vertically |
<leader>sh |
Split horizontally | Split window horizontally |
<leader>se |
Equalize splits | Make split windows equal size |
<leader>sx |
Close split | Close current split window |
| Key | Action | Description |
|---|---|---|
<leader>to |
New tab | Open new tab |
<leader>tx |
Close tab | Close current tab |
<leader>tn |
Next tab | Go to next tab |
<leader>tp |
Previous tab | Go to previous tab |
<leader>tf |
Tab from buffer | Open current buffer in new tab |
| Key | Action | Description |
|---|---|---|
<leader>e |
Toggle explorer | Toggle Neo-tree file explorer |
<leader>o |
Focus explorer | Focus Neo-tree |
| Key | Action | Description |
|---|---|---|
<leader>ff |
Find files | Fuzzy find files in cwd |
<leader>fr |
Recent files | Fuzzy find recent files |
<leader>fs |
Live grep | Find string in cwd |
<leader>fc |
Grep cursor | Find string under cursor |
<leader>ft |
Find todos | Find todo comments |
<leader>fk |
Find keymaps | Show all keymaps |
| Key | Action | Description |
|---|---|---|
gR |
Show references | Show LSP references |
gD |
Go to declaration | Go to declaration |
gd |
Show definitions | Show LSP definitions |
gi |
Show implementations | Show LSP implementations |
gt |
Type definitions | Show LSP type definitions |
<leader>ca |
Code actions | See available code actions |
<leader>rn |
Rename | Smart rename |
<leader>D |
Buffer diagnostics | Show buffer diagnostics |
<leader>d |
Line diagnostics | Show line diagnostics |
[d |
Previous diagnostic | Go to previous diagnostic |
]d |
Next diagnostic | Go to next diagnostic |
K |
Hover documentation | Show documentation |
<leader>rs |
Restart LSP | Restart LSP server |
| Key | Action | Description |
|---|---|---|
<C-k> |
Previous item | Previous completion item |
<C-j> |
Next item | Next completion item |
<C-b> |
Scroll docs up | Scroll documentation up |
<C-f> |
Scroll docs down | Scroll documentation down |
<C-Space> |
Complete | Show completion suggestions |
<C-e> |
Abort | Close completion window |
<CR> |
Confirm | Confirm selection |
| Key | Action | Description |
|---|---|---|
<leader>pr |
Run Python file | Execute current Python file |
<leader>pa |
Activate venv | Activate virtual environment |
<leader>cv |
Select virtual env | Choose virtual environment |
<leader>dr |
Django runserver | Start Django development server |
<leader>ds |
Django shell | Open Django shell |
<leader>dt |
Django test | Run Django tests |
<leader>dM |
Django makemigrations | Create Django migrations |
<leader>dmi |
Django migrate | Apply Django migrations |
<leader>dm |
Create Django model | Generate Django model template |
<leader>dv |
Create Django view | Generate Django view template |
<leader>du |
Add Django URL | Add Django URL pattern |
| Key | Action | Description |
|---|---|---|
<leader>tt |
Run nearest test | Run test under cursor |
<leader>tf |
Run file tests | Run all tests in current file |
<leader>td |
Debug nearest test | Debug test under cursor |
<leader>ts |
Toggle test summary | Show/hide test results |
<leader>to |
Show test output | Display test output |
<F5> |
Start debugging | Start DAP debugger |
<F10> |
Step over | Debug step over |
<F11> |
Step into | Debug step into |
<F12> |
Step out | Debug step out |
<leader>b |
Toggle breakpoint | Set/remove breakpoint |
| Key | Action | Description |
|---|---|---|
<leader>is |
Start/Toggle REPL | Open Iron REPL |
<leader>ir |
Restart REPL | Restart REPL |
<leader>sc |
Send code to REPL | Send selection/motion to REPL |
<leader>sf |
Send file to REPL | Send entire file to REPL |
<leader>sl |
Send line to REPL | Send current line to REPL |
<leader>tf |
Toggle float term | Open floating terminal |
<leader>th |
Toggle horizontal | Open horizontal terminal |
<leader>tv |
Toggle vertical | Open vertical terminal |
<leader>gg |
Toggle LazyGit | Open LazyGit interface |
<leader>tp |
Toggle Python REPL | Open Python REPL in terminal |
| Key | Action | Description |
|---|---|---|
<leader>cp |
Color picker | Open color picker |
<leader>ct |
Convert color | Convert color format |
<leader>ch |
Toggle color highlight | Toggle color highlighting |
<leader>bs |
Start live server | Start Bracey live server |
<leader>bq |
Stop live server | Stop live server |
<leader>br |
Reload live server | Reload live server |
<leader>rr |
Run REST request | Execute HTTP request |
<leader>rl |
Run last request | Re-run last HTTP request |
<leader>db |
Toggle Database UI | Open/close database interface |
<leader>mp |
Markdown preview | Toggle markdown preview |
| Key | Action | Description |
|---|---|---|
<leader>fp |
Find projects | Search and switch projects |
<leader>ot |
Toggle task runner | Open Overseer task runner |
<leader>or |
Run task | Execute project task |
<leader>oa |
Quick task action | Quick task management |
<leader>S |
Open Spectre | Advanced search and replace |
<leader>sw |
Search current word | Search word under cursor |
<leader>sf |
Search in file | Search within current file |
| Key | Action | Description |
|---|---|---|
<leader>gd |
Open Diffview | View git diff |
<leader>gc |
Close Diffview | Close git diff view |
| Key | Action | Description |
|---|---|---|
<leader>mp |
Format | Format file or range |
<leader>l |
Lint | Trigger linting for current file |
| Key | Action | Description |
|---|---|---|
<C-space> |
Init/expand selection | Start or expand selection |
<bs> |
Shrink selection | Shrink selection |
~/.config/nvim/
├── init.lua # Entry point
├── lazy-lock.json # Plugin version lock file
├── README.md # This documentation
├── lua/kling/
│ ├── core/
│ │ ├── init.lua # Core module loader
│ │ ├── keymaps.lua # Global key mappings
│ │ └── options.lua # Neovim options
│ ├── lazy.lua # Lazy.nvim setup
│ ├── python-config.lua # Python utilities and configuration
│ └── plugins/
│ ├── init.lua # Plugin loader
│ ├── alpha.lua # Dashboard
│ ├── auto-session.lua # Session management
│ ├── autopairs.lua # Auto bracket pairing
│ ├── bufferline.lua # Tab bar
│ ├── colorscheme.lua # Tokyo Night theme
│ ├── comment.lua # Smart commenting
│ ├── copilot.lua # GitHub Copilot integration
│ ├── dap-python.lua # Python debugging
│ ├── django.lua # Django development tools
│ ├── dressing.lua # UI improvements
│ ├── formatting.lua # Code formatting
│ ├── indent-blankline.lua # Indentation guides
│ ├── iron.lua # REPL integration
│ ├── lazygit.lua # Git integration
│ ├── linting.lua # Code linting
│ ├── lualine.lua # Status line
│ ├── neogen.lua # Documentation generation
│ ├── neotest.lua # Testing framework
│ ├── nvim-cmp.lua # Autocompletion
│ ├── nvim-dap.lua # Debug Adapter Protocol
│ ├── nvim-tree.lua # File explorer
│ ├── project-management.lua # Project tools
│ ├── substitute.lua # Search/replace
│ ├── surround.lua # Text objects
│ ├── telescope.lua # Fuzzy finder
│ ├── todo-comments.lua # Todo highlighting
│ ├── treesitter.lua # Syntax highlighting
│ ├── trouble.lua # Diagnostics panel
│ ├── venv-selector.lua # Virtual environment management
│ ├── vim-maximizer.lua # Window management
│ ├── web-dev.lua # Web development tools
│ └── lsp/
│ ├── lspconfig.lua # LSP configuration
│ └── mason.lua # LSP server management
The configuration uses Tokyo Night with custom transparency. To modify:
-- In lua/kling/plugins/colorscheme.lua
local transparent = true -- Toggle transparency
-- Modify colors in the on_colors function-
Automatic installation via Mason (recommended):
-- In lua/kling/plugins/lsp/mason.lua ensure_installed = { "lua_ls", "pyright", "ruff_lsp", "your_new_server", -- Add here }
-
Manual configuration:
-- In lua/kling/plugins/lsp/lspconfig.lua lspconfig.your_server.setup({ capabilities = capabilities, -- Your specific configuration })
-- In lua/kling/plugins/formatting.lua
formatters_by_ft = {
python = { "ruff_format", "ruff_organize_imports" },
javascript = { "prettier" },
your_filetype = { "your_formatter" },
}Add to lua/kling/core/keymaps.lua:
keymap.set("n", "<leader>your_key", "<cmd>YourCommand<CR>", { desc = "Your description" })- Check server installation:
:Mason - Restart LSP:
<leader>rs - Check logs:
:LspLog - Python-specific issues:
- Ensure correct Python interpreter:
<leader>cvto select virtual env - Check if Pyright is using correct Python:
:LspInfo - Restart after changing virtual environment
- Ensure correct Python interpreter:
- Update plugins:
:Lazy update - Clean and reinstall:
:Lazy cleanthen restart Neovim - Check plugin status:
:Lazy - Profile startup time:
:Lazy profile
- Check startup time:
nvim --startuptime startup.log - Profile plugins:
:Lazy profile
-
Virtual Environment Not Detected:
- Use
<leader>cvto manually select environment - Check if venv is in standard locations (venv/, .venv/, env/)
- Ensure Python executable is accessible
- Use
-
Django Features Not Working:
- Ensure
manage.pyexists in project root - Django commands require proper virtual environment
- Check if Django is installed:
python -m django --version
- Ensure
-
Debugging Issues:
- Install debugpy:
pip install debugpy - Check DAP configuration:
:lua =vim.tbl_keys(require('dap').configurations.python)
- Install debugpy:
- Check if formatter is installed: Run formatter command in terminal
- Check conform setup:
:ConformInfo - Python formatting: Ensure
ruffis installed:pip install ruff
- Neovim Documentation
- Lua Guide for Neovim
- LSP Configuration
- Telescope Documentation
- Treesitter Documentation
- Python LSP Guide
- Django Documentation
- Ruff Formatter/Linter
- Python Debugging with DAP
- Testing with Neotest
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This configuration is open source and available under the MIT License.
This configuration is built upon the excellent work of the Neovim community and the following plugin authors:
- folke - Tokyo Night, Lazy.nvim, Trouble, and many other plugins
- nvim-telescope - Telescope ecosystem
- nvim-treesitter - Treesitter integration
- hrsh7th - nvim-cmp and related plugins
- mfussenegger - nvim-dap, nvim-lint, nvim-dap-python
- stevearc - conform.nvim, overseer.nvim
- linux-cultist - venv-selector.nvim
- nvim-neotest - Testing framework
- Vigemus - Iron.nvim REPL integration
- GitHub Copilot - AI-powered code completion
- And many others in the Neovim ecosystem
- Professional Python Development: Comprehensive Django support with project detection
- Modern Tooling: Ruff LSP for fast Python linting and formatting
- Advanced Debugging: Full DAP integration with Python, Django, Flask, FastAPI configurations
- Intelligent Virtual Environment Management: Automatic detection and switching
- Web Development Ready: Complete toolchain for modern web development
- Project-Aware: Smart project detection and management
Happy coding! 🎉