Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Andhar7/nvim

Repository files navigation

🚀 Neovim Configuration

A modern, feature-rich Neovim configuration built with lazy.nvim plugin manager, designed for efficient development workflows.

✨ Features

  • 🎨 Beautiful UI: Tokyo Night color scheme with custom transparency and colors
  • 🔍 Fuzzy Finding: FZF integration for files, buffers, and more
  • 🌳 File Explorer: NvimTree for intuitive file management
  • 📝 Language Support: LSP configuration for multiple languages
  • 🔧 Auto-completion: Comprehensive completion with nvim-cmp
  • 🐛 Debugging: Built-in DAP (Debug Adapter Protocol) support
  • 🎯 Syntax Highlighting: TreeSitter for advanced syntax highlighting
  • 🚦 Git Integration: Gitsigns and Fugitive for version control
  • 🔗 Tmux Integration: Seamless navigation between Nvim and Tmux panes
  • 🎛️ Status Line: Custom Lualine configuration

📁 Project Structure

~/.config/nvim/
├── init.lua                    # Entry point
├── lazy-lock.json             # Plugin version lock file
├── lua/
│   ├── config/                # Core configuration
│   │   ├── autocmds.lua       # Auto commands
│   │   ├── globals.lua        # Global variables
│   │   ├── keymaps.lua        # Key mappings
│   │   ├── lazy.lua           # Plugin manager setup
│   │   └── options.lua        # Neovim options
│   ├── plugins/               # Plugin configurations
│   │   ├── colorscheme.lua    # Tokyo Night theme
│   │   ├── fzf-lua.lua        # Fuzzy finder
│   │   ├── nvim-cmp.lua       # Auto-completion
│   │   ├── nvim-lspconfig.lua # LSP configuration
│   │   ├── nvim-tree.lua      # File explorer
│   │   ├── nvim-treesitter.lua# Syntax highlighting
│   │   └── ...                # Other plugins
│   ├── servers/               # LSP server configurations
│   │   ├── bashls.lua         # Bash LSP
│   │   ├── clangd.lua         # C/C++ LSP
│   │   ├── gopls.lua          # Go LSP
│   │   ├── pyright.lua        # Python LSP
│   │   ├── ts_ls.lua          # TypeScript LSP
│   │   └── ...                # Other language servers
│   └── utils/                 # Utility modules
│       ├── diagnostics.lua    # Diagnostic configuration
│       └── lsp.lua            # LSP utilities
└── README.md                  # This file

🛠️ Installation

Prerequisites

  • Neovim >= 0.9.0
  • Git
  • Node.js (for some LSP servers)
  • ripgrep (for better search performance)
  • fd (optional, for faster file finding)

Install Neovim

macOS

brew install neovim

Ubuntu/Debian

sudo apt update
sudo apt install neovim

Arch Linux

sudo pacman -S neovim

Install Dependencies

# Install ripgrep and fd
brew install ripgrep fd              # macOS
sudo apt install ripgrep fd-find     # Ubuntu/Debian
sudo pacman -S ripgrep fd            # Arch Linux

# Install Node.js (if not already installed)
brew install node                    # macOS
sudo apt install nodejs npm          # Ubuntu/Debian
sudo pacman -S nodejs npm            # Arch Linux

Setup Configuration

  1. Backup existing configuration (if any):

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

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

    nvim
  4. Wait for plugins to install - lazy.nvim will automatically install all plugins on first launch.

⚙️ Configuration Overview

Core Settings

  • Line numbers: Enabled with relative numbering
  • Indentation: 2 spaces, smart indenting
  • Search: Case-insensitive with smart case
  • Clipboard: Integrated with system clipboard
  • Undo: Persistent undo history
  • Folding: TreeSitter-based folding

Key Mappings

Leader Key

The leader key is set to <Space> (space bar).

Navigation

Key Action
<C-h/j/k/l> Navigate between windows
<C-d>/<C-u> Half page down/up (centered)
n/N Next/previous search result (centered)
<leader>bn/<leader>bp Next/previous buffer

File Management

Key Action
<leader>e Toggle file explorer
<leader>m Focus file explorer
<leader>rc Edit config file

Window Management

Key Action
<leader>sv/<leader>sh Split vertically/horizontally
<C-Up/Down/Left/Right> Resize windows

Editing

Key Action
J Join lines (keep cursor position)
</> (visual) Indent and reselect

🔧 Language Support

Supported Languages

  • Bash - bashls
  • C/C++ - clangd
  • Docker - dockerls
  • Go - gopls
  • JavaScript/TypeScript - ts_ls
  • JSON - jsonls
  • Lua - lua_ls
  • Python - pyright
  • Solidity - solidity_ls_nomicfoundation
  • Tailwind CSS - tailwindcss
  • YAML - yamlls

Features

  • Auto-completion with context-aware suggestions
  • Diagnostics with inline error/warning display
  • Go to definition/references
  • Hover documentation
  • Code formatting
  • Refactoring support

🎨 Plugins

Core Plugins

Plugin Description
lazy.nvim Modern plugin manager
tokyonight.nvim Beautiful color scheme
nvim-lspconfig LSP configuration
nvim-cmp Auto-completion engine
nvim-treesitter Syntax highlighting

Utility Plugins

Plugin Description
fzf-lua Fuzzy finder
nvim-tree File explorer
gitsigns.nvim Git integration
vim-fugitive Git commands
lualine.nvim Status line
trouble.nvim Diagnostics list
nvim-dap Debug adapter protocol

Development Plugins

Plugin Description
mini.nvim Collection of minimal plugins
ccc.nvim Color picker and highlighter
tailwind-tools.nvim Tailwind CSS utilities
vim-tmux-navigator Tmux integration

🎯 Customization

Adding New Plugins

  1. Create a new file in lua/plugins/ directory:

    -- lua/plugins/my-plugin.lua
    return {
      "author/plugin-name",
      config = function()
        -- Plugin configuration here
      end,
    }
  2. Restart Neovim - lazy.nvim will automatically install the new plugin.

Adding New Language Servers

  1. Create a new file in lua/servers/ directory:

    -- lua/servers/mylang.lua
    return {
      settings = {
        -- Language server specific settings
      },
    }
  2. Add the server to your LSP configuration.

Modifying Key Mappings

Edit lua/config/keymaps.lua to add or modify key mappings:

vim.keymap.set("n", "<leader>my", "<Cmd>MyCommand<CR>", { desc = "My custom command" })

🔧 Troubleshooting

Common Issues

  1. Plugins not loading: Run :Lazy sync to update plugins
  2. LSP not working: Check if language server is installed: :LspInfo
  3. Treesitter errors: Update parsers: :TSUpdate
  4. Performance issues: Check health: :checkhealth

Health Check

Run comprehensive health check:

:checkhealth

Plugin Management

:Lazy                 " Open plugin manager
:Lazy sync           " Update all plugins
:Lazy clean          " Remove unused plugins
:Lazy profile        " View startup performance

📚 Learning Resources

🤝 Contributing

Feel free to submit issues and enhancement requests! To contribute:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

📄 License

This configuration is open source and available under the MIT License.


Happy coding with Neovim! 🎉

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages