default-config.lua 29 KB

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