Added modules to extra files

This commit is contained in:
Justin Frank 2019-03-13 14:00:59 -07:00
parent 7866d88131
commit aa6d19bee6
31 changed files with 278 additions and 42 deletions

View File

@ -8,6 +8,12 @@ hook global BufCreate .*[.](cabal) %{
set-option buffer filetype cabal set-option buffer filetype cabal
} }
hook -once global BufSetOption filetype=cabal %{
require-module cabal
}
provide-module cabal %[
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -72,3 +78,5 @@ hook global WinSetOption filetype=cabal %[
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window cabal-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window cabal-.+ }
] ]
]

View File

@ -6,6 +6,12 @@ hook global BufCreate .*/CMakeCache.txt %{
set-option buffer filetype ini set-option buffer filetype ini
} }
hook -once global BufSetOption filetype=cmake %{
require-module cmake
}
provide-module cmake %{
add-highlighter shared/cmake regions add-highlighter shared/cmake regions
add-highlighter shared/cmake/code default-region group add-highlighter shared/cmake/code default-region group
add-highlighter shared/cmake/comment region '#' '$' fill comment add-highlighter shared/cmake/comment region '#' '$' fill comment
@ -25,3 +31,5 @@ hook -group cmake-highlight global WinSetOption filetype=cmake %{
add-highlighter window/cmake ref cmake add-highlighter window/cmake ref cmake
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/cmake } hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/cmake }
} }
}

View File

@ -8,6 +8,12 @@ hook global BufCreate .*[.](coffee) %{
set-option buffer filetype coffee set-option buffer filetype coffee
} }
hook -once global BufSetOption filetype=coffee %{
require-module coffee
}
provide-module coffee %[
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -77,3 +83,5 @@ hook global WinSetOption filetype=coffee %{
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window coffee-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window coffee-.+ }
} }
]

View File

@ -8,6 +8,12 @@ hook global BufCreate .*[.](feature|story) %{
set-option buffer filetype cucumber set-option buffer filetype cucumber
} }
hook -once global BufSetOption filetype=cucumber %{
require-module cucumber
}
provide-module cucumber %{
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -87,3 +93,5 @@ hook global WinSetOption filetype=cucumber %{
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window cucumber-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window cucumber-.+ }
} }
}

View File

@ -8,6 +8,11 @@ hook global BufCreate .*[.](ex|exs) %{
set-option buffer filetype elixir set-option buffer filetype elixir
} }
hook -once global BufSetOption filetype=elixir %{
require-module elixir
}
provide-module elixir %[
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -75,3 +80,5 @@ hook global WinSetOption filetype=elixir %{
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window elixir-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window elixir-.+ }
} }
]

View File

@ -8,6 +8,12 @@ hook global BufCreate .*[.](elm) %{
set-option buffer filetype elm set-option buffer filetype elm
} }
hook -once global BufSetOption filetype=elm %{
require-module elm
}
provide-module elm %[
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -65,3 +71,5 @@ hook global WinSetOption filetype=elm %{
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window elm-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window elm-.+ }
} }
]

View File

@ -25,6 +25,19 @@ hook global BufCreate .*/etc/paludis(-.*)?/repository_defaults\.conf
hook global BufCreate .*/etc/paludis(-.*)?/specpath\.conf %{ set-option buffer filetype paludis-key-value-conf } hook global BufCreate .*/etc/paludis(-.*)?/specpath\.conf %{ set-option buffer filetype paludis-key-value-conf }
hook global BufCreate .*/etc/paludis(-.*)?/suggestions(\.conf.d/.*.conf|\.conf) %{ set-option buffer filetype paludis-specs-conf } hook global BufCreate .*/etc/paludis(-.*)?/suggestions(\.conf.d/.*.conf|\.conf) %{ set-option buffer filetype paludis-specs-conf }
hook -once global BufSetOption filetype=exheres-0-(licence-groups|metadata) %{
require-module exheres
}
hook -once global BufSetOption filetype=paludis-(key-value|options|mirrors|specs)-conf %{
require-module paludis
}
hook -once global BufSetOption filetype=glep42 %{
require-module glep42
}
provide-module exheres %{
# Highlighters # Highlighters
## exheres-0 Repository metadata files ## exheres-0 Repository metadata files
add-highlighter shared/exheres-0-metadata group add-highlighter shared/exheres-0-metadata group
@ -61,7 +74,9 @@ hook -group exheres-0-licence-groups-highlight global WinSetOption filetype=exhe
add-highlighter window/exheres-0-licence-groups ref exheres-0-licence-groups add-highlighter window/exheres-0-licence-groups ref exheres-0-licence-groups
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/exheres-0-licence-groups } hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/exheres-0-licence-groups }
} }
}
provide-module paludis %{
## Paludis configurations ## Paludis configurations
### options.conf ### options.conf
add-highlighter shared/paludis-options-conf group add-highlighter shared/paludis-options-conf group
@ -108,7 +123,9 @@ hook -group paludis-specs-conf-highlight global WinSetOption filetype=paludis-sp
add-highlighter window/paludis-specs-conf ref paludis-specs-conf add-highlighter window/paludis-specs-conf ref paludis-specs-conf
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/paludis-specs-conf } hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/paludis-specs-conf }
} }
}
provide-module glep42 %{
## News items (GLEP42) ## News items (GLEP42)
add-highlighter shared/glep42 group add-highlighter shared/glep42 group
add-highlighter shared/glep42/ regex ^(Title|Author|Translator|Content-Type|Posted|Revision|News-Item-Format|Display-If-Installed|Display-If-Keyword|Display-If-Profile):([^\n]*(?:\n\h+[^\n]+)*)$ 1:keyword 2:attribute add-highlighter shared/glep42/ regex ^(Title|Author|Translator|Content-Type|Posted|Revision|News-Item-Format|Display-If-Installed|Display-If-Keyword|Display-If-Profile):([^\n]*(?:\n\h+[^\n]+)*)$ 1:keyword 2:attribute
@ -119,3 +136,4 @@ hook -group glep42-highlight global WinSetOption filetype=glep42 %{
add-highlighter window/glep42 ref glep42 add-highlighter window/glep42 ref glep42
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/glep42 } hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/glep42 }
} }
}

View File

@ -8,6 +8,15 @@ hook global BufCreate .*[.](haml) %{
set-option buffer filetype haml set-option buffer filetype haml
} }
hook -once global BufSetOption filetype=haml %{
require-module haml
}
provide-module haml %[
require-module ruby
require-module coffee
require-module sass
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -60,3 +69,5 @@ hook global WinSetOption filetype=haml %{
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window haml-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window haml-.+ }
} }
]

View File

@ -8,6 +8,12 @@ hook global BufCreate .*[.](hbs) %{
set-option buffer filetype hbs set-option buffer filetype hbs
} }
hook -once global BufSetOption filetype=hbs %{
require-module hbs
}
provide-module hbs %[
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -95,3 +101,5 @@ hook global WinSetOption filetype=hbs %{
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window hbs-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window hbs-.+ }
} }
]

View File

@ -2,6 +2,12 @@ hook global BufCreate .*(sway|i3)/config %{
set buffer filetype i3 set buffer filetype i3
} }
hook -once global BufSetOption filetype=i3 %{
require-module i3
}
provide-module i3 %{
add-highlighter shared/i3 regions add-highlighter shared/i3 regions
add-highlighter shared/i3/code default-region group add-highlighter shared/i3/code default-region group
add-highlighter shared/i3/double_string region %{"} %{"} group add-highlighter shared/i3/double_string region %{"} %{"} group
@ -79,3 +85,5 @@ hook global WinSetOption filetype=i3 %[
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window i3-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window i3-.+ }
] ]
}

View File

@ -5,6 +5,12 @@ hook global BufCreate .*/?[jJ]ustfile %{
set-option buffer filetype justfile set-option buffer filetype justfile
} }
hook -once global BufSetOption filetype=justfile %{
require-module justfile
}
provide-module justfile %{
# Indentation # Indentation
# ‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾
@ -46,3 +52,5 @@ hook global WinSetOption filetype=justfile %{
hook window InsertChar \n -group justfile-indent just-indent-on-new-line hook window InsertChar \n -group justfile-indent just-indent-on-new-line
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window justfile-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window justfile-.+ }
} }
}

View File

@ -2,6 +2,12 @@ hook global BufCreate .*\.ks %{
set-option buffer filetype kickstart set-option buffer filetype kickstart
} }
hook -once global BufSetOption filetype=kickstart %{
require-module kickstart
}
provide-module kickstart %{
add-highlighter shared/kickstart regions add-highlighter shared/kickstart regions
add-highlighter shared/kickstart/code default-region group add-highlighter shared/kickstart/code default-region group
add-highlighter shared/kickstart/comment region '(^|\h)\K#' $ fill comment add-highlighter shared/kickstart/comment region '(^|\h)\K#' $ fill comment
@ -28,3 +34,5 @@ hook -group kickstart-highlight global WinSetOption filetype=kickstart %{
add-highlighter window/kickstart ref kickstart add-highlighter window/kickstart ref kickstart
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/kickstart } hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/kickstart }
} }
}

View File

@ -8,6 +8,12 @@ hook global BufCreate .*\.tex %{
set-option buffer filetype latex set-option buffer filetype latex
} }
hook -once global BufSetOption filetype=latex %{
require-module latex
}
provide-module latex %(
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -33,3 +39,5 @@ hook -group latex-highlight global WinSetOption filetype=latex %{
add-highlighter window/latex ref latex add-highlighter window/latex ref latex
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/latex } hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/latex }
} }
)

View File

@ -8,6 +8,12 @@ hook global BufCreate .*[.](moon) %{
set-option buffer filetype moon set-option buffer filetype moon
} }
hook -once global BufSetOption filetype=moon %{
require-module moon
}
provide-module moon %[
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -105,3 +111,5 @@ hook global WinSetOption filetype=moon %{
unalias window alt moon-alternative-file unalias window alt moon-alternative-file
} }
} }
]

View File

@ -5,6 +5,13 @@ hook global BufCreate .*[.](php) %{
set-option buffer filetype php set-option buffer filetype php
} }
hook -once global BufSetOption filetype=php %{
require-module php
}
provide-module php %(
require-module html
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -88,3 +95,5 @@ hook global WinSetOption filetype=php %{
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window php-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window php-.+ }
} }
)

View File

@ -12,6 +12,12 @@ hook global BufCreate .*[.](pug|jade) %{
set-option buffer filetype pug set-option buffer filetype pug
} }
hook -once global BufSetOption filetype=pug %{
require-module pug
}
provide-module pug %{
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -72,3 +78,5 @@ hook global WinSetOption filetype=pug %{
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window pug-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window pug-.+ }
} }
}

View File

@ -10,6 +10,12 @@ hook global BufCreate .*[.](ragel|rl) %{
set-option buffer filetype ragel set-option buffer filetype ragel
} }
hook -once global BufSetOption filetype=ragel %{
require-module ragel
}
provide-module ragel %🦀
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -68,3 +74,5 @@ hook global WinSetOption filetype=ragel %{
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window ragel-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window ragel-.+ }
} }
🦀

View File

@ -8,6 +8,12 @@ hook global BufCreate .*[.](sass) %{
set-option buffer filetype sass set-option buffer filetype sass
} }
hook -once global BufSetOption filetype=sass %{
require-module sass
}
provide-module sass %{
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -60,3 +66,5 @@ hook global WinSetOption filetype=sass %{
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window sass-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window sass-.+ }
} }
}

View File

@ -1,8 +1,6 @@
# http://sass-lang.com # http://sass-lang.com
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
# require css.kak
# Detection # Detection
# ‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾
@ -10,6 +8,14 @@ hook global BufCreate .*[.](scss) %{
set-option buffer filetype scss set-option buffer filetype scss
} }
hook -once global BufSetOption filetype=scss %{
require-module scss
}
provide-module scss %[
require-module css
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -43,3 +49,5 @@ hook global WinSetOption filetype=scss %[
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window scss-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window scss-.+ }
] ]
]

View File

@ -8,6 +8,12 @@ hook global BufCreate .*\.taskpaper %{
set-option buffer filetype taskpaper set-option buffer filetype taskpaper
} }
hook -once global BufSetOption filetype=taskpaper %{
require-module taskpaper
}
provide-module taskpaper %{
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -45,3 +51,5 @@ hook global WinSetOption filetype=taskpaper %{
hook window InsertChar \n -group taskpaper-indent taskpaper-indent-on-new-line hook window InsertChar \n -group taskpaper-indent taskpaper-indent-on-new-line
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window taskpaper-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window taskpaper-.+ }
} }
}

View File

@ -8,6 +8,12 @@ hook global BufCreate .*\.(toml) %{
set-option buffer filetype toml set-option buffer filetype toml
} }
hook -once global BufSetOption filetype=toml %{
require-module toml
}
provide-module toml %{
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -61,3 +67,5 @@ hook global WinSetOption filetype=toml %{
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window toml-.+ } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window toml-.+ }
} }
}

View File

@ -5,6 +5,12 @@ hook global BufCreate .*\.\d+ %{
set-option buffer filetype troff set-option buffer filetype troff
} }
hook -once global BufSetOption filetype=troff %{
require-module troff
}
provide-module troff %{
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -28,3 +34,5 @@ hook -group troff-highlight global WinSetOption filetype=troff %{
add-highlighter window/troff ref troff add-highlighter window/troff ref troff
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/troff } hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/troff }
} }
}

View File

@ -8,6 +8,12 @@ hook global BufCreate .*/?Tup(file|rules)(\.\w+)?$ %{
set-option buffer filetype tupfile set-option buffer filetype tupfile
} }
hook -once global BufSetOption filetype=tupfile %{
require-module tupfile
}
provide-module tupfile %{
# Highlighters # Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾
@ -31,3 +37,5 @@ hook -group tupfile-highlight global WinSetOption filetype=tupfile %{
add-highlighter window/tupfile ref tupfile add-highlighter window/tupfile ref tupfile
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/tupfile } hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/tupfile }
} }
}

View File

@ -1,3 +1,9 @@
hook -once global BufSetOption filetype=python %{
require-module jedi
}
provide-module jedi %{
declare-option -hidden str jedi_tmp_dir declare-option -hidden str jedi_tmp_dir
declare-option -hidden completions jedi_completions declare-option -hidden completions jedi_completions
declare-option -docstring "colon separated list of path added to `python`'s $PYTHONPATH environment variable" \ declare-option -docstring "colon separated list of path added to `python`'s $PYTHONPATH environment variable" \
@ -45,3 +51,5 @@ define-command jedi-disable-autocomplete -docstring "Disable jedi completion" %{
remove-hooks window jedi-autocomplete remove-hooks window jedi-autocomplete
unalias window complete jedi-complete unalias window complete jedi-complete
} }
}

View File

@ -1,3 +1,9 @@
hook -once global BufSetOption filetype=rust %{
require-module racer
}
provide-module racer %{
declare-option -hidden str racer_tmp_dir declare-option -hidden str racer_tmp_dir
declare-option -hidden completions racer_completions declare-option -hidden completions racer_completions
@ -151,3 +157,5 @@ define-command racer-show-doc -docstring "Show the documentation about the rust
fi fi
} }
} }
}

View File

@ -5,13 +5,12 @@
## an iTerm session if not in a tmux session. ## an iTerm session if not in a tmux session.
hook global KakBegin .* %sh{ hook global KakBegin .* %sh{
if [ "$TERM_PROGRAM" = "iTerm.app" ] && [ -z "$TMUX" ]; then if [ "$TERM_PROGRAM" = "iTerm.app" ] && [ -z "$TMUX" ]; then
echo " echo "require-module iterm"
alias global focus iterm-focus
alias global terminal iterm-terminal-vertical
"
fi fi
} }
provide-module iterm %{
define-command -hidden -params 2.. iterm-terminal-split-impl %{ define-command -hidden -params 2.. iterm-terminal-split-impl %{
nop %sh{ nop %sh{
direction="$1" direction="$1"
@ -129,3 +128,8 @@ If no client is passed then the current one is used' \
fi fi
} }
} }
alias global focus iterm-focus
alias global terminal iterm-terminal-vertical
}

View File

@ -1,17 +1,14 @@
declare-option -docstring %{window type that kitty creates on new and repl calls (kitty|os)} str kitty_window_type kitty
hook -group kitty-hooks global KakBegin .* %sh{ hook -group kitty-hooks global KakBegin .* %sh{
if [ "$TERM" = "xterm-kitty" ] && [ -z "$TMUX" ]; then if [ "$TERM" = "xterm-kitty" ] && [ -z "$TMUX" ]; then
echo " echo "require-module kitty"
alias global terminal kitty-terminal
alias global terminal-tab kitty-terminal-tab
alias global focus kitty-focus
alias global repl kitty-repl
alias global send-text kitty-send-text
"
fi fi
} }
provide-module kitty %{
declare-option -docstring %{window type that kitty creates on new and repl calls (kitty|os)} str kitty_window_type kitty
define-command kitty-terminal -params 1.. -shell-completion -docstring ' define-command kitty-terminal -params 1.. -shell-completion -docstring '
kitty-terminal <program> [<arguments>]: create a new terminal as a kitty window kitty-terminal <program> [<arguments>]: create a new terminal as a kitty window
The program passed as argument will be executed in the new terminal' \ The program passed as argument will be executed in the new terminal' \
@ -63,3 +60,11 @@ define-command kitty-send-text -docstring "send the selected text to the repl wi
kitty @ send-text -m=title:kak_repl_window "${kak_selection}" kitty @ send-text -m=title:kak_repl_window "${kak_selection}"
} }
} }
alias global terminal kitty-terminal
alias global terminal-tab kitty-terminal-tab
alias global focus kitty-focus
alias global repl kitty-repl
alias global send-text kitty-send-text
}

View File

@ -1,28 +1,14 @@
# http://tmux.github.io/ # http://tmux.github.io/
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
declare-option -docstring "tmux pane id in which the REPL is running" str tmux_repl_id hook global ModuleLoad tmux %{
require-module tmux-repl
hook global KakBegin .* %sh{
if [ -n "$TMUX" ]; then
VERSION_TMUX=$(tmux -V | cut -d' ' -f2)
VERSION_TMUX=${VERSION_TMUX%%.*}
if [ "${VERSION_TMUX}" = "master" ] \
|| [ "${VERSION_TMUX}" -ge 2 ]; then
echo "
alias global repl tmux-repl-horizontal
alias global send-text tmux-send-text
"
else
echo "
alias global repl tmux-repl-disabled
alias global send-text tmux-repl-disabled
"
fi
fi
} }
provide-module tmux-repl %{
declare-option -docstring "tmux pane id in which the REPL is running" str tmux_repl_id
define-command -hidden -params 1..2 tmux-repl-impl %{ define-command -hidden -params 1..2 tmux-repl-impl %{
evaluate-commands %sh{ evaluate-commands %sh{
if [ -z "$TMUX" ]; then if [ -z "$TMUX" ]; then
@ -65,3 +51,23 @@ define-command -hidden tmux-repl-disabled %{ evaluate-commands %sh{
VERSION_TMUX=$(tmux -V) VERSION_TMUX=$(tmux -V)
printf %s "echo -markup %{{Error}The version of tmux is too old: got ${VERSION_TMUX}, expected >= 2.x}" printf %s "echo -markup %{{Error}The version of tmux is too old: got ${VERSION_TMUX}, expected >= 2.x}"
} } } }
evaluate-commands %sh{
VERSION_TMUX=$(tmux -V | cut -d' ' -f2)
VERSION_TMUX=${VERSION_TMUX%%.*}
if [ "${VERSION_TMUX}" = "master" ] \
|| [ "${VERSION_TMUX}" -ge 2 ]; then
echo "
alias global repl tmux-repl-horizontal
alias global send-text tmux-send-text
"
else
echo "
alias global repl tmux-repl-disabled
alias global send-text tmux-repl-disabled
"
fi
}
}

View File

@ -1,3 +1,9 @@
hook global ModuleLoad x11 %{
require-module x11-repl
}
provide-module x11-repl %{
# termcmd should already be set in x11.kak # termcmd should already be set in x11.kak
define-command -docstring %{x11-repl [<arguments>]: create a new window for repl interaction define-command -docstring %{x11-repl [<arguments>]: create a new window for repl interaction
All optional parameters are forwarded to the new window} \ All optional parameters are forwarded to the new window} \
@ -24,3 +30,5 @@ define-command x11-send-text -docstring "send the selected text to the repl wind
alias global repl x11-repl alias global repl x11-repl
alias global send-text x11-send-text alias global send-text x11-send-text
}