kakoune/share/kak/kakrc

79 lines
1.7 KiB
Plaintext
Raw Normal View History

# define color scheme
#
# For Code
face value red
face type yellow
face identifier green
face string magenta
face error default,red
face keyword blue
face operator yellow
face attribute green
face comment cyan
face meta magenta
# 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
def -shell-params runtime %{ %sh{
2015-05-29 14:50:35 +02:00
while [ $# -gt 0 ]; do
echo "source '${kak_runtime}/$1'"
shift
done
}}
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
}}
%sh{
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
localconfdir="${XDG_CONFIG_HOME}/kak"
else
localconfdir="$HOME/.config/kak"
fi
2013-03-22 13:45:52 +01:00
if [ -d "${localconfdir}/autoload" ]; then
autoload ${localconfdir}/autoload
elif [ -d "${kak_runtime}/autoload" ]; then
autoload ${kak_runtime}/autoload
fi
2013-03-22 13:45:52 +01:00
if [ -f "${localconfdir}/kakrc" ]; then
echo "source '${localconfdir}/kakrc'"
fi
}