plug.kak is a plugin manager for Kakoune editor, that aims to work somewhat similar to vim-plug. It is being tested against Kakoune 2018.09.04. If you're using development release, switch to Kakoune_dev branch.
mkdir -p ~/.config/kak/plugins/
git clone https://github.com/andreyorst/plug.kak.git ~/.config/kak/plugins/plug.kak
And source plug.kak
from your kakrc
, or any of your configuration file.
source /path/to/your/kakoune_config/plugins/plug.kak/rc/plug.kak
If you cloned repo to your plugin installation dir, which defaults to ~/.config/kak/plugins/
plug.kak will be able to manage itself along with another plugins.
You can specify what plugins to install and load by using plug
command:
# make sure that plug.kak is installed at plug_install_dir path
plug "andreyorst/plug.kak"
# branch or tag can be specified with second parameter:
plug "andreyorst/fzf.kak" "branch: master" %{
# you can add configurations to the plugin and enable them only if pluin was loaded:
map -docstring 'fzf mode' global normal '<c-p>' ': fzf-mode<ret>'
set-option global fzf_preview_width '65%'
evaluate-commands %sh{
if [ ! -z "$(command -v fd)" ]; then
echo "set-option global fzf_file_command 'fd . --no-ignore --type f --follow --hidden --exclude .git --exclude .svn'"
else
echo "set-option global fzf_file_command \"find . \( -path '*/.svn*' -o -path '*/.git*' \) -prune -o -type f -follow -print\""
fi
if [ ! -z "$(command -v bat)" ]; then
echo "set-option global fzf_highlighter 'bat'"
elif [ ! -z "$(command -v highlight)" ]; then
echo "set-option global fzf_highlighter 'highlight'"
fi
}
}
plug "https://github.com/alexherbo2/auto-pairs.kak" %{
hook global WinCreate .* %{ auto-pairs-enable }
map global normal <a-s> ': auto-pairs-surround<ret>'
}
You can specify where to install plugins, in case you don't like default ~/.config/kak/plugins/
path, you can
use option plug_install_dir
:
set-option global plug_install_dir '$HOME/.cache/kakoune_plugins'
Or any other path.
To specify maximum amount of simultaneous downloads set plug_max_simultanious_downloads
. Default value is 10
.
Although you can use URLs inside plugin
field, if you're using plugins from, say, Gitlab only, you can drop URLs, and set
default git domain to https://gitlab.com
. Or to bitbucket, and any other git domain, as long as it similar to github's
in term of URL structure.
Default value is https://github.com
plug.kak adds three commands:
plug-install
- Install all plugins specified in any configuration file;plug-update
- Update installed plugins;plug-clean
- Remove plugins, that are installed, but disabled in configuration files;plug
- Load plugin from plugin installation directory.
Here are some examples:
- Add
plug "github_username/reponame"
to yourkakrc
; - Source your
kakrc
withsource
command, or restart Kakoune to tell plug.kak that configuration is changed; - Execute
plug-install
command; - Source your
kakrc
withsource
command, or restart Kakoune to load plugins.
- Execute
plug-update
command; - Restart Kakoune to load updated plugins.
- Delete desired
plug
entry from yourkakrc
or comment it; - Source your
kakrc
withsource
command, or restart Kakoune to tell plug.kak that configuration is changed; - Execute
plug-clean
command; - (Optional) If you didn't restarted Kakoune at 2. restart it to unload uninstalled plugins.