default-config.lua 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305
  1. CONFIG_PATH = os.getenv "HOME" .. "/.local/share/lunarvim/lvim"
  2. DATA_PATH = vim.fn.stdpath "data"
  3. CACHE_PATH = vim.fn.stdpath "cache"
  4. TERMINAL = vim.fn.expand "$TERMINAL"
  5. USER = vim.fn.expand "$USER"
  6. vim.cmd [[ set spellfile=~/.config/lvim/spell/en.utf-8.add ]]
  7. lvim = {
  8. leader = "space",
  9. colorscheme = "spacegray",
  10. line_wrap_cursor_movement = true,
  11. transparent_window = false,
  12. format_on_save = true,
  13. vsnip_dir = os.getenv "HOME" .. "/.config/snippets",
  14. database = { save_location = "~/.config/lunarvim_db", auto_execute = 1 },
  15. keys = {},
  16. -- TODO why do we need this?
  17. builtin = {
  18. lspinstall = {},
  19. telescope = {},
  20. compe = {},
  21. autopairs = {},
  22. treesitter = {},
  23. nvimtree = {},
  24. gitsigns = {},
  25. which_key = {},
  26. comment = {},
  27. 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. go = {
  482. formatters = {
  483. -- {
  484. -- exe = "gofmt",
  485. -- args = {},
  486. -- },
  487. -- {
  488. -- exe = "goimports",
  489. -- args = {},
  490. -- },
  491. -- {
  492. -- exe = "gofumpt",
  493. -- args = {},
  494. -- },
  495. },
  496. linters = {},
  497. lsp = {
  498. provider = "gopls",
  499. setup = {
  500. cmd = {
  501. DATA_PATH .. "/lspinstall/go/gopls",
  502. },
  503. on_attach = common_on_attach,
  504. on_init = common_on_init,
  505. capabilities = common_capabilities,
  506. },
  507. },
  508. },
  509. graphql = {
  510. formatters = {},
  511. linters = {},
  512. lsp = {
  513. provider = "graphql",
  514. setup = {
  515. cmd = {
  516. "graphql-lsp",
  517. "server",
  518. "-m",
  519. "stream",
  520. },
  521. on_attach = common_on_attach,
  522. on_init = common_on_init,
  523. capabilities = common_capabilities,
  524. },
  525. },
  526. },
  527. haskell = {
  528. formatters = {},
  529. linters = {},
  530. lsp = {
  531. provider = "hls",
  532. setup = {
  533. cmd = { DATA_PATH .. "/lspinstall/haskell/hls" },
  534. on_attach = common_on_attach,
  535. on_init = common_on_init,
  536. capabilities = common_capabilities,
  537. },
  538. },
  539. },
  540. html = {
  541. formatters = {
  542. -- {
  543. -- exe = "prettier",
  544. -- args = {},
  545. -- },
  546. -- {
  547. -- exe = "prettierd",
  548. -- args = {},
  549. -- },
  550. },
  551. linters = {},
  552. lsp = {
  553. provider = "html",
  554. setup = {
  555. cmd = {
  556. "node",
  557. DATA_PATH .. "/lspinstall/html/vscode-html/html-language-features/server/dist/node/htmlServerMain.js",
  558. "--stdio",
  559. },
  560. on_attach = common_on_attach,
  561. on_init = common_on_init,
  562. capabilities = common_capabilities,
  563. },
  564. },
  565. },
  566. java = {
  567. formatters = {
  568. -- {
  569. -- exe = "clang_format",
  570. -- args = {},
  571. -- },
  572. -- {
  573. -- exe = "uncrustify",
  574. -- args = {},
  575. -- },
  576. },
  577. linters = {},
  578. lsp = {
  579. provider = "jdtls",
  580. setup = {
  581. cmd = { DATA_PATH .. "/lspinstall/java/jdtls.sh" },
  582. on_attach = common_on_attach,
  583. on_init = common_on_init,
  584. capabilities = common_capabilities,
  585. },
  586. },
  587. },
  588. json = {
  589. formatters = {
  590. -- {
  591. -- exe = "json_tool",
  592. -- args = {},
  593. -- },
  594. -- {
  595. -- exe = "prettier",
  596. -- args = {},
  597. -- },
  598. -- {
  599. -- exe = "prettierd",
  600. -- args = {},
  601. -- },
  602. },
  603. linters = {},
  604. lsp = {
  605. provider = "jsonls",
  606. setup = {
  607. cmd = {
  608. "node",
  609. DATA_PATH .. "/lspinstall/json/vscode-json/json-language-features/server/dist/node/jsonServerMain.js",
  610. "--stdio",
  611. },
  612. on_attach = common_on_attach,
  613. on_init = common_on_init,
  614. capabilities = common_capabilities,
  615. settings = {
  616. json = {
  617. schemas = schemas,
  618. -- = {
  619. -- {
  620. -- fileMatch = { "package.json" },
  621. -- url = "https://json.schemastore.org/package.json",
  622. -- },
  623. -- },
  624. },
  625. },
  626. commands = {
  627. Format = {
  628. function()
  629. vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 })
  630. end,
  631. },
  632. },
  633. },
  634. },
  635. },
  636. julia = {
  637. formatters = {},
  638. linters = {},
  639. lsp = {
  640. provider = "julials",
  641. setup = {
  642. {
  643. "julia",
  644. "--startup-file=no",
  645. "--history-file=no",
  646. -- vim.fn.expand "~/.config/nvim/lua/lsp/julia/run.jl",
  647. CONFIG_PATH .. "/utils/julia/run.jl",
  648. },
  649. on_attach = common_on_attach,
  650. on_init = common_on_init,
  651. capabilities = common_capabilities,
  652. },
  653. },
  654. },
  655. kotlin = {
  656. formatters = {},
  657. linters = {},
  658. lsp = {
  659. provider = "kotlin_language_server",
  660. setup = {
  661. cmd = {
  662. DATA_PATH .. "/lspinstall/kotlin/server/bin/kotlin-language-server",
  663. },
  664. on_attach = common_on_attach,
  665. on_init = common_on_init,
  666. root_dir = function(fname)
  667. local util = require "lspconfig/util"
  668. local root_files = {
  669. "settings.gradle", -- Gradle (multi-project)
  670. "settings.gradle.kts", -- Gradle (multi-project)
  671. "build.xml", -- Ant
  672. "pom.xml", -- Maven
  673. }
  674. local fallback_root_files = {
  675. "build.gradle", -- Gradle
  676. "build.gradle.kts", -- Gradle
  677. }
  678. return util.root_pattern(unpack(root_files))(fname) or util.root_pattern(unpack(fallback_root_files))(fname)
  679. end,
  680. },
  681. },
  682. },
  683. lua = {
  684. formatters = {
  685. -- {
  686. -- exe = "stylua",
  687. -- args = {},
  688. -- },
  689. -- {
  690. -- exe = "lua_format",
  691. -- args = {},
  692. -- },
  693. },
  694. linters = {},
  695. lsp = {
  696. provider = "sumneko_lua",
  697. setup = {
  698. cmd = {
  699. DATA_PATH .. "/lspinstall/lua/sumneko-lua-language-server",
  700. "-E",
  701. DATA_PATH .. "/lspinstall/lua/main.lua",
  702. },
  703. capabilities = common_capabilities,
  704. on_attach = common_on_attach,
  705. on_init = common_on_init,
  706. settings = {
  707. Lua = {
  708. runtime = {
  709. -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
  710. version = "LuaJIT",
  711. -- Setup your lua path
  712. path = vim.split(package.path, ";"),
  713. },
  714. diagnostics = {
  715. -- Get the language server to recognize the `vim` global
  716. globals = { "vim", "lvim" },
  717. },
  718. workspace = {
  719. -- Make the server aware of Neovim runtime files
  720. library = {
  721. [vim.fn.expand "~/.local/share/lunarvim/lvim/lua"] = true,
  722. [vim.fn.expand "$VIMRUNTIME/lua"] = true,
  723. [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
  724. },
  725. maxPreload = 100000,
  726. preloadFileSize = 1000,
  727. },
  728. },
  729. },
  730. },
  731. },
  732. },
  733. nginx = {
  734. formatters = {
  735. -- {
  736. -- exe = "nginx_beautifier",
  737. -- args = {
  738. -- provider = "",
  739. -- setup = {},
  740. -- },
  741. -- },
  742. },
  743. linters = {},
  744. lsp = {},
  745. },
  746. perl = {
  747. formatters = {
  748. -- {
  749. -- exe = "perltidy",
  750. -- args = {},
  751. -- },
  752. },
  753. linters = {},
  754. lsp = {
  755. provider = "",
  756. setup = {},
  757. },
  758. },
  759. sql = {
  760. formatters = {
  761. -- {
  762. -- exe = "sqlformat",
  763. -- args = {},
  764. -- },
  765. },
  766. linters = {},
  767. lsp = {
  768. provider = "sqls",
  769. setup = {
  770. cmd = { "sqls" },
  771. },
  772. },
  773. },
  774. php = {
  775. formatters = {
  776. -- {
  777. -- exe = "phpcbf",
  778. -- args = {},
  779. -- },
  780. },
  781. linters = {},
  782. lsp = {
  783. provider = "intelephense",
  784. setup = {
  785. cmd = {
  786. DATA_PATH .. "/lspinstall/php/node_modules/.bin/intelephense",
  787. "--stdio",
  788. },
  789. on_attach = common_on_attach,
  790. on_init = common_on_init,
  791. filetypes = { "php", "phtml" },
  792. settings = {
  793. intelephense = {
  794. environment = {
  795. phpVersion = "7.4",
  796. },
  797. },
  798. },
  799. },
  800. },
  801. },
  802. puppet = {
  803. formatters = {},
  804. linters = {},
  805. lsp = {
  806. provider = "puppet",
  807. setup = {
  808. cmd = {
  809. DATA_PATH .. "/lspinstall/puppet/puppet-editor-services/puppet-languageserver",
  810. "--stdio",
  811. },
  812. on_attach = common_on_attach,
  813. on_init = common_on_init,
  814. capabilities = common_capabilities,
  815. },
  816. },
  817. },
  818. javascript = {
  819. formatters = {
  820. -- {
  821. -- exe = "prettier",
  822. -- args = {},
  823. -- },
  824. -- {
  825. -- exe = "prettier_d_slim",
  826. -- args = {},
  827. -- },
  828. -- {
  829. -- exe = "prettierd",
  830. -- args = {},
  831. -- },
  832. },
  833. -- @usage can be {"eslint"} or {"eslint_d"}
  834. linters = {},
  835. lsp = {
  836. provider = "tsserver",
  837. setup = {
  838. cmd = {
  839. -- TODO:
  840. DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
  841. "--stdio",
  842. },
  843. on_attach = common_on_attach,
  844. on_init = common_on_init,
  845. capabilities = common_capabilities,
  846. },
  847. },
  848. },
  849. javascriptreact = {
  850. formatters = {
  851. -- {
  852. -- exe = "prettier",
  853. -- args = {},
  854. -- },
  855. -- {
  856. -- exe = "prettier_d_slim",
  857. -- args = {},
  858. -- },
  859. -- {
  860. -- exe = "prettierd",
  861. -- args = {},
  862. -- },
  863. },
  864. linters = {},
  865. lsp = {
  866. provider = "tsserver",
  867. setup = {
  868. cmd = {
  869. -- TODO:
  870. DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
  871. "--stdio",
  872. },
  873. on_attach = common_on_attach,
  874. on_init = common_on_init,
  875. capabilities = common_capabilities,
  876. },
  877. },
  878. },
  879. python = {
  880. formatters = {
  881. -- {
  882. -- exe = "yapf",
  883. -- args = {},
  884. -- },
  885. -- {
  886. -- exe = "isort",
  887. -- args = {},
  888. -- },
  889. },
  890. linters = {},
  891. lsp = {
  892. provider = "pyright",
  893. setup = {
  894. cmd = {
  895. DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver",
  896. "--stdio",
  897. },
  898. on_attach = common_on_attach,
  899. on_init = common_on_init,
  900. capabilities = common_capabilities,
  901. },
  902. },
  903. },
  904. -- R -e 'install.packages("formatR",repos = "http://cran.us.r-project.org")'
  905. -- R -e 'install.packages("readr",repos = "http://cran.us.r-project.org")'
  906. r = {
  907. formatters = {
  908. -- {
  909. -- exe = "format_r",
  910. -- args = {},
  911. -- },
  912. },
  913. linters = {},
  914. lsp = {
  915. provider = "r_language_server",
  916. setup = {
  917. cmd = {
  918. "R",
  919. "--slave",
  920. "-e",
  921. "languageserver::run()",
  922. },
  923. on_attach = common_on_attach,
  924. on_init = common_on_init,
  925. capabilities = common_capabilities,
  926. },
  927. },
  928. },
  929. ruby = {
  930. formatters = {
  931. -- {
  932. -- exe = "rufo",
  933. -- args = {},
  934. -- },
  935. },
  936. linters = {},
  937. lsp = {
  938. provider = "solargraph",
  939. setup = {
  940. cmd = {
  941. DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph",
  942. "stdio",
  943. },
  944. on_attach = common_on_attach,
  945. on_init = common_on_init,
  946. capabilities = common_capabilities,
  947. filetypes = { "ruby" },
  948. init_options = {
  949. formatting = true,
  950. },
  951. root_dir = function(fname)
  952. local util = require("lspconfig").util
  953. return util.root_pattern("Gemfile", ".git")(fname)
  954. end,
  955. settings = {
  956. solargraph = {
  957. diagnostics = true,
  958. },
  959. },
  960. },
  961. },
  962. },
  963. rust = {
  964. formatters = {
  965. -- {
  966. -- exe = "rustfmt",
  967. -- args = {},
  968. -- },
  969. },
  970. linters = {},
  971. lsp = {
  972. provider = "rust_analyzer",
  973. setup = {
  974. cmd = {
  975. DATA_PATH .. "/lspinstall/rust/rust-analyzer",
  976. },
  977. on_attach = common_on_attach,
  978. on_init = common_on_init,
  979. capabilities = common_capabilities,
  980. },
  981. },
  982. },
  983. scala = {
  984. formatters = {
  985. -- {
  986. -- exe = "scalafmt",
  987. -- args = {},
  988. -- },
  989. },
  990. linters = { "" },
  991. lsp = {
  992. provider = "metals",
  993. setup = {
  994. on_attach = common_on_attach,
  995. on_init = common_on_init,
  996. capabilities = common_capabilities,
  997. },
  998. },
  999. },
  1000. sh = {
  1001. formatters = {
  1002. -- {
  1003. -- exe = "shfmt",
  1004. -- args = {},
  1005. -- },
  1006. },
  1007. linters = {},
  1008. lsp = {
  1009. provider = "bashls",
  1010. setup = {
  1011. cmd = {
  1012. DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server",
  1013. "start",
  1014. },
  1015. on_attach = common_on_attach,
  1016. on_init = common_on_init,
  1017. capabilities = common_capabilities,
  1018. },
  1019. },
  1020. },
  1021. svelte = {
  1022. formatters = {},
  1023. linters = {},
  1024. lsp = {
  1025. provider = "svelte",
  1026. setup = {
  1027. cmd = {
  1028. DATA_PATH .. "/lspinstall/svelte/node_modules/.bin/svelteserver",
  1029. "--stdio",
  1030. },
  1031. on_attach = common_on_attach,
  1032. on_init = common_on_init,
  1033. capabilities = common_capabilities,
  1034. },
  1035. },
  1036. },
  1037. swift = {
  1038. formatters = {
  1039. -- {
  1040. -- exe = "swiftformat",
  1041. -- args = {},
  1042. -- },
  1043. },
  1044. linters = {},
  1045. lsp = {
  1046. provider = "sourcekit",
  1047. setup = {
  1048. cmd = {
  1049. "xcrun",
  1050. "sourcekit-lsp",
  1051. },
  1052. on_attach = common_on_attach,
  1053. on_init = common_on_init,
  1054. capabilities = common_capabilities,
  1055. },
  1056. },
  1057. },
  1058. tailwindcss = {
  1059. active = false,
  1060. filetypes = {
  1061. "html",
  1062. "css",
  1063. "scss",
  1064. "javascript",
  1065. "javascriptreact",
  1066. "typescript",
  1067. "typescriptreact",
  1068. },
  1069. },
  1070. terraform = {
  1071. formatters = {
  1072. -- {
  1073. -- exe = "terraform_fmt",
  1074. -- args = {},
  1075. -- },
  1076. },
  1077. linters = {},
  1078. lsp = {
  1079. provider = "terraformls",
  1080. setup = {
  1081. cmd = {
  1082. DATA_PATH .. "/lspinstall/terraform/terraform-ls",
  1083. "serve",
  1084. },
  1085. on_attach = common_on_attach,
  1086. on_init = common_on_init,
  1087. capabilities = common_capabilities,
  1088. },
  1089. },
  1090. },
  1091. tex = {
  1092. formatters = {},
  1093. linters = {},
  1094. lsp = {
  1095. provider = "texlab",
  1096. setup = {
  1097. cmd = { DATA_PATH .. "/lspinstall/latex/texlab" },
  1098. on_attach = common_on_attach,
  1099. on_init = common_on_init,
  1100. capabilities = common_capabilities,
  1101. },
  1102. },
  1103. },
  1104. typescript = {
  1105. formatters = {
  1106. -- {
  1107. -- exe = "prettier",
  1108. -- args = {},
  1109. -- },
  1110. -- {
  1111. -- exe = "prettierd",
  1112. -- args = {},
  1113. -- },
  1114. -- {
  1115. -- exe = "prettier_d_slim",
  1116. -- args = {},
  1117. -- },
  1118. },
  1119. linters = {},
  1120. lsp = {
  1121. provider = "tsserver",
  1122. setup = {
  1123. cmd = {
  1124. -- TODO:
  1125. DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
  1126. "--stdio",
  1127. },
  1128. on_attach = common_on_attach,
  1129. on_init = common_on_init,
  1130. capabilities = common_capabilities,
  1131. },
  1132. },
  1133. },
  1134. typescriptreact = {
  1135. formatters = {
  1136. -- {
  1137. -- exe = "prettier",
  1138. -- args = {},
  1139. -- },
  1140. -- {
  1141. -- exe = "prettierd",
  1142. -- args = {},
  1143. -- },
  1144. -- {
  1145. -- exe = "prettier_d_slim",
  1146. -- args = {},
  1147. -- },
  1148. },
  1149. -- @usage can be {"eslint"} or {"eslint_d"}
  1150. linters = {},
  1151. lsp = {
  1152. provider = "tsserver",
  1153. setup = {
  1154. cmd = {
  1155. -- TODO:
  1156. DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
  1157. "--stdio",
  1158. },
  1159. on_attach = common_on_attach,
  1160. on_init = common_on_init,
  1161. capabilities = common_capabilities,
  1162. },
  1163. },
  1164. },
  1165. vim = {
  1166. formatters = {},
  1167. linters = { "" },
  1168. lsp = {
  1169. provider = "vimls",
  1170. setup = {
  1171. cmd = {
  1172. DATA_PATH .. "/lspinstall/vim/node_modules/.bin/vim-language-server",
  1173. "--stdio",
  1174. },
  1175. on_attach = common_on_attach,
  1176. on_init = common_on_init,
  1177. capabilities = common_capabilities,
  1178. },
  1179. },
  1180. },
  1181. vue = {
  1182. formatters = {
  1183. -- {
  1184. -- exe = "prettier",
  1185. -- args = {},
  1186. -- },
  1187. -- {
  1188. -- exe = "prettierd",
  1189. -- args = {},
  1190. -- },
  1191. -- {
  1192. -- exe = "prettier_d_slim",
  1193. -- args = {},
  1194. -- },
  1195. },
  1196. linters = {},
  1197. lsp = {
  1198. provider = "vuels",
  1199. setup = {
  1200. cmd = {
  1201. DATA_PATH .. "/lspinstall/vue/node_modules/.bin/vls",
  1202. },
  1203. on_attach = common_on_attach,
  1204. on_init = common_on_init,
  1205. capabilities = common_capabilities,
  1206. },
  1207. },
  1208. },
  1209. yaml = {
  1210. formatters = {
  1211. -- {
  1212. -- exe = "prettier",
  1213. -- args = {},
  1214. -- },
  1215. -- {
  1216. -- exe = "prettierd",
  1217. -- args = {},
  1218. -- },
  1219. },
  1220. linters = {},
  1221. lsp = {
  1222. provider = "yamlls",
  1223. setup = {
  1224. cmd = {
  1225. DATA_PATH .. "/lspinstall/yaml/node_modules/.bin/yaml-language-server",
  1226. "--stdio",
  1227. },
  1228. on_attach = common_on_attach,
  1229. on_init = common_on_init,
  1230. capabilities = common_capabilities,
  1231. },
  1232. },
  1233. },
  1234. zig = {
  1235. formatters = {},
  1236. linters = {},
  1237. lsp = {
  1238. provider = "zls",
  1239. setup = {
  1240. cmd = {
  1241. "zls",
  1242. },
  1243. on_attach = common_on_attach,
  1244. on_init = common_on_init,
  1245. capabilities = common_capabilities,
  1246. },
  1247. },
  1248. },
  1249. gdscript = {
  1250. formatters = {},
  1251. linters = {},
  1252. lsp = {
  1253. provider = "gdscript",
  1254. setup = {
  1255. cmd = {
  1256. "nc",
  1257. "localhost",
  1258. "6008",
  1259. },
  1260. on_attach = common_on_attach,
  1261. on_init = common_on_init,
  1262. capabilities = common_capabilities,
  1263. },
  1264. },
  1265. },
  1266. ps1 = {
  1267. formatters = {},
  1268. linters = {},
  1269. lsp = {
  1270. provider = "powershell_es",
  1271. setup = {
  1272. bundle_path = "",
  1273. on_attach = common_on_attach,
  1274. on_init = common_on_init,
  1275. capabilities = common_capabilities,
  1276. },
  1277. },
  1278. },
  1279. }
  1280. require("keymappings").config()
  1281. require("core.which-key").config()
  1282. require "core.status_colors"
  1283. require("core.gitsigns").config()
  1284. require("core.compe").config()
  1285. require("core.dashboard").config()
  1286. require("core.dap").config()
  1287. require("core.terminal").config()
  1288. require("core.telescope").config()
  1289. require("core.treesitter").config()
  1290. require("core.nvimtree").config()
  1291. require("core.project").config()
  1292. require("core.bufferline").config()
  1293. require("core.autopairs").config()
  1294. require("core.comment").config()