default-config.lua 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299
  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. "--stdio",
  283. },
  284. on_attach = common_on_attach,
  285. on_init = common_on_init,
  286. capabilities = common_capabilities,
  287. },
  288. },
  289. },
  290. css = {
  291. formatters = {
  292. -- {
  293. -- 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. on_attach = common_on_attach,
  809. on_init = common_on_init,
  810. capabilities = common_capabilities,
  811. },
  812. },
  813. },
  814. javascript = {
  815. formatters = {
  816. -- {
  817. -- exe = "prettier",
  818. -- args = {},
  819. -- },
  820. -- {
  821. -- exe = "prettier_d_slim",
  822. -- args = {},
  823. -- },
  824. -- {
  825. -- exe = "prettierd",
  826. -- args = {},
  827. -- },
  828. },
  829. -- @usage can be {"eslint"} or {"eslint_d"}
  830. linters = {},
  831. lsp = {
  832. provider = "tsserver",
  833. setup = {
  834. cmd = {
  835. -- TODO:
  836. DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
  837. "--stdio",
  838. },
  839. on_attach = common_on_attach,
  840. on_init = common_on_init,
  841. capabilities = common_capabilities,
  842. },
  843. },
  844. },
  845. javascriptreact = {
  846. formatters = {
  847. -- {
  848. -- exe = "prettier",
  849. -- args = {},
  850. -- },
  851. -- {
  852. -- exe = "prettier_d_slim",
  853. -- args = {},
  854. -- },
  855. -- {
  856. -- exe = "prettierd",
  857. -- args = {},
  858. -- },
  859. },
  860. linters = {},
  861. lsp = {
  862. provider = "tsserver",
  863. setup = {
  864. cmd = {
  865. -- TODO:
  866. DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
  867. "--stdio",
  868. },
  869. on_attach = common_on_attach,
  870. on_init = common_on_init,
  871. capabilities = common_capabilities,
  872. },
  873. },
  874. },
  875. python = {
  876. formatters = {
  877. -- {
  878. -- exe = "yapf",
  879. -- args = {},
  880. -- },
  881. -- {
  882. -- exe = "isort",
  883. -- args = {},
  884. -- },
  885. },
  886. linters = {},
  887. lsp = {
  888. provider = "pyright",
  889. setup = {
  890. cmd = {
  891. DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver",
  892. "--stdio",
  893. },
  894. on_attach = common_on_attach,
  895. on_init = common_on_init,
  896. capabilities = common_capabilities,
  897. },
  898. },
  899. },
  900. -- R -e 'install.packages("formatR",repos = "http://cran.us.r-project.org")'
  901. -- R -e 'install.packages("readr",repos = "http://cran.us.r-project.org")'
  902. r = {
  903. formatters = {
  904. -- {
  905. -- exe = "format_r",
  906. -- args = {},
  907. -- },
  908. },
  909. linters = {},
  910. lsp = {
  911. provider = "r_language_server",
  912. setup = {
  913. cmd = {
  914. "R",
  915. "--slave",
  916. "-e",
  917. "languageserver::run()",
  918. },
  919. on_attach = common_on_attach,
  920. on_init = common_on_init,
  921. capabilities = common_capabilities,
  922. },
  923. },
  924. },
  925. ruby = {
  926. formatters = {
  927. -- {
  928. -- exe = "rufo",
  929. -- args = {},
  930. -- },
  931. },
  932. linters = {},
  933. lsp = {
  934. provider = "solargraph",
  935. setup = {
  936. cmd = {
  937. DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph",
  938. "stdio",
  939. },
  940. on_attach = common_on_attach,
  941. on_init = common_on_init,
  942. capabilities = common_capabilities,
  943. filetypes = { "ruby" },
  944. init_options = {
  945. formatting = true,
  946. },
  947. root_dir = function(fname)
  948. local util = require("lspconfig").util
  949. return util.root_pattern("Gemfile", ".git")(fname)
  950. end,
  951. settings = {
  952. solargraph = {
  953. diagnostics = true,
  954. },
  955. },
  956. },
  957. },
  958. },
  959. rust = {
  960. formatters = {
  961. -- {
  962. -- exe = "rustfmt",
  963. -- args = {},
  964. -- },
  965. },
  966. linters = {},
  967. lsp = {
  968. provider = "rust_analyzer",
  969. setup = {
  970. cmd = {
  971. DATA_PATH .. "/lspinstall/rust/rust-analyzer",
  972. },
  973. on_attach = common_on_attach,
  974. on_init = common_on_init,
  975. capabilities = common_capabilities,
  976. },
  977. },
  978. },
  979. scala = {
  980. formatters = {
  981. -- {
  982. -- exe = "scalafmt",
  983. -- args = {},
  984. -- },
  985. },
  986. linters = { "" },
  987. lsp = {
  988. provider = "metals",
  989. setup = {
  990. on_attach = common_on_attach,
  991. on_init = common_on_init,
  992. capabilities = common_capabilities,
  993. },
  994. },
  995. },
  996. sh = {
  997. formatters = {
  998. -- {
  999. -- exe = "shfmt",
  1000. -- args = {},
  1001. -- },
  1002. },
  1003. linters = {},
  1004. lsp = {
  1005. provider = "bashls",
  1006. setup = {
  1007. cmd = {
  1008. DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server",
  1009. "start",
  1010. },
  1011. on_attach = common_on_attach,
  1012. on_init = common_on_init,
  1013. capabilities = common_capabilities,
  1014. },
  1015. },
  1016. },
  1017. svelte = {
  1018. formatters = {},
  1019. linters = {},
  1020. lsp = {
  1021. provider = "svelte",
  1022. setup = {
  1023. cmd = {
  1024. DATA_PATH .. "/lspinstall/svelte/node_modules/.bin/svelteserver",
  1025. "--stdio",
  1026. },
  1027. on_attach = common_on_attach,
  1028. on_init = common_on_init,
  1029. capabilities = common_capabilities,
  1030. },
  1031. },
  1032. },
  1033. swift = {
  1034. formatters = {
  1035. -- {
  1036. -- exe = "swiftformat",
  1037. -- args = {},
  1038. -- },
  1039. },
  1040. linters = {},
  1041. lsp = {
  1042. provider = "sourcekit",
  1043. setup = {
  1044. cmd = {
  1045. "xcrun",
  1046. "sourcekit-lsp",
  1047. },
  1048. on_attach = common_on_attach,
  1049. on_init = common_on_init,
  1050. capabilities = common_capabilities,
  1051. },
  1052. },
  1053. },
  1054. tailwindcss = {
  1055. active = false,
  1056. filetypes = {
  1057. "html",
  1058. "css",
  1059. "scss",
  1060. "javascript",
  1061. "javascriptreact",
  1062. "typescript",
  1063. "typescriptreact",
  1064. },
  1065. },
  1066. terraform = {
  1067. formatters = {
  1068. -- {
  1069. -- exe = "terraform_fmt",
  1070. -- args = {},
  1071. -- },
  1072. },
  1073. linters = {},
  1074. lsp = {
  1075. provider = "terraformls",
  1076. setup = {
  1077. cmd = {
  1078. DATA_PATH .. "/lspinstall/terraform/terraform-ls",
  1079. "serve",
  1080. },
  1081. on_attach = common_on_attach,
  1082. on_init = common_on_init,
  1083. capabilities = common_capabilities,
  1084. },
  1085. },
  1086. },
  1087. tex = {
  1088. formatters = {},
  1089. linters = {},
  1090. lsp = {
  1091. provider = "texlab",
  1092. setup = {
  1093. cmd = { DATA_PATH .. "/lspinstall/latex/texlab" },
  1094. on_attach = common_on_attach,
  1095. on_init = common_on_init,
  1096. capabilities = common_capabilities,
  1097. },
  1098. },
  1099. },
  1100. typescript = {
  1101. formatters = {
  1102. -- {
  1103. -- exe = "prettier",
  1104. -- args = {},
  1105. -- },
  1106. -- {
  1107. -- exe = "prettierd",
  1108. -- args = {},
  1109. -- },
  1110. -- {
  1111. -- exe = "prettier_d_slim",
  1112. -- args = {},
  1113. -- },
  1114. },
  1115. linters = {},
  1116. lsp = {
  1117. provider = "tsserver",
  1118. setup = {
  1119. cmd = {
  1120. -- TODO:
  1121. DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
  1122. "--stdio",
  1123. },
  1124. on_attach = common_on_attach,
  1125. on_init = common_on_init,
  1126. capabilities = common_capabilities,
  1127. },
  1128. },
  1129. },
  1130. typescriptreact = {
  1131. formatters = {
  1132. -- {
  1133. -- exe = "prettier",
  1134. -- args = {},
  1135. -- },
  1136. -- {
  1137. -- exe = "prettierd",
  1138. -- args = {},
  1139. -- },
  1140. -- {
  1141. -- exe = "prettier_d_slim",
  1142. -- args = {},
  1143. -- },
  1144. },
  1145. -- @usage can be {"eslint"} or {"eslint_d"}
  1146. linters = {},
  1147. lsp = {
  1148. provider = "tsserver",
  1149. setup = {
  1150. cmd = {
  1151. -- TODO:
  1152. DATA_PATH .. "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
  1153. "--stdio",
  1154. },
  1155. on_attach = common_on_attach,
  1156. on_init = common_on_init,
  1157. capabilities = common_capabilities,
  1158. },
  1159. },
  1160. },
  1161. vim = {
  1162. formatters = {},
  1163. linters = { "" },
  1164. lsp = {
  1165. provider = "vimls",
  1166. setup = {
  1167. cmd = {
  1168. DATA_PATH .. "/lspinstall/vim/node_modules/.bin/vim-language-server",
  1169. "--stdio",
  1170. },
  1171. on_attach = common_on_attach,
  1172. on_init = common_on_init,
  1173. capabilities = common_capabilities,
  1174. },
  1175. },
  1176. },
  1177. vue = {
  1178. formatters = {
  1179. -- {
  1180. -- exe = "prettier",
  1181. -- args = {},
  1182. -- },
  1183. -- {
  1184. -- exe = "prettierd",
  1185. -- args = {},
  1186. -- },
  1187. -- {
  1188. -- exe = "prettier_d_slim",
  1189. -- args = {},
  1190. -- },
  1191. },
  1192. linters = {},
  1193. lsp = {
  1194. provider = "vuels",
  1195. setup = {
  1196. cmd = {
  1197. DATA_PATH .. "/lspinstall/vue/node_modules/.bin/vls",
  1198. },
  1199. on_attach = common_on_attach,
  1200. on_init = common_on_init,
  1201. capabilities = common_capabilities,
  1202. },
  1203. },
  1204. },
  1205. yaml = {
  1206. formatters = {
  1207. -- {
  1208. -- exe = "prettier",
  1209. -- args = {},
  1210. -- },
  1211. -- {
  1212. -- exe = "prettierd",
  1213. -- args = {},
  1214. -- },
  1215. },
  1216. linters = {},
  1217. lsp = {
  1218. provider = "yamlls",
  1219. setup = {
  1220. cmd = {
  1221. DATA_PATH .. "/lspinstall/yaml/node_modules/.bin/yaml-language-server",
  1222. "--stdio",
  1223. },
  1224. on_attach = common_on_attach,
  1225. on_init = common_on_init,
  1226. capabilities = common_capabilities,
  1227. },
  1228. },
  1229. },
  1230. zig = {
  1231. formatters = {},
  1232. linters = {},
  1233. lsp = {
  1234. provider = "zls",
  1235. setup = {
  1236. cmd = {
  1237. "zls",
  1238. },
  1239. on_attach = common_on_attach,
  1240. on_init = common_on_init,
  1241. capabilities = common_capabilities,
  1242. },
  1243. },
  1244. },
  1245. gdscript = {
  1246. formatters = {},
  1247. linters = {},
  1248. lsp = {
  1249. provider = "gdscript",
  1250. setup = {
  1251. cmd = {
  1252. "nc",
  1253. "localhost",
  1254. "6008",
  1255. },
  1256. on_attach = common_on_attach,
  1257. on_init = common_on_init,
  1258. capabilities = common_capabilities,
  1259. },
  1260. },
  1261. },
  1262. ps1 = {
  1263. formatters = {},
  1264. linters = {},
  1265. lsp = {
  1266. provider = "powershell_es",
  1267. setup = {
  1268. bundle_path = "",
  1269. on_attach = common_on_attach,
  1270. on_init = common_on_init,
  1271. capabilities = common_capabilities,
  1272. },
  1273. },
  1274. },
  1275. }
  1276. require("keymappings").config()
  1277. require("core.which-key").config()
  1278. require "core.status_colors"
  1279. require("core.gitsigns").config()
  1280. require("core.compe").config()
  1281. require("core.dashboard").config()
  1282. require("core.dap").config()
  1283. require("core.terminal").config()
  1284. require("core.telescope").config()
  1285. require("core.treesitter").config()
  1286. require("core.nvimtree").config()
  1287. require("core.rooter").config()
  1288. require("core.bufferline").config()