From 82fd65a2bd2d5ae01063b7161bfb6c5864a3d4b6 Mon Sep 17 00:00:00 2001 From: srdusr Date: Thu, 3 Aug 2023 16:17:11 +0200 Subject: Just formatted the file --- lua/plugins/lsp.lua | 58 +++++++++++++++++------------------------------------ 1 file changed, 18 insertions(+), 40 deletions(-) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index fcdc529..b875182 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -60,18 +60,15 @@ vim.diagnostic.config({ severity_sort = false, -- default to false }) -vim.lsp.handlers["textDocument/publishDiagnostics"] = - vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - underline = false, - virtual_text = false, - signs = true, - update_in_insert = false, - }) +vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + underline = false, + virtual_text = false, + signs = true, + update_in_insert = false, +}) -vim.lsp.handlers["textDocument/hover"] = - vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }) -vim.lsp.handlers["textDocument/signatureHelp"] = - vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" }) +vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }) +vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" }) -- Use an on_attach function to only map the following keys after the language server attaches to the current buffer local on_attach = function(client, bufnr) @@ -87,31 +84,15 @@ local on_attach = function(client, bufnr) -- Mappings map("n", "K", "lua vim.lsp.buf.hover()") --map("n", "gd", "lua vim.lsp.buf.definition()") - map( - "n", - "gd", - "lua require('goto-preview').goto_preview_definition()" - ) + map("n", "gd", "lua require('goto-preview').goto_preview_definition()") --map("n", "gi", "lua vim.lsp.buf.implementation()") - map( - "n", - "gi", - "lua require('goto-preview').goto_preview_implementation()" - ) + map("n", "gi", "lua require('goto-preview').goto_preview_implementation()") --map("n", "gr", "lua vim.lsp.buf.references()") - map( - "n", - "gr", - "lua require('goto-preview').goto_preview_references()" - ) + map("n", "gr", "lua require('goto-preview').goto_preview_references()") map("n", "gD", "lua vim.lsp.buf.declaration()") -- most lsp servers don't implement textDocument/Declaration, so gD is useless for now. map("n", "k", "lua vim.lsp.buf.signature_help()") --map("n", "gt", "lua vim.lsp.buf.type_definition()") - map( - "n", - "gt", - "lua require('goto-preview').goto_preview_type_definition()" - ) + map("n", "gt", "lua require('goto-preview').goto_preview_type_definition()") map("n", "gn", "lua vim.lsp.buf.rename()") map("n", "ga", "lua vim.lsp.buf.code_action()") map("n", "gf", "lua vim.lsp.buf.formatting()") @@ -188,8 +169,7 @@ local servers = { intelephense = {}, julials = { on_new_config = function(new_config, _) - local julia = - vim.fn.expand("~/.julia/environments/nvim-lspconfig/bin/julia") + local julia = vim.fn.expand("~/.julia/environments/nvim-lspconfig/bin/julia") if lspconfig.util.path.is_file(julia) then new_config.cmd[1] = julia end @@ -258,9 +238,7 @@ local servers = { }, sqlls = {}, tsserver = { - capabilities = require("cmp_nvim_lsp").default_capabilities( - vim.lsp.protocol.make_client_capabilities() - ), + capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()), on_attach = function(client) client.server_capabilities.document_formatting = false client.server_capabilities.document_range_formatting = false @@ -393,10 +371,10 @@ local sources = { builtins.formatting.trim_whitespace.with({ filetypes = { "tmux", "teal", "zsh" }, }), - builtins.formatting.beautysh, - --builtins.formatting.beautysh.with({ - -- filetypes = "zsh", - --}), + --builtins.formatting.beautysh, + builtins.formatting.beautysh.with({ + filetypes = "zsh", + }), builtins.formatting.clang_format, builtins.formatting.rustfmt, builtins.formatting.sql_formatter, -- cgit v1.2.3