From 395f43837898a1a1ac19755e479ad6aa1a574c25 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sat, 30 Jul 2022 22:28:02 +0200 Subject: [PATCH] Remove unnecessary leading space in prompt from mappings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We often use the pattern «map global normal ": foo"». The space after the colon is unnecessary since execution of the mapping won't add to history anyway, since 217dd6a1d (Disable history when executing maps, 2015-11-10). With the parent commit, the space is no longer necessary for user mappings, so there is no reason to continue the cargo-cult. Remove the space from mappings to set a good example. --- doc/pages/mapping.asciidoc | 2 +- rc/filetype/diff.kak | 2 +- rc/filetype/mail.kak | 4 ++-- rc/tools/doc.kak | 2 +- rc/tools/git.kak | 4 ++-- rc/tools/man.kak | 10 +++++----- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/pages/mapping.asciidoc b/doc/pages/mapping.asciidoc index 019a6bcf..0ba142c4 100644 --- a/doc/pages/mapping.asciidoc +++ b/doc/pages/mapping.asciidoc @@ -68,7 +68,7 @@ command you invoke with the `%val{count}` and `%val{register}` expansions (See <>). For example: ---- -map global normal = ': echo Got count %val{count} and reg %val{register}' +map global normal = ':echo Got count %val{count} and reg %val{register}' ---- == Mappable keys diff --git a/rc/filetype/diff.kak b/rc/filetype/diff.kak index 2655b9b5..5be241f2 100644 --- a/rc/filetype/diff.kak +++ b/rc/filetype/diff.kak @@ -4,7 +4,7 @@ hook global BufCreate .*\.(diff|patch) %{ hook global WinSetOption filetype=diff %{ require-module diff - map buffer normal %{: diff-jump} + map buffer normal :diff-jump } hook -group diff-highlight global WinSetOption filetype=diff %{ diff --git a/rc/filetype/mail.kak b/rc/filetype/mail.kak index 9fb2d14e..92c2e17c 100644 --- a/rc/filetype/mail.kak +++ b/rc/filetype/mail.kak @@ -4,9 +4,9 @@ hook global BufCreate .+\.eml %{ hook global WinSetOption filetype=mail %{ require-module mail - map buffer normal %{: diff-jump} + map buffer normal :diff-jump hook -once -always window WinSetOption filetype=.* %{ - unmap buffer normal %{: diff-jump} + unmap buffer normal :diff-jump } } diff --git a/rc/tools/doc.kak b/rc/tools/doc.kak index d5227ee4..e710a80f 100644 --- a/rc/tools/doc.kak +++ b/rc/tools/doc.kak @@ -131,7 +131,7 @@ define-command -params 1 -hidden doc-render %{ set-option buffer readonly true add-highlighter buffer/ ranges doc_render_ranges add-highlighter buffer/ wrap -word -indent - map buffer normal ': doc-follow-link' + map buffer normal :doc-follow-link } define-command -params 0..2 \ diff --git a/rc/tools/git.kak b/rc/tools/git.kak index d361a6c7..d8e7ef87 100644 --- a/rc/tools/git.kak +++ b/rc/tools/git.kak @@ -104,8 +104,8 @@ define-command -params 1.. \ # We need to unmap in case an existing buffer changes type, # for example if the user runs "git show" and "git status". map_diff_goto_source=$([ -n "${map_diff_goto_source}" ] \ - && printf %s "map buffer normal %[: git-diff-goto-source] -docstring 'Jump to source from git diff'" \ - || printf %s "unmap buffer normal %[: git-diff-goto-source]") + && printf %s "map buffer normal :git-diff-goto-source -docstring 'Jump to source from git diff'" \ + || printf %s "unmap buffer normal :git-diff-goto-source") printf %s "evaluate-commands -try-client '$kak_opt_docsclient' %{ edit! -fifo ${output} *git* diff --git a/rc/tools/man.kak b/rc/tools/man.kak index facfaedf..d2b7a16b 100644 --- a/rc/tools/man.kak +++ b/rc/tools/man.kak @@ -14,7 +14,7 @@ hook -group man-highlight global WinSetOption filetype=man %{ # References to other manpages add-highlighter window/man-highlight/ regex [-a-zA-Z0-9_.]+\([a-z0-9]+\) 0:header - map window normal ': man-jump' + map window normal :man-jump hook -once -always window WinSetOption filetype=.* %{ remove-highlighter window/man-highlight @@ -141,7 +141,7 @@ man-jump %{ # Suggested keymaps for a user mode declare-user-mode man -map global man 'g' -docstring 'Jump to a man page using selected man page link' ': man-jump' -map global man 'j' -docstring 'Go to next man page link' ': man-link-next' -map global man 'k' -docstring 'Go to previous man page link' ': man-link-prev' -map global man 'm' -docstring 'Look up a man page' ':man' +map global man 'g' -docstring 'Jump to a man page using selected man page link' :man-jump +map global man 'j' -docstring 'Go to next man page link' :man-link-next +map global man 'k' -docstring 'Go to previous man page link' :man-link-prev +map global man 'm' -docstring 'Look up a man page' :man