Skip to content

Deohgu/Neovim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kickstart.nvim

Personal Neovim config.

Requirements for an Apple Silicon MacBook

Install the following packages using Homebrew:

brew install neovim ripgrep fzf sqlite fd black isort prettier stylua terraform
brew install --cask font-hack-nerd-font

Python Setup for Neovim

Create a dedicated virtual environment for Neovim:

# Create a virtual environment for Neovim
python3 -m venv ~/neovim_env

# Activate the environment
source ~/neovim_env/bin/activate

# Install the neovim package
pip install neovim

# Deactivate the environment
deactivate

Add this to your Neovim configuration (init.lua or similar):

-- Set the Python provider to use the dedicated Neovim environment
vim.g.python3_host_prog = vim.fn.expand('~/.config/nvim/neovim_env/bin/python')

Add the virtual environment to your global .gitignore:

echo "~/neovim_env/" >> ~/.gitignore

Node.js Setup

  1. Install nvm:
brew install nvm
  1. Add to your .zshrc:
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion"
  1. Install and use a Node.js version:
nvm install node  # Install the latest version
nvm use node      # Use the latest version
  1. Install the neovim npm package:
npm install -g neovim

Language Server Protocol (LSP) Setup

To set up LSP for various languages, you'll need to install language servers and configure them in Neovim. Here's an example for Python using Pyright:

  1. Install Pyright:
npm install -g pyright
  1. Add this to your Neovim configuration:
local lspconfig = require('lspconfig')

lspconfig.pyright.setup{
  settings = {
    python = {
      analysis = {
        autoSearchPaths = true,
        useLibraryCodeForTypes = true,
        diagnosticMode = "workspace"
      }
    }
  }
}

Repeat similar steps for other languages you work with.

Final Steps

After completing the setup:

  1. Restart Neovim
  2. Run :checkhealth to ensure everything is properly configured
  3. Address any remaining warnings or errors as needed

Remember to keep your Neovim and its plugins updated regularly for the best experience.