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.

43 lines
893 B

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. local lspconfig = require('lspconfig');
  5. lsp.preset('recommended')
  6. -- (Optional) Configure lua language server for neovim
  7. lsp.nvim_workspace()
  8. lsp.ensure_installed({
  9. 'tailwindcss',
  10. 'tsserver',
  11. 'texlab',
  12. 'pyright',
  13. 'sumneko_lua',
  14. 'efm',
  15. 'ltex',
  16. 'jsonls'
  17. })
  18. lsp.configure("efm", {
  19. settings = {
  20. languages = {
  21. sh = "shellcheck -x",
  22. bash = "shellcheck -x",
  23. zsh = "shellcheck -x",
  24. }
  25. },
  26. filetypes = { "sh", "bash", "zsh" }
  27. })
  28. lsp.on_attach(function(client, bufnr)
  29. local opts = { buffer = bufnr, remap = false }
  30. vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
  31. end)
  32. lsp.setup()
  33. vim.diagnostic.config({
  34. virtual_text = true,
  35. underline = true,
  36. float = true,
  37. })