default-config.lua 28 KB

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