-
Notifications
You must be signed in to change notification settings - Fork 2
/
.vimrc_lsp.lua
103 lines (80 loc) · 2.01 KB
/
.vimrc_lsp.lua
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
local cmp = require 'cmp'
local cmp_format = require('lsp-zero').cmp_format({ details = true })
cmp.setup({
preselect = 'item',
completion = {
completeopt = 'menu,menuone,noinsert'
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'buffer' },
}),
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
-- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
['<CR>'] = cmp.mapping.confirm({ select = true }),
}),
formatting = cmp_format,
})
local lsp_zero = require('lsp-zero')
local cmp_lsp_default_capabilities = require('cmp_nvim_lsp').default_capabilities()
require 'lspconfig.ui.windows'.default_options.border = 'single'
lsp_zero.extend_lspconfig({
sign_text = true,
capabilities = cmp_lsp_default_capabilities,
})
lsp_zero.ui({
float_border = 'rounded',
sign_text = {
error = '✘',
warn = '⚠',
hint = '⚑',
info = 'ℹ',
},
})
vim.diagnostic.config({
virtual_text = false,
severity_sort = true,
float = {
style = 'minimal',
border = 'rounded',
source = 'always',
header = '',
prefix = '',
},
})
require 'lspconfig'.vtsls.setup {
settings = {
vtsls = {
enableMoveToFileCodeAction = true,
autoUseWorkspaceTsdk = true,
},
typescript = {
suggest = {
completeFunctionCalls = true,
},
},
}
}
require 'lspconfig'.eslint.setup {}
require 'lspconfig'.svelte.setup {}
require 'lspconfig'.graphql.setup {}
require 'lspconfig'.lua_ls.setup {}
require 'lspconfig'.cssls.setup {}
require'lspconfig'.bashls.setup{}
require 'fzf_lsp'.setup {
override_ui_select = true
}
require 'nvim-tree'.setup {
view = {
width = 50,
},
}
require 'lsp-file-operations'.setup {}