default-config.lua 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155
  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. }
  1136. require("core.which-key").config()
  1137. require "core.status_colors"
  1138. require("core.gitsigns").config()
  1139. require("core.compe").config()
  1140. require("core.dashboard").config()
  1141. require("core.dap").config()
  1142. require("core.terminal").config()
  1143. require("core.telescope").config()
  1144. require("core.treesitter").config()
  1145. require("core.nvimtree").config()