+++ /dev/null
-local lsp = require('lsp-zero')
-lsp.preset('recommended')
-
-lsp.configure('lua_ls', {
- settings = {
- Lua = {
- diagnostics = {
- globals = { 'vim' }
- }
- }
- }
-})
-
-
-lsp.on_attach(function(client, bufnr)
- lsp.default_keymaps({buffer = bufnr})
- vim.keymap.set ("n", "<leader>r", vim.lsp.buf.rename, options)
- vim.keymap.set ("n", "<leader>f", vim.lsp.buf.code_action, options)
-end)
-
-lsp.set_sign_icons({
- error = '✘',
- warn = '▲',
- hint = '⚑',
- info = '»'
-})
--- lsp.on_attach = function (_, bufnr)
--- print "attached"
--- local options = { buffer = bufnr, remap = false }
--- vim.keymap.set ("n", "K", vim.lsp.buf.hover, options) -- buffer=0 -> only in current buffer
--- vim.keymap.set ("n", "gd", vim.lsp.buf.definition, options) -- goto definition
--- vim.keymap.set ("n", "gT", vim.lsp.buf.type_definition, options) -- goto typedefinition
--- vim.keymap.set ("n", "gi", vim.lsp.buf.implementation, options) -- goto implementation
--- vim.keymap.set ("n", "dj", vim.diagnostic.goto_next, options) -- goto dignostic next
--- vim.keymap.set ("n", "dk", vim.diagnostic.goto_prev, options) -- goto diognostic prev
--- vim.keymap.set ("n", "dl", "<cmd>Telescope diagnostic", options) -- goto list failure
--- vim.keymap.set ("n", "<leader>r", vim.lsp.buf.rename, options)
--- vim.keymap.set ("n", "<leader>f", vim.lsp.buf.code_action, options)
--- end
-
-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.setup_nvim_cmp({
- mapping = cmp_mappings,
-})
-
-cmp.setup({
- experimental = { ghost_text = true },
-});
-
-
-lsp.setup()
-
-vim.diagnostic.config({
- virtual_text = {
- -- source = "always", -- Or "if_many"
- prefix = '●', -- Could be '■', '▎', 'x'
- },
- severity_sort = true,
- float = {
- source = "always", -- Or "if_many"
- },
-})
-