aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Barnes <craigbarnes@protonmail.com>2021-05-25 16:03:26 +0000
committerCraig Barnes <craigbarnes@protonmail.com>2021-05-25 16:03:26 +0000
commit3eaf6ead2cf7d4654ecff1111e7a8b4cc2f161c7 (patch)
tree10b804a4a83f28bb8194505cb8a53d16b7ecb72c
parentMerge branch 'handle-display-roundtrip-failure' (diff)
parentconfig: bind ctrl+c to "cancel" in search/url mode by default (diff)
Merge branch 'ctrl-c-cancel'
-rw-r--r--CHANGELOG.md1
-rw-r--r--config.c2
-rw-r--r--doc/foot.1.scd2
-rw-r--r--doc/foot.ini.5.scd5
4 files changed, 7 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 69c5db1c..859cf1e6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -51,6 +51,7 @@
* XDG activation support, will be used by `[bell].urgent` when
available (falling back to coloring the window margins red when
unavailable) (https://codeberg.org/dnkl/foot/issues/487).
+* `ctrl`+`c` as a default key binding; to cancel search/url mode.
### Changed
diff --git a/config.c b/config.c
index d0b36129..c28cfcb8 100644
--- a/config.c
+++ b/config.c
@@ -2333,6 +2333,7 @@ add_default_search_bindings(struct config *conf)
const struct config_key_modifiers shift = {.shift = true};
const struct config_key_modifiers ctrl_shift = {.ctrl = true, .shift = true};
+ add_binding(BIND_ACTION_SEARCH_CANCEL, ctrl, XKB_KEY_c);
add_binding(BIND_ACTION_SEARCH_CANCEL, ctrl, XKB_KEY_g);
add_binding(BIND_ACTION_SEARCH_CANCEL, none, XKB_KEY_Escape);
add_binding(BIND_ACTION_SEARCH_COMMIT, none, XKB_KEY_Return);
@@ -2374,6 +2375,7 @@ add_default_url_bindings(struct config *conf)
const struct config_key_modifiers none = {0};
const struct config_key_modifiers ctrl = {.ctrl = true};
+ add_binding(BIND_ACTION_URL_CANCEL, ctrl, XKB_KEY_c);
add_binding(BIND_ACTION_URL_CANCEL, ctrl, XKB_KEY_g);
add_binding(BIND_ACTION_URL_CANCEL, ctrl, XKB_KEY_d);
add_binding(BIND_ACTION_URL_CANCEL, none, XKB_KEY_Escape);
diff --git a/doc/foot.1.scd b/doc/foot.1.scd
index 2ff4e45a..8537ee5f 100644
--- a/doc/foot.1.scd
+++ b/doc/foot.1.scd
@@ -204,7 +204,7 @@ Note that these are just the defaults; they can be changed in
*shift*+*insert*
Paste from primary selection into the search buffer.
-*escape*, *ctrl*+*g*
+*escape*, *ctrl*+*g*, *ctrl*+*c*
Cancel the search
*return*
diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd
index 22668bbd..50ddb787 100644
--- a/doc/foot.ini.5.scd
+++ b/doc/foot.ini.5.scd
@@ -611,7 +611,8 @@ scrollback search mode. The syntax is exactly the same as the regular
*cancel*
Aborts the search. The viewport is restored and the _primary
- selection_ is **not** updated. Default: _Control+g Escape_.
+ selection_ is **not** updated. Default: _Control+g Control+c
+ Escape_.
*commit*
Exit search mode and copy current selection into the _primary
@@ -688,7 +689,7 @@ mode. The syntax is exactly the same as the regular **key-bindings**.
*cancel*
Exits URL mode without opening an URL. Default: _Control+g
- Control+d Escape_.
+ Control+c Control+d Escape_.
*toggle-url-visible*
By default, the jump label only shows the key sequence required to