diff options
| author | raiguard <caleb.heuer@gmail.com> | 2021-12-12 20:09:48 -0700 |
|---|---|---|
| committer | raiguard <caleb.heuer@gmail.com> | 2021-12-12 20:12:32 -0700 |
| commit | 29ef2008c3aadc05f4e14583296061b0f9684099 (patch) | |
| tree | e70b0e156daf82b73ef7744601bc9e8f1f7fe6b0 | |
| parent | 7a596c2e59bea5b85764165f2b5ff9caf6b3705d (diff) | |
Add README
| -rw-r--r-- | README.md | 72 | ||||
| -rw-r--r-- | harpoon.kak | 3 |
2 files changed, 74 insertions, 1 deletions
@@ -1,2 +1,74 @@ # harpoon.kak + Quickly switch between your most important Kakoune buffers. + +Based on [Harpoon](https://github.com/ThePrimeagen/harpoon) for Neovim. + +## Installation + +Requires [luar](https://github.com/gustavo-hms/luar). This plugin will automatically require the `luar` module. + +Make sure you have [Lua](https://www.lua.org/) installed on your `PATH`. + +### [plug.kak](https://github.com/andreyorst/plug.kak) + +```kak +plug "gustavo-hms/luar" %{ + plug "raiguard/harpoon.kak" %{ + # Add default keybindings + harpoon-add-bindings + } +} +``` + +### [cork.kak](https://github.com/topisani/cork.kak) + +```kak +cork luar "https://github.com/gustavo-hmo/luar" %{ + cork harpoon.kak "https://github.com/raiguard/harpoon.kak" %{ + # Add default keybindings + harpoon-add-bindings + } +} +``` + +### Manually + +Stick `harpoon.kak` in your autoload or source it manually. + +## Usage + +> Assumes that you are using the default keybindings by calling `harpoon-add-bindings`. + +Harpoon files by calling `:harpoon-add` or via the user mode (see `Configuration`). Harpooned files are accessible by calling `:harpoon-nav <index>` or by pressing `<c-<index>>`. + +For example, add your main file with `:harpoon-add 1`, then return to it at any time by pressing `<c-1>`. + +You can have as many harpoons as you like, though you shouldn't need more than three or four at a given time. + +Call `:harpoon-list` to list all of the harpooned files, and `:harpoon-remove <index>` to remove a harpooned file. + +## Configuration + +The plugin provides a `harpoon` user mode: + +```kak +map global harpoon a ": harpoon-add<ret>" -docstring "Add file to end" +map global harpoon l ": harpoon-list<ret>" -docstring "List files" +map global harpoon 1 ": harpoon-add 1<ret>" -docstring "Add file to 1" +map global harpoon 2 ": harpoon-add 2<ret>" -docstring "Add file to 2" +map global harpoon 3 ": harpoon-add 3<ret>" -docstring "Add file to 3" +map global harpoon 4 ": harpoon-add 4<ret>" -docstring "Add file to 4" +map global harpoon 5 ": harpoon-add 5<ret>" -docstring "Add file to 5" +map global harpoon 6 ": harpoon-add 6<ret>" -docstring "Add file to 6" +map global harpoon 7 ": harpoon-add 7<ret>" -docstring "Add file to 7" +map global harpoon 8 ": harpoon-add 8<ret>" -docstring "Add file to 8" +map global harpoon 9 ": harpoon-add 9<ret>" -docstring "Add file to 9" +``` + +Calling `harpoon-add-bindings` will make this accessible via `,h`, and will add the `<c-<index>>` bindings for quick jumping in normal mode. + +## Roadmap + +- Persist harpoons per-session +- Add interactive harpoons buffer for reordering and deletion diff --git a/harpoon.kak b/harpoon.kak index 79350a2..309452f 100644 --- a/harpoon.kak +++ b/harpoon.kak @@ -1,4 +1,5 @@ -declare-option -hidden str harpoon_path %sh{ dirname $kak_source } +require-module luar + declare-option str-to-str-map harpoon_buffers define-command -params 1 -docstring "Navigate to the file at the specified index" harpoon-nav %{ |
