perf.kak (1328B)
1 provide-module perf-report %{ 2 add-highlighter shared/perf-report group 3 add-highlighter shared/perf-report/above_threshold regex '\b([5-9]|\d{2})\.\d+%' 0:red 4 add-highlighter shared/perf-report/below_threshold regex '\b[0-4]\.\d+%' 0:green 5 6 7 define-command -override perf-report-focus %{ 8 execute-keys 'xs...\d+\.\d+%<ret><a-:><a-semicolon>vtv<lt><semicolon>' 9 } 10 } 11 12 hook -group perf-report-highlight global WinSetOption filetype=perf-report %{ 13 require-module perf-report 14 add-highlighter window/perf-report ref perf-report 15 hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/perf-report } 16 17 map window normal <ret> ': perf-report-focus<ret>' 18 } 19 20 provide-module perf-annotate %{ 21 require-module gas 22 add-highlighter shared/perf-annotate group 23 add-highlighter shared/perf-annotate/gas ref gas 24 add-highlighter shared/perf-annotate/above_threshold regex '^\h+([1-9]|\d{2})\.\d+\b' 0:red 25 add-highlighter shared/perf-annotate/below_threshold regex '^\h+0\.\d+\b' 0:green 26 } 27 28 hook -group perf-annotate-highlight global WinSetOption filetype=perf-annotate %{ 29 require-module perf-annotate 30 add-highlighter window/perf-annotate ref perf-annotate 31 hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/perf-annotate } 32 }