Add prettier and typescript lsp
This commit is contained in:
parent
e3190826fb
commit
56dac66dd2
23
init.lua
23
init.lua
|
|
@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
|
|||
vim.o.number = true
|
||||
-- You can also add relative line numbers, to help with jumping.
|
||||
-- Experiment for yourself to see if you like it!
|
||||
-- vim.o.relativenumber = true
|
||||
vim.o.relativenumber = true
|
||||
|
||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||
vim.o.mouse = 'a'
|
||||
|
|
@ -683,7 +683,21 @@ require('lazy').setup({
|
|||
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||
-- ts_ls = {},
|
||||
--
|
||||
|
||||
eslint = {},
|
||||
oxlint = {},
|
||||
ts_ls = {
|
||||
cmd = { 'tsgo', '--lsp', '--stdio' },
|
||||
filestypes = {
|
||||
'javascript',
|
||||
'javascriptreact',
|
||||
'javascript.jsx',
|
||||
'typescript',
|
||||
'typescriptreact',
|
||||
'typescript.tsx',
|
||||
},
|
||||
root_dir = require('lspconfig').util.root_pattern('tsconfig.json', 'package.json', 'package.json'),
|
||||
settings = {},
|
||||
},
|
||||
lua_ls = {
|
||||
-- cmd = { ... },
|
||||
-- filetypes = { ... },
|
||||
|
|
@ -716,6 +730,7 @@ require('lazy').setup({
|
|||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, {
|
||||
'stylua', -- Used to format Lua code
|
||||
'prettierd',
|
||||
})
|
||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||
|
||||
|
|
@ -772,7 +787,9 @@ require('lazy').setup({
|
|||
-- python = { "isort", "black" },
|
||||
--
|
||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
javascript = { 'prettierd', 'prettier', stop_after_first = true },
|
||||
typescript = { 'prettierd', 'prettier', lsp_format = 'first', stop_after_first = true },
|
||||
typescriptreact = { 'prettierd', 'prettier', lsp_format = 'first', stop_after_first = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue