Export $FZF_KEY environment variable to child processes

It's the name of the last key pressed.

Related #3412
This commit is contained in:
Junegunn Choi
2024-04-13 14:00:16 +09:00
parent a4745626dd
commit fd1ba46f77
8 changed files with 315 additions and 121 deletions

View File

@@ -176,3 +176,15 @@ func RepeatToFill(str string, length int, limit int) string {
}
return output
}
// ToKebabCase converts the given CamelCase string to kebab-case
func ToKebabCase(s string) string {
name := ""
for i, r := range s {
if i > 0 && r >= 'A' && r <= 'Z' {
name += "-"
}
name += string(r)
}
return strings.ToLower(name)
}