diff options
Diffstat (limited to 'share')
| l--------- | share/kak/autoload | 1 | ||||
| -rw-r--r-- | share/kak/kakrc | 22 |
2 files changed, 20 insertions, 3 deletions
diff --git a/share/kak/autoload b/share/kak/autoload new file mode 120000 index 00000000..0cf5a921 --- /dev/null +++ b/share/kak/autoload @@ -0,0 +1 @@ +/home/mawww/prj/kakoune/rc
\ No newline at end of file diff --git a/share/kak/kakrc b/share/kak/kakrc index f319e832..8a5f77f7 100644 --- a/share/kak/kakrc +++ b/share/kak/kakrc @@ -31,16 +31,32 @@ def -shell-params runtime %{ %sh{ }} %sh{ + autoload() { + dir=$1 + echo "echo -debug autoloading $dir" + for rcfile in ${dir}/*.kak; do + echo "echo -debug autoloading $rcfile" + echo "try %{ source '${rcfile}' } catch %{ }"; + done + for subdir in ${dir}/*; do + if [ -d "$subdir" ]; then + autoload $subdir + fi + done + } + if [ -n "${XDG_CONFIG_HOME}" ]; then localconfdir="${XDG_CONFIG_HOME}/kak" else localconfdir="$HOME/.config/kak" fi + if [ -d "${localconfdir}/autoload" ]; then - for rcfile in ${localconfdir}/autoload/*.kak; do - echo "try %{ source '${rcfile}' } catch %{ }"; - done + autoload ${localconfdir}/autoload + elif [ -d "${kak_runtime}/autoload" ]; then + autoload ${kak_runtime}/autoload fi + if [ -f "${localconfdir}/kakrc" ]; then echo "source '${localconfdir}/kakrc'" fi |
