Skip to content

Instantly share code, notes, and snippets.

@gpproton
Created December 10, 2024 22:15
Show Gist options
  • Save gpproton/29717131b45c54a9c4eb409027100c37 to your computer and use it in GitHub Desktop.
Save gpproton/29717131b45c54a9c4eb409027100c37 to your computer and use it in GitHub Desktop.
Using auto-header with LazyVim to automatically create or update
-- NOTE: Ensure you update placeholder values
-- Create file in the location below
-- ~/.config/nvim/lua/plugins/auto-header.lua
-- Then sync lazyVim
Core_data = {
author_name = "<Your Name>",
author_mail = "<[email protected]>",
company = "<Your Company>",
}
Core_template = {
"",
" Author: #author_name (#author_mail)",
" Created At: #date_now",
" Modified By: #author_name (#author_mail)",
" Modified At: #date_now",
}
function Merge_table(table1, table2)
for _, value in ipairs(table2) do
table1[#table1 + 1] = value
end
return table1
end
return {
{
"VincentBerthier/auto-header.nvim",
config = function()
require("auto-header").setup({
create = true,
update = true,
languages = {
"cpp",
"python",
"bash",
"rust",
"go",
"zig",
"lua",
"csharp",
"typescript",
"javascript",
"yaml",
"jsonc",
},
key = nil,
templates = {
{
language = "*",
prefix = "auto",
block = "-",
block_length = 0,
before = {},
after = { "" },
template = Core_template,
data = Core_data,
track_change = {
"Modified At: ",
"Modified By: ",
},
},
},
projects = {
-- For OSUMT Project Ying
{
root = "/home/<user>/<project>",
data = Core_data,
template = Merge_table({
" Copyright (c) 2024 - #cp_year #company",
"",
" Licensed under the drolx Project License 1.0",
" you may not use this file except in compliance with the License.",
" https://your-company.com/licenses/project-license-1.0",
" Unless required by applicable law or agreed to in writing, software",
' distributed under the License is distributed on an "AS IS" BASIS,',
" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
" See the License for the specific language governing permissions and",
" limitations under the License.",
}, Core_template),
},
},
})
end,
},
}
// Copyright (c) 2024 - 2024 Your Company
//
// Licensed under the Sample Project License 1.0
// you may not use this file except in compliance with the License.
// https://you-company.com/licenses/project-license-1.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: Your Name ([email protected])
// Created At: Tue 10 Dec 2024 23:06:38
// Modified By: Your Name ([email protected])
// Modified At: Tue 10 Dec 2024 23:06:38
export default defineNuxtConfig({
extends: ['../base'],
modules: ['vuetify-nuxt-module', '@unocss/nuxt',],
devtools: { enabled: true },
compatibilityDate: '2024-04-03',
vuetify: {
vuetifyOptions: {
icons: {
defaultSet: 'mdi',
},
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment