chore: Improve formatting

This commit is contained in:
Donovan Glover 2024-03-30 11:30:33 -04:00
parent 98e88cd6a7
commit e236ab2dae
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -245,21 +245,25 @@ in
config = /* lua */ ''
local lspconfig = require('lspconfig')
local capabilities = require("cmp_nvim_lsp").default_capabilities()
lspconfig.denols.setup {
capabilities = capabilities,
root_dir = lspconfig.util.root_pattern("deno.json", "deno.jsonc"),
}
lspconfig.tsserver.setup {
capabilities = capabilities,
root_dir = lspconfig.util.root_pattern("package.json"),
single_file_support = false
}
lspconfig.typst_lsp.setup {
capabilities = capabilities,
settings = {
exportPdf = "onSave"
}
}
lspconfig.eslint.setup {
capabilities = capabilities,
on_attach = function(client, bufnr)
@ -269,20 +273,25 @@ in
})
end
}
lspconfig.tailwindcss.setup {
capabilities = capabilities,
on_attach = function(client, bufnr)
require("tailwindcss-colors").buf_attach(bufnr)
end
}
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev)
local opts = { buffer = ev.buf }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)