From 5ad44995036274989f82f62b9ff2135687b00394 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 13 Jan 2017 00:56:30 +0000 Subject: [PATCH] Fix naming conventions in bundled scripts Do not use _ prefix for hidden commands, use - as a word separator in command names. --- rc/base/clojure.kak | 8 ++++---- rc/base/css.kak | 14 +++++++------- rc/base/d.kak | 12 ++++++------ rc/base/fish.kak | 16 ++++++++-------- rc/base/gas.kak | 8 ++++---- rc/base/go.kak | 12 ++++++------ rc/base/haskell.kak | 10 +++++----- rc/base/html.kak | 14 +++++++------- rc/base/javascript.kak | 14 +++++++------- rc/base/json.kak | 14 +++++++------- rc/base/lisp.kak | 8 ++++---- rc/base/lua.kak | 16 ++++++++-------- rc/base/markdown.kak | 4 ++-- rc/base/perl.kak | 12 ++++++------ rc/base/ruby.kak | 16 ++++++++-------- rc/base/rust.kak | 18 +++++++++--------- rc/base/scala.kak | 14 +++++++------- rc/base/yaml.kak | 10 +++++----- rc/core/doc.kak | 4 ++-- rc/core/makefile.kak | 4 ++-- rc/core/man.kak | 6 +++--- rc/extra/cabal.kak | 18 +++++++++--------- rc/extra/coffee.kak | 10 +++++----- rc/extra/cucumber.kak | 10 +++++----- rc/extra/go-tools.kak | 8 ++++---- rc/extra/haml.kak | 10 +++++----- rc/extra/hbs.kak | 10 +++++----- rc/extra/modeline.kak | 4 ++-- rc/extra/moon.kak | 14 +++++++------- rc/extra/php.kak | 14 +++++++------- rc/extra/pug.kak | 10 +++++----- rc/extra/ragel.kak | 14 +++++++------- rc/extra/sass.kak | 10 +++++----- rc/extra/scss.kak | 12 ++++++------ rc/extra/taskpaper.kak | 4 ++-- rc/extra/tmux-repl.kak | 10 +++++----- 36 files changed, 196 insertions(+), 196 deletions(-) diff --git a/rc/base/clojure.kak b/rc/base/clojure.kak index de053959..2172a21e 100644 --- a/rc/base/clojure.kak +++ b/rc/base/clojure.kak @@ -22,16 +22,16 @@ add-highlighter -group /clojure regex \b(clojure.core/['/\w]+)\b 0:keyword # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _clojure_filter_around_selections _lisp_filter_around_selections -def -hidden _clojure_indent_on_new_line _lisp_indent_on_new_line +def -hidden clojure-filter-around-selections lisp-filter-around-selections +def -hidden clojure-indent-on-new-line lisp-indent-on-new-line # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ hook -group clojure-highlight global WinSetOption filetype=clojure %{ add-highlighter ref clojure } hook global WinSetOption filetype=clojure %[ - hook window InsertEnd .* -group clojure-hooks _clojure_filter_around_selections - hook window InsertChar \n -group clojure-indent _clojure_indent_on_new_line + hook window InsertEnd .* -group clojure-hooks clojure-filter-around-selections + hook window InsertChar \n -group clojure-indent clojure-indent-on-new-line ] hook -group clojure-highlight global WinSetOption filetype=(?!clojure).* %{ remove-highlighter clojure } diff --git a/rc/base/css.kak b/rc/base/css.kak index bcc15488..9848da77 100644 --- a/rc/base/css.kak +++ b/rc/base/css.kak @@ -36,23 +36,23 @@ add-highlighter -group /css/selector regex [*]|[#.][A-Za-z][A-Za-z0-9_-]* 0:iden # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _css_filter_around_selections %{ +def -hidden css-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _css_indent_on_new_line %[ +def -hidden css-indent-on-new-line %[ eval -draft -itersel %[ # preserve previous line indent try %[ exec -draft \; K ] # filter previous line - try %[ exec -draft k : _css_filter_around_selections ] + try %[ exec -draft k : css-filter-around-selections ] # indent after lines ending with with { try %[ exec -draft k \{$ j ] ] ] -def -hidden _css_indent_on_closing_curly_brace %[ +def -hidden css-indent-on-closing-curly-brace %[ eval -draft -itersel %[ # align to opening curly brace when alone on a line try %[ exec -draft ^\h+\}$ m s \`|.\' 1 ] @@ -65,9 +65,9 @@ def -hidden _css_indent_on_closing_curly_brace %[ hook -group css-highlight global WinSetOption filetype=css %{ add-highlighter ref css } hook global WinSetOption filetype=css %[ - hook window InsertEnd .* -group css-hooks _css_filter_around_selections - hook window InsertChar \n -group css-indent _css_indent_on_new_line - hook window InsertChar \} -group css-indent _css_indent_on_closing_curly_brace + hook window InsertEnd .* -group css-hooks css-filter-around-selections + hook window InsertChar \n -group css-indent css-indent-on-new-line + hook window InsertChar \} -group css-indent css-indent-on-closing-curly-brace ] hook -group css-highlight global WinSetOption filetype=(?!css).* %{ remove-highlighter css } diff --git a/rc/base/d.kak b/rc/base/d.kak index ed1f98d2..92fbd64f 100644 --- a/rc/base/d.kak +++ b/rc/base/d.kak @@ -81,7 +81,7 @@ add-highlighter -group /d/code regex "\b(this)\b\s*[^(]" 1:value # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _d-indent-on-new-line %~ +def -hidden d-indent-on-new-line %~ eval -draft -itersel %= # preserve previous line indent try %{ exec -draft \;K } @@ -100,12 +100,12 @@ def -hidden _d-indent-on-new-line %~ = ~ -def -hidden _d-indent-on-opening-curly-brace %[ +def -hidden d-indent-on-opening-curly-brace %[ # align indent with opening paren when { is entered on a new line after the closing paren try %[ exec -draft -itersel h)M \`\(.*\)\h*\n\h*\{\' s \`|.\' 1 ] ] -def -hidden _d-indent-on-closing-curly-brace %[ +def -hidden d-indent-on-closing-curly-brace %[ # align to opening curly brace when alone on a line try %[ exec -itersel -draft ^\h+\}$hms\`|.\'1 ] ] @@ -118,9 +118,9 @@ hook -group d-highlight global WinSetOption filetype=d %{ add-highlighter ref d hook global WinSetOption filetype=d %{ # cleanup trailing whitespaces when exiting insert mode hook window InsertEnd .* -group d-hooks %{ try %{ exec -draft s^\h+$d } } - hook window InsertChar \n -group d-indent _d-indent-on-new-line - hook window InsertChar \{ -group d-indent _d-indent-on-opening-curly-brace - hook window InsertChar \} -group d-indent _d-indent-on-closing-curly-brace + hook window InsertChar \n -group d-indent d-indent-on-new-line + hook window InsertChar \{ -group d-indent d-indent-on-opening-curly-brace + hook window InsertChar \} -group d-indent d-indent-on-closing-curly-brace } hook -group d-highlight global WinSetOption filetype=(?!d).* %{ remove-highlighter d } diff --git a/rc/base/fish.kak b/rc/base/fish.kak index e12e4d34..f2875b33 100644 --- a/rc/base/fish.kak +++ b/rc/base/fish.kak @@ -29,14 +29,14 @@ add-highlighter -group /fish/code regex \b(and|begin|bg|bind|block|break|breakpo # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _fish_filter_around_selections %{ +def -hidden fish-filter-around-selections %{ eval -no-hooks -draft -itersel %{ # remove trailing white spaces try %{ exec -draft s\h+$d } } } -def -hidden _fish_indent_on_char %{ +def -hidden fish-indent-on-char %{ eval -no-hooks -draft -itersel %{ # align middle and end structures to start and indent when necessary try %{ exec -draft ^\h*(else)$^\h*(if)s\A|\Z' } @@ -45,18 +45,18 @@ def -hidden _fish_indent_on_char %{ } } -def -hidden _fish_indent_on_new_line %{ +def -hidden fish-indent-on-new-line %{ eval -no-hooks -draft -itersel %{ # preserve previous line indent try %{ exec -draft K } # filter previous line - try %{ exec -draft k:_fish_filter_around_selections } + try %{ exec -draft k:fish-filter-around-selections } # indent after start structure try %{ exec -draft k^\h*(begin|case|else|for|function|if|switch|while)\bj } } } -def -hidden _fish_insert_on_new_line %{ +def -hidden fish-insert-on-new-line %{ eval -no-hooks -draft -itersel %{ # copy _#_ comment prefix and following white spaces try %{ exec -draft ks^\h*\K#\h*yjp } @@ -74,9 +74,9 @@ def -hidden _fish_insert_on_new_line %{ hook -group fish-highlight global WinSetOption filetype=fish %{ add-highlighter ref fish } hook global WinSetOption filetype=fish %{ - hook window InsertChar .* -group fish-indent _fish_indent_on_char - hook window InsertChar \n -group fish-insert _fish_insert_on_new_line - hook window InsertChar \n -group fish-indent _fish_indent_on_new_line + hook window InsertChar .* -group fish-indent fish-indent-on-char + hook window InsertChar \n -group fish-insert fish-insert-on-new-line + hook window InsertChar \n -group fish-indent fish-indent-on-new-line } hook -group fish-highlight global WinSetOption filetype=(?!fish).* %{ remove-highlighter fish } diff --git a/rc/base/gas.kak b/rc/base/gas.kak index e31a7da6..04ec6a35 100644 --- a/rc/base/gas.kak +++ b/rc/base/gas.kak @@ -66,7 +66,7 @@ add-highlighter -group /gas/code regex \ ^\h*(cvttp[ds]2dq|cvttp[ds]2pi|cvtts[ds]2si)\b|\ ^\h*(vxorp[sd]|vandp[sd]|ucomis[sd])\b 0:keyword -def -hidden _gas_filter_around_selections %{ +def -hidden gas-filter-around-selections %{ eval -draft -itersel %{ exec # remove trailing white spaces @@ -74,12 +74,12 @@ def -hidden _gas_filter_around_selections %{ } } -def -hidden _gas_indent_on_new_line %~ +def -hidden gas-indent-on-new-line %~ eval -draft -itersel %< # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _gas_filter_around_selections } + try %{ exec -draft k : gas-filter-around-selections } # indent after label try %[ exec -draft k :$ j ] > @@ -88,7 +88,7 @@ def -hidden _gas_indent_on_new_line %~ hook -group gas-highlight global WinSetOption filetype=gas %{ add-highlighter ref gas } hook global WinSetOption filetype=gas %{ - hook window InsertChar \n -group gas-indent _gas_indent_on_new_line + hook window InsertChar \n -group gas-indent gas-indent-on-new-line } hook -group gas-highlight global WinSetOption filetype=(?!gas).* %{ remove-highlighter gas } diff --git a/rc/base/go.kak b/rc/base/go.kak index f7cc0083..b726d105 100644 --- a/rc/base/go.kak +++ b/rc/base/go.kak @@ -53,7 +53,7 @@ add-highlighter -group /go/code regex %{-?([0-9]*\.(?!0[xX]))?\b([0-9]+|0[xX][0- # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _go-indent-on-new-line %~ +def -hidden go-indent-on-new-line %~ eval -draft -itersel %= # preserve previous line indent try %{ exec -draft \;K } @@ -72,12 +72,12 @@ def -hidden _go-indent-on-new-line %~ = ~ -def -hidden _go-indent-on-opening-curly-brace %[ +def -hidden go-indent-on-opening-curly-brace %[ # align indent with opening paren when { is entered on a new line after the closing paren try %[ exec -draft -itersel h)M \`\(.*\)\h*\n\h*\{\' s \`|.\' 1 ] ] -def -hidden _go-indent-on-closing-curly-brace %[ +def -hidden go-indent-on-closing-curly-brace %[ # align to opening curly brace when alone on a line try %[ exec -itersel -draft ^\h+\}$hms\`|.\'1 ] ] @@ -90,9 +90,9 @@ hook -group go-highlight global WinSetOption filetype=go %{ add-highlighter ref hook global WinSetOption filetype=go %{ # cleanup trailing whitespaces when exiting insert mode hook window InsertEnd .* -group go-hooks %{ try %{ exec -draft s^\h+$d } } - hook window InsertChar \n -group go-indent _go-indent-on-new-line - hook window InsertChar \{ -group go-indent _go-indent-on-opening-curly-brace - hook window InsertChar \} -group go-indent _go-indent-on-closing-curly-brace + hook window InsertChar \n -group go-indent go-indent-on-new-line + hook window InsertChar \{ -group go-indent go-indent-on-opening-curly-brace + hook window InsertChar \} -group go-indent go-indent-on-closing-curly-brace } hook -group go-highlight global WinSetOption filetype=(?!go).* %{ remove-highlighter go } diff --git a/rc/base/haskell.kak b/rc/base/haskell.kak index ffeeb485..2de45911 100644 --- a/rc/base/haskell.kak +++ b/rc/base/haskell.kak @@ -31,12 +31,12 @@ add-highlighter -group /haskell/code regex \b(Int|Integer|Char|Bool|Float|Double # http://en.wikibooks.org/wiki/Haskell/Indentation -def -hidden _haskell_filter_around_selections %{ +def -hidden haskell-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _haskell_indent_on_new_line %{ +def -hidden haskell-indent-on-new-line %{ eval -draft -itersel %{ # copy -- comments prefix and following white spaces try %{ exec -draft k s ^\h*\K--\h* y gh j P } @@ -45,7 +45,7 @@ def -hidden _haskell_indent_on_new_line %{ # align to first clause try %{ exec -draft \; k x X s ^\h*(if|then|else)?\h*(([\w']+\h+)+=)?\h*(case\h+[\w']+\h+of|do|let|where)\h+\K.* s \`|.\' & } # filter previous line - try %{ exec -draft k : _haskell_filter_around_selections } + try %{ exec -draft k : haskell-filter-around-selections } # indent after lines beginning with condition or ending with expression or =( try %{ exec -draft \; k x ^\h*(if)|(case\h+[\w']+\h+of|do|let|where|[=(])$ j } } @@ -57,8 +57,8 @@ def -hidden _haskell_indent_on_new_line %{ hook -group haskell-highlight global WinSetOption filetype=haskell %{ add-highlighter ref haskell } hook global WinSetOption filetype=haskell %{ - hook window InsertEnd .* -group haskell-hooks _haskell_filter_around_selections - hook window InsertChar \n -group haskell-indent _haskell_indent_on_new_line + hook window InsertEnd .* -group haskell-hooks haskell-filter-around-selections + hook window InsertChar \n -group haskell-indent haskell-indent-on-new-line } hook -group haskell-highlight global WinSetOption filetype=(?!haskell).* %{ remove-highlighter haskell } diff --git a/rc/base/html.kak b/rc/base/html.kak index 29606125..743c6c89 100644 --- a/rc/base/html.kak +++ b/rc/base/html.kak @@ -37,24 +37,24 @@ add-highlighter -group /html/tag/content/string fill string # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _html_filter_around_selections %{ +def -hidden html-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _html_indent_on_char %{ +def -hidden html-indent-on-char %{ eval -draft -itersel %{ # align closing tag to opening when alone on a line try %{ exec -draft s ^\h+$ 1 s \`|.\' 1 } } } -def -hidden _html_indent_on_new_line %{ +def -hidden html-indent-on-new-line %{ eval -draft -itersel %{ # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _html_filter_around_selections } + try %{ exec -draft k : html-filter-around-selections } # indent after lines ending with opening tag try %{ exec -draft k <[^/][^>]+>$ j } } @@ -66,9 +66,9 @@ def -hidden _html_indent_on_new_line %{ hook -group html-highlight global WinSetOption filetype=(?:html|xml) %{ add-highlighter ref html } hook global WinSetOption filetype=(?:html|xml) %{ - hook window InsertEnd .* -group html-hooks _html_filter_around_selections - hook window InsertChar .* -group html-indent _html_indent_on_char - hook window InsertChar \n -group html-indent _html_indent_on_new_line + hook window InsertEnd .* -group html-hooks html-filter-around-selections + hook window InsertChar .* -group html-indent html-indent-on-char + hook window InsertChar \n -group html-indent html-indent-on-new-line } hook -group html-highlight global WinSetOption filetype=(?!html|xml).* %{ remove-highlighter html } diff --git a/rc/base/javascript.kak b/rc/base/javascript.kak index 8b2ae3e1..94636460 100644 --- a/rc/base/javascript.kak +++ b/rc/base/javascript.kak @@ -37,26 +37,26 @@ add-highlighter -group /javascript/code regex \b(break|case|catch|class|const|co # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _javascript_filter_around_selections %{ +def -hidden javascript-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _javascript_indent_on_char %< +def -hidden javascript-indent-on-char %< eval -draft -itersel %< # align closer token to its opener when alone on a line try %/ exec -draft ^\h+[]}]$ m s \`|.\' 1 / > > -def -hidden _javascript_indent_on_new_line %< +def -hidden javascript-indent-on-new-line %< eval -draft -itersel %< # copy // comments prefix and following white spaces try %{ exec -draft k s ^\h*\K#\h* y gh j P } # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _javascript_filter_around_selections } + try %{ exec -draft k : javascript-filter-around-selections } # indent after lines beginning / ending with opener token try %_ exec -draft k ^\h*[[{]|[[{]$ j _ > @@ -68,9 +68,9 @@ def -hidden _javascript_indent_on_new_line %< hook -group javascript-highlight global WinSetOption filetype=javascript %{ add-highlighter ref javascript } hook global WinSetOption filetype=javascript %{ - hook window InsertEnd .* -group javascript-hooks _javascript_filter_around_selections - hook window InsertChar .* -group javascript-indent _javascript_indent_on_char - hook window InsertChar \n -group javascript-indent _javascript_indent_on_new_line + hook window InsertEnd .* -group javascript-hooks javascript-filter-around-selections + hook window InsertChar .* -group javascript-indent javascript-indent-on-char + hook window InsertChar \n -group javascript-indent javascript-indent-on-new-line } hook -group javascript-highlight global WinSetOption filetype=(?!javascript).* %{ remove-highlighter javascript } diff --git a/rc/base/json.kak b/rc/base/json.kak index dd9276a1..c8f2ebc2 100644 --- a/rc/base/json.kak +++ b/rc/base/json.kak @@ -21,24 +21,24 @@ add-highlighter -group /json/code regex \b(true|false|null|\d+(?:\.\d+)?(?:[eE][ # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _json_filter_around_selections %{ +def -hidden json-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _json_indent_on_char %< +def -hidden json-indent-on-char %< eval -draft -itersel %< # align closer token to its opener when alone on a line try %< exec -draft ^\h+[]}]$ m s \`|.\' 1 > > > -def -hidden _json_indent_on_new_line %< +def -hidden json-indent-on-new-line %< eval -draft -itersel %< # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _json_filter_around_selections } + try %{ exec -draft k : json-filter-around-selections } # indent after lines beginning with opener token try %< exec -draft k ^\h*[[{] j > > @@ -50,9 +50,9 @@ def -hidden _json_indent_on_new_line %< hook -group json-highlight global WinSetOption filetype=json %{ add-highlighter ref json } hook global WinSetOption filetype=json %{ - hook window InsertEnd .* -group json-hooks _json_filter_around_selections - hook window InsertChar .* -group json-indent _json_indent_on_char - hook window InsertChar \n -group json-indent _json_indent_on_new_line + hook window InsertEnd .* -group json-hooks json-filter-around-selections + hook window InsertChar .* -group json-indent json-indent-on-char + hook window InsertChar \n -group json-indent json-indent-on-new-line } hook -group json-highlight global WinSetOption filetype=(?!json).* %{ remove-highlighter json } diff --git a/rc/base/lisp.kak b/rc/base/lisp.kak index 0dbe0704..8fbc17aa 100644 --- a/rc/base/lisp.kak +++ b/rc/base/lisp.kak @@ -26,12 +26,12 @@ add-highlighter -group /lisp/code regex \b(def[a-z]+|if|do|let|lambda|catch|and| # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _lisp_filter_around_selections %{ +def -hidden lisp-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _lisp_indent_on_new_line %{ +def -hidden lisp-indent-on-new-line %{ eval -draft -itersel %{ # preserve previous line indent try %{ exec -draft \; K } @@ -46,8 +46,8 @@ def -hidden _lisp_indent_on_new_line %{ hook -group lisp-highlight global WinSetOption filetype=lisp %{ add-highlighter ref lisp } hook global WinSetOption filetype=lisp %{ - hook window InsertEnd .* -group lisp-hooks _lisp_filter_around_selections - hook window InsertChar \n -group lisp-indent _lisp_indent_on_new_line + hook window InsertEnd .* -group lisp-hooks lisp-filter-around-selections + hook window InsertChar \n -group lisp-indent lisp-indent-on-new-line } hook -group lisp-highlight global WinSetOption filetype=(?!lisp).* %{ remove-highlighter lisp } diff --git a/rc/base/lua.kak b/rc/base/lua.kak index 6a05157e..4a43a080 100644 --- a/rc/base/lua.kak +++ b/rc/base/lua.kak @@ -51,14 +51,14 @@ def lua-alternative-file -docstring 'Jump to the alternate file (implementation printf %s\\n "edit $altfile" }} -def -hidden _lua_filter_around_selections %{ +def -hidden lua-filter-around-selections %{ eval -no-hooks -draft -itersel %{ # remove trailing white spaces try %{ exec -draft s\h+$d } } } -def -hidden _lua_indent_on_char %{ +def -hidden lua-indent-on-char %{ eval -no-hooks -draft -itersel %{ # align middle and end structures to start and indent when necessary, elseif is already covered by else try %{ exec -draft ^\h*(else)$^\h*(if)s\A|\Z' } @@ -66,18 +66,18 @@ def -hidden _lua_indent_on_char %{ } } -def -hidden _lua_indent_on_new_line %{ +def -hidden lua-indent-on-new-line %{ eval -no-hooks -draft -itersel %{ # preserve previous line indent try %{ exec -draft K } # filter previous line - try %{ exec -draft k:_lua_filter_around_selections } + try %{ exec -draft k:lua-filter-around-selections } # indent after start structure try %{ exec -draft k^\h*(else|elseif|for|function|if|while)\bj } } } -def -hidden _lua_insert_on_new_line %{ +def -hidden lua-insert-on-new-line %{ eval -no-hooks -draft -itersel %{ # copy -- comment prefix and following white spaces try %{ exec -draft ks^\h*\K--\h*yjp } @@ -95,9 +95,9 @@ def -hidden _lua_insert_on_new_line %{ hook -group lua-highlight global WinSetOption filetype=lua %{ add-highlighter ref lua } hook global WinSetOption filetype=lua %{ - hook window InsertChar .* -group lua-indent _lua_indent_on_char - hook window InsertChar \n -group lua-insert _lua_insert_on_new_line - hook window InsertChar \n -group lua-indent _lua_indent_on_new_line + hook window InsertChar .* -group lua-indent lua-indent-on-char + hook window InsertChar \n -group lua-insert lua-insert-on-new-line + hook window InsertChar \n -group lua-indent lua-indent-on-new-line alias window alt lua-alternative-file } diff --git a/rc/base/markdown.kak b/rc/base/markdown.kak index 1c4ee929..c0921ca0 100644 --- a/rc/base/markdown.kak +++ b/rc/base/markdown.kak @@ -124,7 +124,7 @@ add-highlighter -group /markdown/content regex \H\K\h\h$ 0:PrimarySelection # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _markdown_indent_on_new_line %{ +def -hidden markdown-indent-on-new-line %{ eval -draft -itersel %{ # copy block quote(s), list item prefix and following white spaces try %{ exec -draft k s ^\h*\K((>\h*)|[*+-])+\h* y gh j P } @@ -141,7 +141,7 @@ def -hidden _markdown_indent_on_new_line %{ hook -group markdown-highlight global WinSetOption filetype=markdown %{ add-highlighter ref markdown } hook global WinSetOption filetype=markdown %{ - hook window InsertChar \n -group markdown-indent _markdown_indent_on_new_line + hook window InsertChar \n -group markdown-indent markdown-indent-on-new-line } hook -group markdown-highlight global WinSetOption filetype=(?!markdown).* %{ remove-highlighter markdown } diff --git a/rc/base/perl.kak b/rc/base/perl.kak index e9449eaa..01f84b12 100644 --- a/rc/base/perl.kak +++ b/rc/base/perl.kak @@ -73,7 +73,7 @@ add-highlighter -group /perl/code regex \$(LAST_REGEXP_CODE_RESULT|LIST_SEPARATO # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _perl-indent-on-new-line %~ +def -hidden perl-indent-on-new-line %~ eval -draft -itersel %= # preserve previous line indent try %{ exec -draft \;K } @@ -92,12 +92,12 @@ def -hidden _perl-indent-on-new-line %~ = ~ -def -hidden _perl-indent-on-opening-curly-brace %[ +def -hidden perl-indent-on-opening-curly-brace %[ # align indent with opening paren when { is entered on a new line after the closing paren try %[ exec -draft -itersel h)M \`\(.*\)\h*\n\h*\{\' s \`|.\' 1 ] ] -def -hidden _perl-indent-on-closing-curly-brace %[ +def -hidden perl-indent-on-closing-curly-brace %[ # align to opening curly brace when alone on a line try %[ exec -itersel -draft ^\h+\}$hms\`|.\'1 ] ] @@ -110,9 +110,9 @@ hook -group perl-highlight global WinSetOption filetype=perl %{ add-highlighter hook global WinSetOption filetype=perl %{ # cleanup trailing whitespaces when exiting insert mode hook window InsertEnd .* -group perl-hooks %{ try %{ exec -draft s^\h+$d } } - hook window InsertChar \n -group perl-indent _perl-indent-on-new-line - hook window InsertChar \{ -group perl-indent _perl-indent-on-opening-curly-brace - hook window InsertChar \} -group perl-indent _perl-indent-on-closing-curly-brace + hook window InsertChar \n -group perl-indent perl-indent-on-new-line + hook window InsertChar \{ -group perl-indent perl-indent-on-opening-curly-brace + hook window InsertChar \} -group perl-indent perl-indent-on-closing-curly-brace } hook -group perl-highlight global WinSetOption filetype=(?!perl).* %{ remove-highlighter perl } diff --git a/rc/base/ruby.kak b/rc/base/ruby.kak index edb014ad..0c939a5b 100644 --- a/rc/base/ruby.kak +++ b/rc/base/ruby.kak @@ -100,7 +100,7 @@ def ruby-alternative-file -docstring 'Jump to the alternate file (implementation echo "edit $altfile" }} -def -hidden _ruby_filter_around_selections %{ +def -hidden ruby-filter-around-selections %{ eval -no-hooks -draft -itersel %{ exec # remove trailing white spaces @@ -108,7 +108,7 @@ def -hidden _ruby_filter_around_selections %{ } } -def -hidden _ruby_indent_on_char %{ +def -hidden ruby-indent-on-char %{ eval -no-hooks -draft -itersel %{ # align middle and end structures to start try %{ exec -draft ^ \h * (else|elsif) $ ^ \h * (if) s \A | \Z \' } @@ -118,18 +118,18 @@ def -hidden _ruby_indent_on_char %{ } } -def -hidden _ruby_indent_on_new_line %{ +def -hidden ruby-indent-on-new-line %{ eval -no-hooks -draft -itersel %{ # preserve previous line indent try %{ exec -draft K } # filter previous line - try %{ exec -draft k : _ruby_filter_around_selections } + try %{ exec -draft k : ruby-filter-around-selections } # indent after start structure try %{ exec -draft k ^ \h * (begin|case|class|def|do|else|elsif|ensure|for|if|module|rescue|unless|until|when|while) \b j } } } -def -hidden _ruby_insert_on_new_line %{ +def -hidden ruby-insert-on-new-line %{ eval -no-hooks -draft -itersel %{ # copy _#_ comment prefix and following white spaces try %{ exec -draft k s ^ \h * \K \# \h * y gh j P } @@ -147,9 +147,9 @@ def -hidden _ruby_insert_on_new_line %{ hook -group ruby-highlight global WinSetOption filetype=ruby %{ add-highlighter ref ruby } hook global WinSetOption filetype=ruby %{ - hook window InsertChar .* -group ruby-indent _ruby_indent_on_char - hook window InsertChar \n -group ruby-insert _ruby_insert_on_new_line - hook window InsertChar \n -group ruby-indent _ruby_indent_on_new_line + hook window InsertChar .* -group ruby-indent ruby-indent-on-char + hook window InsertChar \n -group ruby-insert ruby-insert-on-new-line + hook window InsertChar \n -group ruby-indent ruby-indent-on-new-line alias window alt ruby-alternative-file } diff --git a/rc/base/rust.kak b/rc/base/rust.kak index d9494acc..69b1eb41 100644 --- a/rc/base/rust.kak +++ b/rc/base/rust.kak @@ -34,19 +34,19 @@ add-highlighter -group /rust/code regex \b(?:u8|u16|u32|u64|usize|i8|i16|i32|i64 # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _rust_filter_around_selections %{ +def -hidden rust-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _rust_indent_on_new_line %~ +def -hidden rust-indent-on-new-line %~ eval -draft -itersel %< # copy // comments prefix and following white spaces try %{ exec -draft k s ^\h*\K//\h* y gh j P } # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _rust_filter_around_selections } + try %{ exec -draft k : rust-filter-around-selections } # indent after lines ending with { or ( try %[ exec -draft k [{(]\h*$ j ] # align to opening paren of previous line @@ -54,14 +54,14 @@ def -hidden _rust_indent_on_new_line %~ > ~ -def -hidden _rust_indent_on_opening_curly_brace %[ +def -hidden rust-indent-on-opening-curly-brace %[ eval -draft -itersel %_ # align indent with opening paren when { is entered on a new line after the closing paren try %[ exec -draft h ) M \`\(.*\)\h*\n\h*\{\' s \`|.\' 1 ] _ ] -def -hidden _rust_indent_on_closing_curly_brace %[ +def -hidden rust-indent-on-closing-curly-brace %[ eval -draft -itersel %_ # align to opening curly brace when alone on a line try %[ exec -draft ^\h+\}$ h m s \`|.\' 1 ] @@ -74,10 +74,10 @@ def -hidden _rust_indent_on_closing_curly_brace %[ hook -group rust-highlight global WinSetOption filetype=rust %{ add-highlighter ref rust } hook global WinSetOption filetype=rust %[ - hook window InsertEnd .* -group rust-hooks _rust_filter_around_selections - hook window InsertChar \n -group rust-indent _rust_indent_on_new_line - hook window InsertChar \{ -group rust-indent _rust_indent_on_opening_curly_brace - hook window InsertChar \} -group rust-indent _rust_indent_on_closing_curly_brace + hook window InsertEnd .* -group rust-hooks rust-filter-around-selections + hook window InsertChar \n -group rust-indent rust-indent-on-new-line + hook window InsertChar \{ -group rust-indent rust-indent-on-opening-curly-brace + hook window InsertChar \} -group rust-indent rust-indent-on-closing-curly-brace ] hook -group rust-highlight global WinSetOption filetype=(?!rust).* %{ remove-highlighter rust } diff --git a/rc/base/scala.kak b/rc/base/scala.kak index 893753e1..ab7a0d19 100644 --- a/rc/base/scala.kak +++ b/rc/base/scala.kak @@ -34,25 +34,25 @@ add-highlighter -group /scala/code regex "'[_A-Za-z0-9$]+" 0:identifier # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _scala_filter_around_selections %{ +def -hidden scala-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _scala_indent_on_new_line %[ +def -hidden scala-indent-on-new-line %[ eval -draft -itersel %[ # copy // comments prefix and following white spaces try %[ exec -draft k s ^\h*\K#\h* y gh j P ] # preserve previous line indent try %[ exec -draft \; K ] # filter previous line - try %[ exec -draft k : _scala_filter_around_selections ] + try %[ exec -draft k : scala-filter-around-selections ] # indent after lines ending with { try %[ exec -draft k \{$ j ] ] ] -def -hidden _scala_indent_on_closing_curly_brace %[ +def -hidden scala-indent-on-closing-curly-brace %[ eval -draft -itersel %[ # align to opening curly brace when alone on a line try %[ exec -draft ^\h+\}$ m s \`|.\' 1 ] @@ -65,9 +65,9 @@ def -hidden _scala_indent_on_closing_curly_brace %[ hook -group scala-highlight global WinSetOption filetype=scala %{ add-highlighter ref scala } hook global WinSetOption filetype=scala %[ - hook window InsertEnd .* -group scala-hooks _scala_filter_around_selections - hook window InsertChar \n -group scala-indent _scala_indent_on_new_line - hook window InsertChar \} -group scala-indent _scala_indent_on_closing_curly_brace + hook window InsertEnd .* -group scala-hooks scala-filter-around-selections + hook window InsertChar \n -group scala-indent scala-indent-on-new-line + hook window InsertChar \} -group scala-indent scala-indent-on-closing-curly-brace ] hook -group scala-highlight global WinSetOption filetype=(?!scala).* %{ remove-highlighter scala } diff --git a/rc/base/yaml.kak b/rc/base/yaml.kak index 0229bc2a..a1854134 100644 --- a/rc/base/yaml.kak +++ b/rc/base/yaml.kak @@ -27,19 +27,19 @@ add-highlighter -group /yaml/code regex \b(true|false|null)\b 0:value # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _yaml_filter_around_selections %{ +def -hidden yaml-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _yaml_indent_on_new_line %{ +def -hidden yaml-indent-on-new-line %{ eval -draft -itersel %{ # copy '#' comment prefix and following white spaces try %{ exec -draft k s ^\h*\K#\h* y gh j P } # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _yaml_filter_around_selections } + try %{ exec -draft k : yaml-filter-around-selections } # indent after : try %{ exec -draft k x :$ j } } @@ -51,8 +51,8 @@ def -hidden _yaml_indent_on_new_line %{ hook -group yaml-highlight global WinSetOption filetype=yaml %{ add-highlighter ref yaml } hook global WinSetOption filetype=yaml %{ - hook window InsertEnd .* -group yaml-hooks _yaml_filter_around_selections - hook window InsertChar \n -group yaml-indent _yaml_indent_on_new_line + hook window InsertEnd .* -group yaml-hooks yaml-filter-around-selections + hook window InsertChar \n -group yaml-indent yaml-indent-on-new-line } hook -group yaml-highlight global WinSetOption filetype=(?!yaml).* %{ remove-highlighter yaml } diff --git a/rc/core/doc.kak b/rc/core/doc.kak index ff4d58a1..c64a763a 100644 --- a/rc/core/doc.kak +++ b/rc/core/doc.kak @@ -1,6 +1,6 @@ decl str docsclient -def -hidden -params 1..2 _doc-open %{ +def -hidden -params 1..2 doc-open %{ %sh{ manout=$(mktemp /tmp/kak-man-XXXXXX) @@ -46,7 +46,7 @@ An optional keyword argument can be passed to the function, which will be automa exit fi - printf %s\\n "eval -try-client %opt{docsclient} _doc-open ${PATH_DOC} $@" + printf %s\\n "eval -try-client %opt{docsclient} doc-open ${PATH_DOC} $@" } } diff --git a/rc/core/makefile.kak b/rc/core/makefile.kak index a0068277..3ef2e592 100644 --- a/rc/core/makefile.kak +++ b/rc/core/makefile.kak @@ -34,7 +34,7 @@ add-highlighter -group /makefile/content regex [+?:]= 0:operator # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _makefile-indent-on-new-line %{ +def -hidden makefile-indent-on-new-line %{ eval -draft -itersel %{ # preserve previous line indent try %{ exec -draft \;K } @@ -53,7 +53,7 @@ def -hidden _makefile-indent-on-new-line %{ hook -group makefile-highlight global WinSetOption filetype=makefile %{ add-highlighter ref makefile } hook global WinSetOption filetype=makefile %{ - hook window InsertChar \n -group makefile-indent _makefile-indent-on-new-line + hook window InsertChar \n -group makefile-indent makefile-indent-on-new-line } hook -group makefile-highlight global WinSetOption filetype=(?!makefile).* %{ remove-highlighter makefile } diff --git a/rc/core/man.kak b/rc/core/man.kak index e604f454..21a80348 100644 --- a/rc/core/man.kak +++ b/rc/core/man.kak @@ -16,7 +16,7 @@ hook -group man-highlight global WinSetOption filetype=man %{ hook global WinSetOption filetype=man %{ hook -group man-hooks window WinResize .* %{ - _man %opt{_manpage} + man-impl %opt{_manpage} } } @@ -26,7 +26,7 @@ hook global WinSetOption filetype=(?!man).* %{ remove-hooks window man-hooks } -def -hidden -params 1..2 _man %{ %sh{ +def -hidden -params 1..2 man-impl %{ %sh{ manout=$(mktemp /tmp/kak-man-XXXXXX) colout=$(mktemp /tmp/kak-man-XXXXXX) MANWIDTH=${kak_window_width} man "$@" > $manout @@ -71,5 +71,5 @@ The page can be a word, or a word directly followed by a section number between subject=${subject%%\(*} fi - printf %s\\n "eval -collapse-jumps -try-client %opt{docsclient} _man $pagenum $subject" + printf %s\\n "eval -collapse-jumps -try-client %opt{docsclient} man-impl $pagenum $subject" } } diff --git a/rc/extra/cabal.kak b/rc/extra/cabal.kak index 25b0d8b9..ae636938 100644 --- a/rc/extra/cabal.kak +++ b/rc/extra/cabal.kak @@ -24,32 +24,32 @@ add-highlighter -group /cabal/code regex ^\h*([A-Za-z][A-Za-z0-9_-]*)\h*: 1:iden # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _cabal_filter_around_selections %{ +def -hidden cabal-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _cabal_indent_on_new_line %[ +def -hidden cabal-indent-on-new-line %[ eval -draft -itersel %[ # copy '#' comment prefix and following white spaces try %[ exec -draft k s ^\h*\K#\h* y gh j P ] # preserve previous line indent try %[ exec -draft \; K ] # filter previous line - try %[ exec -draft k : _cabal_filter_around_selections ] + try %[ exec -draft k : cabal-filter-around-selections ] # indent after lines ending with { or : try %[ exec -draft k [:{]$ j ] ] ] -def -hidden _cabal_indent_on_opening_curly_brace %[ +def -hidden cabal-indent-on-opening-curly-brace %[ eval -draft -itersel %[ # align indent with opening paren when { is entered on a new line after the closing paren try %[ exec -draft h ) M \`\(.*\)\h*\n\h*\{\' s \`|.\' 1 ] ] ] -def -hidden _cabal_indent_on_closing_curly_brace %[ +def -hidden cabal-indent-on-closing-curly-brace %[ eval -draft -itersel %[ # align to opening curly brace when alone on a line try %[ exec -draft ^\h+\}$ h m s \`|.\' 1 ] @@ -62,10 +62,10 @@ def -hidden _cabal_indent_on_closing_curly_brace %[ hook -group cabal-highlight global WinSetOption filetype=cabal %{ add-highlighter ref cabal } hook global WinSetOption filetype=cabal %[ - hook window InsertEnd .* -group cabal-hooks _cabal_filter_around_selections - hook window InsertChar \n -group cabal-indent _cabal_indent_on_new_line - hook window InsertChar \{ -group cabal-indent _cabal_indent_on_opening_curly_brace - hook window InsertChar \} -group cabal-indent _cabal_indent_on_closing_curly_brace + hook window InsertEnd .* -group cabal-hooks cabal-filter-around-selections + hook window InsertChar \n -group cabal-indent cabal-indent-on-new-line + hook window InsertChar \{ -group cabal-indent cabal-indent-on-opening-curly-brace + hook window InsertChar \} -group cabal-indent cabal-indent-on-closing-curly-brace ] hook -group cabal-highlight global WinSetOption filetype=(?!cabal).* %{ remove-highlighter cabal } diff --git a/rc/extra/coffee.kak b/rc/extra/coffee.kak index 53c1d00f..73809b3b 100644 --- a/rc/extra/coffee.kak +++ b/rc/extra/coffee.kak @@ -45,7 +45,7 @@ add-highlighter -group /coffee/code regex \b(break|case|catch|class|const|contin # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _coffee_filter_around_selections %{ +def -hidden coffee-filter-around-selections %{ eval -draft -itersel %{ exec # remove trailing white spaces @@ -53,14 +53,14 @@ def -hidden _coffee_filter_around_selections %{ } } -def -hidden _coffee_indent_on_new_line %{ +def -hidden coffee-indent-on-new-line %{ eval -draft -itersel %{ # copy '#' comment prefix and following white spaces try %{ exec -draft k s ^ \h * \K \# \h * y gh j P } # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _coffee_filter_around_selections } + try %{ exec -draft k : coffee-filter-around-selections } # indent after start structure try %{ exec -draft k ^ \h * (case|catch|class|else|finally|for|function|if|switch|try|while|with) \b | (=|->) $ j } } @@ -72,8 +72,8 @@ def -hidden _coffee_indent_on_new_line %{ hook -group coffee-highlight global WinSetOption filetype=coffee %{ add-highlighter ref coffee } hook global WinSetOption filetype=coffee %{ - hook window InsertEnd .* -group coffee-hooks _coffee_filter_around_selections - hook window InsertChar \n -group coffee-indent _coffee_indent_on_new_line + hook window InsertEnd .* -group coffee-hooks coffee-filter-around-selections + hook window InsertChar \n -group coffee-indent coffee-indent-on-new-line } hook -group coffee-highlight global WinSetOption filetype=(?!coffee).* %{ remove-highlighter coffee } diff --git a/rc/extra/cucumber.kak b/rc/extra/cucumber.kak index c33a2028..84f58519 100644 --- a/rc/extra/cucumber.kak +++ b/rc/extra/cucumber.kak @@ -56,19 +56,19 @@ add-highlighter -group /cucumber/code regex \b(Feature|Business\h+Need|Ability|B # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _cucumber_filter_around_selections %{ +def -hidden cucumber-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _cucumber_indent_on_new_line %{ +def -hidden cucumber-indent-on-new-line %{ eval -draft -itersel %{ # copy '#' comment prefix and following white spaces try %{ exec -draft k s ^\h*\K#\h* y gh j P } # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _cucumber_filter_around_selections } + try %{ exec -draft k : cucumber-filter-around-selections } # indent after lines containing : try %{ exec -draft k x : j } } @@ -80,8 +80,8 @@ def -hidden _cucumber_indent_on_new_line %{ hook -group cucumber-highlight global WinSetOption filetype=cucumber %{ add-highlighter ref cucumber } hook global WinSetOption filetype=cucumber %{ - hook window InsertEnd .* -group cucumber-hooks _cucumber_filter_around_selections - hook window InsertChar \n -group cucumber-indent _cucumber_indent_on_new_line + hook window InsertEnd .* -group cucumber-hooks cucumber-filter-around-selections + hook window InsertChar \n -group cucumber-indent cucumber-indent-on-new-line } hook -group cucumber-highlight global WinSetOption filetype=(?!cucumber).* %{ remove-highlighter cucumber } diff --git a/rc/extra/go-tools.kak b/rc/extra/go-tools.kak index 5c3e9b12..058c957e 100644 --- a/rc/extra/go-tools.kak +++ b/rc/extra/go-tools.kak @@ -85,7 +85,7 @@ def -params ..1 go-format \ decl -hidden str go_doc_tmp_dir # FIXME text escaping -def -hidden -params 1..2 _gogetdoc-cmd %{ +def -hidden -params 1..2 gogetdoc-cmd %{ %sh{ dir=$(mktemp -d -t kak-go.XXXXXXXX) printf %s\\n "set buffer go_doc_tmp_dir ${dir}" @@ -153,15 +153,15 @@ def -hidden -params 1..2 _gogetdoc-cmd %{ } def go-doc-info -docstring "Show the documention of the symbol under the cursor" %{ - _gogetdoc-cmd "info" + gogetdoc-cmd "info" } def go-print-signature -docstring "Print the signature of the symbol under the cursor" %{ - _gogetdoc-cmd "echo" + gogetdoc-cmd "echo" } def go-jump -docstring "Jump to the symbol definition" %{ - _gogetdoc-cmd "jump" 1 + gogetdoc-cmd "jump" 1 } def go-share-selection -docstring "Share the selection using the Go Playground" %{ %sh{ diff --git a/rc/extra/haml.kak b/rc/extra/haml.kak index ef694fbc..6bb30200 100644 --- a/rc/extra/haml.kak +++ b/rc/extra/haml.kak @@ -33,19 +33,19 @@ add-highlighter -group /haml/code regex ^\h*%([A-Za-z][A-Za-z0-9_-]*)([#.][A-Za- # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _haml_filter_around_selections %{ +def -hidden haml-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _haml_indent_on_new_line %{ +def -hidden haml-indent-on-new-line %{ eval -draft -itersel %{ # copy '/' comment prefix and following white spaces try %{ exec -draft k s ^\h*\K/\h* y gh j P } # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _haml_filter_around_selections } + try %{ exec -draft k : haml-filter-around-selections } # indent after lines beginning with : or - try %{ exec -draft k ^\h*[:-] j } } @@ -57,8 +57,8 @@ def -hidden _haml_indent_on_new_line %{ hook -group haml-highlight global WinSetOption filetype=haml %{ add-highlighter ref haml } hook global WinSetOption filetype=haml %{ - hook window InsertEnd .* -group haml-hooks _haml_filter_around_selections - hook window InsertChar \n -group haml-indent _haml_indent_on_new_line + hook window InsertEnd .* -group haml-hooks haml-filter-around-selections + hook window InsertChar \n -group haml-indent haml-indent-on-new-line } hook -group haml-highlight global WinSetOption filetype=(?!haml).* %{ remove-highlighter haml } diff --git a/rc/extra/hbs.kak b/rc/extra/hbs.kak index d2a81789..b95a18eb 100644 --- a/rc/extra/hbs.kak +++ b/rc/extra/hbs.kak @@ -34,19 +34,19 @@ add-highlighter -group /hbs/block-expression regex ((\w|-)+)=(('|").*?('|")) 1:a # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _hbs_filter_around_selections %{ +def -hidden hbs-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _hbs_indent_on_new_line %{ +def -hidden hbs-indent-on-new-line %{ eval -draft -itersel %{ # copy '/' comment prefix and following white spaces try %{ exec -draft k s ^\h*\K/\h* y j p } # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _hbs_filter_around_selections } + try %{ exec -draft k : hbs-filter-around-selections } # indent after lines beginning with : or - try %{ exec -draft k ^\h*[:-] j } } @@ -60,8 +60,8 @@ hook -group hbs-highlight global WinSetOption filetype=hbs %{ } hook global WinSetOption filetype=hbs %{ - hook window InsertEnd .* -group hbs-hooks _hbs_filter_around_selections - hook window InsertChar \n -group hbs-indent _hbs_indent_on_new_line + hook window InsertEnd .* -group hbs-hooks hbs-filter-around-selections + hook window InsertChar \n -group hbs-indent hbs-indent-on-new-line } hook -group hbs-highlight global WinSetOption filetype=(?!hbs).* %{ diff --git a/rc/extra/modeline.kak b/rc/extra/modeline.kak index 4e9e5466..00d23715 100644 --- a/rc/extra/modeline.kak +++ b/rc/extra/modeline.kak @@ -11,7 +11,7 @@ # and the end of the buffer decl int modelines 5 -def -hidden _modeline-parse %{ +def -hidden modeline-parse %{ %sh{ # Translate a vim option into the corresponding kakoune one function translate_opt_vim { @@ -103,6 +103,6 @@ def modeline-parse -docstring "Read and interpret vi-format modelines at the beg try %{ eval -draft %{ exec \%s\`|.\' %opt{modelines}k %opt{modelines}X \ s^[^\s]+?\s(vim?|kak(oune)?):\s?[^\n]+ - eval -draft -itersel _modeline-parse + eval -draft -itersel modeline-parse } } } diff --git a/rc/extra/moon.kak b/rc/extra/moon.kak index 2c8746a5..78807da8 100644 --- a/rc/extra/moon.kak +++ b/rc/extra/moon.kak @@ -55,7 +55,7 @@ def moon-alternative-file -docstring 'Jump to the alternate file (implementation printf %s\\n "edit $altfile" }} -def -hidden _moon_filter_around_selections %{ +def -hidden moon-filter-around-selections %{ eval -draft -itersel %{ exec # remove trailing white spaces @@ -63,7 +63,7 @@ def -hidden _moon_filter_around_selections %{ } } -def -hidden _moon_indent_on_char %{ +def -hidden moon-indent-on-char %{ eval -draft -itersel %{ # align _else_ statements to start try %{ exec -draft ^ \h * (else(if)?) $ ^ \h * (if|unless|when) s \A | \Z \' } @@ -74,14 +74,14 @@ def -hidden _moon_indent_on_char %{ } } -def -hidden _moon_indent_on_new_line %{ +def -hidden moon-indent-on-new-line %{ eval -draft -itersel %{ # copy -- comment prefix and following white spaces try %{ exec -draft k s ^ \h * \K -- \h * y gh j P } # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _moon_filter_around_selections } + try %{ exec -draft k : moon-filter-around-selections } # indent after start structure try %{ exec -draft k ^ \h * (class|else(if)?|for|if|switch|unless|when|while|with) \b | ([:=]|[-=]>) $ j } # deindent after return statements @@ -95,9 +95,9 @@ def -hidden _moon_indent_on_new_line %{ hook -group moon-highlight global WinSetOption filetype=moon %{ add-highlighter ref moon } hook global WinSetOption filetype=moon %{ - hook window InsertEnd .* -group moon-hooks _moon_filter_around_selections - hook window InsertChar .* -group moon-indent _moon_indent_on_char - hook window InsertChar \n -group moon-indent _moon_indent_on_new_line + hook window InsertEnd .* -group moon-hooks moon-filter-around-selections + hook window InsertChar .* -group moon-indent moon-indent-on-char + hook window InsertChar \n -group moon-indent moon-indent-on-new-line alias window alt moon-alternative-file } diff --git a/rc/extra/php.kak b/rc/extra/php.kak index 8a447b87..563ccf98 100644 --- a/rc/extra/php.kak +++ b/rc/extra/php.kak @@ -31,26 +31,26 @@ add-highlighter -group /php/code regex \b(__halt_compiler|abstract|and|array|as| # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _php_filter_around_selections %{ +def -hidden php-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _php_indent_on_char %< +def -hidden php-indent-on-char %< eval -draft -itersel %< # align closer token to its opener when alone on a line try %/ exec -draft ^\h+[]}]$ m s \`|.\' 1 / > > -def -hidden _php_indent_on_new_line %< +def -hidden php-indent-on-new-line %< eval -draft -itersel %< # copy // comments prefix and following white spaces try %{ exec -draft k s ^\h*\K#\h* y gh j P } # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _php_filter_around_selections } + try %{ exec -draft k : php-filter-around-selections } # indent after lines beginning / ending with opener token try %_ exec -draft k ^\h*[[{]|[[{]$ j _ > @@ -62,9 +62,9 @@ def -hidden _php_indent_on_new_line %< hook -group php-highlight global WinSetOption filetype=php %{ add-highlighter ref php } hook global WinSetOption filetype=php %{ - hook window InsertEnd .* -group php-hooks _php_filter_around_selections - hook window InsertChar .* -group php-indent _php_indent_on_char - hook window InsertChar \n -group php-indent _php_indent_on_new_line + hook window InsertEnd .* -group php-hooks php-filter-around-selections + hook window InsertChar .* -group php-indent php-indent-on-char + hook window InsertChar \n -group php-indent php-indent-on-new-line } hook -group php-highlight global WinSetOption filetype=(?!php).* %{ remove-highlighter php } diff --git a/rc/extra/pug.kak b/rc/extra/pug.kak index 260d9821..c8983a78 100644 --- a/rc/extra/pug.kak +++ b/rc/extra/pug.kak @@ -44,17 +44,17 @@ add-highlighter -group /pug/code regex ((?:\.[A-Za-z][A-Za-z0-9_-] # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _pug_filter_around_selections %{ +def -hidden pug-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _pug_indent_on_new_line %{ +def -hidden pug-indent-on-new-line %{ eval -draft -itersel %{ # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _pug_filter_around_selections } + try %{ exec -draft k : pug-filter-around-selections } # copy '//', '|', '-' or '(!)=' prefix and following whitespace try %{ exec -draft k s ^\h*\K[/|!=-]{1,2}\h* y gh j P } # indent unless we copied something above @@ -68,8 +68,8 @@ def -hidden _pug_indent_on_new_line %{ hook -group pug-highlight global WinSetOption filetype=pug %{ add-highlighter ref pug } hook global WinSetOption filetype=pug %{ - hook window InsertEnd .* -group pug-hooks _pug_filter_around_selections - hook window InsertChar \n -group pug-indent _pug_indent_on_new_line + hook window InsertEnd .* -group pug-hooks pug-filter-around-selections + hook window InsertChar \n -group pug-indent pug-indent-on-new-line } hook -group pug-highlight global WinSetOption filetype=(?!pug).* %{ remove-highlighter pug } diff --git a/rc/extra/ragel.kak b/rc/extra/ragel.kak index 48291448..cc396cf5 100644 --- a/rc/extra/ragel.kak +++ b/rc/extra/ragel.kak @@ -29,12 +29,12 @@ add-highlighter -group /ragel/code regex \b(action|alnum|alpha|any|ascii|case|cn # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _ragel_filter_around_selections %{ +def -hidden ragel-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _ragel_indent_on_char %< +def -hidden ragel-indent-on-char %< eval -draft -itersel %< # align closer token to its opener when alone on a line try %< exec -draft ^\h+[]})]$ m s \`|.\' 1 > @@ -42,14 +42,14 @@ def -hidden _ragel_indent_on_char %< > > -def -hidden _ragel_indent_on_new_line %< +def -hidden ragel-indent-on-new-line %< eval -draft -itersel %< # copy _#_ comment prefix and following white spaces try %{ exec -draft k s ^\h*\K#\h* y gh j P } # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _ragel_filter_around_selections } + try %{ exec -draft k : ragel-filter-around-selections } # indent after lines ending with opener token try %< exec -draft k [[{(*]$ j > > @@ -61,9 +61,9 @@ def -hidden _ragel_indent_on_new_line %< hook -group ragel-highlight global WinSetOption filetype=ragel %{ add-highlighter ref ragel } hook global WinSetOption filetype=ragel %{ - hook window InsertEnd .* -group ragel-hooks _ragel_filter_around_selections - hook window InsertChar .* -group ragel-indent _ragel_indent_on_char - hook window InsertChar \n -group ragel-indent _ragel_indent_on_new_line + hook window InsertEnd .* -group ragel-hooks ragel-filter-around-selections + hook window InsertChar .* -group ragel-indent ragel-indent-on-char + hook window InsertChar \n -group ragel-indent ragel-indent-on-new-line } hook -group ragel-highlight global WinSetOption filetype=(?!ragel).* %{ remove-highlighter ragel } diff --git a/rc/extra/sass.kak b/rc/extra/sass.kak index 53e41477..37c5f192 100644 --- a/rc/extra/sass.kak +++ b/rc/extra/sass.kak @@ -29,19 +29,19 @@ add-highlighter -group /sass/code regex !important 0:keyword # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _sass_filter_around_selections %{ +def -hidden sass-filter-around-selections %{ # remove trailing white spaces try %{ exec -draft -itersel s \h+$ d } } -def -hidden _sass_indent_on_new_line %{ +def -hidden sass-indent-on-new-line %{ eval -draft -itersel %{ # copy '/' comment prefix and following white spaces try %{ exec -draft k s ^\h*\K/\h* y gh j P } # preserve previous line indent try %{ exec -draft \; K } # filter previous line - try %{ exec -draft k : _sass_filter_around_selections } + try %{ exec -draft k : sass-filter-around-selections } # avoid indent after properties and comments try %{ exec -draft k [:/] j } } @@ -53,8 +53,8 @@ def -hidden _sass_indent_on_new_line %{ hook -group sass-highlight global WinSetOption filetype=sass %{ add-highlighter ref sass } hook global WinSetOption filetype=sass %{ - hook window InsertEnd .* -group sass-hooks _sass_filter_around_selections - hook window InsertChar \n -group sass-indent _sass_indent_on_new_line + hook window InsertEnd .* -group sass-hooks sass-filter-around-selections + hook window InsertChar \n -group sass-indent sass-indent-on-new-line } hook -group sass-highlight global WinSetOption filetype=(?!sass).* %{ remove-highlighter sass } diff --git a/rc/extra/scss.kak b/rc/extra/scss.kak index d0f89967..001dbf7b 100644 --- a/rc/extra/scss.kak +++ b/rc/extra/scss.kak @@ -22,9 +22,9 @@ add-highlighter -group /scss regex @[A-Za-z][A-Za-z0-9_-]* 0:meta # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _scss_filter_around_selections _css_filter_around_selections -def -hidden _scss_indent_on_new_line _css_indent_on_new_line -def -hidden _scss_indent_on_closing_curly_brace _css_indent_on_closing_curly_brace +def -hidden scss-filter-around-selections css-filter-around-selections +def -hidden scss-indent-on-new-line css-indent-on-new-line +def -hidden scss-indent-on-closing-curly-brace css-indent-on-closing-curly-brace # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾ @@ -32,9 +32,9 @@ def -hidden _scss_indent_on_closing_curly_brace _css_indent_on_closing_curly_bra hook -group scss-highlight global WinSetOption filetype=scss %{ add-highlighter ref scss } hook global WinSetOption filetype=scss %[ - hook window InsertEnd .* -group scss-hooks _scss_filter_around_selections - hook window InsertChar \n -group scss-indent _scss_indent_on_new_line - hook window InsertChar \} -group scss-indent _scss_indent_on_closing_curly_brace + hook window InsertEnd .* -group scss-hooks scss-filter-around-selections + hook window InsertChar \n -group scss-indent scss-indent-on-new-line + hook window InsertChar \} -group scss-indent scss-indent-on-closing-curly-brace ] hook -group scss-highlight global WinSetOption filetype=(?!scss).* %{ remove-highlighter scss } diff --git a/rc/extra/taskpaper.kak b/rc/extra/taskpaper.kak index becf3fae..8fb02be0 100644 --- a/rc/extra/taskpaper.kak +++ b/rc/extra/taskpaper.kak @@ -22,7 +22,7 @@ add-highlighter -group /taskpaper regex (([a-z]+://\S+)|((mailto:)[\w+-]+@\S+)) # Commands # ‾‾‾‾‾‾‾‾ -def -hidden _taskpaper-indent-on-new-line %{ +def -hidden taskpaper-indent-on-new-line %{ eval -draft -itersel %{ # preserve previous line indent try %{ exec -draft \;K } @@ -38,7 +38,7 @@ def -hidden _taskpaper-indent-on-new-line %{ hook -group taskpaper-highlight global WinSetOption filetype=taskpaper %{ add-highlighter ref 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 -group taskpaper-highlight global WinSetOption filetype=(?!taskpaper).* %{ remove-highlighter taskpaper diff --git a/rc/extra/tmux-repl.kak b/rc/extra/tmux-repl.kak index fbc63a19..fe191946 100644 --- a/rc/extra/tmux-repl.kak +++ b/rc/extra/tmux-repl.kak @@ -10,12 +10,12 @@ hook global KakBegin .* %{ if [ "${VERSION_TMUX}" -gt 1 ]; then echo " alias global repl tmux-repl-horizontal - alias global send-text _tmux-send-text + alias global send-text tmux-send-text " else echo " - alias global repl _tmux-repl-disabled - alias global send-text _tmux-repl-disabled + alias global repl tmux-repl-disabled + alias global send-text tmux-repl-disabled " fi fi @@ -49,7 +49,7 @@ def tmux-repl-window -params 0..1 -command-completion -docstring "Create a new w tmux-repl-impl 'new-window' %arg{@} } -def -hidden _tmux-send-text -docstring "Send the selected text to the repl pane" %{ +def -hidden tmux-send-text -docstring "Send the selected text to the repl pane" %{ nop %sh{ tmux set-buffer -b kak_selection "${kak_selection}" kak_orig_window=$(tmux display-message -p '#I') @@ -62,7 +62,7 @@ def -hidden _tmux-send-text -docstring "Send the selected text to the repl pane" } } -def -hidden _tmux-repl-disabled %{ %sh{ +def -hidden tmux-repl-disabled %{ %sh{ VERSION_TMUX=$(tmux -V) printf %s "echo -color Error %{The version of tmux is too old: got ${VERSION_TMUX}, expected >= 2.x}" } }