File tree Expand file tree Collapse file tree
config/nvim/lua/plugin-specs/lsp Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ -- Configure nvim-lspconfig to use the language servers I want.
12return 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.
3337end
Original file line number Diff line number Diff line change 1+ -- Configure none-ls to use the formatters I want, and set it up to auto-format
2+ -- on save.
13return 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 })
You can’t perform that action at this time.
0 commit comments