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.

49 lines
926 B

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. lsp.ensure_installed({
  13. 'tailwindcss',
  14. 'tsserver',
  15. 'texlab',
  16. 'pyright',
  17. 'sumneko_lua',
  18. 'efm',
  19. 'ltex',
  20. 'jsonls'
  21. })
  22. lsp.configure("efm", {
  23. settings = {
  24. languages = {
  25. sh = "shellcheck -x",
  26. bash = "shellcheck -x",
  27. zsh = "shellcheck -x",
  28. }
  29. },
  30. filetypes = { "sh", "bash", "zsh" }
  31. })
  32. lsp.on_attach(function(client, bufnr)
  33. local opts = { buffer = bufnr, remap = false }
  34. vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
  35. end)
  36. lsp.setup()
  37. vim.diagnostic.config({
  38. virtual_text = true,
  39. underline = true,
  40. float = true,
  41. })