diff --git a/init.lua b/init.lua index ada6139..2514f9e 100644 --- a/init.lua +++ b/init.lua @@ -1,4 +1,2 @@ -- bootstrap lazy.nvim, LazyVim and your plugins require("config.lazy") -vim.g.copilot_no_tab_map = true -vim.api.nvim_set_keymap("i", "", 'copilot#Accept("")', { silent = true, expr = true }) diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua new file mode 100644 index 0000000..5383582 --- /dev/null +++ b/lua/config/lsp.lua @@ -0,0 +1,31 @@ +local null_ls = require("null-ls") + +local no_really = { + method = null_ls.methods.DIAGNOSTICS, + filetypes = { "markdown", "text", "tex" }, + generator = { + fn = function(params) + local diagnostics = {} + -- sources have access to a params object + -- containing info about the current file and editor state + for i, line in ipairs(params.content) do + local col, end_col = line:find("really") + if col and end_col then + -- null-ls fills in undefined positions + -- and converts source diagnostics into the required format + table.insert(diagnostics, { + row = i, + col = col, + end_col = end_col + 1, + source = "no-really", + message = "Don't use 'really!'", + severity = vim.diagnostic.severity.WARN, + }) + end + end + return diagnostics + end, + }, +} + +null_ls.register(no_really)