default-config.lua 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296
  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()
  1285. require("core.autopairs").config()