comparison dot_config/nvim/init.lua @ 412:ad54efacea8a

Remove lspsaga in favour of built-in hover windows
author zegervdv <zegervdv@me.com>
date Sun, 18 Jul 2021 09:31:34 +0200
parents 4abd1fbc8829
children 32f1aecb9d01
comparison
equal deleted inserted replaced
411:4abd1fbc8829 412:ad54efacea8a
202 'nvim-treesitter/nvim-treesitter-textobjects', 202 'nvim-treesitter/nvim-treesitter-textobjects',
203 { 'nvim-treesitter/playground', opt = true }, 203 { 'nvim-treesitter/playground', opt = true },
204 } 204 }
205 use { 'hrsh7th/vim-vsnip', requires = 'hrsh7th/vim-vsnip-integ' } 205 use { 'hrsh7th/vim-vsnip', requires = 'hrsh7th/vim-vsnip-integ' }
206 use { 206 use {
207 'glepnir/lspsaga.nvim',
208 config = function()
209 require('lspsaga').init_lsp_saga {}
210 end,
211 }
212 use {
213 'rmagatti/goto-preview', 207 'rmagatti/goto-preview',
214 config = function() 208 config = function()
215 require('goto-preview').setup {} 209 require('goto-preview').setup {}
216 end, 210 end,
217 } 211 }
371 local null_ls = require 'null-ls' 365 local null_ls = require 'null-ls'
372 366
373 local on_attach = function(client) 367 local on_attach = function(client)
374 local nnoremap = vim.keymap.nnoremap 368 local nnoremap = vim.keymap.nnoremap
375 local inoremap = vim.keymap.inoremap 369 local inoremap = vim.keymap.inoremap
376 -- nnoremap { '', require'lspsaga.diagnostic'.show_line_diagnostics, silent = true }
377 nnoremap { 'gd', vim.lsp.buf.declaration, silent = true } 370 nnoremap { 'gd', vim.lsp.buf.declaration, silent = true }
378 nnoremap { '<c-]>', vim.lsp.buf.definition, silent = true } 371 nnoremap { '<c-]>', vim.lsp.buf.definition, silent = true }
379 nnoremap { 'K', require('lspsaga.hover').render_hover_doc, silent = true } 372 nnoremap { 'K', vim.lsp.buf.hover, silent = true }
380 nnoremap { 'gD', vim.lsp.buf.implementation, silent = true } 373 nnoremap { 'gD', vim.lsp.buf.implementation, silent = true }
381 nnoremap { '1gD', vim.lsp.buf.type_definition, silent = true } 374 nnoremap { '1gD', vim.lsp.buf.type_definition, silent = true }
382 nnoremap { 'gr', vim.lsp.buf.references, silent = true } 375 nnoremap { 'gr', vim.lsp.buf.references, silent = true }
383 nnoremap { 'g0', vim.lsp.buf.document_symbol, silent = true } 376 nnoremap { 'g0', vim.lsp.buf.document_symbol, silent = true }
384 nnoremap { 377 nnoremap {
412 }) 405 })
413 vim.fn.sign_define( 406 vim.fn.sign_define(
414 'LspDiagnosticsSignHint', 407 'LspDiagnosticsSignHint',
415 { texthl = 'LspDiagnosticsSignHint', linehl = '', numhl = '', text = '▎' } 408 { texthl = 'LspDiagnosticsSignHint', linehl = '', numhl = '', text = '▎' }
416 ) 409 )
410
411 vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'single' })
412 vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.hover, { border = 'single' })
417 end 413 end
418 414
419 vim.lsp.handlers['textDocument/formatting'] = function(err, _, result, _, bufnr) 415 vim.lsp.handlers['textDocument/formatting'] = function(err, _, result, _, bufnr)
420 if err ~= nil or result == nil then 416 if err ~= nil or result == nil then
421 return 417 return