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,7 +8,7 @@ hook global BufCreate .*[.](editorconfig) %{
set-option buffer filetype ini
set-option buffer static_words indent_style indent_size tab_width \
end_of_line charset insert_final_newline trim_trailing_whitespace root \
latin1 utf-8 utf-8-bom utf-16be utf-16le lf cr crlf unset space tab
latin1 utf-8 utf-8-bom utf-16be utf-16le lf cr crlf unset space tab
}
declare-option -hidden bool editorconfig_trim_trailing_whitespace false

View File

@ -8,6 +8,12 @@ hook global BufCreate .*[.](cabal) %{
set-option buffer filetype cabal
}
hook -once global BufSetOption filetype=cabal %{
require-module cabal
}
provide-module cabal %[
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -72,3 +78,5 @@ hook global WinSetOption filetype=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
}
hook -once global BufSetOption filetype=cmake %{
require-module cmake
}
provide-module cmake %{
add-highlighter shared/cmake regions
add-highlighter shared/cmake/code default-region group
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
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
}
hook -once global BufSetOption filetype=coffee %{
require-module coffee
}
provide-module coffee %[
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -77,3 +83,5 @@ hook global WinSetOption filetype=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
}
hook -once global BufSetOption filetype=cucumber %{
require-module cucumber
}
provide-module cucumber %{
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -87,3 +93,5 @@ hook global WinSetOption filetype=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
}
hook -once global BufSetOption filetype=elixir %{
require-module elixir
}
provide-module elixir %[
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -48,11 +53,11 @@ define-command -hidden elixir-trim-indent %{
define-command -hidden elixir-indent-on-new-line %{
evaluate-commands -draft -itersel %{
# copy -- comments prefix and following white spaces
# copy -- comments prefix and following white spaces
try %{ execute-keys -draft k <a-x> s ^\h*\K--\h* <ret> y gh j P }
# preserve previous line indent
try %{ execute-keys -draft \; K <a-&> }
# indent after line ending with:
# indent after line ending with:
# try %{ execute-keys -draft k x <a-k> (do|else|->)$ <ret> & }
# filter previous line
try %{ execute-keys -draft k : elixir-trim-indent <ret> }
@ -75,3 +80,5 @@ hook global WinSetOption filetype=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
}
hook -once global BufSetOption filetype=elm %{
require-module elm
}
provide-module elm %[
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -65,3 +71,5 @@ hook global WinSetOption filetype=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(-.*)?/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
## exheres-0 Repository metadata files
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
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/exheres-0-licence-groups }
}
}
provide-module paludis %{
## Paludis configurations
### options.conf
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
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/paludis-specs-conf }
}
}
provide-module glep42 %{
## News items (GLEP42)
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
@ -119,3 +136,4 @@ hook -group glep42-highlight global WinSetOption filetype=glep42 %{
add-highlighter window/glep42 ref 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
}
hook -once global BufSetOption filetype=haml %{
require-module haml
}
provide-module haml %[
require-module ruby
require-module coffee
require-module sass
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -60,3 +69,5 @@ hook global WinSetOption filetype=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
}
hook -once global BufSetOption filetype=hbs %{
require-module hbs
}
provide-module hbs %[
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -95,3 +101,5 @@ hook global WinSetOption filetype=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
}
hook -once global BufSetOption filetype=i3 %{
require-module i3
}
provide-module i3 %{
add-highlighter shared/i3 regions
add-highlighter shared/i3/code default-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-.+ }
]
}

View File

@ -5,6 +5,12 @@ hook global BufCreate .*/?[jJ]ustfile %{
set-option buffer filetype justfile
}
hook -once global BufSetOption filetype=justfile %{
require-module justfile
}
provide-module justfile %{
# Indentation
# ‾‾‾‾‾‾‾‾‾‾‾
@ -46,3 +52,5 @@ hook global WinSetOption filetype=justfile %{
hook window InsertChar \n -group justfile-indent just-indent-on-new-line
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
}
hook -once global BufSetOption filetype=kickstart %{
require-module kickstart
}
provide-module kickstart %{
add-highlighter shared/kickstart regions
add-highlighter shared/kickstart/code default-region group
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
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
}
hook -once global BufSetOption filetype=latex %{
require-module latex
}
provide-module latex %(
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -33,3 +39,5 @@ hook -group latex-highlight global WinSetOption filetype=latex %{
add-highlighter window/latex ref 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
}
hook -once global BufSetOption filetype=moon %{
require-module moon
}
provide-module moon %[
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -105,3 +111,5 @@ hook global WinSetOption filetype=moon %{
unalias window alt moon-alternative-file
}
}
]

View File

@ -5,6 +5,13 @@ hook global BufCreate .*[.](php) %{
set-option buffer filetype php
}
hook -once global BufSetOption filetype=php %{
require-module php
}
provide-module php %(
require-module html
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -88,3 +95,5 @@ hook global WinSetOption filetype=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
}
hook -once global BufSetOption filetype=pug %{
require-module pug
}
provide-module pug %{
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -72,3 +78,5 @@ hook global WinSetOption filetype=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
}
hook -once global BufSetOption filetype=ragel %{
require-module ragel
}
provide-module ragel %🦀
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -68,3 +74,5 @@ hook global WinSetOption filetype=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
}
hook -once global BufSetOption filetype=sass %{
require-module sass
}
provide-module sass %{
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -60,3 +66,5 @@ hook global WinSetOption filetype=sass %{
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window sass-.+ }
}
}

View File

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

View File

@ -6,7 +6,13 @@
hook global BufCreate .*\.taskpaper %{
set-option buffer filetype taskpaper
}
}
hook -once global BufSetOption filetype=taskpaper %{
require-module taskpaper
}
provide-module taskpaper %{
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -45,3 +51,5 @@ hook global WinSetOption filetype=taskpaper %{
hook window InsertChar \n -group taskpaper-indent taskpaper-indent-on-new-line
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
}
hook -once global BufSetOption filetype=toml %{
require-module toml
}
provide-module toml %{
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -61,3 +67,5 @@ hook global WinSetOption filetype=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
}
hook -once global BufSetOption filetype=troff %{
require-module troff
}
provide-module troff %{
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -28,3 +34,5 @@ hook -group troff-highlight global WinSetOption filetype=troff %{
add-highlighter window/troff ref 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
}
hook -once global BufSetOption filetype=tupfile %{
require-module tupfile
}
provide-module tupfile %{
# Highlighters
# ‾‾‾‾‾‾‾‾‾‾‾‾
@ -31,3 +37,5 @@ hook -group tupfile-highlight global WinSetOption filetype=tupfile %{
add-highlighter window/tupfile ref tupfile
hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/tupfile }
}
}

View File

@ -22,7 +22,7 @@ define-command autorestore-restore-buffer -docstring "Restore the backup for the
echo -debug Old backup file(s) found: will not restore ${older} .
"
fi
exit
exit
fi
printf %s\\n "
@ -39,7 +39,7 @@ define-command autorestore-restore-buffer -docstring "Restore the backup for the
nop %sh{
if [ \"\${kak_opt_autorestore_purge_restored}\" = true ];
then
rm -f \"${buffer_dirname}/.${buffer_basename}.kak.\"*
rm -f \"${buffer_dirname}/.${buffer_basename}.kak.\"*
fi
}
}

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 completions jedi_completions
declare-option -docstring "colon separated list of path added to `python`'s $PYTHONPATH environment variable" \
@ -17,7 +23,7 @@ define-command jedi-complete -docstring "Complete the current selection" %{
cd $(dirname ${kak_buffile})
header="${kak_cursor_line}.${kak_cursor_column}@${kak_timestamp}"
export PYTHONPATH="$kak_opt_jedi_python_path:$PYTHONPATH"
export PYTHONPATH="$kak_opt_jedi_python_path:$PYTHONPATH"
compl=$(python 2> "${dir}/fifo" <<-END
import jedi
script=jedi.Script(open('$dir/buf', 'r').read(), $kak_cursor_line, $kak_cursor_column - 1, '$kak_buffile')
@ -45,3 +51,5 @@ define-command jedi-disable-autocomplete -docstring "Disable jedi completion" %{
remove-hooks window jedi-autocomplete
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 completions racer_completions
@ -151,3 +157,5 @@ define-command racer-show-doc -docstring "Show the documentation about the rust
fi
}
}
}

View File

@ -5,13 +5,12 @@
## an iTerm session if not in a tmux session.
hook global KakBegin .* %sh{
if [ "$TERM_PROGRAM" = "iTerm.app" ] && [ -z "$TMUX" ]; then
echo "
alias global focus iterm-focus
alias global terminal iterm-terminal-vertical
"
echo "require-module iterm"
fi
}
provide-module iterm %{
define-command -hidden -params 2.. iterm-terminal-split-impl %{
nop %sh{
direction="$1"
@ -129,3 +128,8 @@ If no client is passed then the current one is used' \
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{
if [ "$TERM" = "xterm-kitty" ] && [ -z "$TMUX" ]; then
echo "
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
"
echo "require-module kitty"
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 '
kitty-terminal <program> [<arguments>]: create a new terminal as a kitty window
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}"
}
}
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/
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
declare-option -docstring "tmux pane id in which the REPL is running" str tmux_repl_id
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
hook global ModuleLoad tmux %{
require-module tmux-repl
}
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 %{
evaluate-commands %sh{
if [ -z "$TMUX" ]; then
@ -52,7 +38,7 @@ define-command tmux-repl-window -params 0..1 -command-completion -docstring "Cre
define-command -hidden tmux-send-text -params 0..1 -docstring "tmux-send-text [text]: Send text(append new line) to the REPL pane.
If no text is passed, then the selection is used" %{
nop %sh{
if [ $# -eq 0 ]; then
if [ $# -eq 0 ]; then
tmux set-buffer -b kak_selection "${kak_selection}"
else
tmux set-buffer -b kak_selection "$1"
@ -65,3 +51,23 @@ define-command -hidden tmux-repl-disabled %{ evaluate-commands %sh{
VERSION_TMUX=$(tmux -V)
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
define-command -docstring %{x11-repl [<arguments>]: create a new window for repl interaction
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 send-text x11-send-text
}