project configs and template plugins for licensing

master
blob42 11 months ago
parent a1d6714a9f
commit 7090563294

@ -0,0 +1,18 @@
local ok, pconfig = pcall(require, "nvim-projectconfig")
if not ok then
vim.notify("missing module nvim-projectconfig", vim.log.levels.WARN)
return false
end
local M = {}
local config = {
project_dir = "~/.config/nvim-project-confs/", -- trailing slash important
selint = false,
}
M.setup = function()
pconfig.setup(config)
end
return M

@ -229,7 +229,17 @@ return {
override_priority = 2000, -- highest priority for my luasnips
}
end
}, -- }}}
},
-- vim templates
["https://codeberg.org/jgoguen/tmpl.vim"] = {
setup = function()
end
},
-- }}}
-- text formatting
--
@ -482,7 +492,7 @@ return {
end
},
-- session and view
-- sessions, projects and views
["vim-scripts/restore_view.vim"] = {}, -- TODO: check if still needed
@ -496,6 +506,11 @@ return {
-- end
-- },
["windwp/nvim-projectconfig"] = {
config = function()
require("custom.plugins.configs.projectconfig").setup()
end,
},
--
-- Misc / General plugins
@ -662,7 +677,7 @@ return {
--
['stevearc/aerial.nvim'] = {
lock = true,
-- lock = true,
after = { "base46" },
keys = { "<Right>" },
cmd = { "Aerial*" },

@ -27,9 +27,14 @@ local _PP_CONF = {
callbacks = pp_callbacks,
}
-- these are the custom callbacks that can be enabled from perproject files
-- setting manually the callbacks here is a safety measure from auto running
-- untrusted code from perproject files
-- TODO: load callbacks from a `callbacks_file` under `runtimepath`
local pp_callbacks = {
-- @enabled: bool
-- auto start lsp for this project
lsp_autostart = function(enabled)
if enabled then
local other_matching_configs = require('lspconfig.util').get_other_matching_providers(vim.bo.filetype)
@ -37,6 +42,15 @@ local pp_callbacks = {
config.launch()
end
end
end,
-- used for testing
-- create a `.pnvim.json` file with this content:
-- {
-- "test_callback": true
-- }
test_callback = function(enabled)
P("test callback")
end
}
@ -59,7 +73,8 @@ end
-- local scandir = require("plenary.scandir")
local function per_project_file()
--TODO:
local function per_project_dir()
local cwd = Path.new(vim.fn.getcwd())
local pp_dir = cwd:joinpath(_PP_CONF_.basename)
@ -82,8 +97,8 @@ local function per_project_file()
print("no " .. _PP_CONF.basename)
end
-- TODO:
-- check if there is a custom .nvim-lsp dir in working dir
-- TODO: handle directoryies
-- check if there is a custom .pnvim.json dir in working dir
-- each file inside .nvim-lsp represent a active option if
-- it is present
-- example
@ -95,6 +110,7 @@ end
M.per_project_jsonfile = function()
local cwd = Path.new(vim.fn.getcwd())
local pp_file = cwd:joinpath(_PP_CONF.basename)
-- if is file then load the file
if pp_file:is_file() then
local ok, decoded = pcall(vim.json.decode, (pp_file:read()))
if not ok then

@ -23,7 +23,7 @@ return M
-- if require
s("ifreq", fmt([[
local ok, {} = pcall(require, "{}")
if not ok then
if not ok then
vim.notify("missing module {}", vim.log.levels.WARN)
return
end

@ -0,0 +1 @@
Copyright (c) <# YEAR #> <# AUTHOR #>

@ -0,0 +1,14 @@
<$ COPYRIGHT.NOTICE $>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

@ -0,0 +1,15 @@
<$ COPYRIGHT.NOTICE $>
This file is part of <# PROGRAM #>.
<# PROGRAM #> is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
<# PROGRAM #> is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with <# PROGRAM #>. If not, see <http://www.gnu.org/licenses/>.

@ -0,0 +1,2 @@
<$ LICENSE.PERFILE.AGPL3 $>
Loading…
Cancel
Save