default-config.lua 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305
  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()