neovim-lsp

A personal Neovim config lua along with c++ auto completion using clangd, all configured using lsp

Took a lot of reference from


Theirs repos and youtube videos were really helpful

Table of Contents

List of plugins

Themes

Usage

  • Create a new directory inside .config/ folder named as nvim ( mkdir .config/nvim)
  • or you could just clone this repo inside .config/ directory and change the name of current from neovim-lsp/ to nvim/ then place it inside .config/
git clone https://github.com/Appyouz/neovim-lsp.git 
  • open plugins.lua file located inside nv lua/user/plugins.lua

Note: You will be presented with bunch of errors, just dont freak out everything will be fine once plugins are installed. Neovim is trying to load the configuaration files located inside after/plugin/.

  • once plugins are installed, close the file and reopen again
:wq
  • on oepening neovim again, nvim-treesitter will begin to load and compile just wait for it. it might show some errors dont worry it will work after reloading. (those errors do not seem to get in the way)

Now you can install your required language-servers using Mason

:Mason

You need to install ctags in order for preservim/tagbar to work. You can find ctags available in official repos of your linux distribution.

auto-completion keymaps

Keymaps Descriptions
<C-b> Up scrolling docs
<C-f> Down scrolling docs
<C-Space> complete
<C-e> abort completion
<CR> confirm completion
<Tab> Down scrolling snippets
<Shift-Tab> Up scrolling snippets

Lsp keymaps

Keymaps Descriptions
gD go to definition
K buf.hover shows more info
[d diagnostic jump prev
]d diagnostic jump next
<space>wa add workspace folder
<space>wr remove workspace folder
<space>wl list workspace folder
<space>f formatting
<space>wl list workspace folder
<space>rn lsp saga rename
<space>ca lsp saga code action

comment.nvim

Keymaps Descriptions
gcc line comment
gb block comment

Screenshots

In order to see shortcut keys you can press leader(space key) and a popup will come listing shortcut keys for this setup. space key is prefix. Check after/plugin/which-key.lua to find its config nvim

2023-03-15-22:48:37-screenshot

Note: you will need to setup your language servers inside the lua/user/lsp/lsp.lua using lsp, for the full list of configs check server_configurations.md

file browser

2023-03-15-22:59:25-screenshot

dashboard

2023-03-15-22:59:02-screenshot