-
Notifications
You must be signed in to change notification settings - Fork 0
macOS 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 macOS.
Before linking the configuration, ensure you have the following installed, primarily using Homebrew:
- Homebrew: The essential macOS package manager. Install it if you haven't already.
-
Neovim: Latest stable version (0.9+).
brew install neovim
-
Git: Required for cloning this repository and for
lazy.nvim. Usually comes with Xcode Command Line Tools, or install viabrew install git. -
C Compiler & Build Tools: Essential for
nvim-treesitter. Installing Xcode Command Line Tools usually suffices.(If that fails, you might need the full Xcode from the App Store, but try the command line tools first). Verifyxcode-select --install
clangorgccis available. -
Java Development Kit (JDK):
-
JDK 21 (or newer): Required to run the
jdtlsLanguage Server.brew install openjdk@21 # You might need to symlink it for system use if brew doesn't do it: # sudo ln -sfn /opt/homebrew/opt/openjdk@21/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-21.jdk # Verify 'java -version' points to 21+ or configure the path explicitly in init.lua if needed.
-
Target JDK(s): Install JDKs for your projects (e.g.,
brew install openjdk@8). Use/usr/libexec/java_home -Vto list installed JDKs and potentially setJAVA_HOMEin your shell profile (.zshrc,.bash_profile).
-
JDK 21 (or newer): Required to run the
-
Python: Install Python 3.x via Homebrew.
Ensure
brew install python3
python3andpip3are available. -
Nerd Font (Recommended): For UI icons.
Configure your terminal emulator (e.g., iTerm2, Terminal.app) to use the installed Nerd Font.
brew tap homebrew/cask-fonts brew install --cask font-YOUR-NERD-FONT-NAME # e.g., font-hack-nerd-font -
External Tools (Recommended):
brew install ripgrep # rg brew install fd # fd brew install p7zip # 7z (needed by mason.nvim for some packages)
-
Clone this Dotfiles Repository:
git clone <URL_OF_YOUR_DOTFILES_REPO> ~/dotfiles # Replace <URL_OF_YOUR_DOTFILES_REPO> and choose a local path (e.g., ~/dotfiles)
-
Backup/Remove Existing Neovim Config:
- Neovim's configuration typically lives at
~/.config/nvim. - If this directory exists, rename or delete it. Make a backup first!
# Optional: Backup existing config mv ~/.config/nvim ~/.config/nvim.bak
- Neovim's configuration typically lives at
-
Create Symbolic Link:
- Use the
ln -scommand to link the location Neovim expects (~/.config/nvim) to the configuration within your cloned repository:ln -s ~/dotfiles/mac/nvim ~/.config/nvim # IMPORTANT: Adjust ~/dotfiles/mac/nvim if you cloned the repo elsewhere or use a different structure.
- Use the
-
Launch Neovim:
- Run
nvimin your terminal.
- Run
-
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. Ensure the C compiler (clangorgcc) is found. - Run
:Masonto check the status of LSPs (jdtls,pyright) and formatters. Install any missing required tools. - Treesitter parsers for Java and Python should install automatically. Check with
:TSInstallInfo.
- On the first launch,
-
Compiler: Xcode Command Line Tools (
xcode-select --install) usually provideclang, which Treesitter should find. -
JDK Management: Ensure the JDK 21+ found by
brew install openjdk@21is the onejavapoints to, or add a specific handler ininit.lua(similar to Windows/Linux) to pointjdtlsdirectly to the executable path (e.g.,/opt/homebrew/opt/openjdk@21/bin/java). -
Clipboard: macOS clipboard integration with Neovim usually works out of the box (
pbcopy/pbpaste).
_Made with love and enthusiasm by vampirepapi_ ❤️🔥