Re: Consistently exit "message display" with 'q'?

2007-03-22 Thread mzyzik
I would like to concur with some that it is strange that the "d"/"u"
keys work for scrolling when the "Press ENTER or type command to
continue" message comes up; however, the "q" key does not just exit the
prompt, but also begins recording a macro.

I feel that "q" should only exit (and not record a macro). So, the user
would be able to hold down "d" to get to the bottom of the message, and
then press "q" to exit it, just like with the "less" program.

--Matt

On Thu, Mar 22, 2007 at 01:36:20PM +0800, [EMAIL PROTECTED] wrote:
> John Orr <[EMAIL PROTECTED]>  2007-03-22 12:43:51:
> > Thanks for the clarification Brett.  At least if you have external
> > commands you use regularly though, you could wrap them in a vim
> > function, thereby making them effectively internal, making g< useful.
> >
> > Just an update - I promised I'd investigate extending my "patch" to
> > help those people who complained about losing their commands if they
> > pressed one too many keys.
> > I tried the most obvious approach, and whilst it sort of worked,
> > there was some unhandled complexity to do with reverting to "more-
> > prompt" mode which I couldn't easily work out.
> > I think it was because vim thought we had alreday exited "more-
> > prompt" mode, when in fact we shouldn't have (so you couldn't scroll
> > back up when you reached the end).
> > Since this g< command works somewhat (or can be made to work by
> > using a wrapper function for external commands), I think I might
> > give up on this and just be satisfied with the simpler "q exits the
> > Press Enter prompt" change.
> > Cheers,
> > John
> 
> Just done some experiment, if I use j/k or / to scroll within the
> "more-prompt" the message will never quit. Seems good but not quite useful
> to me since I always use "f"/"b" or / to view the message.
> 
> So the only issue is the lack of "f"/"b" or  support for the
> "more-prompt" and "hit-enter-prompt". key "f" and "b" is the standard
> page-scrolling key for less and more, it seems strange that the
> "more-prompt" and "hit-enter-prompt" do not have support the "f" and "b"
> key.
> 
> Let's hope it will be available in future versions.
> 
> --
> Sincerely,
> Pan, Shi Zhu


Re: Consistently exit "message display" with 'q'?

2007-03-21 Thread panshizhu
John Orr <[EMAIL PROTECTED]> 写于 2007-03-22 12:43:51:
> Thanks for the clarification Brett.  At least if you have external
> commands you use regularly though, you could wrap them in a vim
> function, thereby making them effectively internal, making g< useful.
>
> Just an update - I promised I'd investigate extending my "patch" to
> help those people who complained about losing their commands if they
> pressed one too many keys.
> I tried the most obvious approach, and whilst it sort of worked,
> there was some unhandled complexity to do with reverting to "more-
> prompt" mode which I couldn't easily work out.
> I think it was because vim thought we had alreday exited "more-
> prompt" mode, when in fact we shouldn't have (so you couldn't scroll
> back up when you reached the end).
> Since this g< command works somewhat (or can be made to work by
> using a wrapper function for external commands), I think I might
> give up on this and just be satisfied with the simpler "q exits the
> Press Enter prompt" change.
> Cheers,
> John

Just done some experiment, if I use j/k or / to scroll within the
"more-prompt" the message will never quit. Seems good but not quite useful
to me since I always use "f"/"b" or / to view the message.

So the only issue is the lack of "f"/"b" or  support for the
"more-prompt" and "hit-enter-prompt". key "f" and "b" is the standard
page-scrolling key for less and more, it seems strange that the
"more-prompt" and "hit-enter-prompt" do not have support the "f" and "b"
key.

Let's hope it will be available in future versions.

--
Sincerely,
Pan, Shi Zhu

Re: Consistently exit "message display" with 'q'?

2007-03-21 Thread John Orr
Thanks for the clarification Brett.  At least if you have external commands you 
use regularly though, you could wrap them in a vim function, thereby making 
them effectively internal, making g< useful.

Just an update - I promised I'd investigate extending my "patch" to help those 
people who complained about losing their commands if they pressed one too many 
keys.
I tried the most obvious approach, and whilst it sort of worked, there was some 
unhandled complexity to do with reverting to "more-prompt" mode which I 
couldn't easily work out.  
I think it was because vim thought we had alreday exited "more-prompt" mode, 
when in fact we shouldn't have (so you couldn't scroll back up when you reached 
the end).
Since this g< command works somewhat (or can be made to work by using a wrapper 
function for external commands), I think I might give up on this and just be 
satisfied with the simpler "q exits the Press Enter prompt" change.

Cheers,
John

On Wednesday 21 March 2007 23:55, Stahlman Family wrote:
> 
> - Original Message - 
> From: "Jean-Rene David" <[EMAIL PROTECTED]>
> To: 
> Sent: Tuesday, March 20, 2007 9:56 AM
> Subject: Re: Consistently exit "message display" with 'q'?
> 
> 
> >* Bram Moolenaar [2007.03.20 11:45]:
> >> > How many times did I repeat a command just because
> >> > I had pressed  one time too many...
> >>
> >> You can type "g<" to go back to the messages.
> >
> > Thanks! Didn't know about that.
> >
> > Reading the help, this only brings back the last
> > viewed page of messages though. Not quite the same
> > thing as bringing up the complete output of the
> > last command.
> 
> Also note that it works only for internal commands. The original post gave 
> both an internal (set) and external (!ls) command in his 
> example...
> 
> Brett Stahlman
> >
> > -- 
> > JR
> > 
> 
> 


Re: Consistently exit "message display" with 'q'?

2007-03-21 Thread Stahlman Family


- Original Message - 
From: "Jean-Rene David" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, March 20, 2007 9:56 AM
Subject: Re: Consistently exit "message display" with 'q'?



* Bram Moolenaar [2007.03.20 11:45]:

> How many times did I repeat a command just because
> I had pressed  one time too many...

You can type "g<" to go back to the messages.


Thanks! Didn't know about that.

Reading the help, this only brings back the last
viewed page of messages though. Not quite the same
thing as bringing up the complete output of the
last command.


Also note that it works only for internal commands. The original post gave both an internal (set) and external (!ls) command in his 
example...


Brett Stahlman


--
JR





OT: More vs. less (Was: Consistently exit "message display" with 'q'?)

2007-03-20 Thread A.J.Mechelynck

fREW wrote:

On 3/20/07, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:

cga2000 wrote:
> On Mon, Mar 19, 2007 at 11:50:12PM EST, A.J.Mechelynck wrote:
>
> [..]
>
> "more" shows the colors with no problem. In general, I use:
>> - less
>>   - when there is a long listing which I want to be able to scroll 
back and

>> forth, or to search with a / command
>>   - not when there are interspersed ANSI-like escape sequences as 
in "ls

>> --color".
>
> [OT]
>
> You could try "less -R".
>
> Works for me, although a quick look at the man page suggests this might
> not work under all circumstances: ".. tries to keep track .."
>
> In any case I have aliased "b" as in "browse" to "less -R -M" and never
> had a problem.
>
> Thanks,
> cga
>

Hey, nice! I'm going to alias "less" with "/usr/bin/less -R" in my bash
startup scripts.

Best regards,
Tony.
--
Megaton Man:"LOOK at them!  Helpless, tender creatures, relying on
ME, waiting for ME to make my move!"

(from below):   "Move your ASS, Fat-head!"

Megaton Man:"It is a MANDATE, and I am DUTY BOUND to OBEY!"



Another thing worth trying if you use something like zsh that supports
global aliases is:

alias -g L=" | less -R"

which makes it so you can do:

ls L

Nifty, but if you use zsh, you probably already know that ;-)

-fREW



I don't: what I use is bash; and "ls --color |less" (meaning "ls -A -N 
--color=always -T 0 -F |less -R") is enough abbreviation for me, thanks. :-)


Best regards,
Tony.
--
Meader's Law:
Whatever happens to you, it will previously have happened to
everyone you know, only more so.


Re: Consistently exit "message display" with 'q'?

2007-03-20 Thread fREW

On 3/20/07, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:

cga2000 wrote:
> On Mon, Mar 19, 2007 at 11:50:12PM EST, A.J.Mechelynck wrote:
>
> [..]
>
> "more" shows the colors with no problem. In general, I use:
>> - less
>>   - when there is a long listing which I want to be able to scroll back and
>> forth, or to search with a / command
>>   - not when there are interspersed ANSI-like escape sequences as in "ls
>> --color".
>
> [OT]
>
> You could try "less -R".
>
> Works for me, although a quick look at the man page suggests this might
> not work under all circumstances: ".. tries to keep track .."
>
> In any case I have aliased "b" as in "browse" to "less -R -M" and never
> had a problem.
>
> Thanks,
> cga
>

Hey, nice! I'm going to alias "less" with "/usr/bin/less -R" in my bash
startup scripts.

Best regards,
Tony.
--
Megaton Man:"LOOK at them!  Helpless, tender creatures, relying on
ME, waiting for ME to make my move!"

(from below):   "Move your ASS, Fat-head!"

Megaton Man:"It is a MANDATE, and I am DUTY BOUND to OBEY!"



Another thing worth trying if you use something like zsh that supports
global aliases is:

alias -g L=" | less -R"

which makes it so you can do:

ls L

Nifty, but if you use zsh, you probably already know that ;-)

-fREW


Re: Consistently exit "message display" with 'q'?

2007-03-20 Thread A.J.Mechelynck

cga2000 wrote:

On Mon, Mar 19, 2007 at 11:50:12PM EST, A.J.Mechelynck wrote:

[..]

"more" shows the colors with no problem. In general, I use:

- less
  - when there is a long listing which I want to be able to scroll back and 
forth, or to search with a / command
  - not when there are interspersed ANSI-like escape sequences as in "ls 
--color".


[OT] 


You could try "less -R".

Works for me, although a quick look at the man page suggests this might
not work under all circumstances: ".. tries to keep track .." 


In any case I have aliased "b" as in "browse" to "less -R -M" and never
had a problem.

Thanks,
cga



Hey, nice! I'm going to alias "less" with "/usr/bin/less -R" in my bash 
startup scripts.


Best regards,
Tony.
--
Megaton Man:"LOOK at them!  Helpless, tender creatures, relying on
ME, waiting for ME to make my move!"

(from below):   "Move your ASS, Fat-head!"

Megaton Man:"It is a MANDATE, and I am DUTY BOUND to OBEY!"


Re: Consistently exit "message display" with 'q'?

2007-03-20 Thread Bram Moolenaar

Jean-Rene David wrote:

> * Bram Moolenaar [2007.03.20 11:45]:
> > > How many times did I repeat a command just because
> > > I had pressed  one time too many...
> > 
> > You can type "g<" to go back to the messages.
> 
> Thanks! Didn't know about that.
> 
> Reading the help, this only brings back the last
> viewed page of messages though. Not quite the same
> thing as bringing up the complete output of the
> last command.

After "g<" you are back at the hit-enter prompt and scroll further back.

-- 
Q: What do you call a fish without an eye?
A: fsh!
Q: What do you call a deer with no eyes?
A: no eye deer.
Q: What do you call a deer with no eyes and no legs?
A: still no eye deer.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Consistently exit "message display" with 'q'?

2007-03-20 Thread Jean-Rene David
* Bram Moolenaar [2007.03.20 11:45]:
> > How many times did I repeat a command just because
> > I had pressed  one time too many...
> 
> You can type "g<" to go back to the messages.

Thanks! Didn't know about that.

Reading the help, this only brings back the last
viewed page of messages though. Not quite the same
thing as bringing up the complete output of the
last command.

-- 
JR


Re: Consistently exit "message display" with 'q'?

2007-03-20 Thread Bram Moolenaar

Jean-Rene David wrote:

> * [EMAIL PROTECTED] [2007.03.19 22:30]:
> > The more frustrating thing is: if I continuously
> > scroll down in the 'more-prompt' mode, the
> > 'more-prompt' will eventually quits the display
> > and the message are disappeared forever, so I
> > must be careful NOT to press any key when the
> > last line of message are shown. 
> 
> I'm fairly sympathetic to this concern.
> 
> How many times did I repeat a command just because
> I had pressed  one time too many...

You can type "g<" to go back to the messages.

-- 
Life is a gift, living is an art.   (Bram Moolenaar)

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///


Re: Consistently exit "message display" with 'q'?

2007-03-20 Thread cga2000
On Mon, Mar 19, 2007 at 11:50:12PM EST, A.J.Mechelynck wrote:

[..]

"more" shows the colors with no problem. In general, I use:
> 
> - less
>   - when there is a long listing which I want to be able to scroll back and 
> forth, or to search with a / command
>   - not when there are interspersed ANSI-like escape sequences as in "ls 
> --color".

[OT] 

You could try "less -R".

Works for me, although a quick look at the man page suggests this might
not work under all circumstances: ".. tries to keep track .." 

In any case I have aliased "b" as in "browse" to "less -R -M" and never
had a problem.

Thanks,
cga


Re: Consistently exit "message display" with 'q'?

2007-03-20 Thread Yakov Lerner

On 3/19/07, John Orr <[EMAIL PROTECTED]> wrote:

Hi all,

I'm a bit frustrated by a particular behaviour of vim, and today I modified the 
source code to 'fix' it.  I'd be very grateful for some opinions if you
a) agree with my thoughts, or
b) have a better solution.

The problem - is when you run a command that outputs "messages" to vim - over 
multiple lines.  For example,
:!ls
or
:set

They scroll messages up the screen, and a kind of Unix 'less' function is 
effectively invoked (since it steals it's scrolling commands from vi(m)).
In Unix "less" (and also Unix "more"), a simple, close-to-the-fingers way to 
exit is to type the letter 'q'.  This works no matter whether you're at the start, middle or end of 
the file.
In vim, if only a part of the messages would fit on the screen, you get the 
prompt '-- More --' - and if you press 'q', it will exit message display.  If 
you press Enter, it will just scroll one line.
However, if all the messages would fit on the screen, you get the prompt 'Press 
ENTER or type command to continue'.  Now the 'q' and 'Enter' keys do totally 
different things - q heads you towards macro recording, and Enter exits message 
display.

Often, the line I want to see is at the top of the message output - and I don't 
care whether all the messages fitted on the screen, or whether there are more - 
I just want to exit message display.
To me, it makes perfect sense that, just as with the unix 'less' program, 
pressing 'q' should exit message display - regardless of whether there are more 
lines to display or not.
Sure, I can press Escape, but it's much harder to press than 'q'.  Yes, I can 
press Ctrl-[ - but that's also much harder than 'q'.  (Both of these options 
will also trigger the 'error bell' (audible or visual) - which seems rather 
unnecessary to me in this situation.)
Otherwise - I have to look to the bottom of the screen to see whether vim wants 
'q' or Enter to exit message display.
Is it just me that finds this open for improvement?

I've tried finding good mappings to solve this problem, but it's not at all 
easy.

The source code change I made today was to change line 1004 of message.c from
if (vim_strchr((char_u *)"\r\n ", c) == NULL && c != Ctrl_C)
to
if (vim_strchr((char_u *)"\r\n ", c) == NULL && c != Ctrl_C && c != 'q')
It seems to work fine I think.


I wish we had special mapping mode for the More-response.
Then you could  map 'q' in this mode as you wish.

Yakov


Re: Consistently exit "message display" with 'q'?

2007-03-19 Thread A.J.Mechelynck

John Orr wrote:

Hi Tony, (and others),

Thanks for your (tireless) input, yes, Ctrl-C is certainly a good suggestion, 
that works consistently, with no error bells/flashes, no matter how far through 
the messages you are.
And I totally agree that it's good to make it easy to know when there is more 
output to come or not, by having a different 'end' message.

Thanks also to the other guys who've responded, raising related points.  
I suppose I'm biased - after getting hooked on vim, it seemed natural to alias unix 'more' to instead use unix 'less' - so I can get the vim style cursor movement commands.
Hence I'm rather accustomed to the unix 'less' manner of scrolling text/messages.  I guess the current vim approach is a melding of both Unix 'more' and 'less', 
which certainly has it's own advantages.  Eg - unix "more" exits at the end of the messages in a similar way to vim (the key difference being that with vim, the messages all disappear,

whilst with more, you've probably got them scrolled up your terminal window to 
review).

Undoubtedly there would be both "more" devotees and "less" devotees using vim - so what we've currently got is probably a good compromise.  
It may be better, perhaps, to have an option to enable fully compatible versions of one or the other.  But that's probably a lot of work.


For now, I've got my code patch (not that it's nice to have oddly patched 
code).  When I get some time I'll see if I can't find a similar change to 
address the other issue raised here, unless someone gets there before me.

Thank you all for your responses.
John


Personally I use both "less" and "more" -- for different purposes. For 
instance, with a long "ls" listing, using --color makes "less" stumble, but 
"more" shows the colors with no problem. In general, I use:


- less
  - when there is a long listing which I want to be able to scroll back and 
forth, or to search with a / command
  - not when there are interspersed ANSI-like escape sequences as in "ls 
--color".


- more
  - if I  want to discard the listing after the first screenful, as when I 
use "src/vim --version |more" between "make" and "make install" of a Vim 
recompile.

  - if I know that I won't have to scroll back or search
  - if I want the last screenful to remain visible above the next shell prompt
  - if there are ANSI-like color escapes

But Vim is more versatile than either. It even allows you to capture the 
output of a "display" command like ":ver" or, with no parameters, ":au" or 
":hi"; but you have to set up the capture in advance (see ":help :redir").



Best regards,
Tony.
--
REPORTER: Senator, are you for or against the MX missile system?

SENATOR: Bob, the MX missile system reminds me of an old saying that
the country folk in my state like to say.  It goes like this: "You can
carry a pig for six miles, but if you set it down it might run away."
I have no idea why the country folk say this.  Maybe there's some kind
of chemical pollutant in their drinking water.  That is why I pledge to
do all that I can to protect the environment of this great nation of
ours, and put prayer back in the schools, where it belongs.  What we
need is jobs, not empty promises.  I realize I'm risking my political
career be being so outspoken on a sensitive issue such as the MX, but
that's just the kind of straight-talking honest person I am, and I
can't help it.
-- Dave Barry, "On Presidential Politics"


Re: Consistently exit "message display" with 'q'?

2007-03-19 Thread John Orr
Hi Tony, (and others),

Thanks for your (tireless) input, yes, Ctrl-C is certainly a good suggestion, 
that works consistently, with no error bells/flashes, no matter how far through 
the messages you are.
And I totally agree that it's good to make it easy to know when there is more 
output to come or not, by having a different 'end' message.

Thanks also to the other guys who've responded, raising related points.  
I suppose I'm biased - after getting hooked on vim, it seemed natural to alias 
unix 'more' to instead use unix 'less' - so I can get the vim style cursor 
movement commands.
Hence I'm rather accustomed to the unix 'less' manner of scrolling 
text/messages.  I guess the current vim approach is a melding of both Unix 
'more' and 'less', 
which certainly has it's own advantages.  Eg - unix "more" exits at the end of 
the messages in a similar way to vim (the key difference being that with vim, 
the messages all disappear,
whilst with more, you've probably got them scrolled up your terminal window to 
review).

Undoubtedly there would be both "more" devotees and "less" devotees using vim - 
so what we've currently got is probably a good compromise.  
It may be better, perhaps, to have an option to enable fully compatible 
versions of one or the other.  But that's probably a lot of work.

For now, I've got my code patch (not that it's nice to have oddly patched 
code).  When I get some time I'll see if I can't find a similar change to 
address the other issue raised here, unless someone gets there before me.

Thank you all for your responses.
John


On Tuesday 20 March 2007 14:58, A.J.Mechelynck wrote:
> [EMAIL PROTECTED] wrote:
> > "A.J.Mechelynck" <[EMAIL PROTECTED]> 写于 2007-03-20 11:18:06:
> >> To go back in the scrolling display, in Vim 7 (but not in Vim 6 or
> > earlier)
> >> you can use  or  depending on how far you want to go back.
> >>
> >>
> >> Best regards,
> >> Tony.
> >> --
> > 
> > Hi Tony,
> > 
> > Anyway to prevent 'more-prompt' from changing into 'hit-enter-prompt' at
> > the last line?
> > 
> > When you scroll down and see the 'hit-enter-prompt', anykey will close the
> > message display, and the  does not work under that circumstance.
> > 
> > --
> > Sincerely, Pan, Shi Zhu. ext: 2606
> > 
> > 
> 
> In Vim 7.0.219 (and probably in at least some earlier v7 builds) hitting  
> (but not ) at the Hit-Enter prompt scrolls the message back by one 
> line (if it's longer than the screen, but if it isn't there's not much 
> purpose 
> in scrolling back).
> 
> After hitting  once at the Hit-Enter prompt you're back to the 
> More-prompt 
> so _then_ you can use  again.
> 
> IMHO it is advantageous to have a different prompt at the end of the message 
> because it tells you that there's nothing to scroll _forward_ to.
> 
> 
> Best regards,
> Tony.
> -- 
> I think that I shall never see
> A billboard lovely as a tree.
> Perhaps, unless the billboards fall
> I'll never see a tree at all.
>   -- Ogden Nash
> 


Re: Consistently exit "message display" with 'q'?

2007-03-19 Thread panshizhu
"A.J.Mechelynck" <[EMAIL PROTECTED]> 写于 2007-03-20 11:58:26:
>
> After hitting  once at the Hit-Enter prompt you're back to the
> More-prompt
> so _then_ you can use  again.
>
> IMHO it is advantageous to have a different prompt at the end of the
message
> because it tells you that there's nothing to scroll _forward_ to.
>
>
> Best regards,
> Tony.
> --

It is not hurt to have a different prompt, but in the Hit-Enter prompt, hit
*any-key* will close the message display.

This is different from the Vim "state", we know that press the ESC twice
will go into normal mode. If I pressed the ESC 3 times (by mistake) it does
not hurt.

Press  will scroll down in 'more-prompt', and the prompt may silent
change into 'hit-enter-prompt', if I then pressed the  for one more
time, the messages may lost forever and I may not have chance to see the
message at all. Such kind of unrecoverable "destructive" command like
"close the message" should be explicitly defined like 'q' and should not be
*any-key*.

--
Sincerely, Pan, Shi Zhu. ext: 2606

Re: Consistently exit "message display" with 'q'?

2007-03-19 Thread A.J.Mechelynck

[EMAIL PROTECTED] wrote:

"A.J.Mechelynck" <[EMAIL PROTECTED]> 写于 2007-03-20 11:18:06:

To go back in the scrolling display, in Vim 7 (but not in Vim 6 or

earlier)

you can use  or  depending on how far you want to go back.


Best regards,
Tony.
--


Hi Tony,

Anyway to prevent 'more-prompt' from changing into 'hit-enter-prompt' at
the last line?

When you scroll down and see the 'hit-enter-prompt', anykey will close the
message display, and the  does not work under that circumstance.

--
Sincerely, Pan, Shi Zhu. ext: 2606




In Vim 7.0.219 (and probably in at least some earlier v7 builds) hitting  
(but not ) at the Hit-Enter prompt scrolls the message back by one 
line (if it's longer than the screen, but if it isn't there's not much purpose 
in scrolling back).


After hitting  once at the Hit-Enter prompt you're back to the More-prompt 
so _then_ you can use  again.


IMHO it is advantageous to have a different prompt at the end of the message 
because it tells you that there's nothing to scroll _forward_ to.



Best regards,
Tony.
--
I think that I shall never see
A billboard lovely as a tree.
Perhaps, unless the billboards fall
I'll never see a tree at all.
-- Ogden Nash


Re: Consistently exit "message display" with 'q'?

2007-03-19 Thread panshizhu
"A.J.Mechelynck" <[EMAIL PROTECTED]> 写于 2007-03-20 11:18:06:
> To go back in the scrolling display, in Vim 7 (but not in Vim 6 or
earlier)
> you can use  or  depending on how far you want to go back.
>
>
> Best regards,
> Tony.
> --

Hi Tony,

Anyway to prevent 'more-prompt' from changing into 'hit-enter-prompt' at
the last line?

When you scroll down and see the 'hit-enter-prompt', anykey will close the
message display, and the  does not work under that circumstance.

--
Sincerely, Pan, Shi Zhu. ext: 2606

Re: Consistently exit "message display" with 'q'?

2007-03-19 Thread A.J.Mechelynck

John Orr wrote:

Hi all,

I'm a bit frustrated by a particular behaviour of vim, and today I modified the 
source code to 'fix' it.  I'd be very grateful for some opinions if you
a) agree with my thoughts, or 
b) have a better solution.


The problem - is when you run a command that outputs "messages" to vim - over 
multiple lines.  For example,
:!ls
or
:set

They scroll messages up the screen, and a kind of Unix 'less' function is 
effectively invoked (since it steals it's scrolling commands from vi(m)).
In Unix "less" (and also Unix "more"), a simple, close-to-the-fingers way to 
exit is to type the letter 'q'.  This works no matter whether you're at the start, middle or end of 
the file.
In vim, if only a part of the messages would fit on the screen, you get the 
prompt '-- More --' - and if you press 'q', it will exit message display.  If 
you press Enter, it will just scroll one line.
However, if all the messages would fit on the screen, you get the prompt 'Press 
ENTER or type command to continue'.  Now the 'q' and 'Enter' keys do totally 
different things - q heads you towards macro recording, and Enter exits message 
display.

Often, the line I want to see is at the top of the message output - and I don't 
care whether all the messages fitted on the screen, or whether there are more - 
I just want to exit message display.
To me, it makes perfect sense that, just as with the unix 'less' program, 
pressing 'q' should exit message display - regardless of whether there are more 
lines to display or not.
Sure, I can press Escape, but it's much harder to press than 'q'.  Yes, I can press Ctrl-[ - but that's also much harder than 'q'.  (Both of these options will also trigger the 'error bell' (audible or visual) - which seems rather unnecessary to me in this situation.)  
Otherwise - I have to look to the bottom of the screen to see whether vim wants 'q' or Enter to exit message display.

Is it just me that finds this open for improvement?

I've tried finding good mappings to solve this problem, but it's not at all 
easy.

The source code change I made today was to change line 1004 of message.c from
if (vim_strchr((char_u *)"\r\n ", c) == NULL && c != Ctrl_C)
to 
if (vim_strchr((char_u *)"\r\n ", c) == NULL && c != Ctrl_C && c != 'q')

It seems to work fine I think.

If I'm the only one who finds this a problem, how do all of you exit from 
message display?  Do you do different things depending on the message at the 
bottom? Use Escape?
Otherwise, would anyone else like to see this tiny change accepted into vim?

Thanks for your thoughts,
John


To exit the scrolling display ang go back to plain-vanilla Vim, hit Ctrl-C (or 
Ctrl-Break) at the More-prompt or Hit-Enter-prompt. On AZERTY/QWERTY/QWERTZ 
keyboard, the C is near enough to the left Ctrl key to allow hitting the two 
keys easily with the fingers of a single hand. (I don't know about the Dvorak 
layout.)


To go back in the scrolling display, in Vim 7 (but not in Vim 6 or earlier) 
you can use  or  depending on how far you want to go back.



Best regards,
Tony.
--
The assertion that "all men are created equal" was of no practical use
in effecting our separation from Great Britain and it was placed in the
Declaration not for that, but for future use.
--  Abraham Lincoln


Re: Consistently exit "message display" with 'q'?

2007-03-19 Thread Jean-Rene David
* [EMAIL PROTECTED] [2007.03.19 22:30]:
> The more frustrating thing is: if I continuously
> scroll down in the 'more-prompt' mode, the
> 'more-prompt' will eventually quits the display
> and the message are disappeared forever, so I
> must be careful NOT to press any key when the
> last line of message are shown. 

I'm fairly sympathetic to this concern.

How many times did I repeat a command just because
I had pressed  one time too many...

-- 
JR


Re: Consistently exit "message display" with 'q'?

2007-03-19 Thread panshizhu
John Orr <[EMAIL PROTECTED]> 写于 2007-03-19 21:23:59:
> Hi all,
>
> I'm a bit frustrated by a particular behaviour of vim, and today I
> modified the source code to 'fix' it.  I'd be very grateful for some
> opinions if you
> a) agree with my thoughts, or
> b) have a better solution.
>
> The problem - is when you run a command that outputs "messages" to
> vim - over multiple lines.  For example,
> :!ls
> or
> :set
>
> They scroll messages up the screen, and a kind of Unix 'less'
> function is effectively invoked (since it steals it's scrolling
> commands from vi(m)).
> In Unix "less" (and also Unix "more"), a simple, close-to-the-
> fingers way to exit is to type the letter 'q'.  This works no matter
> whether you're at the start, middle or end of the file.
> In vim, if only a part of the messages would fit on the screen, you
> get the prompt '-- More --' - and if you press 'q', it will exit
> message display.  If you press Enter, it will just scroll one line.
> However, if all the messages would fit on the screen, you get the
> prompt 'Press ENTER or type command to continue'.  Now the 'q' and
> 'Enter' keys do totally different things - q heads you towards macro
> recording, and Enter exits message display.
>
> Often, the line I want to see is at the top of the message output -
> and I don't care whether all the messages fitted on the screen, or
> whether there are more - I just want to exit message display.
> To me, it makes perfect sense that, just as with the unix 'less'
> program, pressing 'q' should exit message display - regardless of
> whether there are more lines to display or not.
> Sure, I can press Escape, but it's much harder to press than 'q'.
> Yes, I can press Ctrl-[ - but that's also much harder than 'q'.
> (Both of these options will also trigger the 'error bell' (audible
> or visual) - which seems rather unnecessary to me in this situation.)
> Otherwise - I have to look to the bottom of the screen to see
> whether vim wants 'q' or Enter to exit message display.
> Is it just me that finds this open for improvement?
>
> I've tried finding good mappings to solve this problem, but it's not
> at all easy.
>
> The source code change I made today was to change line 1004 of message.c
from
> if (vim_strchr((char_u *)"\r\n ", c) == NULL && c != Ctrl_C)
> to
> if (vim_strchr((char_u *)"\r\n ", c) == NULL && c != Ctrl_C && c != 'q')
> It seems to work fine I think.
>
> If I'm the only one who finds this a problem, how do all of you exit
> from message display?  Do you do different things depending on the
> message at the bottom? Use Escape?
> Otherwise, would anyone else like to see this tiny change accepted into
vim?
>
> Thanks for your thoughts,
> John

Hi,

I don't know how other people quits the message display but I do feel
unhappy since the first day I use vim and have no good work around unless
having a big screen (so that most messages could fit in my screen)...

The more frustrating thing is: if I continuously scroll down in the
'more-prompt' mode, the 'more-prompt' will eventually quits the display and
the message are disappeared forever, so I must be careful NOT to press any
key when the last line of message are shown. What I expect is: press
"Enter" or "space" will always do scroll ONLY, and do never quit the
message display, this is consistent with the Unix "less" command.

If you just eat the 'q' after the message display, it will work if you want
to just quit all message, but when you want to view the last lines of the
message, the 'more-prompt' is still inconsistent since it will change into
"Press Enter or type command to continue" on the last line.

So I think a better way is to change the code for the 'less' mode, (in Vim
document, it is called 'more-prompt'), the 'more-prompt' should always
require 'q' 'ESC' to exit, even if the last line of text are shown. And
there should be an option to turn the 'more-prompt' always on. i.e. All
message will show 'more-prompt' regardless of the message 'lines'.

To conclude:
1. an option to "always show" the 'more-prompt'
2. 'more-prompt' will never fall into "Press Enter or type command to
continue" state even if on the last line, so we always require 'q' or ESC
to quit the 'more-prompt'. this is consistent with the Unix 'less' command.
--
Sincerely, Pan, Shi Zhu. ext: 2606

Consistently exit "message display" with 'q'?

2007-03-19 Thread John Orr
Hi all,

I'm a bit frustrated by a particular behaviour of vim, and today I modified the 
source code to 'fix' it.  I'd be very grateful for some opinions if you
a) agree with my thoughts, or 
b) have a better solution.

The problem - is when you run a command that outputs "messages" to vim - over 
multiple lines.  For example,
:!ls
or
:set

They scroll messages up the screen, and a kind of Unix 'less' function is 
effectively invoked (since it steals it's scrolling commands from vi(m)).
In Unix "less" (and also Unix "more"), a simple, close-to-the-fingers way to 
exit is to type the letter 'q'.  This works no matter whether you're at the 
start, middle or end of the file.
In vim, if only a part of the messages would fit on the screen, you get the 
prompt '-- More --' - and if you press 'q', it will exit message display.  If 
you press Enter, it will just scroll one line.
However, if all the messages would fit on the screen, you get the prompt 'Press 
ENTER or type command to continue'.  Now the 'q' and 'Enter' keys do totally 
different things - q heads you towards macro recording, and Enter exits message 
display.

Often, the line I want to see is at the top of the message output - and I don't 
care whether all the messages fitted on the screen, or whether there are more - 
I just want to exit message display.
To me, it makes perfect sense that, just as with the unix 'less' program, 
pressing 'q' should exit message display - regardless of whether there are more 
lines to display or not.
Sure, I can press Escape, but it's much harder to press than 'q'.  Yes, I can 
press Ctrl-[ - but that's also much harder than 'q'.  (Both of these options 
will also trigger the 'error bell' (audible or visual) - which seems rather 
unnecessary to me in this situation.)  
Otherwise - I have to look to the bottom of the screen to see whether vim wants 
'q' or Enter to exit message display.
Is it just me that finds this open for improvement?

I've tried finding good mappings to solve this problem, but it's not at all 
easy.

The source code change I made today was to change line 1004 of message.c from
if (vim_strchr((char_u *)"\r\n ", c) == NULL && c != Ctrl_C)
to 
if (vim_strchr((char_u *)"\r\n ", c) == NULL && c != Ctrl_C && c != 'q')
It seems to work fine I think.

If I'm the only one who finds this a problem, how do all of you exit from 
message display?  Do you do different things depending on the message at the 
bottom? Use Escape?
Otherwise, would anyone else like to see this tiny change accepted into vim?

Thanks for your thoughts,
John




*
"This e-mail (and any attachments) is confidential and privileged information 
of Catapult Communications"
*