From d92c241fe76e95af6fd6a279385bd4de9af4efb1 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 3 Feb 2016 23:46:01 +0000 Subject: [PATCH] Make doc command work without requiring installation --- rc/{ => base}/doc.kak | 9 +++------ share/doc/kak/manpages | 1 + 2 files changed, 4 insertions(+), 6 deletions(-) rename rc/{ => base}/doc.kak (82%) create mode 120000 share/doc/kak/manpages diff --git a/rc/doc.kak b/rc/base/doc.kak similarity index 82% rename from rc/doc.kak rename to rc/base/doc.kak index 97811145..2af28b5a 100644 --- a/rc/doc.kak +++ b/rc/base/doc.kak @@ -1,12 +1,9 @@ - -decl str doc_path "/usr/share/doc/kak/manpages" - def -hidden -params 1..2 _doc-open %{ %sh{ manout=$(mktemp /tmp/kak-man-XXXXXX) colout=$(mktemp /tmp/kak-man-XXXXXX) - MANWIDTH=${kak_window_width} man -l "$1" > $manout + MANWIDTH=${kak_window_width} man "$1" > $manout retval=$? col -b -x > ${colout} < ${manout} @@ -32,13 +29,13 @@ def -hidden -params 1..2 _doc-open %{ def -params 1..2 \ -shell-completion %{ - find "${kak_opt_doc_path}" -type f -iname "*$@*.gz" -printf '%f\n' | while read l; do + find "${kak_runtime}/../doc/kak/manpages/" -type f -iname "*$@*.gz" -printf '%f\n' | while read l; do echo "${l%.*}" done } \ doc -docstring "Open a buffer containing the documentation about a given subject" %{ %sh{ - readonly PATH_DOC="${kak_opt_doc_path}/${1}.gz" + readonly PATH_DOC="${kak_runtime}/../doc/kak/manpages/${1}.gz" shift if [ ! -f "${PATH_DOC}" ]; then diff --git a/share/doc/kak/manpages b/share/doc/kak/manpages new file mode 120000 index 00000000..9f6cd9d0 --- /dev/null +++ b/share/doc/kak/manpages @@ -0,0 +1 @@ +../../../doc/manpages \ No newline at end of file