kakrc: Simplify and optimize the autoload function
This commit is contained in:
parent
3a0d9481ac
commit
d5726c0cfd
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user