Code Monkey home page Code Monkey logo

plug.kak's Introduction

plug.kak

GitHub release GitHub Release Date Github commits (since latest release) license

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.

Installation

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.

Usage

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>'
}

Configuration

Plugin installation directory

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.

Maximum downloads

To specify maximum amount of simultaneous downloads set plug_max_simultanious_downloads. Default value is 10.

Default git domain

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

Commands

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:

Installing new plugin

  1. Add plug "github_username/reponame" to your kakrc;
  2. Source your kakrc with source command, or restart Kakoune to tell plug.kak that configuration is changed;
  3. Execute plug-install command;
  4. Source your kakrc with source command, or restart Kakoune to load plugins.

Updating installed plugins

  1. Execute plug-update command;
  2. Restart Kakoune to load updated plugins.

Removing unneded plugins

  1. Delete desired plug entry from your kakrc or comment it;
  2. Source your kakrc with source command, or restart Kakoune to tell plug.kak that configuration is changed;
  3. Execute plug-clean command;
  4. (Optional) If you didn't restarted Kakoune at 2. restart it to unload uninstalled plugins.

plug.kak's People

Contributors

andreyorst avatar abuffseagull avatar

Watchers

Bruno Heridet avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.