default-config.lua 29 KB

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