0

这是我打印 hello world 的代码

打印你好世界

现在如果我使用Format调用的命令vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]]

我的代码会变成这样现在文本中出现奇怪的符号

现在奇怪的符号出现在文本中

clangd 用^M符号更改我的文本

neovim 版本:0.6.1

这是我的 lsp-installer 配置文件的一部分:

lsp_installer.on_server_ready(function(server)
local opts = {
    on_attach = require("config.lsp.handlers").on_attach,
    capabilities = require("config.lsp.handlers").capabilities,
}

-- Lua
if server.name == "sumneko_lua" then
    local sumneko_opts = require("config.lsp.settings.sumneko_lua")
    opts = vim.tbl_deep_extend("force", sumneko_opts, opts)
end

-- Python
if server.name == "pyright" then
    local pyright_opts = require("config.lsp.settings.pyright")
    opts = vim.tbl_deep_extend("force", pyright_opts, opts)
end

-- C/C++
-- if server.name == "clangd" then
--
-- end


-- This setup() function is exactly the same as lspconfig's setup function.
-- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
server:setup(opts)

结尾)

4

0 回答 0