2013-03-28 18:38:41 +01:00
|
|
|
# define color scheme
|
2015-05-09 22:00:50 +02:00
|
|
|
#
|
|
|
|
# For Code
|
2014-07-12 11:55:50 +02:00
|
|
|
face value red
|
|
|
|
face type yellow
|
2014-07-14 22:42:19 +02:00
|
|
|
face identifier green
|
2014-07-12 11:55:50 +02:00
|
|
|
face string magenta
|
|
|
|
face error default,red
|
|
|
|
face keyword blue
|
|
|
|
face operator yellow
|
|
|
|
face attribute green
|
|
|
|
face comment cyan
|
2014-07-13 17:57:49 +02:00
|
|
|
face meta magenta
|
2013-03-28 18:38:41 +01:00
|
|
|
|
2015-05-09 22:00:50 +02:00
|
|
|
# For markup
|
|
|
|
face title blue
|
|
|
|
face header cyan
|
|
|
|
face bold red
|
|
|
|
face italic yellow
|
|
|
|
face mono green
|
|
|
|
face block magenta
|
|
|
|
face link cyan
|
|
|
|
face bullet cyan
|
|
|
|
face list yellow
|
|
|
|
|
2012-09-10 20:45:34 +02:00
|
|
|
def -shell-params runtime %{ %sh{
|
2015-05-29 14:50:35 +02:00
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
echo "source '${kak_runtime}/$1'"
|
|
|
|
shift
|
|
|
|
done
|
2012-09-10 20:45:34 +02:00
|
|
|
}}
|
2012-01-14 02:04:08 +01:00
|
|
|
|
2015-07-02 14:56:38 +02:00
|
|
|
def -shell-params -docstring "colorscheme <name>: enable named colorscheme" \
|
2015-07-03 22:14:34 +02:00
|
|
|
-shell-completion %{
|
|
|
|
prefix=${1:0:${kak_pos_in_token}}
|
|
|
|
(
|
|
|
|
for col in ${kak_runtime}/colors/*.kak; do
|
|
|
|
expr $(basename "${col}" .kak) : "^\(${prefix}.*\)$"
|
|
|
|
done
|
|
|
|
) | grep -v '^$'
|
|
|
|
} \
|
|
|
|
colorscheme %{ %sh{
|
|
|
|
if [ $# -eq 1 ]; then
|
|
|
|
echo "source '${kak_runtime}/colors/$1.kak'"
|
|
|
|
else
|
|
|
|
echo -color Error 'Usage: colorscheme <scheme name>'
|
|
|
|
fi
|
2015-07-02 14:56:38 +02:00
|
|
|
}}
|
|
|
|
|
2012-09-10 20:45:34 +02:00
|
|
|
%sh{
|
2015-05-30 15:32:04 +02:00
|
|
|
autoload() {
|
|
|
|
dir=$1
|
|
|
|
for rcfile in ${dir}/*.kak; do
|
|
|
|
echo "try %{ source '${rcfile}' } catch %{ }";
|
|
|
|
done
|
|
|
|
for subdir in ${dir}/*; do
|
|
|
|
if [ -d "$subdir" ]; then
|
|
|
|
autoload $subdir
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2013-03-22 13:45:52 +01:00
|
|
|
if [ -n "${XDG_CONFIG_HOME}" ]; then
|
2012-09-10 20:45:34 +02:00
|
|
|
localconfdir="${XDG_CONFIG_HOME}/kak"
|
|
|
|
else
|
|
|
|
localconfdir="$HOME/.config/kak"
|
|
|
|
fi
|
2015-05-30 15:32:04 +02:00
|
|
|
|
2013-03-22 13:45:52 +01:00
|
|
|
if [ -d "${localconfdir}/autoload" ]; then
|
2015-05-30 15:32:04 +02:00
|
|
|
autoload ${localconfdir}/autoload
|
|
|
|
elif [ -d "${kak_runtime}/autoload" ]; then
|
|
|
|
autoload ${kak_runtime}/autoload
|
2012-09-10 20:45:34 +02:00
|
|
|
fi
|
2015-05-30 15:32:04 +02:00
|
|
|
|
2013-03-22 13:45:52 +01:00
|
|
|
if [ -f "${localconfdir}/kakrc" ]; then
|
2012-12-06 20:30:34 +01:00
|
|
|
echo "source '${localconfdir}/kakrc'"
|
|
|
|
fi
|
2012-09-10 20:45:34 +02:00
|
|
|
}
|