dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

mason.lua (1836B)


      1 -- https://github.com/mason-org/mason.nvim
      2 
      3 -- ~/.config/nvim/lua/plugins/mason.lua
      4 return {
      5     {
      6         "williamboman/mason.nvim",
      7         config = function()
      8             require("mason").setup()
      9         end,
     10     },
     11     {
     12         "williamboman/mason-lspconfig.nvim",
     13         dependencies = { "williamboman/mason.nvim", "neovim/nvim-lspconfig" },
     14         config = function()
     15             require("mason-lspconfig").setup({
     16                 ensure_installed = {
     17                     "lua_ls",
     18 
     19                     "pyright",
     20                 },
     21             automatic_installation = true,
     22             })
     23 
     24             local lspconfig = require("lspconfig")
     25 
     26             -- Example: configure LSP servers here
     27             local servers = {
     28                 "lua_ls",
     29                 "pyright",
     30                 "clangd",
     31                 -- "rust-analyzer",
     32                 -- "tsserver"
     33             }
     34             for _, server in ipairs(servers) do
     35                 lspconfig[server].setup({})
     36             end
     37         end,
     38     },
     39     {
     40         "jay-babu/mason-null-ls.nvim",
     41         dependencies = {
     42             "williamboman/mason.nvim",
     43             "nvimtools/none-ls.nvim", -- formerly "jose-elias-alvarez/null-ls.nvim"
     44         },
     45         config = function()
     46             require("mason-null-ls").setup({
     47                 ensure_installed = {
     48                     "prettier",
     49                     "stylua",
     50                     "black",
     51                 },
     52                 automatic_installation = true,
     53             })
     54             local null_ls = require("null-ls")
     55 
     56             null_ls.setup({
     57                 sources = {
     58                     null_ls.builtins.formatting.prettier,
     59                     null_ls.builtins.formatting.stylua,
     60                     null_ls.builtins.formatting.black,
     61                 },
     62             })
     63         end,
     64     },
     65 }