default-config.lua 25 KB

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