summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Fonseca <jonas.fonseca@gmail.com>2014-03-30 22:00:03 -0400
committerJonas Fonseca <jonas.fonseca@gmail.com>2014-04-26 15:47:10 -0400
commit052e36343e3c78ca79fc621aaf93d036937a9ee3 (patch)
tree203a514a0ad1ed1cefa7a7e903e5c8069c50d677
parent70be210fd255c2b14375186e34ec689861e6bdc0 (diff)
Change default keybindingsdefault-keybinding-convention
This implements part of issue #257 to ensure that Tig has a more consistent default set of keybindings. - Lower-case keys are used primarily for view switching; and should always be non-destructive. - Upper-case keys are used for view-specific actions including user-defined commands.
-rw-r--r--contrib/bindings-v1.x.tigrc23
-rw-r--r--src/keys.c4
-rw-r--r--tigrc31
3 files changed, 41 insertions, 17 deletions
diff --git a/contrib/bindings-v1.x.tigrc b/contrib/bindings-v1.x.tigrc
new file mode 100644
index 00000000..8bd7b4f9
--- /dev/null
+++ b/contrib/bindings-v1.x.tigrc
@@ -0,0 +1,23 @@
+# Bindings from before version 2.0
+#
+# To use these bindings copy the file to your HOME directory and include
+# it from your ~/.tigrc file:
+#
+# $ cp contrib/bindings-v1.x.tigrc ~/.tigrc.compat
+# $ echo "source ~/.tigrc.compat" >> ~/.tigrc
+
+bind generic B view-blame
+bind generic G view-grep
+bind generic H view-refs
+bind generic S view-status
+
+bind generic r screen-redraw
+bind generic w scroll-page-up
+bind generic s scroll-page-down
+bind generic b move-page-up
+
+bind generic g :toggle commit-title-graph
+bind generic i :toggle sort-field
+bind generic . :toggle line-number
+bind generic Hash :toggle file-name
+bind generic F :toggle commit-title-refs
diff --git a/src/keys.c b/src/keys.c
index 065ea606..7b949690 100644
--- a/src/keys.c
+++ b/src/keys.c
@@ -181,6 +181,10 @@ static const struct key_table key_table[] = {
{ "F10", KEY_F(10) },
{ "F11", KEY_F(11) },
{ "F12", KEY_F(12) },
+ { "ScrBack", KEY_SR },
+ { "ScrFwd", KEY_SF },
+ { "ScrollBack", KEY_SR },
+ { "ScrollFwd", KEY_SF },
};
int
diff --git a/tigrc b/tigrc
index a0e32a8b..2a10fdf4 100644
--- a/tigrc
+++ b/tigrc
@@ -145,7 +145,7 @@ bind status C !git commit
bind stash P ?git stash pop %(stash)
bind stash ! ?git stash drop %(stash)
bind refs C ?git checkout %(branch)
-bind refs ! ?git branch -d %(branch)
+bind refs ! ?git branch -D %(branch)
# Normal commands
# ---------------
@@ -156,14 +156,14 @@ bind generic d view-diff
bind generic l view-log
bind generic t view-tree
bind generic f view-blob
-bind generic B view-blame
-bind generic H view-refs
+bind generic b view-blame
+bind generic r view-refs
bind generic p view-pager
bind generic h view-help
-bind generic S view-status
+bind generic s view-status
bind generic c view-stage
bind generic y view-stash
-bind generic G view-grep
+bind generic g view-grep
# View manipulation
bind generic Enter enter # Enter and open selected entry
@@ -195,6 +195,8 @@ bind stage ] :toggle diff-context +1 # Increase the diff context
bind diff @ :/^@@ # Jump to next (c)hunk
bind diff [ :toggle diff-context -1
bind diff ] :toggle diff-context +1
+bind main G :toggle commit-title-graph # Toggle revision graph visualization
+bind main F :toggle commit-title-refs # Toggle reference display (tags/branches)
# Cursor navigation
bind generic k move-up
@@ -204,7 +206,7 @@ bind generic ^D move-page-down
bind generic Space move-page-down
bind generic PgUp move-page-up
bind generic ^U move-page-up
-bind generic b move-page-up
+#bind generic b move-page-up
bind generic - move-page-up
bind generic Home move-first-line
bind generic End move-last-line
@@ -217,8 +219,8 @@ bind generic Insert scroll-line-up
bind generic ^Y scroll-line-up
bind generic Delete scroll-line-down
bind generic ^E scroll-line-down
-bind generic w scroll-page-up
-bind generic s scroll-page-down
+bind generic ScrBack scroll-page-up
+bind generic ScrFwd scroll-page-down
# Searching
bind generic / search
@@ -230,16 +232,12 @@ bind generic N find-prev
bind generic o options # Open the options menu
# Bindings for toggling settings
bind generic I :toggle sort-order # Toggle ascending/descending sort order
-bind generic i :toggle sort-field # Toggle field to sort by
-bind generic . :toggle line-number # Toggle line numbers
+bind generic S :toggle sort-field # Toggle field to sort by
+bind generic Hash :toggle line-number # Toggle line numbers
bind generic D :toggle date # Toggle date display
bind generic A :toggle author # Toggle author display
-bind generic g :toggle commit-title-graph
- # Toggle revision graph visualization
bind generic ~ :toggle line-graphics # Toggle (line) graphics mode
-bind generic Hash :toggle file-name # Toggle file name display
-bind generic F :toggle commit-title-refs
- # Toggle reference display (tags/branches)
+bind generic F :toggle file-name # Toggle file name display
# bind generic ??? :toogle show-changes # Toggle local changes display in the main view
bind generic W :toggle ignore-space # Toggle ignoring whitespace in diffs
# bind generic ? :toggle commit-order # Toggle commit ordering
@@ -256,8 +254,7 @@ bind generic % :toggle file-filter
# Misc
bind generic e edit # Open in editor
bind generic : prompt # Open the prompt
-bind generic r screen-redraw # Redraw the screen
-bind generic ^L screen-redraw
+bind generic ^L screen-redraw # Redraw the screen
bind generic z stop-loading # Stop all loading views
bind generic v show-version # Show Tig version