summaryrefslogtreecommitdiff
path: root/config/.config/nvim/after/plugin/lsp.lua
blob: 58546de8b6f4c234f8405c9d0865533a2ca851f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
    local lsp = require('lsp-zero').preset({
  name = 'minimal',
  set_lsp_keymaps = true,
  manage_nvim_cmp = true,
  suggest_lsp_servers = false,
})

-- (Optional) Configure lua language server for neovim
lsp.nvim_workspace()

lsp.ensure_installed = ({
    "quick_lint_js",
    "html-lsp",
    "css-lsp";
    "lua_ls",
    "clangd",
    "python-lsp-server",
})



----------------------
-- Completion stuff --
----------------------

lsp.setup_nvim_cmp({
  preselect = 'none',
  completion = {
    autocomplete = false,
    completeopt = 'menu,menuone,noinsert,noselect',
  },
})



local cmp = require('cmp')
local cmp_select = {behavior = cmp.SelectBehavior.Select}
local cmp_mappings = lsp.defaults.cmp_mappings({
    ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
    ['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
    ['<C-y>'] = cmp.mapping.confirm( {select = true} ),
    ['<C-Space>'] = cmp.mapping.complete(),
})





lsp.set_preferences({
    sign_icons = { }
})

lsp.setup()




------------------------
-- Disable Diagnostics -
------------------------

vim.diagnostic.config({
  virtual_text = false,
  signs = false,
  update_in_insert = false,
  underline = false,
  severity_sort = false,
  float = false,
})