summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Leferry 2 <alexherbo2@gmail.com>2020-09-06 16:17:35 +0200
committerAlex Leferry 2 <alexherbo2@gmail.com>2020-09-06 16:22:48 +0200
commit49b47844e958c3594e61e1249444796a7eea7aac (patch)
treecec81a7c3deb9a1667c4ebced8d2baca2f9b9815
parent56e78b346116ee9b86237157a43fc7aaa397cde7 (diff)
Let users require modules
-rw-r--r--README.md10
-rw-r--r--rc/connect.kak13
2 files changed, 8 insertions, 15 deletions
diff --git a/README.md b/README.md
index 302707a..713bb52 100644
--- a/README.md
+++ b/README.md
@@ -43,7 +43,11 @@ Run the following in your terminal:
make install
```
-Add [`connect.kak`](rc/connect.kak) to your autoload or source it manually.
+Add [`connect.kak`](rc/connect.kak) and its [modules] to your autoload or source them manually.
+
+``` kak
+require-module connect
+```
## Usage
@@ -89,7 +93,7 @@ $ dolphin
**Kakoune** – Same, but with a dedicated [`dolphin`][`dolphin.kak`] command:
``` kak
-connect-require dolphin
+require-module connect-dolphin
dolphin
```
@@ -158,7 +162,7 @@ use the alias `:a` or `a` to reattach back and forth inside a `kak-shell`
``` kak
# Modules
-connect-require fzf
+require-module connect-fzf
# Explore files and buffers with fzf
alias global explore-files fzf-files
diff --git a/rc/connect.kak b/rc/connect.kak
index d9efaf6..d0aebb4 100644
--- a/rc/connect.kak
+++ b/rc/connect.kak
@@ -4,7 +4,7 @@ declare-option -hidden str connect_modules_path "%opt{connect_root_path}/connect
# Default modules
hook global ModuleLoaded connect %{
- connect-require fifo
+ require-module connect-fifo
}
provide-module connect %{
@@ -42,15 +42,6 @@ provide-module connect %{
# Initialize the option with the user config paths
set-option global connect_paths "%val{config}/connect/aliases" "%val{config}/connect/commands"
- # Require modules
- define-command connect-require -params 1 -shell-script-candidates %(find "$kak_opt_connect_modules_path" -type f -name '*.kak' -exec basename '{}' .kak ';') -docstring 'Require connect module' %{
- # Handle “Already defined module”
- try %{
- source "%opt{connect_modules_path}/%arg{1}/%arg{1}.kak"
- }
- require-module "connect-%arg{1}"
- }
-
# Commands
define-command connect-terminal -params .. -shell-completion -docstring 'Open a new terminal' %{
terminal sh -c %{
@@ -142,5 +133,3 @@ provide-module connect %{
alias global $ connect-shell
alias global & connect-detach
}
-
-require-module connect