GithubHelp home page GithubHelp logo

diogo-ss / 42-header.nvim Goto Github PK

View Code? Open in Web Editor NEW
28.0 2.0 6.0 716 KB

Neovim header for 42 projects. Written in Lua.

License: MIT License

Lua 100.00%
42header lua lua-plugin neovim neovim-lua-plugin neovim-plugin

42-header.nvim's Introduction

πŸ›Έ 42 Header

This plugin is whole re-write of 42header in Lua.

✨ Features

  • Command: Stdheader
  • Auto update on save (optional)
  • Supports commentstring
  • Supports Git

πŸš€ Showcase

header

🎈 Setup

πŸ“¦ Packer.nvim
use {
  "Diogo-ss/42-header.nvim",
  cmd = { "Stdheader" },
  config = function()
    require "42header"setup {
      default_map = true, -- Default mapping <F1> in normal mode.
      auto_update = true, -- Update header when saving.
      user = "username", -- Your user.
      mail = "[email protected]", -- Your mail.
    -- add other options.
    }
  end,
}
πŸ’€ Lazy.nvim
{
  "Diogo-ss/42-header.nvim",
  cmd = { "Stdheader" },
  keys = { "<F1>" },
  opts = {
    default_map = true, -- Default mapping <F1> in normal mode.
    auto_update = true, -- Update header when saving.
    user = "username", -- Your user.
    mail = "[email protected]", -- Your mail.
    -- add other options.
  },
  config = function(_, opts)
    require("42header").setup(opts)
  end,
}

βš™ Options

{
  ---Max header size (not recommended change).
  --length = 80,
  ---Header margin (not recommended change).
  --margin = 5,
  ---Activate default mapping (e.g. F1).
  default_map = true,
  ---Enable auto-update of headers.
  auto_update = true,
  ---Default user.name.
  user = "username",
  ---Default user.email.
  mail = "[email protected]",
  ---ASCII art.
  --asciiart = { "---", "---", ... },
  ---Git config.
  git = {
    ---Enable Git support.
    enabled = false,
    ---PATH to the Git binary.
    bin = "git",
    ---Use global user.name, otherwise use local user.name.
    user_global = true,
    ---Use global user.email, otherwise use local user.email.
    email_global = true,
  },
}

🌐 User and Mail

user and mail can be defined using global variables.

vim.g.user = "username"
vim.g.mail = "[email protected]"

NOTE: The order of priority: global variables > git config (if support enabled) > user config.

42-header.nvim's People

Contributors

diogo-ss avatar github-actions[bot] avatar jaredyalves avatar ofacy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

42-header.nvim's Issues

Instalação no Astrovim

Hey Diogo, tentei instalar atravΓ©s do instalador lazy.nvim sem sucesso, uso com o Astrovim no MacOS. Pode me ajudar?

Add a option to search for user and email in ~/.gitconfig

First of all thanks a lot for writing this very useful extension for us nvim users.

My suggestion is basically this : have a option that will make the header email and user be based on the info of the gitconfig, if it's a repo the file being edited is currently in.

I'm pretty sure this is not as straightforward as i make it sound, and would love to help you with this if you need any help.

ci: rewriting

  • using actions instead of commands
  • ci in the more is only triggered manually
  • add luacheck for other branches

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.