default-config.lua 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014
  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").common_on_attach
  55. local common_capabilities = require("lsp").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 = require("lsp").common_on_attach,
  635. capabilities = require("lsp").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 = require("lsp").common_on_attach,
  657. capabilities = require("lsp").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 = require("lsp").common_on_attach,
  679. capabilities = require("lsp").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. terraform = {
  846. formatter = {
  847. exe = "terraform_fmt",
  848. args = {},
  849. },
  850. linters = {},
  851. lsp = {
  852. provider = "terraformls",
  853. setup = {
  854. cmd = {
  855. DATA_PATH .. "/lspinstall/terraform/terraform-ls",
  856. "serve",
  857. },
  858. on_attach = common_on_attach,
  859. capabilities = common_capabilities,
  860. },
  861. },
  862. },
  863. tex = {
  864. formatter = {
  865. exe = "latexindent",
  866. args = {},
  867. stdin = false,
  868. },
  869. linters = { "chktex" },
  870. lsp = {
  871. provider = "texlab",
  872. setup = {
  873. cmd = { DATA_PATH .. "/lspinstall/latex/texlab" },
  874. on_attach = common_on_attach,
  875. capabilities = common_capabilities,
  876. },
  877. },
  878. },
  879. typescript = {
  880. -- @usage can be prettier or eslint
  881. formatter = {
  882. exe = "prettier",
  883. args = {},
  884. },
  885. linters = {
  886. "eslint",
  887. },
  888. lsp = {
  889. provider = "tsserver",
  890. setup = {
  891. cmd = {
  892. -- TODO:
  893. DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
  894. "--stdio",
  895. },
  896. on_attach = require("lsp").common_on_attach,
  897. capabilities = require("lsp").common_capabilities(),
  898. },
  899. },
  900. },
  901. typescriptreact = {
  902. -- @usage can be prettier or eslint
  903. formatter = {
  904. exe = "prettier",
  905. args = {},
  906. },
  907. linters = {
  908. "eslint",
  909. },
  910. lsp = {
  911. provider = "tsserver",
  912. setup = {
  913. cmd = {
  914. -- TODO:
  915. DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
  916. "--stdio",
  917. },
  918. on_attach = require("lsp").common_on_attach,
  919. capabilities = require("lsp").common_capabilities(),
  920. },
  921. },
  922. },
  923. vim = {
  924. formatter = {
  925. exe = "",
  926. args = {},
  927. },
  928. linters = { "" },
  929. lsp = {
  930. provider = "vimls",
  931. setup = {
  932. cmd = {
  933. DATA_PATH .. "/lspinstall/vim/node_modules/.bin/vim-language-server",
  934. "--stdio",
  935. },
  936. on_attach = common_on_attach,
  937. capabilities = common_capabilities,
  938. },
  939. },
  940. },
  941. vue = {
  942. formatter = {
  943. exe = "prettier",
  944. args = {},
  945. },
  946. linters = {},
  947. lsp = {
  948. provider = "vetur",
  949. setup = {
  950. cmd = {
  951. DATA_PATH .. "/lspinstall/vue/node_modules/.bin/vls",
  952. },
  953. on_attach = common_on_attach,
  954. capabilities = common_capabilities,
  955. },
  956. },
  957. },
  958. yaml = {
  959. formatter = {
  960. exe = "prettier",
  961. args = {},
  962. },
  963. linters = {},
  964. lsp = {
  965. provider = "yamlls",
  966. setup = {
  967. cmd = {
  968. DATA_PATH .. "/lspinstall/yaml/node_modules/.bin/yaml-language-server",
  969. "--stdio",
  970. },
  971. on_attach = common_on_attach,
  972. capabilities = common_capabilities,
  973. },
  974. },
  975. },
  976. zig = {
  977. formatter = {
  978. exe = "",
  979. args = {},
  980. stdin = false,
  981. },
  982. linters = {},
  983. lsp = {
  984. provider = "zls",
  985. setup = {
  986. cmd = {
  987. "zls",
  988. },
  989. on_attach = common_on_attach,
  990. capabilities = common_capabilities,
  991. },
  992. },
  993. },
  994. }
  995. require("core.which-key").config()
  996. require "core.status_colors"
  997. require("core.gitsigns").config()
  998. require("core.compe").config()
  999. require("core.dashboard").config()
  1000. require("core.dap").config()
  1001. require("core.terminal").config()
  1002. require("core.telescope").config()
  1003. require("core.treesitter").config()
  1004. require("core.nvimtree").config()