Skip to content

Commit 3b766e4

Browse files
committed
More commenting of Neovim config
1 parent 6e83b82 commit 3b766e4

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

config/nvim/lua/plugin-specs/lsp/lspconfig-config.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
-- Configure nvim-lspconfig to use the language servers I want.
12
return function()
23
local lspconfig = require("lspconfig")
3-
local capabilities = require("cmp_nvim_lsp").default_capabilities()
44

5+
-- The language servers need to know what capabilities our completion
6+
-- system supports. This fetches the capabilities to pass along to them.
7+
local capabilities = require("cmp_nvim_lsp").default_capabilities()
58
local opts = { capabilities = capabilities }
9+
610
local dotfiles_env = os.getenv("DOTFILES_ENV")
711

812
if dotfiles_env == "home" then
@@ -28,6 +32,6 @@ return function()
2832
vim.fn.sign_define("DiagnosticSignInfo", { text = "󰋽 ", texthl = "DiagnosticSignInfo" })
2933
vim.fn.sign_define("DiagnosticSignHint", { text = "󰌶", texthl = "DiagnosticSignHint" })
3034

31-
-- Language servers can be configured on a per-project basis using exrc.
32-
-- See the .nvim.lua file in .dotfiles for an example.
35+
-- Language servers can also be configured on a per-project basis using
36+
-- exrc. See the .nvim.lua file in .dotfiles for an example.
3337
end

config/nvim/lua/plugin-specs/lsp/null-ls-config.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
-- Configure none-ls to use the formatters I want, and set it up to auto-format
2+
-- on save.
13
return function()
24
local null_ls = require("null-ls")
35
local formatting = null_ls.builtins.formatting
@@ -7,9 +9,7 @@ return function()
79

810
if dotfiles_env == "home" then
911
sources = {
10-
formatting.prettierd.with({
11-
disabled_filetypes = { "ruby" },
12-
}),
12+
formatting.prettierd,
1313
formatting.stylua,
1414
}
1515
end
@@ -28,6 +28,8 @@ return function()
2828

2929
null_ls.setup({
3030
sources = sources,
31+
-- This sets up auto-formatting on save. Taken from:
32+
-- https://github.com/jose-elias-alvarez/null-ls.nvim/wiki/Formatting-on-save
3133
on_attach = function(client, bufnr)
3234
if client.supports_method("textDocument/formatting") then
3335
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })

0 commit comments

Comments
 (0)