mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-07-15 03:44:43 +02:00
prettier and eslint configured
This commit is contained in:
parent
b3f2348d97
commit
7eea23bb6c
9 changed files with 123 additions and 93 deletions
|
@ -1,24 +1,12 @@
|
|||
-- TODO figure out why this don't work
|
||||
vim.fn.sign_define("LspDiagnosticsSignError", {
|
||||
texthl = "LspDiagnosticsSignError",
|
||||
text = "",
|
||||
numhl = "LspDiagnosticsSignError"
|
||||
})
|
||||
vim.fn.sign_define("LspDiagnosticsSignWarning", {
|
||||
texthl = "LspDiagnosticsSignWarning",
|
||||
text = "",
|
||||
numhl = "LspDiagnosticsSignWarning"
|
||||
})
|
||||
vim.fn.sign_define("LspDiagnosticsSignInformation", {
|
||||
texthl = "LspDiagnosticsSignInformation",
|
||||
text = "",
|
||||
numhl = "LspDiagnosticsSignInformation"
|
||||
})
|
||||
vim.fn.sign_define("LspDiagnosticsSignHint", {
|
||||
texthl = "LspDiagnosticsSignHint",
|
||||
text = "",
|
||||
numhl = "LspDiagnosticsSignHint"
|
||||
})
|
||||
vim.fn.sign_define("LspDiagnosticsSignError",
|
||||
{texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"})
|
||||
vim.fn.sign_define("LspDiagnosticsSignWarning",
|
||||
{texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"})
|
||||
vim.fn.sign_define("LspDiagnosticsSignInformation",
|
||||
{texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"})
|
||||
vim.fn.sign_define("LspDiagnosticsSignHint",
|
||||
{texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"})
|
||||
|
||||
vim.cmd('nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>')
|
||||
vim.cmd('nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>')
|
||||
|
@ -42,10 +30,7 @@ autocmd BufWritePre *.lua lua vim.lsp.buf.formatting_sync(nil, 100) ]]
|
|||
-- Java
|
||||
-- autocmd FileType java nnoremap ca <Cmd>lua require('jdtls').code_action()<CR>
|
||||
|
||||
local lsp_config = {}
|
||||
|
||||
function lsp_config.common_on_attach(client, bufnr)
|
||||
|
||||
local function documentHighlight(client, bufnr)
|
||||
-- Set autocommands conditional on server_capabilities
|
||||
if client.resolved_capabilities.document_highlight then
|
||||
vim.api.nvim_exec([[
|
||||
|
@ -58,7 +43,19 @@ function lsp_config.common_on_attach(client, bufnr)
|
|||
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
||||
augroup END
|
||||
]], false)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
local lsp_config = {}
|
||||
|
||||
function lsp_config.common_on_attach(client, bufnr)
|
||||
documentHighlight(client, bufnr)
|
||||
end
|
||||
|
||||
function lsp_config.tsserver_on_attach(client, bufnr)
|
||||
lsp_config.common_on_attach(client, bufnr)
|
||||
client.resolved_capabilities.document_formatting = false
|
||||
end
|
||||
|
||||
-- Use a loop to conveniently both setup defined servers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue