-
Notifications
You must be signed in to change notification settings - Fork 0
Windows Setup.md
Shubham Sourabh edited this page Apr 14, 2025
·
1 revision
This guide details the steps to set up the Neovim configuration from this repository on a Windows system (tested on Windows 11).
Before linking the configuration, ensure you have the following installed and configured:
-
Neovim: Latest stable version (0.9+). Install via
winget,scoop,choco, or download from the Neovim GitHub releases. Ensurenvim.exeis in your system PATH. -
Git: Required for cloning this repository and for
lazy.nvim. Install from git-scm.com. -
Visual Studio Build Tools: Essential for
nvim-treesitter.- Download "Build Tools for Visual Studio" from the Visual Studio Downloads page (under "Tools for Visual Studio").
- During installation, select the "Desktop development with C++" workload.
-
Java Development Kit (JDK):
-
JDK 21 (or newer): Required to run the
jdtlsLanguage Server. The configuration explicitly points to this JDK'sjava.exe. Find your JDK 21 path. -
Target JDK(s): Install any other JDKs needed for your projects (e.g., JDK 1.8). Your system
JAVA_HOMEcan point to this target JDK.
-
JDK 21 (or newer): Required to run the
-
Python: Install Python 3.x from python.org or the Microsoft Store. Ensure Python and
pipare added to your PATH during installation. - Nerd Font (Recommended): For UI icons. Download from Nerd Fonts, install (right-click -> Install for all users), and configure your terminal (e.g., Windows Terminal) to use it.
-
Terminal (Recommended): Windows Terminal provides a much better experience than default
cmd.exeor PowerShell windows. -
External Tools (Recommended): Install via
wingetorscoop:-
winget install BurntSushi.ripgrep(orscoop install ripgrep) - For Telescopelive_grep. -
winget install sharkdp.fd(orscoop install fd) - Improves Telescope file finding. -
winget install 7zip.7zip(orscoop install 7zip) - Required bymason.nvimfor some package installations.
-
-
Clone this Dotfiles Repository:
git clone <URL_OF_YOUR_DOTFILES_REPO> C:\path\to\your\dotfiles # Replace <URL_OF_YOUR_DOTFILES_REPO> and choose a local path
-
Backup/Remove Existing Neovim Config:
- Neovim's configuration lives at
%LOCALAPPDATA%\nvim(usuallyC:\Users\YourUsername\AppData\Local\nvim). - If this folder exists, rename or delete it. Make a backup first!
# Optional: Backup existing config Move-Item -Path $env:LOCALAPPDATA\nvim -Destination $env:LOCALAPPDATA\nvim.bak -ErrorAction SilentlyContinue
- Neovim's configuration lives at
-
Create Symbolic Link:
- Open PowerShell or Command Prompt as Administrator (Right-click -> Run as administrator).
- Run the
mklinkcommand to link the location Neovim expects to the configuration within your cloned repository:mklink /D "%LOCALAPPDATA%\nvim" "C:\path\to\your\dotfiles\windows\nvim" # IMPORTANT: Replace C:\path\to\your\dotfiles with the actual path where you cloned the repo.
- You should see a "symbolic link created" message.
-
Launch Neovim (IMPORTANT!):
- Due to how Visual Studio Build Tools sets up its environment, you MUST launch Neovim from the "Developer PowerShell for VS" or "Developer Command Prompt for VS" (find it in your Start Menu). This ensures
nvim-treesittercan find the C compiler (cl.exe). - Run
nviminside the Developer Prompt.
- Due to how Visual Studio Build Tools sets up its environment, you MUST launch Neovim from the "Developer PowerShell for VS" or "Developer Command Prompt for VS" (find it in your Start Menu). This ensures
-
Install Plugins & Tools:
- On the first launch,
lazy.nvimshould automatically start cloning plugins. Wait for this to complete. - Run
:Lazy syncto ensure everything is up-to-date. - Run
:checkhealthto verify the setup. Address any critical errors (other than expected warnings about missing optional tools/providers). - Run
:Masonto check the status of LSPs (jdtls,pyright) and formatters. Install any missing required tools (likestylua,black,isort,google-java-formatif you intend to use them withconform.nvim). - Treesitter parsers for Java and Python should install automatically (because of the
ensure_installedandauto_installsettings) now thatcl.exeis found. You can check with:TSInstallInfo.
- On the first launch,
-
cl.exe/ C Compiler Not Found: Launch Neovim from the Developer Prompt for VS. -
jdtlsRequires Java 21+ Error: The configuration inwindows/nvim/init.luaexplicitly sets thejava.exepath forjdtlsin thelspconfigsetup. Ensure this path points correctly to your actual JDK 21+ installation (not the Oraclejavapathsymlinks). -
Completion Not Working: Ensure
nvim-cmpis loaded (loads onInsertEnter). Use<C-Space>to trigger manually,<C-y>to accept. Check:Lazystatus and:messagesfor errors.
Use this PowerShell command to find the installation directory (avoid C:\Program Files\Common Files\Oracle\Java\javapath):
Get-ChildItem -Path "C:\Program Files\Java", "C:\Program Files" -Filter "jdk-21*" -Directory -Recurse -ErrorAction SilentlyContinue | Select-Object -ExpandProperty FullName
# Look for paths like C:\Program Files\Java\jdk-21.x.y _Made with love and enthusiasm by vampirepapi_ ❤️🔥