Neovim configs for 2023. Hopefully they last.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.2 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. -- Learn the keybindings, see :help lsp-zero-keybindings
  2. -- Learn to configure LSP servers, see :help lsp-zero-api-showcase
  3. local lsp = require('lsp-zero')
  4. lsp.preset('recommended')
  5. lsp.setup_nvim_cmp({
  6. experimental = {
  7. ghost_text = true,
  8. },
  9. })
  10. -- (Optional) Configure lua language server for neovim
  11. lsp.nvim_workspace()
  12. local platform = require("mason-core.platform");
  13. local servers = {
  14. 'tailwindcss',
  15. 'tsserver',
  16. 'texlab',
  17. 'pyright',
  18. 'efm',
  19. 'ltex',
  20. 'jsonls'
  21. }
  22. if not (platform.is.linux_x64_musl or
  23. platform.is.linux_arm64_musl)
  24. then
  25. table.insert(servers, "sumneko_lua");
  26. end
  27. lsp.ensure_installed({
  28. 'tailwindcss',
  29. 'tsserver',
  30. 'texlab',
  31. 'pyright',
  32. 'sumneko_lua',
  33. 'efm',
  34. 'ltex',
  35. 'jsonls'
  36. })
  37. lsp.configure("efm", {
  38. settings = {
  39. languages = {
  40. sh = "shellcheck -x",
  41. bash = "shellcheck -x",
  42. zsh = "shellcheck -x",
  43. }
  44. },
  45. filetypes = { "sh", "bash", "zsh" }
  46. })
  47. --lsp.on_attach(function(client, bufnr)
  48. -- local opts = { buffer = bufnr, remap = false }
  49. -- vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
  50. --end)
  51. lsp.setup()
  52. vim.diagnostic.config({
  53. virtual_text = true,
  54. underline = true,
  55. float = true,
  56. })