Lesson 18 of 19 ↓
- 1.Fedora + Distrobox + Arch + AUR Setup Guide
- 2.Enabling Hibernate on Linux
- 3.A Practical Git Workflow
- 4.Useful Linux Commands & Tips
- 5.Mirroring Your Android Screen with Scrcpy
- 6.Downloading Media with Yt-dlp
- 7.Consistent C/c++ Style with Clang-format
- 8.Auto-mounting Drives at Boot
- 9.Customizing Grub
- 10.Linux Swap Files Explained
- 11.Zram: Compressed Swap in Ram
- 12.Custom App Launch Behavior Via .desktop Files
- 13.Custom Mime Icons in Gnome
- 14.Fixing Missing Dock Icons (startupwmclass)
- 15.Installing Questasim for Hdl Simulation
- 16.Building Python 2 From Source
- 17.Auto-Starting WhatsApp and Telegram (Minimized or Tray)
- 18.Custom Neovim Configuration Guide
- 19.Running Windows Applications on Linux Seamlessly with WinBoat (Docker)
2 min read
Custom Neovim Configuration Guide
Setting up a modern, custom IDE environment with Neovim on Linux doesn't require starting completely from scratch. This guide details installing build and search dependencies on Fedora, leveraging Git sparse-checkout to extract a specific configuration directory from a repository, and deploying a Lazy.nvim-powered custom setup.
📦 Install Dependencies
Neovim and modern plugins (like Telescope or Treesitter) require system compilers and search tools to compile parsers and search through project files quickly. On Fedora, install these tools:
sudo dnf install -y gcc make git ripgrep fd-find unzip neovimgcc/make: Needed for compiling C/C++ parser libraries for syntax highlighting.ripgrep/fd-find: Highly optimized tools utilized by Telescope for live text and file searching.unzip: Required for extracting Language Server Protocol (LSP) servers and formatting tools.
🚀 Optional: Install Kickstart Base Config
If you want a minimal, single-file starting point to understand Neovim's Lua configuration API, you can clone kickstart.nvim as a base:
git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim🔥 Deploying the Custom Configuration
This custom Neovim configuration is structured to be modular and is managed inside a shared dotfiles repository. We can use a Git feature called sparse checkout to download only this directory, avoiding downloading unrelated dotfiles.
Step 1: Initialize Sparse Checkout
Clone the dotfiles repository without downloading the file contents immediately (--no-checkout), then configure Git to only download the Neovim configuration directory:
# Clone the repository structure
git clone --no-checkout git@github.com:abdallah-shehawey/dotfiles-linux.git
cd dotfiles-linux
# Enable sparse checkout in cone mode
git sparse-checkout init --cone
# Specify the target directory to checkout
git sparse-checkout set configs/nvim/nvim-config
# Checkout the files
git checkoutStep 2: Copy the Config to Home
Backup or delete any existing Neovim config directory first, then copy the folder to your user's config directory:
# Backup existing config (if any)
mv ~/.config/nvim ~/.config/nvim.backup 2>/dev/null
# Copy the new config
cp -r configs/nvim/nvim-config "$HOME/.config/nvim"Alternatively, you can move the folder directly:
mv configs/nvim/nvim-config "$HOME/.config/nvim"📂 Configuration Structure
Once installed at ~/.config/nvim, the configuration uses the standard layout:
init.lua: The entry point script, which sets up basic editor options, keymaps, and initializes the package manager (lazy.nvim).lua/: Contains custom modules, plugin lists, and LSP configs.after/: Directory for scripts loaded automatically after the main configuration, often used for filetype-specific settings.
Start Neovim:
nvimLazy.nvim will automatically launch and download all defined plugins, including syntax highlighters, autocomplete engines, file trees, and LSP servers.
Comments
Loading the discussion…