Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(js-ts-ide): basic javascript/typescript config #32

Open
wants to merge 1 commit into
base: js-ts-ide
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
lvim.format_on_save = false
lvim.lsp.diagnostics.virtual_text = false

-- All the treesitter parsers you want to install. If you want all of them, just
-- replace everything with "all".
lvim.builtin.treesitter.ensure_installed = {
"javascript",
"typescript",
}

-- Setup lsp.
vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "tsserver" })

-- Customize tsserver by changing the flags below.
local tsserver_flags = {}
local capabilities = require("lvim.lsp").common_capabilities()

require("lvim.lsp.manager").setup("tsserver", {
cmd = { "clangd", unpack(tsserver_flags) },
on_attach = require("lvim.lsp").common_on_attach,
on_init = require("lvim.lsp").common_on_init,
capabilities = capabilities,
})

-- Set a formatter.
local formatters = require("lvim.lsp.null-ls.formatters")
formatters.setup({
{ command = "prettier", filetypes = { "javascript", "typescript" } },
})

-- Set a linter.
local linters = require("lvim.lsp.null-ls.linters")
linters.setup({
{ command = "eslint", filetypes = { "javascript", "typescript" } },
})

-- Additional Plugins
lvim.plugins = {}