aboutsummaryrefslogtreecommitdiff
path: root/lua/config
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2021-08-12 00:30:07 +0800
committerjdhao <jdhao@hotmail.com>2021-08-12 00:30:07 +0800
commit082a8ab6b5098bbc831bbe4fe0727dff5053f431 (patch)
treeed69aab3f2b864f16d9edc8ffd477e7a4ce99e73 /lua/config
parent9c9e1d639c28d14204a23ad60f7f1fffd6f0c592 (diff)
refactor: rename on_attach to custom_attach
Diffstat (limited to 'lua/config')
-rw-r--r--lua/config/lsp.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua
index 1728c5d..1cae961 100644
--- a/lua/config/lsp.lua
+++ b/lua/config/lsp.lua
@@ -8,7 +8,7 @@ function M.show_line_diagnostics()
vim.lsp.diagnostic.show_line_diagnostics(opts)
end
-local on_attach = function(client, bufnr)
+local custom_attach = function(client, bufnr)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
@@ -69,7 +69,7 @@ capabilities.textDocument.completion.completionItem.snippetSupport = true
local lspconfig = require("lspconfig")
lspconfig.pylsp.setup{
- on_attach = on_attach,
+ on_attach = custom_attach,
settings = {
pylsp = {
plugins = {
@@ -88,11 +88,11 @@ lspconfig.pylsp.setup{
}
-- lspconfig.pyright.setup{
--- on_attach = on_attach,
+-- on_attach = custom_attach,
-- }
lspconfig.clangd.setup{
- on_attach = on_attach,
+ on_attach = custom_attach,
capabilities = capabilities,
filetypes = { "c", "cpp", "cc" },
flags = {
@@ -102,7 +102,7 @@ lspconfig.clangd.setup{
-- set up vim-language-server
lspconfig.vimls.setup{
- on_attach = on_attach,
+ on_attach = custom_attach,
flags = {
debounce_text_changes = 500,
}
@@ -117,7 +117,7 @@ if vim.g.is_mac > 0 or vim.g.is_linux > 0 and sumneko_binary_path ~= '' then
table.insert(runtime_path, "lua/?/init.lua")
require'lspconfig'.sumneko_lua.setup {
- on_attach = on_attach,
+ on_attach = custom_attach,
cmd = {sumneko_binary_path, "-E", sumneko_root_path .. "/main.lua"};
settings = {
Lua = {