On Thu, Oct 27, 2011 at 23:50:36 +0100, Nicholas Marriott wrote: > Man page I just meant remove the quotes, if you look at the bind-key bit > it just says: > > is bound in > .Ar key-table : > the binding for command mode with > .Fl c > > So there is no markup or quotes around the "command" in "command mode".
Ah, whoops. New patches attached (they replace the previous ones). --Ben
From 312a3ed02b61facec7290a44f6978949f1eefd3e Mon Sep 17 00:00:00 2001 From: Ben Boeckel <maths...@gmail.com> Date: Thu, 20 Oct 2011 17:23:39 -0400 Subject: [PATCH 1/2] Options for changing colours in cmd vs ins modes There's currently no indication that you're in command or insert mode when using vi bindings for the command prompt. Add options for different colours. The defaults for command mode are inverted from insert mode by default. --- trunk/options-table.c | 15 +++++++++++++++ trunk/status.c | 18 +++++++++++++++--- trunk/tmux.1 | 6 ++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/trunk/options-table.c b/trunk/options-table.c index 0832117..ac090f7 100644 --- a/trunk/options-table.c +++ b/trunk/options-table.c @@ -193,6 +193,21 @@ const struct options_table_entry session_options_table[] = { .default_num = 3 }, + { .name = "message-command-attr", + .type = OPTIONS_TABLE_ATTRIBUTES, + .default_num = 0 + }, + + { .name = "message-command-bg", + .type = OPTIONS_TABLE_COLOUR, + .default_num = 0 + }, + + { .name = "message-command-fg", + .type = OPTIONS_TABLE_COLOUR, + .default_num = 3 + }, + { .name = "message-fg", .type = OPTIONS_TABLE_COLOUR, .default_num = 0 diff --git a/trunk/status.c b/trunk/status.c index 1baab92..8c97d5f 100644 --- a/trunk/status.c +++ b/trunk/status.c @@ -919,9 +919,16 @@ status_prompt_redraw(struct client *c) off = 0; memcpy(&gc, &grid_default_cell, sizeof gc); - colour_set_fg(&gc, options_get_number(&s->options, "message-fg")); - colour_set_bg(&gc, options_get_number(&s->options, "message-bg")); - gc.attr |= options_get_number(&s->options, "message-attr"); + /* Change colours for ins versus cmd mode. */ + if (c->prompt_mdata.mode == 1) { + colour_set_fg(&gc, options_get_number(&s->options, "message-command-fg")); + colour_set_bg(&gc, options_get_number(&s->options, "message-command-bg")); + gc.attr |= options_get_number(&s->options, "message-command-attr"); + } else { + colour_set_fg(&gc, options_get_number(&s->options, "message-fg")); + colour_set_bg(&gc, options_get_number(&s->options, "message-bg")); + gc.attr |= options_get_number(&s->options, "message-attr"); + } screen_write_start(&ctx, NULL, &c->status); @@ -977,7 +984,12 @@ status_prompt_key(struct client *c, int key) c->flags |= CLIENT_STATUS; } break; + case MODEKEYEDIT_SWITCHMODE: + c->flags |= CLIENT_STATUS; + break; case MODEKEYEDIT_SWITCHMODEAPPEND: + c->flags |= CLIENT_STATUS; + /* FALLTHROUGH */ case MODEKEYEDIT_CURSORRIGHT: if (c->prompt_index < size) { c->prompt_index++; diff --git a/trunk/tmux.1 b/trunk/tmux.1 index f56cf8d..4ef46fa 100644 --- a/trunk/tmux.1 +++ b/trunk/tmux.1 @@ -1963,6 +1963,12 @@ from the 256-colour set, or a hexadecimal RGB string such as .Ql #ffffff , which chooses the closest match from the default 256-colour set. +.It Ic message-command-attr Ar attributes +Set status line message attributes when in command mode. +.It Ic message-command-bg Ar colour +Set status line message background colour when in command mode. +.It Ic message-command-fg Ar colour +Set status line message foreground colour when in command mode. .It Ic message-fg Ar colour Set status line message foreground colour. .It Ic message-limit Ar number -- 1.7.6.4
From 924d4f2d85f146dc4842fa6d6bacbaa036549037 Mon Sep 17 00:00:00 2001 From: Ben Boeckel <maths...@gmail.com> Date: Thu, 20 Oct 2011 17:27:19 -0400 Subject: [PATCH 2/2] Add command colour options to vim highlighting --- trunk/examples/tmux.vim | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/trunk/examples/tmux.vim b/trunk/examples/tmux.vim index d21c377..6912b56 100644 --- a/trunk/examples/tmux.vim +++ b/trunk/examples/tmux.vim @@ -47,11 +47,11 @@ syn keyword tmuxCmds capture-pane joinp join-pane choose-buffer syn keyword tmuxOptsSet prefix status status-fg status-bg bell-action syn keyword tmuxOptsSet default-command history-limit status-left status-right syn keyword tmuxOptsSet status-interval set-titles display-time buffer-limit -syn keyword tmuxOptsSet status-left-length status-right-length message-fg -syn keyword tmuxOptsSet message-bg lock-after-time default-path repeat-time -syn keyword tmuxOptsSet message-attr status-attr status-keys set-remain-on-exit -syn keyword tmuxOptsSet status-utf8 default-terminal visual-activity -syn keyword tmuxOptsSet visual-bell visual-content status-justify +syn keyword tmuxOptsSet status-left-length status-right-length +syn keyword tmuxOptsSet message-[command-]bg lock-after-time default-path +syn keyword tmuxOptsSet message-[command-]attr status-attr set-remain-on-exit +syn keyword tmuxOptsSet status-utf8 default-terminal visual-activity repeat-time +syn keyword tmuxOptsSet visual-bell visual-content status-justify status-keys syn keyword tmuxOptsSet terminal-overrides status-left-attr status-left-bg syn keyword tmuxOptsSet status-left-fg status-right-attr status-right-bg syn keyword tmuxOptsSet status-right-fg update-environment base-index @@ -59,7 +59,7 @@ syn keyword tmuxOptsSet display-panes-colour display-panes-time default-shell syn keyword tmuxOptsSet set-titles-string lock-command lock-server syn keyword tmuxOptsSet mouse-select-pane message-limit quiet escape-time syn keyword tmuxOptsSet pane-active-border-bg pane-active-border-fg -syn keyword tmuxOptsSet pane-border-bg pane-border-fg +syn keyword tmuxOptsSet pane-border-bg pane-border-fg message-[command-]fg syn keyword tmuxOptsSet display-panes-active-colour alternate-screen syn keyword tmuxOptsSet detach-on-destroy @@ -72,7 +72,7 @@ syn keyword tmuxOptsSetw main-pane-width main-pane-height monitor-content syn keyword tmuxOptsSetw window-status-current-attr window-status-current-bg syn keyword tmuxOptsSetw window-status-current-fg mode-mouse synchronize-panes syn keyword tmuxOptsSetw window-status-format window-status-current-format -syn keyword tmuxOptsSetw word-separators window-status-alert-alert +syn keyword tmuxOptsSetw word-separators window-status-alert-alert[-attr] syn keyword tmuxOptsSetw window-status-alert-bg window-status-alert-fg syn keyword tmuxTodo FIXME NOTE TODO XXX contained -- 1.7.6.4
pgpW4SmbYJDXM.pgp
Description: PGP signature
------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users