default-config.lua 25 KB

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