default-config.lua 29 KB

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