Skip to content

fredrkl/nvimsetup

Repository files navigation

My Neovim setup

Requirements

Nodejs is only needed for GitHub Copilot. Dotnet sdk is only needed for the Bicep LSP.

Setup

  • Install neovim
  • Install Nerdfonts
  • Fork this repo and clone it to your ~/.config/ folder
  • Start NeoVim
  • Run :checkhealth lazy for lazy vim plugin verification
  • Verify plugins by running the Lazy command
  • With rustup installed run rustup component add rust-analyzer

Sources

Mason Language Server Protocol (LSP) plugin manager

This plugin uses the Mason plugin to manage LSPs. See the mason github repo for available Mason LSP servers.

For the C# LSP, I use the roslyn.vim plugin. The Mason plugin is extended with the additional registries:

  • "github:mason-org/mason-registry"
  • "github:Crashdummyy/mason-registry"

I aim to use Homebrew and my dotfiles repo for installing the LSPs and linters where possible, as it is the most convenient way to install and update. Where it is not possible I use the Mason plugin to install and manage the LSPs.

Bicep Language Server Protocol (LSP)

The LSP for Bicep need dotnet cli to run, and is started with the cmd property. Please see the nvim-lspconfig.lua and the official lsp config for more information.

.NET LSP

We are using the roslyn.nvim plugin for .NET LSP support. The plugin is configured in the nvim-lspconfig.lua file. The plugin uses the netcoredbg tool for debugging, which is installed in the Debugger section below.

Remember to install the roslyn LSP through the Mast plugin:

:MasonInstall roslyn

Debugger

To setup debugger for .net we need the netcoredbg tool. Unfortunately, the netocredbg tool does not have a native M Chip version for macOS. To install the netcoredbg tool, follow the instructions below.

brew install cmake
xcode-select --install
git clone git@github.com:Samsung/netcoredbg.git $HOME/repos/netcoredbg
cd $HOME/repos/netcoredbg
mkdir build
cd build
mkdir /usr/local/bin/netcoredbg
CC=clang CXX=clang++ cmake -DCMAKE_INSTALL_PREFIX=/usr/local/bin/netcoredbg

GitHub Copilot

GitHub Copilot is a plugin that uses AI to help you write code. To use it, you need to have a GitHub account and be logged in to GitHub in your browser. See the neovim copliot plugin repo for more information, e.g., default keybindings. The copliot plugin uses the meta key by default, however that has been remapped in this settup to avoid meta key usage. See the plugin setup for the new keybindings.

If using iTerm2 on macOS, the meta key is not enabled by default. To enable it, go to Preferences > Profiles > Keys and select Left option key acts as +Esc.

Tmux

This neovim setup works well with tmux. I have created a tmux setup that works well with this neovim setup.

Rest

In order to get Rest.nvim to work, you need to have Python installed.

RipGrep

In order to use the grep telescope file search you need to install ripgrep:

brew install ripgrep

Throubleshooting

If the markdown preview is not working, try to run the following in its plugin folder.

yarn install

The plugin folder is located in ~/.local/share/nvim/lazy/markdown-preview.nvim.

Tips

It can be beneficial to remap Caps Lock key to the Ctrl key. The Ctrl is used a lot in neovim, and it is easier to reach the Caps Lock key using the home row.

CHANGELOG

About

My Neovim setup.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages