diff options
| author | Frank LENORMAND <lenormf@gmail.com> | 2017-05-15 22:27:22 +0300 |
|---|---|---|
| committer | Frank LENORMAND <lenormf@gmail.com> | 2017-05-15 22:27:22 +0300 |
| commit | d5726c0cfd3f4e872c6f85c6596ecb78614589f2 (patch) | |
| tree | e00ec8ea70c228689097b788224a585cbf6e769a /share | |
| parent | 3a0d9481ac0d037deb43fe93f35318acae763d6b (diff) | |
kakrc: Simplify and optimize the autoload function
Diffstat (limited to 'share')
| -rw-r--r-- | share/kak/kakrc | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/share/kak/kakrc b/share/kak/kakrc index 4b234fc3..7a9f1692 100644 --- a/share/kak/kakrc +++ b/share/kak/kakrc @@ -24,17 +24,8 @@ def -params 1 -docstring "colorscheme <name>: enable named colorscheme" \ %sh{ autoload_directory() { - dir=$1 - for rcfile in ${dir}/*.kak; do - if [ -f "$rcfile" ]; then - echo "try %{ source '${rcfile}' } catch %{ echo -debug Autoload: could not load '${rcfile}' }"; - fi - done - for subdir in ${dir}/*; do - if [ -d "$subdir" ]; then - autoload_directory $subdir - fi - done + find -L "$1" -type f -name '*\.kak' \ + -exec printf 'try %%{ source "%s" } catch %%{ echo -debug Autoload: could not load "%s" }\n' '{}' '{}' \; } localconfdir=${XDG_CONFIG_HOME:-${HOME}/.config}/kak |
