Mercurial > dotfiles
comparison dot_config/nvim/init.lua @ 301:f1590ff676ab
Remove diagnostics plugin and upgrade config to built-in diagnostics
author | zegervdv <zegervdv@me.com> |
---|---|
date | Fri, 13 Nov 2020 09:39:25 +0100 |
parents | a7901c1366de |
children | 10078cb76622 |
comparison
equal
deleted
inserted
replaced
300:c49fb04cf6da | 301:f1590ff676ab |
---|---|
53 comment = {}, | 53 comment = {}, |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 local on_attach = function(client) | 57 local on_attach = function(client) |
58 require'diagnostic'.on_attach({ | |
59 enable_virtual_text = 1, | |
60 }) | |
61 require'completion'.on_attach({ | 58 require'completion'.on_attach({ |
62 sorting = 'alphabet', | 59 sorting = 'alphabet', |
63 matching_strategy_list = {'exact', 'fuzzy'}, | 60 matching_strategy_list = {'exact', 'fuzzy'}, |
64 chain_complete_list = chain_complete_list, | 61 chain_complete_list = chain_complete_list, |
65 }) | 62 }) |
66 -- This came from https://github.com/tjdevries/config_manager/blob/master/xdg_config/nvim/lua/lsp_config.lua | 63 -- This came from https://github.com/tjdevries/config_manager/blob/master/xdg_config/nvim/lua/lsp_config.lua |
67 local mapper = function(mode, key, result) | 64 local mapper = function(mode, key, result) |
68 vim.fn.nvim_buf_set_keymap(0, mode, key, result, {noremap=true, silent=true}) | 65 vim.fn.nvim_buf_set_keymap(0, mode, key, result, {noremap=true, silent=true}) |
69 end | 66 end |
70 | 67 |
71 vim.api.nvim_command('autocmd CursorHold <buffer> lua vim.lsp.util.show_line_diagnostics()') | 68 vim.api.nvim_command('autocmd CursorHold <buffer> lua vim.lsp.diagnostic.show_line_diagnostics()') |
72 mapper('n', 'gd', '<cmd>lua vim.lsp.buf.declaration()<CR>') | 69 mapper('n', 'gd', '<cmd>lua vim.lsp.buf.declaration()<CR>') |
73 mapper('n', '<c-]>', '<cmd>lua vim.lsp.buf.definition()<CR>') | 70 mapper('n', '<c-]>', '<cmd>lua vim.lsp.buf.definition()<CR>') |
74 mapper('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>') | 71 mapper('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>') |
75 mapper('n', 'gD', '<cmd>lua vim.lsp.buf.implementation()<CR>') | 72 mapper('n', 'gD', '<cmd>lua vim.lsp.buf.implementation()<CR>') |
76 mapper('n', '1gD', '<cmd>lua vim.lsp.buf.type_definition()<CR>') | 73 mapper('n', '1gD', '<cmd>lua vim.lsp.buf.type_definition()<CR>') |
77 mapper('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>') | 74 mapper('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>') |
78 mapper('n', 'g0', '<cmd>lua vim.lsp.buf.document_symbol()<CR>') | 75 mapper('n', 'g0', '<cmd>lua vim.lsp.buf.document_symbol()<CR>') |
79 mapper('i', '<c-l>', '<cmd>lua vim.lsp.buf.signature_help()<CR>') | 76 mapper('i', '<c-l>', '<cmd>lua vim.lsp.buf.signature_help()<CR>') |
77 mapper('n', '<leader>f', '<cmd>lua vim.lsp.buf.code_action()<CR>') | |
80 end | 78 end |
81 | 79 |
82 lsp.pyls.setup{ | 80 lsp.pyls.setup{ |
83 cmd = {"pyls"}, | 81 cmd = {"pyls"}, |
84 on_attach = on_attach; | 82 on_attach = on_attach; |