Skip to content

Latest commit

 

History

History
317 lines (251 loc) · 9.52 KB

File metadata and controls

317 lines (251 loc) · 9.52 KB

🚀 Neovim Configuration

A powerful, feature-rich Neovim configuration tailored for modern development

✨ Features

  • 🎨 Beautiful UI with transparent OneDark Pro theme
  • 🔍 Fuzzy Finding with Telescope and custom grep functionality
  • 🤖 AI-Powered Development with GitHub Copilot, Avante, and Claude Code
  • 🌳 Syntax Highlighting with Treesitter
  • 🔧 LSP Integration with auto-completion and diagnostics
  • 📁 File Management with Neo-tree (file explorer)
  • 📊 Custom Status Line with beautiful icons and information
  • Fast Performance with lazy loading
  • 🎯 Rails Development optimized with specific keymaps

🛠️ Installation

Prerequisites

  • Neovim >= 0.8
  • Git
  • Node.js (for LSP servers)
  • Ruby (for Rails development)
  • Ripgrep (for fast searching)

Quick Install

# Backup existing config (optional)
mv ~/.config/nvim ~/.config/nvim.backup

# Clone this configuration
git clone https://github.com/galulex/nvim.git ~/.config/nvim

# Start Neovim - plugins will auto-install
nvim

Manual Setup

  1. Install Neovim:

    # macOS
    brew install neovim
    
    # Ubuntu/Debian
    sudo apt install neovim
    
    # Arch Linux
    sudo pacman -S neovim
  2. Install dependencies:

    # Install ripgrep for fast searching
    brew install ripgrep chafa ctags fd typos-lsp # macOS
    sudo apt install ripgrep chafa ctags fd-find # Ubuntu
    
    # Install Node.js for LSP servers
    brew install node  # macOS
    curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
    sudo apt-get install -y nodejs  # Ubuntu
  3. Copy configuration:

    cp -r . ~/.config/nvim/
  4. Launch Neovim:

    nvim

📦 Plugins

🎨 UI & Appearance

🔍 Navigation & Search

🤖 AI & Completion

🌳 Language Support

🔧 Development Tools

🚄 Rails Specific

⌨️ Key Mappings

🔧 General

Key Mode Action
<leader> Space (leader key)
<D-s> Normal/Insert Save file
<D-a> Normal/Insert Select all
<D-c> Normal Copy to clipboard
<D-v> Normal/Insert/Command Paste from clipboard
<D-z> Normal/Insert Undo
<D-/> Normal/Visual Toggle comment

🚀 Navigation

Key Mode Action
<D-o> Normal Open file (Telescope)
<C-p> Normal Open file (Telescope)
<S-Tab> Normal Recent files
<D-S-o> Normal LSP references
<D-f> Normal/Visual Find text (grep)

📑 Tabs & Windows

Key Mode Action
<D-t> Normal New tab
<D-[> / <D-Up> Normal/Insert Previous tab
<D-]> / <D-Down> Normal/Insert Next tab
<D-w> Normal/Insert Close tab
<S-w> Normal Open directory of current file

🎯 Text Editing

Key Mode Action
< / > Visual Indent/outdent (keeps selection)
<C-Up> / <C-Down> Normal/Visual Move lines up/down
<M-Right> / <M-Left> Normal/Visual/Insert Move by word

🚄 Rails Development

Key Mode Action
gV Normal Go to view
gC Normal Go to controller
gM Normal Go to model
gH Normal Go to helper
gJ Normal Go to JavaScript
gS Normal Go to stylesheet

🎨 Neovide (GUI) Specific

Key Mode Action
<D-=> Normal Zoom in
<D--> Normal Zoom out
<D-0> Normal Reset zoom

🔧 Configuration Structure

~/.config/nvim/
├── init.lua                 # Entry point
├── lua/
│   ├── config/
│   │   ├── keymaps.lua     # Key mappings
│   │   ├── lazy.lua        # Plugin manager setup
│   │   ├── settings.lua    # Vim settings
│   │   └── tabline.lua     # Custom tabline
│   └── plugins/
│       ├── autopairs.lua   # Auto-close pairs
│       ├── avante.lua      # AI assistant (disabled)
│       ├── claude_code.lua # Claude Code integration
│       ├── cmp.lua         # Completion engine
│       ├── colorscheme.lua # Theme configuration
│       ├── copilot.lua     # GitHub Copilot
│       ├── gitsigns.lua    # Git integration
│       ├── lazygit.lua     # LazyGit integration
│       ├── lspconfig.lua   # LSP configuration
│       ├── lualine.lua     # Status line
│       ├── mason.lua       # LSP package manager
│       ├── neotree.lua     # File explorer
│       ├── noice.lua       # UI enhancements
│       ├── rails.lua       # Rails support
│       ├── telescope.lua   # Fuzzy finder
│       ├── treesitter.lua  # Syntax highlighting
│       └── ...
└── lazy-lock.json          # Plugin lock file

🎨 Theme & UI

  • Color Scheme: OneDark Pro with transparency
  • Font: Supports any Nerd Font for icons
  • Transparency: Enabled for modern look
  • Status Line: Custom with file progress, git status, and time
  • Icons: Extensive use of Nerd Font icons throughout

🔍 Search & Navigation

  • Telescope: Fuzzy finding with custom grep functionality
  • File Ignore: Automatically ignores common build/cache directories
  • Custom Grep: GrepCword command for searching current word
  • Visual Search: Select text and press <D-f> to search

🤖 AI Integration

GitHub Copilot

  • Tab: Accept suggestion
  • M-] / M-[: Next/previous suggestion
  • Integrated with completion engine

Claude Code

  • Vertical split terminal integration
  • 40% screen width allocation

Avante (Disabled)

  • Advanced AI assistant capabilities
  • Can be enabled by setting enabled = true in avante.lua

🚄 Rails Development

Optimized for Ruby on Rails development with:

  • LSP: Ruby LSP and Solargraph support
  • Auto-format: Ruby files on save
  • Quick Navigation: Rails-specific keymaps (gV, gC, gM, etc.)
  • Slim Templates: Syntax highlighting and support

🛠️ Customization

Adding New Plugins

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

    -- lua/plugins/my-plugin.lua
    return {
      "username/plugin-name",
      config = function()
        -- plugin configuration
      end
    }
  2. Restart Neovim - Lazy.nvim will auto-install

Changing Theme

Edit lua/plugins/colorscheme.lua:

return {
  "your-theme/nvim",
  config = function()
    vim.cmd("colorscheme your-theme")
  end
}

Custom Keymaps

Add to lua/config/keymaps.lua:

vim.keymap.set("n", "<your-key>", "<your-command>")

🐛 Troubleshooting

Plugin Issues

# Remove plugin cache
rm -rf ~/.local/share/nvim/lazy/

# Restart Neovim
nvim

LSP Not Working

# Check LSP servers
:Mason
# Install required servers: ruby-lsp, solargraph, etc.

Performance Issues

# Check startup time
nvim --startuptime startup.log

# Disable heavy plugins temporarily
# Edit respective plugin files and set enabled = false

📚 Resources

🤝 Contributing

Feel free to submit issues and enhancement requests!

📄 License

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


Happy coding! 🚀