diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..afd8b9b --- /dev/null +++ b/.luarc.json @@ -0,0 +1,7 @@ +{ + "diagnostics.disable": [ + "undefined-global", + "unused-local" + ] +} + diff --git a/lua/crentist/init.lua b/lua/crentist/init.lua index fc8596f..a117e40 100644 --- a/lua/crentist/init.lua +++ b/lua/crentist/init.lua @@ -4,4 +4,5 @@ require("crentist.autocmd") require("crentist.lazy_init") require("crentist.filetype") require("crentist.luasnip") +require("crentist.null-ls") diff --git a/lua/crentist/lazy/none-ls.lua b/lua/crentist/lazy/none-ls.lua new file mode 100644 index 0000000..5a22535 --- /dev/null +++ b/lua/crentist/lazy/none-ls.lua @@ -0,0 +1,11 @@ +return { + 'nvimtools/none-ls.nvim', + -- Optional dependencies + dependencies = { 'nvim-lua/plenary.nvim' }, + opts = {}, + config = function() + local null_ls = require('null-ls') + null_ls.setup({}) + end +} + diff --git a/lua/crentist/null-ls.lua b/lua/crentist/null-ls.lua new file mode 100644 index 0000000..f4a25b9 --- /dev/null +++ b/lua/crentist/null-ls.lua @@ -0,0 +1,51 @@ +-- https://www.youtube.com/watch?v=q-oBU2fO1H4&t=189s +local null_ls = require("null-ls") + +-- local function check_if_comment(node, params) +-- if node == 'nil' then return false +-- if node:type() ~= 'comment' or node:type() ~= 'comment_content' then return false end +-- +-- if node:type() == 'comment' then +-- local child = node:child() +-- +-- if child == 'nil' then return false end +-- end +-- +-- -- node exists and is a part of comment +-- if node == 'nil' or node:type() ~= 'comment' or node:type() ~= 'comment_content' then return false end +-- +-- local parent = node:parent() +-- if parent == 'nil' or parent:type() ~= 'comment' then return false end +-- +-- local text = vim.treesitter.get_node_text(node, ) +-- end + +-- null_ls.register({ +-- name = 'Comment actions', +-- method = null_ls.methods.CODE_ACTION, +-- filetypes = {}, +-- generator = { +-- fn = function(params) +-- local out = {} +-- +-- table.insert(out, +-- { +-- title = 'Test', +-- action = function() +-- print(vim.treesitter.get_node()) +-- end +-- }) +-- return out +-- end +-- } +-- }) + + +vim.keymap.set({ "i", "s" }, "", function() + vim.lsp.buf.code_action() +end, { desc = "Snippet next argument", silent = true }) + +vim.keymap.set("n", "gra", function() + vim.lsp.buf.code_action() +end, { desc = "Snippet next argument", silent = true }) +