mirror of
https://github.com/tomru/vim.git
synced 2026-03-03 06:27:18 +01:00
disable predefined Format command
This commit is contained in:
20
init.lua
20
init.lua
@@ -396,9 +396,9 @@ local on_attach = function(_, bufnr)
|
||||
end, '[W]orkspace [L]ist Folders')
|
||||
|
||||
-- Create a command `:Format` local to the LSP buffer
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||
vim.lsp.buf.format()
|
||||
end, { desc = 'Format current buffer with LSP' })
|
||||
-- vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||
-- vim.lsp.buf.format()
|
||||
-- end, { desc = 'Format current buffer with LSP' })
|
||||
end
|
||||
|
||||
-- Enable the following language servers
|
||||
@@ -422,7 +422,9 @@ local servers = {
|
||||
},
|
||||
},
|
||||
},
|
||||
stylelint_lsp = {},
|
||||
stylelint_lsp = {
|
||||
filetypes = { 'css' },
|
||||
},
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
workspace = { checkThirdParty = false },
|
||||
@@ -450,11 +452,16 @@ mason_lspconfig.setup {
|
||||
|
||||
mason_lspconfig.setup_handlers {
|
||||
function(server_name)
|
||||
require('lspconfig')[server_name].setup {
|
||||
local settings = servers[server_name]
|
||||
local config = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = servers[server_name],
|
||||
settings = settings,
|
||||
}
|
||||
if settings ~= nil and settings['filetypes'] ~= nil then
|
||||
config.filetypes = settings.filetypes
|
||||
end
|
||||
require('lspconfig')[server_name].setup(config)
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -498,6 +505,7 @@ cmp.setup {
|
||||
end, { 'i', 's' }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'neorg' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user