Skip to content

Repository files navigation

My Neovim Config

Personal Neovim configuration focused on a small, practical Lua setup for daily development. It uses lazy.nvim for plugin management, blink.cmp for completion, built-in Neovim LSP, Treesitter, Telescope, Git tooling, snippets, and a few workflow helpers.

Requirements

  • Neovim, preferably the latest stable release.
  • Git, curl, unzip, make, and a C/C++ build toolchain.
  • Node.js and npm for JavaScript/TypeScript-related language tooling.
  • Rust/Cargo for tree-sitter-cli and stylua installation.
  • Python/pip for Python tooling and the Neovim Python provider.
  • fd and ripgrep for fast file search and grep.
  • A Nerd Font. The install script installs Hack Nerd Font.

Installation

Clone this repository into your Neovim config directory:

git clone <repo-url> ~/.config/nvim
cd ~/.config/nvim
./install_nvim.sh

The install script is Linux-oriented. It installs or checks for Neovim, Rust/Cargo, Tree-sitter CLI, Stylua, npm language tools, Python tools, fd, ripgrep, black, flake8, and Hack Nerd Font.

Plugins are bootstrapped automatically through lazy.nvim when Neovim starts.

Project Layout

  • init.lua loads the user config entrypoint.
  • lua/user/config/ contains core setup: lazy.nvim bootstrap, settings, mappings, globals, and autocmds.
  • lua/user/plugins/ contains plugin specs loaded by lazy.nvim.
  • lua/user/lsp/ contains the LSP setup and server-specific overrides.
  • snippets/ contains VS Code-style snippets loaded by LuaSnip.
  • utilities/ contains helper scripts used by install_nvim.sh.

Core Features

  • Lazy-loaded plugin setup with lazy.nvim.
  • Completion through blink.cmp with LSP, path, snippets, and buffer sources.
  • VS Code-style snippets through LuaSnip from the local snippets/ directory.
  • Built-in LSP setup with document highlights, diagnostics, completion capabilities, and format-on-save when supported by the server.
  • Treesitter parsers for Rust, JavaScript, TypeScript, Lua, C, C++, CSS, SCSS, Bash, Python, HTML, Fish, JSON, Go, Make, Markdown, YAML, Vim, and Vimdoc.
  • Telescope file, grep, buffer, and help search with telescope-fzf-native.
  • Oil file explorer replacing netrw.
  • Git signs, Fugitive commands, and inline git blame.
  • Harpoon 2 quick file navigation.
  • Auto pairs, auto tags, and commenting helpers.
  • Onedark colorscheme plus ThemeSwitch integration.

Language Servers

Configured LSP servers:

  • lua_ls
  • cssls
  • emmet_ls
  • jsonls
  • markdown_oxide
  • pyright
  • bashls
  • rust_analyzer
  • tailwindcss
  • ts_ls
  • gopls
  • astro

Custom server config files currently exist for lua_ls, cssls, jsonls, and rust_analyzer under lua/user/lsp/servers/.

Plugins

Key Mappings

Most keymaps are defined in lua/user/config/mappings.lua and plugin-specific files.

  • jk in insert mode leaves insert mode.
  • J / K in visual mode move the selected lines down/up.
  • n / N keep search results centered.
  • <C-d> / <C-u> keep half-page scrolling centered.
  • <leader>w writes the current buffer.
  • <leader>we writes and sources the current file.
  • <Tab> / <S-Tab> cycle buffers.
  • <leader>b wipes the current buffer.
  • <leader>p pastes over a visual selection without replacing the default register.
  • < / > in visual mode indent and keep the selection active.
  • <leader>o formats the current buffer with LSP.
  • <leader>l formats the visual selection with LSP.
  • <leader>t toggles Undotree.
  • <M-j> / <M-k> move through the quickfix list.
  • gd / gD jump to definition/declaration.
  • <C-k> shows LSP signature help.
  • [d jumps to the next diagnostic with a float.
  • ga opens LSP code actions.
  • gl opens diagnostics in a rounded float.

Plugin Key Mappings

  • <leader>f opens Telescope file search.
  • <leader>sg opens Telescope live grep.
  • <leader>fb opens Telescope buffers.
  • <leader>fh opens Telescope help tags.
  • - opens Oil in the current directory.
  • <leader>- toggles Oil float.
  • <leader>a adds the current file to Harpoon.
  • <C-e> toggles the Harpoon quick menu.
  • <leader>1 through <leader>4 jump to Harpoon entries.
  • <C-S-P> / <C-S-N> move to previous/next Harpoon entries.
  • <leader>gs opens Fugitive Git status.
  • <leader>gD opens Fugitive 3-way diff split.
  • <leader>gc starts a Git commit.
  • <leader>gC starts git commit --amend.
  • <leader>gp runs Git pull.
  • <leader>gS stashes all changes.

Formatting

  • Lua formatting is configured with stylua.toml.
  • LSP formatting runs automatically before save for servers that advertise formatting support.
  • Manual formatting is available with <leader>o for the current buffer and <leader>l for a visual range.

Inspirations

  1. ThePrimeagen
  2. jdhao

Releases

Packages

Used by

Contributors

Languages