mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
refactor: rename on_attach to custom_attach
This commit is contained in:
parent
9c9e1d639c
commit
082a8ab6b5
@ -8,7 +8,7 @@ function M.show_line_diagnostics()
|
|||||||
vim.lsp.diagnostic.show_line_diagnostics(opts)
|
vim.lsp.diagnostic.show_line_diagnostics(opts)
|
||||||
end
|
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_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
|
||||||
local function buf_set_option(...) vim.api.nvim_buf_set_option(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")
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
lspconfig.pylsp.setup{
|
lspconfig.pylsp.setup{
|
||||||
on_attach = on_attach,
|
on_attach = custom_attach,
|
||||||
settings = {
|
settings = {
|
||||||
pylsp = {
|
pylsp = {
|
||||||
plugins = {
|
plugins = {
|
||||||
@ -88,11 +88,11 @@ lspconfig.pylsp.setup{
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- lspconfig.pyright.setup{
|
-- lspconfig.pyright.setup{
|
||||||
-- on_attach = on_attach,
|
-- on_attach = custom_attach,
|
||||||
-- }
|
-- }
|
||||||
|
|
||||||
lspconfig.clangd.setup{
|
lspconfig.clangd.setup{
|
||||||
on_attach = on_attach,
|
on_attach = custom_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
filetypes = { "c", "cpp", "cc" },
|
filetypes = { "c", "cpp", "cc" },
|
||||||
flags = {
|
flags = {
|
||||||
@ -102,7 +102,7 @@ lspconfig.clangd.setup{
|
|||||||
|
|
||||||
-- set up vim-language-server
|
-- set up vim-language-server
|
||||||
lspconfig.vimls.setup{
|
lspconfig.vimls.setup{
|
||||||
on_attach = on_attach,
|
on_attach = custom_attach,
|
||||||
flags = {
|
flags = {
|
||||||
debounce_text_changes = 500,
|
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")
|
table.insert(runtime_path, "lua/?/init.lua")
|
||||||
|
|
||||||
require'lspconfig'.sumneko_lua.setup {
|
require'lspconfig'.sumneko_lua.setup {
|
||||||
on_attach = on_attach,
|
on_attach = custom_attach,
|
||||||
cmd = {sumneko_binary_path, "-E", sumneko_root_path .. "/main.lua"};
|
cmd = {sumneko_binary_path, "-E", sumneko_root_path .. "/main.lua"};
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user