A modern, productive Neovim setup powered by LazyVim and a curated set of plugins for code navigation, Git integration, and more.
- โจ Features
- โก Requirements
- ๐ Installation
- ๐ ๏ธ First Steps
- ๐ค AI Features
- ๐ฅ Git Shortcuts
- ๐งญ Navigation Shortcuts
- ๐ Search & File Shortcuts
- ๐๏ธ Explorer Shortcuts
- ๐งโ๐ป LSP & Code Navigation
- ๐ฌ Commenting
- ๐ Table Formatting
- ๐ก Other Useful Shortcuts
- ๐ Troubleshooting
- ๐จ Customization
- ๐ Credits
- Fast startup and plugin management with LazyVim
- Powerful LSP integration and code navigation
- AI-powered code completion and assistance
- Git integration with handy shortcuts
- Fuzzy search and file explorer
- Easy commenting and table formatting
- Customizable keymaps for productivity
- Neovim >= 0.9
- git
- ripgrep (for searching)
- node.js (for some language servers)
- A Nerd Font (for icons)
- Terminal with true color support
# Clone the repository
git clone https://github.com/yourusername/neovim-config.git ~/.config/nvim
# Run setup script
cd ~/.config/nvim
scripts/setup.shAfter installation, open Neovim to automatically install plugins:
nvimWhen you first open Neovim, you'll want to:
:Lazyโ Manage plugins:Masonโ Manage LSP servers and tools:checkhealthโ Diagnose common issues:LazyExtrasโ Enable optional plugins
The leader key is set to <Space>. When you see <leader> in a keybinding, press Space followed by the specified key(s).
This configuration includes AI-powered assistance to supercharge your coding workflow and productivity.
GitHub Copilot is an AI pair programmer that offers real-time code suggestions directly in your editor.
- Real-time Suggestions: Receive context-aware code suggestions as you type
- Multilingual Support: Works across dozens of programming languages
- Complete Function Suggestions: Generates entire function implementations based on comments or function names
<M-CR>(Alt+Enter) โ Access the completion panel with alternative suggestions<C-l>(Ctrl+l) โ Accept current suggestion<M-[>/<M-]>โ Navigate between suggestions (previous/next)<C-]>โ Dismiss current suggestion<C-x><C-o>โ Trigger manual completion in case automatic suggestions don't appear
Copilot is configured through the copilot.lua plugin in lua/plugins/avante_ai.lua:
{
"zbirenbaum/copilot.lua",
event = "VeryLazy",
opts = {
enabled = true,
filetypes = {
markdown = true,
help = true,
-- Add other filetypes as needed
},
panel = {
enabled = true,
layout = {
position = "right",
ratio = 0.4,
},
},
suggestion = {
enabled = true,
auto_trigger = true,
debounce = 75,
},
},
}Avante.nvim is an AI-assisted coding experience enhancer that works alongside Copilot.
- Context-Aware Suggestions: Provides intelligent suggestions based on project context
- Semantic Understanding: Understands your codebase at a semantic level
- Seamless Integration: Works harmoniously with GitHub Copilot
- Avante works best when your project has consistent coding conventions
- It learns from your coding patterns over time
- For best results, maintain well-structured and documented code
- Missing Icons: Ensure you have a Nerd Font properly installed and configured
- Slow Suggestions: Check your internet connection and GitHub Copilot status
- No Suggestions: Verify your Copilot authentication with
:Copilot auth - Icons Not Displaying: Reload your configuration after ensuring Nerd Font is active
To get the most out of these AI features, ensure your GitHub Copilot subscription is active and authenticated with :Copilot auth.
<leader>gpโ Preview Git hunk<leader>grโ Reset Git hunk<leader>gRโ Reset Git buffer<leader>ggโ Open Neogit (commit/push/etc)<leader>gโ More Git commands
<leader>gbโ Blame line<leader>gdโ Diff file<leader>glโ View log
[g/]gโ Previous/Next Git hunk[w/]wโ Previous/Next warning[e/]eโ Previous/Next error[d/]dโ Previous/Next diagnostic[m/]mโ Previous/Next mark[f/]fโ Previous/Next functiongdโ Go to definitiongrโ Go to referencesggโ Go to top of fileGโ Go to end of file
<C-h>/<C-j>/<C-k>/<C-l>โ Navigate between windows<C-w>vโ Split window vertically<C-w>sโ Split window horizontally<C-w>cโ Close current window
<leader>ffโ Find file<leader>sgโ Grep content in files<leader>ssโ LSP symbol search<leader>srโ Search and replace<leader>sโ More search options
<leader>swโ Search word under cursor<leader>sbโ Search in open buffers<leader>shโ Search help tags<leader>sHโ Search command history
<leader>eโ Toggle file explorerdโ Delete fileyโ Yank file pathcโ Copy fileaโ Add filerโ Rename file<M-h>โ Toggle hidden files[g/]gโ Previous/Next changed Git file
gdโ Go to definitiongDโ Go to declarationgIโ Go to implementationgrโ Show referencesKโ Show documentation (hover)<leader>caโ Code actions<leader>crโ Rename symbol<leader>cfโ Format buffer or selection<leader>xโ Diagnostics/Quick fix<leader>ssโ Show LSP symbols
gccโ Toggle comment (line)gcโ Toggle comment (selection in visual mode)gcOโ Add comment on line abovegcoโ Add comment on line belowgcAโ Add comment at end of line
Align tables easily using Tabularize:
Before:
|start| eat| left |
| 12 | 5 | 7 |
| 20| 5 | 15 |
After running :Tabularize /| or <leader>t|:
| start | eat | left |
| 12 | 5 | 7 |
| 20 | 5 | 15 |
qโ Quit (mapped toq1)wโ Save file (mapped tow2)wqโ Save and quit (mapped towq1)<leader>qqโ Quit all<leader>nโ Notification history:vs file_pathโ Open file vertically:sp file_pathโ Open file horizontallygfโ Open file under cursorzzโ Center cursorzbโ Cursor at bottomztโ Cursor at top
-
Icons not displaying correctly
- Ensure you have installed a Nerd Font and configured your terminal to use it
- Check if your terminal supports Unicode characters
-
LSP not working
- Verify the language server is installed via
:Mason - Check for errors with
:LspInfoand:LspLog - Make sure necessary dependencies are installed for your language server
- Verify the language server is installed via
-
Plugin errors
- Run
:Lazyand check for any plugin errors - Use
:checkhealthfor diagnostics - Check
:messagesfor error details
- Run
If you encounter configuration issues:
- Try resetting your configuration:
rm -rf ~/.local/share/nvim/lazy - Start Neovim with minimal settings:
nvim -u NONE - Check for conflicting plugins in
lua/plugins/
Create a new file in the lua/plugins/ directory:
-- lua/plugins/my_plugins.lua
return {
{
"plugin-author/plugin-name",
config = function()
-- your config here
end,
},
}Edit your keymaps in lua/config/keymaps.lua:
-- lua/config/keymaps.lua
local keymap = vim.keymap.set
-- Add your custom keymaps
keymap("n", "<leader>x", "<cmd>YourCommand<cr>", { desc = "Your Command" })Add or modify theme configuration in lua/plugins/colorscheme.lua.
- LazyVim
- nvim-lspconfig
- Telescope
- Copilot.lua
- Avante.nvim
- And all plugin authors!