Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cant get it to work (newbie) #3

Open
Shoxx98 opened this issue Mar 20, 2024 · 0 comments
Open

cant get it to work (newbie) #3

Shoxx98 opened this issue Mar 20, 2024 · 0 comments

Comments

@Shoxx98
Copy link

Shoxx98 commented Mar 20, 2024

loaded it with lazy.nvim using this config:

return{
    {
        'VincentBerthier/auto-header.nvim',

        config = function ()
            require("auto-header").setup({
                -- if true, a header will automatically be added when a file is first saved
                create = true,
                -- if true, some fields of the existing header will be updated
                update = true,
                -- languages for which the plugin is enabled. To enable it to all files, add "*"
                languages = { "cpp", "python", "bash", "rust", "lua" },
                -- The keybinding to use (in normal mode only) that will add or refresh the header
                -- Note that it will ignore the create / update parameters specified above, but
                -- will still require a valid template and project information.
                key = nil,
                -- The templates to use to create the headers, one by language ("*" will be used if no specific one was found)
                -- The language is determined by neovim’s buffer filetype.
                templates = {
                    {
                        -- The language for which this template applies
                        language = "*",
                        -- The prefix of each line of the header ("auto" is allowed, the buffer’s commentstring will then be used)
                        prefix = "auto",
                        -- If block and block_length are both set, the header will take the form of a block
                        block = "-",
                        block_length = 0,
                        -- Lines to add before the header
                        before = {},
                        -- Lines to add after the header
                        after = { "4" },
                        -- The comment lines of the buffer
                        -- Some fields preceded by # will be set if known or given
                        template = {
                            "File: #file_relative_path",
                            "Project: #project_name",
                            "Creation date: #date_now",
                            "Author: #author_name <#author_mail>",
                            "-----",
                            "Last modified: #date_now",
                            "Modified By: #author_name <#author_mail>",
                            "-----",
                            -- module.license.MIT
                        },
                        data = {
                            author_name = "",
                            author_mail = "",
                        },
                        -- All the lines beginning with these patterns will be updated
                        track_change = {
                            "File: ",
                            "Last modified: ",
                            "Modified By: ",
                            "Copyright ",
                        },
                    }
                },
            })
        end

    }
}

also tried to use it, just using the first line ('VincentBerthier/auto-header.nvim')

steps to reproduce:

  • make file (sdfjk.lua) using % in Netrw
  • save it using :w
  • optional: run :AutoHeader
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant