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.

57 lines
1.1 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
  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(servers)
  28. lsp.configure("efm", {
  29. settings = {
  30. languages = {
  31. sh = "shellcheck -x",
  32. bash = "shellcheck -x",
  33. zsh = "shellcheck -x",
  34. }
  35. },
  36. filetypes = { "sh", "bash", "zsh" }
  37. })
  38. lsp.on_attach(function(client, bufnr)
  39. local opts = { buffer = bufnr, remap = false }
  40. vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
  41. end)
  42. lsp.setup()
  43. vim.diagnostic.config({
  44. virtual_text = true,
  45. underline = true,
  46. float = true,
  47. })