default-config.lua 22 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015
  1. CONFIG_PATH = os.getenv "HOME" .. "/.local/share/lunarvim/lvim"
  2. DATA_PATH = vim.fn.stdpath "data"
  3. CACHE_PATH = vim.fn.stdpath "cache"
  4. TERMINAL = vim.fn.expand "$TERMINAL"
  5. USER = vim.fn.expand "$USER"
  6. lvim = {
  7. leader = "space",
  8. colorscheme = "spacegray",
  9. line_wrap_cursor_movement = true,
  10. transparent_window = false,
  11. format_on_save = true,
  12. vsnip_dir = os.getenv "HOME" .. "/.config/snippets",
  13. database = { save_location = "~/.config/lunarvim_db", auto_execute = 1 },
  14. keys = {},
  15. -- TODO why do we need this?
  16. builtin = {
  17. lspinstall = {},
  18. telescope = {},
  19. compe = {},
  20. autopairs = {},
  21. treesitter = {},
  22. nvimtree = {},
  23. gitsigns = {},
  24. which_key = {},
  25. comment = {},
  26. rooter = {},
  27. galaxyline = {},
  28. bufferline = {},
  29. dap = {},
  30. dashboard = {},
  31. terminal = {},
  32. },
  33. lsp = {
  34. diagnostics = {
  35. virtual_text = {
  36. prefix = "",
  37. spacing = 0,
  38. },
  39. signs = true,
  40. underline = true,
  41. },
  42. override = {},
  43. document_highlight = true,
  44. popup_border = "single",
  45. default_keybinds = true,
  46. on_attach_callback = nil,
  47. },
  48. plugins = {
  49. -- use lv-config.lua for this not put here
  50. },
  51. autocommands = {},
  52. }
  53. local schemas = nil
  54. local common_on_attach = require("lsp.service").common_on_attach
  55. local common_capabilities = require("lsp.service").common_capabilities()
  56. local status_ok, jsonls_settings = pcall(require, "nlspsettings.jsonls")
  57. if status_ok then
  58. schemas = jsonls_settings.get_default_schemas()
  59. end
  60. -- TODO move all of this into lang specific files, only require when using
  61. lvim.lang = {
  62. asm = {
  63. formatter = {
  64. exe = "asmfmt",
  65. args = {},
  66. },
  67. linters = {},
  68. lsp = {
  69. provider = "",
  70. setup = {},
  71. },
  72. },
  73. beancount = {
  74. formatter = {
  75. exe = "bean_format",
  76. args = {},
  77. },
  78. linters = {},
  79. lsp = {
  80. provider = "beancount",
  81. setup = {
  82. cmd = { "beancount-langserver" },
  83. on_attach = common_on_attach,
  84. capabilities = common_capabilities,
  85. },
  86. },
  87. },
  88. c = {
  89. formatter = {
  90. exe = "clang_format",
  91. args = {},
  92. stdin = true,
  93. },
  94. linters = {
  95. "clangtidy",
  96. },
  97. lsp = {
  98. provider = "clangd",
  99. setup = {
  100. cmd = {
  101. DATA_PATH .. "/lspinstall/cpp/clangd/bin/clangd",
  102. "--background-index",
  103. "--header-insertion=never",
  104. "--cross-file-rename",
  105. "--clang-tidy",
  106. "--clang-tidy-checks=-*,llvm-*,clang-analyzer-*",
  107. },
  108. on_attach = common_on_attach,
  109. capabilities = common_capabilities,
  110. },
  111. },
  112. },
  113. cpp = {
  114. formatter = {
  115. exe = "clang_format",
  116. args = {},
  117. stdin = true,
  118. },
  119. linters = {
  120. "cppcheck",
  121. "clangtidy",
  122. },
  123. lsp = {
  124. provider = "clangd",
  125. setup = {
  126. cmd = {
  127. DATA_PATH .. "/lspinstall/cpp/clangd/bin/clangd",
  128. "--background-index",
  129. "--header-insertion=never",
  130. "--cross-file-rename",
  131. "--clang-tidy",
  132. "--clang-tidy-checks=-*,llvm-*,clang-analyzer-*",
  133. },
  134. on_attach = common_on_attach,
  135. capabilities = common_capabilities,
  136. },
  137. },
  138. },
  139. crystal = {
  140. formatter = {
  141. exe = "crystal_format",
  142. args = {},
  143. },
  144. linters = {},
  145. lsp = {
  146. provider = "crystalline",
  147. setup = {
  148. cmd = { "crystalline" },
  149. on_attach = common_on_attach,
  150. capabilities = common_capabilities,
  151. },
  152. },
  153. },
  154. cs = {
  155. formatter = {
  156. exe = "clang_format",
  157. args = {},
  158. },
  159. linters = {},
  160. lsp = {
  161. provider = "omnisharp",
  162. setup = {
  163. cmd = {
  164. DATA_PATH .. "/lspinstall/csharp/omnisharp/run",
  165. "--languageserver",
  166. "--hostPID",
  167. tostring(vim.fn.getpid()),
  168. },
  169. on_attach = common_on_attach,
  170. capabilities = common_capabilities,
  171. },
  172. },
  173. },
  174. cmake = {
  175. formatter = {
  176. exe = "cmake_format",
  177. args = {},
  178. },
  179. linters = {},
  180. lsp = {
  181. provider = "cmake",
  182. setup = {
  183. cmd = {
  184. DATA_PATH .. "/lspinstall/cmake/venv/bin/cmake-language-server",
  185. "--stdio",
  186. },
  187. on_attach = common_on_attach,
  188. capabilities = common_capabilities,
  189. },
  190. },
  191. },
  192. clojure = {
  193. formatter = {
  194. exe = "",
  195. args = {},
  196. },
  197. linters = {},
  198. lsp = {
  199. provider = "clojure_lsp",
  200. setup = {
  201. cmd = {
  202. DATA_PATH .. "/lspinstall/clojure/clojure-lsp",
  203. "--stdio",
  204. },
  205. on_attach = common_on_attach,
  206. capabilities = common_capabilities,
  207. },
  208. },
  209. },
  210. css = {
  211. formatter = {
  212. exe = "prettier",
  213. args = {},
  214. },
  215. linters = {},
  216. lsp = {
  217. provider = "cssls",
  218. setup = {
  219. cmd = {
  220. "node",
  221. DATA_PATH .. "/lspinstall/css/vscode-css/css-language-features/server/dist/node/cssServerMain.js",
  222. "--stdio",
  223. },
  224. on_attach = common_on_attach,
  225. capabilities = common_capabilities,
  226. },
  227. },
  228. },
  229. d = {
  230. formatter = {
  231. exe = "dfmt",
  232. args = {},
  233. },
  234. linters = {},
  235. lsp = {
  236. provider = "serve_d",
  237. setup = {
  238. cmd = { "serve-d" },
  239. on_attach = common_on_attach,
  240. capabilities = common_capabilities,
  241. },
  242. },
  243. },
  244. dart = {
  245. formatter = {
  246. exe = "dart_format",
  247. args = {},
  248. stdin = true,
  249. },
  250. linters = {},
  251. lsp = {
  252. provider = "dartls",
  253. setup = {
  254. cmd = {
  255. "dart",
  256. "/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot",
  257. "--lsp",
  258. },
  259. on_attach = common_on_attach,
  260. capabilities = common_capabilities,
  261. },
  262. },
  263. },
  264. docker = {
  265. formatter = {
  266. exe = "",
  267. args = {},
  268. },
  269. linters = {},
  270. lsp = {
  271. provider = "dockerls",
  272. setup = {
  273. cmd = {
  274. DATA_PATH .. "/lspinstall/dockerfile/node_modules/.bin/docker-langserver",
  275. "--stdio",
  276. },
  277. on_attach = common_on_attach,
  278. capabilities = common_capabilities,
  279. },
  280. },
  281. },
  282. elixir = {
  283. formatter = {
  284. exe = "mix",
  285. args = {},
  286. stdin = true,
  287. },
  288. linters = {},
  289. lsp = {
  290. provider = "elixirls",
  291. setup = {
  292. cmd = {
  293. DATA_PATH .. "/lspinstall/elixir/elixir-ls/language_server.sh",
  294. },
  295. on_attach = common_on_attach,
  296. capabilities = common_capabilities,
  297. },
  298. },
  299. },
  300. elm = {
  301. formatter = {
  302. exe = "elm_format",
  303. args = {},
  304. stdin = true,
  305. },
  306. linters = {},
  307. lsp = {
  308. provider = "elmls",
  309. setup = {
  310. cmd = {
  311. DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-language-server",
  312. },
  313. on_attach = common_on_attach,
  314. init_options = {
  315. elmAnalyseTrigger = "change",
  316. elmFormatPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-format",
  317. elmPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/",
  318. elmTestPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-test",
  319. },
  320. },
  321. },
  322. },
  323. erlang = {
  324. formatter = {
  325. exe = "erlfmt",
  326. args = {},
  327. },
  328. linters = {},
  329. lsp = {
  330. provider = "erlangls",
  331. setup = {
  332. cmd = {
  333. "erlang_ls",
  334. },
  335. on_attach = common_on_attach,
  336. capabilities = common_capabilities,
  337. },
  338. },
  339. },
  340. emmet = { active = false },
  341. fish = {
  342. formatter = {
  343. exe = "fish_indent",
  344. args = {},
  345. },
  346. linters = {},
  347. lsp = {
  348. provider = "",
  349. setup = {
  350. on_attach = common_on_attach,
  351. capabilities = common_capabilities,
  352. },
  353. },
  354. },
  355. go = {
  356. formatter = {
  357. exe = "gofmt",
  358. args = {},
  359. stdin = true,
  360. },
  361. linters = {
  362. "golangcilint",
  363. "revive",
  364. },
  365. lsp = {
  366. provider = "gopls",
  367. setup = {
  368. cmd = {
  369. DATA_PATH .. "/lspinstall/go/gopls",
  370. },
  371. on_attach = common_on_attach,
  372. capabilities = common_capabilities,
  373. },
  374. },
  375. },
  376. graphql = {
  377. formatter = {
  378. exe = "",
  379. args = {},
  380. },
  381. linters = {},
  382. lsp = {
  383. provider = "graphql",
  384. setup = {
  385. cmd = {
  386. "graphql-lsp",
  387. "server",
  388. "-m",
  389. "stream",
  390. },
  391. on_attach = common_on_attach,
  392. capabilities = common_capabilities,
  393. },
  394. },
  395. },
  396. html = {
  397. formatter = {
  398. exe = "prettier",
  399. args = {},
  400. },
  401. linters = {
  402. "tidy",
  403. -- https://docs.errata.ai/vale/scoping#html
  404. "vale",
  405. },
  406. lsp = {
  407. provider = "html",
  408. setup = {
  409. cmd = {
  410. "node",
  411. DATA_PATH .. "/lspinstall/html/vscode-html/html-language-features/server/dist/node/htmlServerMain.js",
  412. "--stdio",
  413. },
  414. on_attach = common_on_attach,
  415. capabilities = common_capabilities,
  416. },
  417. },
  418. },
  419. java = {
  420. formatter = {
  421. exe = "prettier",
  422. args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0) },
  423. },
  424. linters = {},
  425. lsp = {
  426. provider = "jdtls",
  427. setup = {
  428. cmd = { DATA_PATH .. "/lspinstall/java/jdtls.sh" },
  429. on_attach = common_on_attach,
  430. capabilities = common_capabilities,
  431. },
  432. },
  433. },
  434. json = {
  435. formatter = {
  436. exe = "json_tool",
  437. args = {},
  438. stdin = true,
  439. },
  440. linters = {},
  441. lsp = {
  442. provider = "jsonls",
  443. setup = {
  444. cmd = {
  445. "node",
  446. DATA_PATH .. "/lspinstall/json/vscode-json/json-language-features/server/dist/node/jsonServerMain.js",
  447. "--stdio",
  448. },
  449. on_attach = common_on_attach,
  450. capabilities = common_capabilities,
  451. settings = {
  452. json = {
  453. schemas = schemas,
  454. -- = {
  455. -- {
  456. -- fileMatch = { "package.json" },
  457. -- url = "https://json.schemastore.org/package.json",
  458. -- },
  459. -- },
  460. },
  461. },
  462. commands = {
  463. Format = {
  464. function()
  465. vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 })
  466. end,
  467. },
  468. },
  469. },
  470. },
  471. },
  472. julia = {
  473. formatter = {
  474. exe = "",
  475. args = {},
  476. },
  477. linters = {},
  478. lsp = {
  479. provider = "julials",
  480. setup = {
  481. {
  482. "julia",
  483. "--startup-file=no",
  484. "--history-file=no",
  485. -- vim.fn.expand "~/.config/nvim/lua/lsp/julia/run.jl",
  486. CONFIG_PATH .. "/utils/julia/run.jl",
  487. },
  488. on_attach = common_on_attach,
  489. capabilities = common_capabilities,
  490. },
  491. },
  492. },
  493. kotlin = {
  494. formatter = {
  495. exe = "",
  496. args = {},
  497. },
  498. linters = {},
  499. lsp = {
  500. provider = "kotlin_language_server",
  501. setup = {
  502. cmd = {
  503. DATA_PATH .. "/lspinstall/kotlin/server/bin/kotlin-language-server",
  504. },
  505. on_attach = common_on_attach,
  506. root_dir = function(fname)
  507. local util = require "lspconfig/util"
  508. local root_files = {
  509. "settings.gradle", -- Gradle (multi-project)
  510. "settings.gradle.kts", -- Gradle (multi-project)
  511. "build.xml", -- Ant
  512. "pom.xml", -- Maven
  513. }
  514. local fallback_root_files = {
  515. "build.gradle", -- Gradle
  516. "build.gradle.kts", -- Gradle
  517. }
  518. return util.root_pattern(unpack(root_files))(fname) or util.root_pattern(unpack(fallback_root_files))(fname)
  519. end,
  520. },
  521. },
  522. },
  523. lua = {
  524. formatter = {
  525. exe = "stylua",
  526. args = {},
  527. },
  528. linters = { "luacheck" },
  529. lsp = {
  530. provider = "sumneko_lua",
  531. setup = {
  532. cmd = {
  533. DATA_PATH .. "/lspinstall/lua/sumneko-lua-language-server",
  534. "-E",
  535. DATA_PATH .. "/lspinstall/lua/main.lua",
  536. },
  537. on_attach = common_on_attach,
  538. settings = {
  539. Lua = {
  540. runtime = {
  541. -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
  542. version = "LuaJIT",
  543. -- Setup your lua path
  544. path = vim.split(package.path, ";"),
  545. },
  546. diagnostics = {
  547. -- Get the language server to recognize the `vim` global
  548. globals = { "vim", "lvim" },
  549. },
  550. workspace = {
  551. -- Make the server aware of Neovim runtime files
  552. library = {
  553. [vim.fn.expand "~/.local/share/lunarvim/lvim/lua"] = true,
  554. [vim.fn.expand "$VIMRUNTIME/lua"] = true,
  555. [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
  556. },
  557. maxPreload = 100000,
  558. preloadFileSize = 1000,
  559. },
  560. },
  561. },
  562. },
  563. },
  564. },
  565. nginx = {
  566. formatter = {
  567. exe = "nginx_beautifier",
  568. args = {
  569. provider = "",
  570. setup = {},
  571. },
  572. },
  573. linters = {},
  574. lsp = {},
  575. },
  576. perl = {
  577. formatter = {
  578. exe = "perltidy",
  579. args = {},
  580. },
  581. linters = {},
  582. lsp = {
  583. provider = "",
  584. setup = {},
  585. },
  586. },
  587. sql = {
  588. formatter = {
  589. exe = "sqlformat",
  590. args = {},
  591. },
  592. linters = {},
  593. lsp = {
  594. provider = "sqls",
  595. setup = {
  596. cmd = { "sqls" },
  597. },
  598. },
  599. },
  600. php = {
  601. formatter = {
  602. exe = "phpcbf",
  603. args = {},
  604. },
  605. linters = {},
  606. lsp = {
  607. provider = "intelephense",
  608. setup = {
  609. cmd = {
  610. DATA_PATH .. "/lspinstall/php/node_modules/.bin/intelephense",
  611. "--stdio",
  612. },
  613. on_attach = common_on_attach,
  614. filetypes = { "php", "phtml" },
  615. settings = {
  616. intelephense = {
  617. environment = {
  618. phpVersion = "7.4",
  619. },
  620. },
  621. },
  622. },
  623. },
  624. },
  625. puppet = {
  626. formatter = {
  627. exe = "",
  628. args = {},
  629. },
  630. linters = {},
  631. lsp = {
  632. provider = "puppet",
  633. setup = {
  634. on_attach = common_on_attach,
  635. capabilities = common_capabilities,
  636. },
  637. },
  638. },
  639. javascript = {
  640. -- @usage can be prettier or eslint
  641. formatter = {
  642. exe = "prettier",
  643. args = {},
  644. },
  645. linters = {
  646. "eslint",
  647. },
  648. lsp = {
  649. provider = "tsserver",
  650. setup = {
  651. cmd = {
  652. -- TODO:
  653. DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
  654. "--stdio",
  655. },
  656. on_attach = common_on_attach,
  657. capabilities = common_capabilities,
  658. },
  659. },
  660. },
  661. javascriptreact = {
  662. -- @usage can be prettier or eslint
  663. formatter = {
  664. exe = "prettier",
  665. args = {},
  666. },
  667. linters = {
  668. "eslint",
  669. },
  670. lsp = {
  671. provider = "tsserver",
  672. setup = {
  673. cmd = {
  674. -- TODO:
  675. DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
  676. "--stdio",
  677. },
  678. on_attach = common_on_attach,
  679. capabilities = common_capabilities,
  680. },
  681. },
  682. },
  683. python = {
  684. -- @usage can be flake8 or yapf
  685. formatter = {
  686. exe = "black",
  687. args = {},
  688. },
  689. linters = {
  690. "flake8",
  691. "pylint",
  692. "mypy",
  693. },
  694. lsp = {
  695. provider = "pyright",
  696. setup = {
  697. cmd = {
  698. DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver",
  699. "--stdio",
  700. },
  701. on_attach = common_on_attach,
  702. capabilities = common_capabilities,
  703. },
  704. },
  705. },
  706. -- R -e 'install.packages("formatR",repos = "http://cran.us.r-project.org")'
  707. -- R -e 'install.packages("readr",repos = "http://cran.us.r-project.org")'
  708. r = {
  709. formatter = {
  710. exe = "format_r",
  711. args = {},
  712. },
  713. linters = {},
  714. lsp = {
  715. provider = "r_language_server",
  716. setup = {
  717. cmd = {
  718. "R",
  719. "--slave",
  720. "-e",
  721. "languageserver::run()",
  722. },
  723. on_attach = common_on_attach,
  724. capabilities = common_capabilities,
  725. },
  726. },
  727. },
  728. ruby = {
  729. formatter = {
  730. exe = "rufo",
  731. args = {},
  732. },
  733. linters = { "ruby" },
  734. lsp = {
  735. provider = "solargraph",
  736. setup = {
  737. cmd = {
  738. DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph",
  739. "stdio",
  740. },
  741. on_attach = common_on_attach,
  742. capabilities = common_capabilities,
  743. },
  744. },
  745. },
  746. rust = {
  747. formatter = {
  748. exe = "rustfmt",
  749. args = {},
  750. },
  751. linters = {},
  752. lsp = {
  753. provider = "rust_analyzer",
  754. setup = {
  755. cmd = {
  756. DATA_PATH .. "/lspinstall/rust/rust-analyzer",
  757. },
  758. on_attach = common_on_attach,
  759. capabilities = common_capabilities,
  760. },
  761. },
  762. },
  763. scala = {
  764. formatter = {
  765. exe = "scalafmt",
  766. args = {},
  767. },
  768. linters = { "" },
  769. lsp = {
  770. provider = "metals",
  771. setup = {
  772. on_attach = common_on_attach,
  773. capabilities = common_capabilities,
  774. },
  775. },
  776. },
  777. sh = {
  778. -- @usage can be 'shfmt'
  779. formatter = {
  780. exe = "shfmt",
  781. args = {},
  782. },
  783. -- @usage can be 'shellcheck'
  784. linters = { "shellcheck" },
  785. lsp = {
  786. provider = "bashls",
  787. setup = {
  788. cmd = {
  789. DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server",
  790. "start",
  791. },
  792. on_attach = common_on_attach,
  793. capabilities = common_capabilities,
  794. },
  795. },
  796. },
  797. svelte = {
  798. formatter = {
  799. exe = "",
  800. args = {},
  801. },
  802. linters = {},
  803. lsp = {
  804. provider = "svelte",
  805. setup = {
  806. cmd = {
  807. DATA_PATH .. "/lspinstall/svelte/node_modules/.bin/svelteserver",
  808. "--stdio",
  809. },
  810. on_attach = common_on_attach,
  811. capabilities = common_capabilities,
  812. },
  813. },
  814. },
  815. swift = {
  816. formatter = {
  817. exe = "swiftformat",
  818. args = {},
  819. },
  820. linters = {},
  821. lsp = {
  822. provider = "sourcekit",
  823. setup = {
  824. cmd = {
  825. "xcrun",
  826. "sourcekit-lsp",
  827. },
  828. on_attach = common_on_attach,
  829. capabilities = common_capabilities,
  830. },
  831. },
  832. },
  833. tailwindcss = {
  834. active = false,
  835. filetypes = {
  836. "html",
  837. "css",
  838. "scss",
  839. "javascript",
  840. "javascriptreact",
  841. "typescript",
  842. "typescriptreact",
  843. },
  844. },
  845. tf = {
  846. formatter = {
  847. exe = "terraform_fmt",
  848. args = {},
  849. },
  850. linters = {},
  851. lsp = {
  852. provider = "terraformls",
  853. setup = {
  854. filetypes = { "terraform", "tf" },
  855. cmd = {
  856. DATA_PATH .. "/lspinstall/terraform/terraform-ls",
  857. "serve",
  858. },
  859. on_attach = common_on_attach,
  860. capabilities = common_capabilities,
  861. },
  862. },
  863. },
  864. tex = {
  865. formatter = {
  866. exe = "latexindent",
  867. args = {},
  868. stdin = false,
  869. },
  870. linters = { "chktex" },
  871. lsp = {
  872. provider = "texlab",
  873. setup = {
  874. cmd = { DATA_PATH .. "/lspinstall/latex/texlab" },
  875. on_attach = common_on_attach,
  876. capabilities = common_capabilities,
  877. },
  878. },
  879. },
  880. typescript = {
  881. -- @usage can be prettier or eslint
  882. formatter = {
  883. exe = "prettier",
  884. args = {},
  885. },
  886. linters = {
  887. "eslint",
  888. },
  889. lsp = {
  890. provider = "tsserver",
  891. setup = {
  892. cmd = {
  893. -- TODO:
  894. DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
  895. "--stdio",
  896. },
  897. on_attach = common_on_attach,
  898. capabilities = common_capabilities,
  899. },
  900. },
  901. },
  902. typescriptreact = {
  903. -- @usage can be prettier or eslint
  904. formatter = {
  905. exe = "prettier",
  906. args = {},
  907. },
  908. linters = {
  909. "eslint",
  910. },
  911. lsp = {
  912. provider = "tsserver",
  913. setup = {
  914. cmd = {
  915. -- TODO:
  916. DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
  917. "--stdio",
  918. },
  919. on_attach = common_on_attach,
  920. capabilities = common_capabilities,
  921. },
  922. },
  923. },
  924. vim = {
  925. formatter = {
  926. exe = "",
  927. args = {},
  928. },
  929. linters = { "" },
  930. lsp = {
  931. provider = "vimls",
  932. setup = {
  933. cmd = {
  934. DATA_PATH .. "/lspinstall/vim/node_modules/.bin/vim-language-server",
  935. "--stdio",
  936. },
  937. on_attach = common_on_attach,
  938. capabilities = common_capabilities,
  939. },
  940. },
  941. },
  942. vue = {
  943. formatter = {
  944. exe = "prettier",
  945. args = {},
  946. },
  947. linters = {},
  948. lsp = {
  949. provider = "vuels",
  950. setup = {
  951. cmd = {
  952. DATA_PATH .. "/lspinstall/vue/node_modules/.bin/vls",
  953. },
  954. on_attach = common_on_attach,
  955. capabilities = common_capabilities,
  956. },
  957. },
  958. },
  959. yaml = {
  960. formatter = {
  961. exe = "prettier",
  962. args = {},
  963. },
  964. linters = {},
  965. lsp = {
  966. provider = "yamlls",
  967. setup = {
  968. cmd = {
  969. DATA_PATH .. "/lspinstall/yaml/node_modules/.bin/yaml-language-server",
  970. "--stdio",
  971. },
  972. on_attach = common_on_attach,
  973. capabilities = common_capabilities,
  974. },
  975. },
  976. },
  977. zig = {
  978. formatter = {
  979. exe = "",
  980. args = {},
  981. stdin = false,
  982. },
  983. linters = {},
  984. lsp = {
  985. provider = "zls",
  986. setup = {
  987. cmd = {
  988. "zls",
  989. },
  990. on_attach = common_on_attach,
  991. capabilities = common_capabilities,
  992. },
  993. },
  994. },
  995. }
  996. require("core.which-key").config()
  997. require "core.status_colors"
  998. require("core.gitsigns").config()
  999. require("core.compe").config()
  1000. require("core.dashboard").config()
  1001. require("core.dap").config()
  1002. require("core.terminal").config()
  1003. require("core.telescope").config()
  1004. require("core.treesitter").config()
  1005. require("core.nvimtree").config()