Skip to content

mosmuell/nvim_config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Personal Neovim Config

This repository contains my personal neovim configuration I use on a daily basis. It is based off nvim-basic-ide and customised to my needs.

All the included plugins are pinned to a version that ensures they are compatible and will not update potentially introducing errors into your config.

Install Neovim 0.9

You can install Neovim with your package manager e.g. brew, apt, dnf, pacman etc.. but remember that when you update your packages Neovim may be upgraded to a newer version.

If you would like to make sure Neovim only updates when you want it to than I recommend installing from source:

NOTE Verify the required build prerequisites for your system.

git clone https://github.com/neovim/neovim.git
cd neovim
git checkout release-0.9
make CMAKE_BUILD_TYPE=Release
sudo make install

Install the latest node-js

For some things to work, you need a recent version of node. You can normally install it using your package manager.

On Ubuntu, however, the version will not be recent enough. You can update it using npm:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

Installation

Clone this repository to the ~/.config/nvim directory. Make sure to save or backup your old configuration beforehand.

git clone https://github.com/mosmuell/nvim_config.git ~/.config/nvim

Then, run nvim and wait for the plugins to be installed.

NOTE (You will notice treesitter pulling in a bunch of parsers the next time you open Neovim)

NOTE Checkout this file for some predefined keymaps: keymaps

Get healthy

Open nvim and enter the following:

:checkhealth

You'll probably notice you don't have support for copy/paste also that python and node haven't been setup. Here's how to fix that:

Copy/Paste

  • On mac pbcopy should be builtin

  • On Debian-base distros

    sudo apt install xsel # for X11
    sudo apt install wl-clipboard # for wayland
  • On Fedora

    sudo dnf install xsel # for X11
    sudo dnf install wl-clipboard # for wayland

Python / node support

Next we need to install python support (node is optional):

  • Neovim python support

    sudo apt install python3-pynvim  # on Debian
    sudo dnf install python3-pynvim  # on Fedora
  • Neovim node support

    npm i -g neovim

We will also need ripgrep for Telescope to work:

  • Ripgrep

    sudo apt install ripgrep  # on Debian
    sudo dnf install ripgrep  # on Fedora

Fonts

I recommend using the following repo to get a "Nerd Font" (Font that supports icons)

getnf

Configuration

LSP

To add a new LSP

First Enter:

:Mason

and press i on the Language Server you wish to install

Next you will need to add the server to this list: servers Note: Builtin LSP doesn't contain all lsps from nvim-lspconfig.

If you want to install any from there, for example terraform_lsp(which adds more functionality than terraformls, like complete resource listing), you can either

  1. add the lsp name in mason lsp block
-- lua/utils/init.lua
M.servers = {
	"lua_ls",
	"cssls",
	"html",
	"tsserver",
	"pyright",
	"bashls",
	"jsonls",
	"yamlls",
}
  1. or manually install the binary of the lsp and put it in your path by downloading the binary or through your package manager.

Formatters and linters

Make sure the formatter or linter is installed and add it to this setup function: null-ls

NOTE Some are already setup as examples, remove them if you want

Plugins

About

Personal neovim config.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages