mirror of
https://github.com/nix-community/nixvim.git
synced 2025-11-08 19:46:06 +01:00
plugins/perfanno: add perfanno-nvim plugin
This commit is contained in:
parent
7660d9ebb7
commit
5b0a6eb34b
2 changed files with 90 additions and 0 deletions
41
plugins/by-name/perfanno/default.nix
Normal file
41
plugins/by-name/perfanno/default.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{ lib, ... }:
|
||||
|
||||
lib.nixvim.plugins.mkNeovimPlugin {
|
||||
name = "perfanno";
|
||||
packPathName = "perfanno.nvim";
|
||||
package = "perfanno-nvim";
|
||||
description = "NeoVim lua plugin that annotates source code with profiling information from perf, LuaJIT, or other profilers.";
|
||||
|
||||
maintainers = [ lib.maintainers.fredeb ];
|
||||
|
||||
settingsExample = {
|
||||
line_highlights = lib.nixvim.nestedLiteralLua "require('perfanno.util').make_bg_highlights(nil, '#CC3300', 10)";
|
||||
vt_highlight = lib.nixvim.nestedLiteralLua "require('perfanno.util').make_fg_highlight('#CC3300')";
|
||||
formats = [
|
||||
{
|
||||
percent = true;
|
||||
format = "%.2f%%";
|
||||
minimum = 0.5;
|
||||
}
|
||||
{
|
||||
percent = false;
|
||||
format = "%d";
|
||||
minimum = 1;
|
||||
}
|
||||
];
|
||||
|
||||
annotate_after_load = true;
|
||||
annotate_on_open = true;
|
||||
telescope = {
|
||||
enabled = lib.nixvim.nestedLiteralLua "pcall(require, 'telescope')";
|
||||
annotate = true;
|
||||
};
|
||||
|
||||
ts_function_patterns = {
|
||||
default = [
|
||||
"function"
|
||||
"method"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
49
tests/test-sources/plugins/by-name/perfanno/default.nix
Normal file
49
tests/test-sources/plugins/by-name/perfanno/default.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
empty =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
plugins.perfanno.enable = !pkgs.stdenv.isDarwin;
|
||||
};
|
||||
|
||||
example =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
plugins.perfanno = {
|
||||
enable = !pkgs.stdenv.isDarwin;
|
||||
|
||||
settings = {
|
||||
line_highlights.__raw = ''require("perfanno.util").make_bg_highlights(nil, "#CC3300", 10)'';
|
||||
vt_highlight.__raw = ''require("perfanno.util").make_fg_highlight("#CC3300")'';
|
||||
formats = [
|
||||
{
|
||||
percent = true;
|
||||
format = "%.2f%%";
|
||||
minimum = 0.5;
|
||||
}
|
||||
{
|
||||
percent = false;
|
||||
format = "%d";
|
||||
minimum = 1;
|
||||
}
|
||||
];
|
||||
|
||||
annotate_after_load = true;
|
||||
annotate_on_open = true;
|
||||
telescope = {
|
||||
enabled.__raw = ''pcall(require, "telescope")'';
|
||||
annotate = true;
|
||||
};
|
||||
|
||||
ts_function_patterns = {
|
||||
default = [
|
||||
"function"
|
||||
"method"
|
||||
];
|
||||
weirdlang = [
|
||||
"weirdfunc"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue