command-prompt now accepts a single argument, a template string. Any occurrences of %% in this string are replaced by whatever is entered at the prompt and the result is executed as a command. This allows things like (now bound by default):

bind , command-prompt "rename-window %%"

Or my favourite:

         bind x command-prompt "split-window 'man %%'"
This commit is contained in:
Nicholas Marriott
2009-01-13 01:08:40 +00:00
parent 9ab200843e
commit 98c85cf989
4 changed files with 96 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $Id: key-bindings.c,v 1.44 2009-01-12 19:23:14 nicm Exp $ */
/* $Id: key-bindings.c,v 1.45 2009-01-13 01:08:40 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -80,6 +80,7 @@ key_bindings_init(void)
{ '"', &cmd_split_window_entry },
{ '#', &cmd_list_buffers_entry },
{ '&', &cmd_kill_window_entry },
{ ',', &cmd_command_prompt_entry },
{ '-', &cmd_delete_buffer_entry },
{ '0', &cmd_select_window_entry },
{ '1', &cmd_select_window_entry },