2 Matching Annotations
- Jan 2022
-
-
Pyright from what I can tell doesn't support formatting. Coc seems to be using autopep8 which is a formatter and not a language server. That being said, for the langauge servers which do support formatting, I use this inside of the on_attach callback from nvim-lspconfig: vim.api.nvim_command[[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()]]
-
- Dec 2021
-
github.com github.com
-
How do I format files on save? See the following snippet: require("null-ls").setup({ -- you can reuse a shared lspconfig on_attach callback here on_attach = function(client) if client.resolved_capabilities.document_formatting then vim.cmd("autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()") end end, })
[[null-lsで保存時に自動フォーマットする]]
Tags
Annotators
URL
-