default-config.lua 28 KB

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