default-config.lua 29 KB

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