Hi
When output of a Vim commands spans multiple screens, it is
possible to press 'f', <PageDown> or <Space> to move down
page by page until the bottom of the output. But the keys
behave differently when reaching the bottom of the output:
- pressing 'f' will stop at the prompt "Press ENTER or
type command to continue" when reaching the bottom of the
output.
- pressing <Space> or <PageDown> will quit when reaching
the bottom of the output.
I often press <PageUp>, <PageDown> to scroll page by page
since it's the most intuitive keys for this purpose. But the
default behavior to quit when reaching the bottom is rather
counter intuitive and can be irritating (list is then lost).
Here is an example to illustrate it:
# Open many files in Vim...
$ cd vim7/src/ ; vim *.[ch]
# List all buffers and show output page by page...
:ls
(then press <PageDown> to go through the output of :ls
command page by page, notice that pressing <PageDown>
at the bottom quits from the output of command).
I'm not sure whether this current behavior for <PageDown> is
intentional or whether it is a bug. It looks like a bug and I
think it should behave like pressing 'f'. In any case, it not
documented in ":help more-prompt".
But even more counter-intuitive:
- pressing <PageUp> moves page by page upward (good) when
pressed at the bottom (i.e. when seeing "Press ENTER or
type command to continue"), then pressing <PageUp> will
quit the output (!?)
- pressing <BS> moves one line up but when when pressed
at the bottom it causes to quit the output (counter-intuitive).
- pressing 'g' goes to the top and pressing 'G' goes to the
bottom. When when pressing 'G' while at the bottom, it
causes to quit the output (counter-intuitive).
Attached patch (from Vim-7.2.148) makes the following simple
changes:
- pressing <PageDown>, <PageUp>, <BS>, 'G' no longer exits
when pressed at the bottom of message output.
- updated documentation (doc/message.txt) to clarify expected
behavior which was unclear for those keys.
Patch makes those keys more user friendly in my opinion.
Let me know what you think of the patch.
Regards
-- Dominique
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
Index: src/message.c
===================================================================
RCS file: /cvsroot/vim/vim7/src/message.c,v
retrieving revision 1.70
diff -c -r1.70 message.c
*** src/message.c 24 Feb 2009 03:37:45 -0000 1.70
--- src/message.c 18 Apr 2009 17:08:33 -0000
***************
*** 959,965 ****
*/
if (p_more && !p_cp)
{
! if (c == 'b' || c == 'k' || c == 'u' || c == 'g' || c == K_UP)
{
/* scroll back to show older messages */
do_more_prompt(c);
--- 959,966 ----
*/
if (p_more && !p_cp)
{
! if (c == 'b' || c == 'k' || c == 'u' || c == 'g'
! || c == K_BS || c == K_UP || c == K_PAGEUP)
{
/* scroll back to show older messages */
do_more_prompt(c);
***************
*** 976,982 ****
}
}
else if (msg_scrolled > Rows - 2
! && (c == 'j' || c == K_DOWN || c == 'd' || c == 'f'))
c = K_IGNORE;
}
} while ((had_got_int && c == Ctrl_C)
--- 977,984 ----
}
}
else if (msg_scrolled > Rows - 2
! && (c == 'j' || c == K_DOWN || c == K_PAGEDOWN
! || c == 'd' || c == 'f' || c == 'G'))
c = K_IGNORE;
}
} while ((had_got_int && c == Ctrl_C)
*** ../vim-runtime/doc/message.txt 2009-02-22 22:51:56.000000000 +0100
--- doc/message.txt 2009-04-18 19:04:09.000000000 +0200
***************
*** 755,766 ****
-> Press <Enter> or <Space> to redraw the screen and continue, without that
key being used otherwise.
-> Press ':' or any other Normal mode command character to start that command.
! -> Press 'k', <Up>, 'u', 'b' or 'g' to scroll back in the messages. This
! works the same way as at the |more-prompt|. Only works when 'compatible'
! is off and 'more' is on.
! -> Pressing 'j', 'd' or <Down> is ignored when messages scrolled off the top
! of the screen, 'compatible' is off and 'more' is on, to avoid that typing
! one 'j' too many causes the messages to disappear.
-> Press <C-Y> to copy (yank) a modeless selection to the clipboard register.
-> Use a menu. The characters defined for Cmdline-mode are used.
-> When 'mouse' contains the 'r' flag, clicking the left mouse button works
--- 755,766 ----
-> Press <Enter> or <Space> to redraw the screen and continue, without that
key being used otherwise.
-> Press ':' or any other Normal mode command character to start that command.
! -> Press 'k', <BS>, <Up>, <PageUp>, 'u', 'b' or 'g' to scroll back in the
! messages. This works the same way as at the |more-prompt|. Only works
! when 'compatible' is off and 'more' is on.
! -> Pressing 'j', 'd', 'f', <Down>, <PageDown> or 'G' is ignored when messages
! scrolled off the top of the screen, 'compatible' is off and 'more' is on,
! to avoid that typing one 'j' too many causes the messages to disappear.
-> Press <C-Y> to copy (yank) a modeless selection to the clipboard register.
-> Use a menu. The characters defined for Cmdline-mode are used.
-> When 'mouse' contains the 'r' flag, clicking the left mouse button works