Skip to content

Commit

Permalink
feat(nvim): add mason-null-ls plugin, pylsp lsp, and black formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
alexiszamanidis committed Jul 1, 2024
1 parent 69a2fcf commit 0890eba
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
14 changes: 11 additions & 3 deletions nvim/.config/nvim/after/plugin/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,22 @@ local cmp_mappings = lsp.defaults.cmp_mappings({
-- cmp_mappings["<Tab>"] = nil
-- cmp_mappings["<S-Tab>"] = nil

local cmp = require("cmp")
local cmp_action = lsp.cmp_action()

cmp.setup({
mapping = cmp_mappings,
})

require("fidget").setup({})
require("mason").setup({})
require("mason-null-ls").setup({
ensure_installed = {
"beautysh",
"codespell",
"eslint",
"prettier",
"google_java_format",
"black",
},
})
require("mason-lspconfig").setup({
-- Replace the language servers listed here
-- with the ones you want to install
Expand All @@ -46,6 +53,7 @@ require("mason-lspconfig").setup({
"bashls",
"prismals",
"jdtls",
"pylsp",
},
handlers = {
lsp.default_setup,
Expand Down
1 change: 1 addition & 0 deletions nvim/.config/nvim/after/plugin/null-ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ null_ls.setup({
require("none-ls.code_actions.eslint"), -- JavaScript etc
formatting.prettier, -- javascript etc
formatting.google_java_format, -- java
formatting.black, -- java
},
-- you can reuse a shared lspconfig on_attach callback here
on_attach = function(client, bufnr)
Expand Down
1 change: 1 addition & 0 deletions nvim/.config/nvim/lua/user/packer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ return packer.startup(function(use)
{ "neovim/nvim-lspconfig" },
{ "williamboman/mason.nvim" },
{ "williamboman/mason-lspconfig.nvim" },
{ "jay-babu/mason-null-ls.nvim" },

-- Autocompletion
{ "hrsh7th/nvim-cmp" },
Expand Down

0 comments on commit 0890eba

Please sign in to comment.