Compare commits

...

2 commits

Author SHA1 Message Date
751dceda4a
Format with non-LSP ruff 2025-02-07 14:59:55 +01:00
6a3c123981
Remove lua-ls 2025-02-07 14:49:06 +01:00
4 changed files with 8 additions and 46 deletions

View file

@ -8,6 +8,7 @@ require('nvim-format-buffer').setup({
return 'prettier --stdin-filepath ' .. vim.api.nvim_buf_get_name(0)
end,
},
{ pattern = { "*.sql" }, command = "pg_format --spaces=2 --wrap-limit=1000 --no-rcfile" }
{ pattern = { "*.sql" }, command = "pg_format --spaces=2 --wrap-limit=1000 --no-rcfile" },
{ pattern = { "*.py", "*.pyi" }, command = "ruff check --select I --fix --silent - | ruff format -" }
},
})

View file

@ -7,7 +7,6 @@ require("config.lsp.ruff")
-- require("config.lsp.typescript")
require("config.lsp.clangd")
require("config.lsp.vls")
require("config.lsp.lua_ls")
require("config.lsp.rust_analyzer")
local api = vim.api

View file

@ -1,38 +0,0 @@
local bin_name = "lua-language-server"
local cmd = { bin_name, "--stdio", }
local root_files = {
'.luarc.json',
'.luarc.jsonc',
'.luacheckrc',
'.stylua.toml',
'stylua.toml',
'selene.toml',
'selene.yml',
'lua/',
'.git',
}
vim.api.nvim_create_autocmd("FileType", {
pattern = "lua",
callback = function()
vim.lsp.start({
name = "lua_ls",
cmd = cmd,
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
settings = {
Lua = {
runtime = {
version = 'LuaJIT',
},
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
},
},
}
},
})
end,
})

View file

@ -18,11 +18,11 @@ vim.api.nvim_create_autocmd("FileType", {
},
})
vim.api.nvim_create_autocmd("BufWritePre", {
pattern = { "*.py", "*.pyi" },
callback = function()
vim.lsp.buf.format({ timeout_ms = 2000 })
end,
})
-- vim.api.nvim_create_autocmd("BufWritePre", {
-- pattern = { "*.py", "*.pyi" },
-- callback = function()
-- vim.lsp.buf.format { timeout_ms = 2000 }
-- end,
-- })
end,
})