default-config.lua 28 KB

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