A personal Neovim configuration built on packer.nvim, with LSP, completion, fuzzy finding, a file tree, and the Rose Pine theme.
- Neovim 0.12+, stable release. nvim-treesitter's
mainbranch needs 0.12+, and some plugins break on older nightly builds. - tree-sitter CLI and a C compiler, to build the treesitter parsers.
- clangd (for C/C++): it should come from the same LLVM version as the compiler your projects use. On macOS, the config uses Homebrew LLVM's clangd (
/opt/homebrew/opt/llvm/bin/clangd) if it's installed; otherwise it uses whicheverclangdis onPATH.
macOS:
brew install neovim tree-sitter-cli llvmUbuntu / Debian (the apt neovim package is often older than 0.12, so install a release from GitHub instead):
sudo apt install build-essential clangd
cargo install --locked tree-sitter-cli # or: npm install -g tree-sitter-cli- LSP via
nvim-lspconfig+mason.nvim+mason-lspconfig(auto-installs servers) - Completion with blink.cmp and
friendly-snippets - Fuzzy finding with Telescope
- File tree with nvim-tree
- Syntax highlighting with nvim-treesitter
- Quick file navigation with Harpoon
- Git integration with vim-fugitive
- Undo history with undotree
- AI completion with GitHub Copilot
-
Back up any existing config:
mv ~/.config/nvim ~/.config/nvim.bak
-
Clone this repo into your config directory:
git clone <your-repo-url> ~/.config/nvim
-
Install packer.nvim:
git clone --depth 1 https://github.com/wbthomason/packer.nvim \ ~/.local/share/nvim/site/pack/packer/start/packer.nvim -
Open Neovim and sync plugins:
nvim
Then run
:PackerSyncinside Neovim. Restart once it finishes — Mason will install the configured LSP servers (lua_ls,pyright,bashls,html,ts_ls, and more) on first launch.
.
├── init.lua # entry point — loads the mehdi module
├── lua/mehdi/
│ ├── init.lua # requires packer / remap / set, sets up nvim-tree
│ ├── packer.lua # plugin declarations
│ ├── remap.lua # general keymaps
│ └── set.lua # editor options
└── after/plugin/ # per-plugin keymaps & setup
├── telescope.lua
├── harpoon.lua
├── undotree.lua
├── fugitive.lua
├── treesitter.lua
└── colors.lua
Leader key is <Space>.
| Key | Action |
|---|---|
<leader>ff |
Format buffer (LSP) |
<leader>s |
Save file |
<leader>x |
Make current file executable |
<leader>rw |
Replace word under cursor |
<leader>p |
Paste over selection without yanking |
<leader>y |
Yank to system clipboard |
<leader>d |
Delete to void register |
J / K (visual) |
Move selected lines down / up |
<C-d> / <C-u> |
Half-page scroll, centered |
| Key | Action |
|---|---|
<leader>eo |
Open tree |
<leader>ec |
Close tree |
| Key | Action |
|---|---|
<leader>pf |
Find files |
<C-p> |
Find git files |
<leader>ps |
Grep for a string |
| Key | Action |
|---|---|
<leader>a |
Add file to Harpoon |
<C-e> |
Toggle quick menu |
<C-j>/<C-k>/<C-l>/<C-;> |
Jump to marked file 1–4 |
| Key | Action |
|---|---|
<leader>gt |
Open Fugitive (Git) |
<leader>u |
Toggle Undotree |
Released under the MIT License.