Skip to content

Commit

Permalink
feat(null ls): added null ls
Browse files Browse the repository at this point in the history
  • Loading branch information
felicandalc committed May 26, 2022
1 parent ca8c0d7 commit 1bcec84
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions lua/nn/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ end

require("nn.lsp.lsp-installer")
require("nn.lsp.handlers").setup()
require "nn.lsp.null-ls"
19 changes: 19 additions & 0 deletions lua/nn/lsp/null-ls.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
local null_ls_status_ok, null_ls = pcall(require, "null-ls")
if not null_ls_status_ok then
return
end

-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
local formatting = null_ls.builtins.formatting
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
local diagnostics = null_ls.builtins.diagnostics

null_ls.setup({
debug = false,
sources = {
formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }),
formatting.black.with({ extra_args = { "--fast" } }),
formatting.stylua,
-- diagnostics.flake8
},
})
1 change: 1 addition & 0 deletions lua/nn/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ return packer.startup(function(use)
-- LSP
use "neovim/nvim-lspconfig"
use "williamboman/nvim-lsp-installer"
use "jose-elias-alvarez/null-ls.nvim" -- For formatters and linters

-- Telescope
use "nvim-telescope/telescope.nvim"
Expand Down
5 changes: 5 additions & 0 deletions plugin/packer_compiled.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ _G.packer_plugins = {
path = "/home/nn/.local/share/nvim/site/pack/packer/opt/markdown-preview.nvim",
url = "https://github.com/iamcco/markdown-preview.nvim"
},
["null-ls.nvim"] = {
loaded = true,
path = "/home/nn/.local/share/nvim/site/pack/packer/start/null-ls.nvim",
url = "https://github.com/jose-elias-alvarez/null-ls.nvim"
},
["nvim-autopairs"] = {
loaded = true,
path = "/home/nn/.local/share/nvim/site/pack/packer/start/nvim-autopairs",
Expand Down

0 comments on commit 1bcec84

Please sign in to comment.