Important notice
This project is currently hosted on GitHub. This is not ideal; GitHub is a proprietary, trade-secret system that is not Free and Open Souce Software (FOSS). I'm deeply concerned about using a proprietary system like GitHub to develop our FOSS project. I urge you to read about the Give up GitHub campaign from the Software Freedom Conservancy to understand some of the reasons why GitHub is not a good place to host FOSS projects.
With that in mind, i'll be migrating this repository to sourcehut on August 1st, after that, with the intent of keeping users and contributors informed, this repository will be archived, and all of it's files and commit history will be removed (with the exception of this notice), keep in mind that development will happen exclusively at sourcehut
Any use of this project's code by GitHub Copilot, past or present, is done without my permission. I do not consent to GitHub's use of this project's code in Copilot.
nvim-startup.lua
Displays neovim startup time
Summary
Installation
If you're using one of these plugin managers:
The installation method is pretty much the same for all of them, simply initialize the plugin manager and include henriquehbr/nvim-startup.lua
on the list
Otherwise, if you're using pathogen
, simply clone it on your ~/.vim/bundle
directory:
$ git clone --depth 1 https://github.com/henriquehbr/nvim-startup.lua
nvim-startup
is intended to be immediately executed on (n)vim startup, so if your plugin manager has some sort ofopt
funcionality that marks it as a optional plugin, avoid it!
Usage
To get it up and running, first, require
it on your config:
require 'nvim-startup'.setup()
Then, the last step required for the plugin to work effectively, is to create a alias on your .bashrc
or .zshrc
like the one below:
alias nvim='nvim --startuptime /tmp/nvim-startuptime'
By default,
nvim-startup
uses/tmp/nvim-startuptime
as it's startup log file, but if you need to change that, you can specify a different path on theg:nvim_startup_file
global variable
After that, you're done, just reload your nvim and hopefully you will see a message just like that:
nvim-startup: running on the next (n)vim instance
Don't worry, that means the plugin still couldn't find the startup time log file on the first run, it's completely normal and expected to happen, it will work fine on subsequent runs of vim, with the message below:
nvim-startup: launched in <x> ms
Configuration
The example below represents all the possible settings with their respective types and default values
require 'nvim-startup'.setup {
startup_file = '/tmp/nvim-startuptime' -- sets startup log path (string)
message = 'Whoa! those {} are pretty fast' -- sets a custom message (string | function)
message = function(time) -- function-based custom message
time < 100 and 'Just {}? really good!' or 'Those {} can get faster'
end
}
Contribution guidelines
Requirements
The following tools are needed in order to properly setup the development workflow:
Steps
If you're willing to contribute to nvim-startup
, it's highly recommended to follow the steps below (for organization purposes)
- Fork the repo
- Open a new branch following one of the following naming patterns
feat/<branch_name>
for featuresfix/<branch_name>
for bugfixeschore/<branch_name>
for small changes that doesn't fit the ones above
- Run
make init
to setup the development environment - All commits must follow a similar naming pattern as the branches (which will be enforced by
commitlint
), examples below:feat: <commit_message>
for featuresfix: <commit_message>
for bugfixeschore: <commit_message>
for small changes that doesn't fit the ones above
- Submit your PR! (preferably a small one and concise one, for a faster code review)
Pull requests that stricly follow the recommendations above will have higher priority in contrast of those who don't