last line view in gvim

2007-01-13 Thread Ilia N Ternovich
Hi all!

Is there any opportunity to watch only for last 2-3 lines in vim buffer
while watching for some big output?

This means that when I create some buffer in vim, then run in it some
process, that produces big output ( for example gdb debugger ) I want to
see only last lines produced this process...

It is very annoying to debug something and always switch into another
buffer, then pressing  key, then switching to main buffer, making
one step with gdb and so on.

-- 
God bless you!
Ilia

2.6.18-gentoo-r4 AMD Athlon(tm) XP 2600+

mailto: [EMAIL PROTECTED]
icq: 198233378

VegaTrek Developer: http://wcuniverse.sourceforge.net/vegatrek/
VegaTrek Forum Moderator:
http://vegastrike.sourceforge.net/forums/viewforum.php?f=13

You know you are a geek when: you emerge this great package called
"fortune-mod-gentoo-forums" -- squinky86

$gpg --keyserver cryptonomicon.mit.edu --search-keys tillias



C++ Syntax highlighting for Identifier, Statement

2007-01-13 Thread Matt England
I'm trying to get function names, class names, objects, variables and 
similar things to appear as non-white text with 'syntax on'.


I thus far have been unsuccessful.  I can get many other constructs 
(constants, types, keywords, etc) to be highlighted, but not the things 
mentioned above.


I've been trying putting different flavors of:

http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/index-c.html

in my .vimrc with no luck.

I've also been trying to change the "Identifier" and "Statement" gizmos in 
these settings with no luck.  (I'd like to know how these "gizmos" map to 
languages like .cpp...but finding the "round trip" info seems rather 
challenging.)  I've also messed around with the syntax/syncolor.vim file a 
bit, but still no luck.


Where does 'cterm' apply and 'guifg' apply and on and on...

I've designed a lot of different software systems in a variety of 
languages, but I'm not sure I've seen anything quite as broad as the 
settings/things in vim programming.  It's rather overwhelming to me at the 
moment.


Thanks for any help,
-Matt
Dispersed Storage:  http://cleversafe.org



Re: Encoding problem

2007-01-13 Thread DervishD
Hi Tony :)

 * A.J.Mechelynck <[EMAIL PROTECTED]> dixit:
> >>":scriptencoding" applies no farther than the end of the current script.
> >
> >And does it affect sourced scripts or should I put that line in all
> >scripts?
> 
> It doesn't affect sourced scripts. Each script should include or not 
> include a ":scriptencoding" statement according to what bytes are found in 
> that script itself.

OK, I thought it was more like a flag, meaning "from now on,
everything you source is latin1". Of course, it wouldn't make much sense
that way, I should have noticed O:)

> >>OK, let's try the opposite: edit options.vim, remove the sriptencoding 
> >>statement, then save it with
> >>
> >>:setlocal bomb fenc=utf-8
> >>:x
> >>
> >>Then restart Vim and see if it works.
> >
> >No, it doesn't work, but the strange thing is that vim barfs *only*
> >with 'showbreak'. I have latin1 (well, utf-8 now) characters in the
> >script, namely in 'foldtext' and 'listchars' at least, and they are
> >processed correctly. Maybe the codes I'm using are considered printable
> >in latin1 and nonprintable in utf8?
> 
> What characters are seen as printable in Vim depends on the 'isprint' 
> option.

Oh, I didn't remember that, I assumed that Vim was using the
"isprint()" functions in ctype for that.

> That option's default is OS-dependent, but apparently not 
> locale-dependent. ASCII characters from 0x20 (space) to 0x7E (tilde), 
> including all digits and letters, are always "printable", even if the 
> option doesn't mention them.

Anyway, I have that option set to "@,161-255", so probably if I set
my encoding to utf8, the multibyte characters (division and left
guillemot) should be printable, but in this case looks like Vim doesn't
like them (it likes them on 'listchars', so the problem is not the
encoding, definitely).

> >Oops, I think I know what's happening. I don't have an utf8 locale,
> >and I don't mean active, I mean *installed*, so if vim is trying to use
> >an utf-8 locale to see if a character is printable or not, it won't work
> >unless vim itself knows if some character is printable or not under
> >utf8. That's why the error is E595 and only shows with 'showbreak'. Vim
> >is considering the division sign and the left guillemot non printable
> >under utf8 encoding (which, BTW, is not right). Probably if I install an
> >utf8 locale, things will work OK. By now I'll leave 'encoding' as
> >default, 'fenc' and 'fencs' empty and will set utf-8 by hand when needed
> >(which is not very frequently for me).
> 
> There used to be a limitation on 'listchars', and possibly it still applies 
> to 'showbreak': the characters in that option had to be valid in the 
> current 'encoding'. If you change the 'encoding', the option may become 
> invalid in the new 'encoding'. If you use 7-bit characters in 'showbreak' 
> it should be OK in all 'encoding's.

Yes, but if I set the encoding to utf8 and save the file *as* utf8,
then Vim should handle it, am I wrong?. Those characters will be valid
utf8 and will be printable :?

> >Problem solved! Thanks a lot for everything, Tony :)
> >
> De nada, hombre.

Do you know that with that kind of expressions you would pass as a
spanish native? Your spanish is much better than you think ;))) I'll try
to learn a bit of esperanto to correspond to your kindness :)

Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!


Re: Reformat in visual area - vmap question

2007-01-13 Thread DervishD
Hi Tim :)

 * Tim Chase <[EMAIL PROTECTED]> dixit:
> >>Yes, ñ or ç would be good. Beware of ' and ` though: they are used in 
> >>Normal mode for "mark" movements.
> >
> >Yes, but both keys do the same, so I'm on the safe side if I choose
> >only one of them, am I wrong?
> 
> They do similar, but not identical actions.  The regular 
> tick/apostrophe jumps to the beginning of the marked line, and 
> the back-tick jumps to the character position where the mark was 
> dropped.

I exclusively use backtick when going to a mark, so using the
single-quote may be a good choice for me, because it is very handy in my
spanish keyboard.

Thanks :)

Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!


Re: Reformat in visual area - vmap question

2007-01-13 Thread DervishD
Hi Jean Rene :)

 * Jean-Rene David <[EMAIL PROTECTED]> dixit:
> * DervishD [2007.01.12 07:45]:
> >  * A.J.Mechelynck <[EMAIL PROTECTED]> dixit:
> > > [...]
> > > Beware of ' and ` though: they are used in 
> > > Normal mode for "mark" movements.
> > 
> > Yes, but both keys do the same, so I'm on
> > the safe side if I choose only one of them,
> > am I wrong?
> 
> They are similar but not quite the same.
> 
> :h mark-motions

Yes, I knew it: one of them is exclusive and the other one just puts
you in the first non-blank character, but since I always think about "go
to the exact place where I did set the mark", I considered them equal.
My bad, sorry O:)

Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!


Re: Can I delete this control sequence?

2007-01-13 Thread Bill McCarthy
On Sat 13-Jan-07 10:01am -0600, Anthony Campbell wrote:

> I've imported a lot of files from a DOS word processor. 
> These have lots of control sequences of the form M-J ) New 
> lines I think). I can search for the M, which is Return, 
> but I don't see any way to get the -J. Is it possible?

I have never seen Vim or Gvim show me a "M-J" for a control
character.  What are you seeing in Vim/Gvim and what is in
the file (in hex, for example) for those characters?

It is not likely a CR or LF.  I've created a small file with
the first line ending in CR, the second line ending in LF
and the last two lines ending in CR/LF.  The following is
what is shown inside Vim (identical to forcing UNIX):

line 1^Mline 2
line 3^M
line 4^M

Forcing DOS with --cmd "set ffs=dos" gives:

line 1^Mline 2
line 3
line 4

Forcing MAC with --cmd "set ffs=mac" gives:

line 1
line 2^Jline 3
^Jline 4
^J

Those ^M's and ^J's show up in blue in standard Gvim.

gvim -u NONE -N

Typing :%!xxd shows:

000: 6c69 6e65 2031 0d6c 696e 6520 320a 6c69  line 1.line 2.li
010: 6e65 2033 0d0a 6c69 6e65 2034 0d0a   ne 3..line 4..

-- 
Best regards,
Bill



Re: Can I delete this control sequence?

2007-01-13 Thread Anthony Campbell

On 13 Jan 2007, Tim Chase wrote:

>And, with xdd, I get
>
>arcadia:~/tmp:$ xxd extract
>000: 200d 8a20 0d0a
>
>Is this any help?

Ah...the most telling/helpful aspect! :)

You might be able to use

:%s/\r\%x8a//g

(typed literally) to nuke those items, or replace them with your 
favorite contents.


And I get to put "\%x" on my list of "new stuff I learned today".

:help /\%x

and a bit under

:help E68

for more on using that for putting hex values in your searches. 
True, it could also be done via control+V followed by "x" 
followed by the "8a" to enter it literally as detailed at


:help i_CTRL-V_digit

So that should get you pointed in the right direction.

-tim



Excellent - thank you very much! Works a treat. Now I 
shall do some reading up too!


Anthony


This message has been scanned for viruses by BlackSpider MailControl - 
www.blackspider.com


Re: Can I delete this control sequence?

2007-01-13 Thread Tim Chase

And, with xdd, I get

arcadia:~/tmp:$ xxd extract
000: 200d 8a20 0d0a

Is this any help?


Ah...the most telling/helpful aspect! :)

You might be able to use

:%s/\r\%x8a//g

(typed literally) to nuke those items, or replace them with your 
favorite contents.


And I get to put "\%x" on my list of "new stuff I learned today".

:help /\%x

and a bit under

:help E68

for more on using that for putting hex values in your searches. 
True, it could also be done via control+V followed by "x" 
followed by the "8a" to enter it literally as detailed at


:help i_CTRL-V_digit

So that should get you pointed in the right direction.

-tim




Re: Can I delete this control sequence?

2007-01-13 Thread Anthony Campbell
If you could, would it be possible to post an excerpt of a dump 
of the file through xxd/od?  This will help determine exactly 
what the file contains at these junctures.  Or, perhaps you can 
even determine from such output exactly what is following the CR. 
 If it truly is a CR/LF pair, and your 'ff' is "unix", then using


:%s/\r\n

should do the trick.

Something like

xxd infile.wp | sed -n '30,50p'

to extract lines 30-50 of the dump where the behavior/characters 
shows up (adjusting those line numbers until you have a window of 
interest) will allow for a more isolated piece if you intend to 
post some to the list.


Alternatively, if there are characters you don't use in your 
file, you could do something like


tr '\r\n' '#@' < infile.wp > outfile.txt

to replace any instance of either CR or LF with a hash or at-sign 
respectively (choose your own characters according to what you 
know of the file contents) which will make them easier for you to 
spot.


Well, I extracted the offending code and looked at it with 
less:

it reads :^M<8A>

And, with xdd, I get

arcadia:~/tmp:$ xxd extract
000: 200d 8a20 0d0a

Is this any help?


This message has been scanned for viruses by BlackSpider MailControl - 
www.blackspider.com


Re: Can I delete this control sequence?

2007-01-13 Thread Tim Chase
I'm not worried about the original line breaks. I think 
these controls were put in by the WP to  be 
reformatable.ends of lines. But they don't seem to be 
ordinary CR/LF.


Anyway, the problem is that -J is not recognized as a 
control sequence by vim so I can't search for it or 
replace it. The best plan I've come up with so far is to 
search for ^M, find it, and do 2x to delete both ^M and 
the next character (i.e. -J). By putting this in a 
register I can repeat it a number of times.


If you could, would it be possible to post an excerpt of a dump 
of the file through xxd/od?  This will help determine exactly 
what the file contains at these junctures.  Or, perhaps you can 
even determine from such output exactly what is following the CR. 
 If it truly is a CR/LF pair, and your 'ff' is "unix", then using


:%s/\r\n

should do the trick.

Something like

xxd infile.wp | sed -n '30,50p'

to extract lines 30-50 of the dump where the behavior/characters 
shows up (adjusting those line numbers until you have a window of 
interest) will allow for a more isolated piece if you intend to 
post some to the list.


Alternatively, if there are characters you don't use in your 
file, you could do something like


tr '\r\n' '#@' < infile.wp > outfile.txt

to replace any instance of either CR or LF with a hash or at-sign 
respectively (choose your own characters according to what you 
know of the file contents) which will make them easier for you to 
spot.


Just a few more ideas,

-tim






Re: Can I delete this control sequence?

2007-01-13 Thread Anthony Campbell

On 13 Jan 2007, Tim Chase wrote:
>I've imported a lot of files from a DOS word processor. 
>These have lots of control sequences of the form M-J ) New 
>lines I think). I can search for the M, which is Return, 
>but I don't see any way to get the -J. Is it possible?


IIUC, you have CR/LF pairs in the incoming file and want do do 
something to them?


Vim does some sniffing to detect the fileformat (":he 'ff'")...if 
they're all CR/LF pairs, the FF will come up as DOS.  However, if 
there are some mismatched pairs in there, it often comes up as 
Unix format.  It sounds like you're getting the latter 
format...that you're seeing Vim display the ^M (CR) and the ^J 
(LF) is interpreted as a line-break.


Thus, what you're looking for is

:%s/\r\n/replacement


However, you may want to keep the original line breaks, in which 
case, you just want to use


:%s/\r$/replacement

With a bit more information about what you're trying to do and 
what's in the file (are they paragraphs separated by double blank 
lines that you want to preserve? do the original line-breaks have 
significance to you?) you might have to modify this idea.


I'm not worried about the original line breaks. I think 
these controls were put in by the WP to  be 
reformatable.ends of lines. But they don't seem to be 
ordinary CR/LF.


Anyway, the problem is that -J is not recognized as a 
control sequence by vim so I can't search for it or 
replace it. The best plan I've come up with so far is to 
search for ^M, find it, and do 2x to delete both ^M and 
the next character (i.e. -J). By putting this in a 
register I can repeat it a number of times.



This message has been scanned for viruses by BlackSpider MailControl - 
www.blackspider.com


Re: Can I delete this control sequence?

2007-01-13 Thread Tim Chase
I've imported a lot of files from a DOS word processor. 
These have lots of control sequences of the form M-J ) New 
lines I think). I can search for the M, which is Return, 
but I don't see any way to get the -J. Is it possible?


IIUC, you have CR/LF pairs in the incoming file and want do do 
something to them?


Vim does some sniffing to detect the fileformat (":he 'ff'")...if 
they're all CR/LF pairs, the FF will come up as DOS.  However, if 
there are some mismatched pairs in there, it often comes up as 
Unix format.  It sounds like you're getting the latter 
format...that you're seeing Vim display the ^M (CR) and the ^J 
(LF) is interpreted as a line-break.


Thus, what you're looking for is

:%s/\r\n/replacement


However, you may want to keep the original line breaks, in which 
case, you just want to use


:%s/\r$/replacement

With a bit more information about what you're trying to do and 
what's in the file (are they paragraphs separated by double blank 
lines that you want to preserve? do the original line-breaks have 
significance to you?) you might have to modify this idea.


HTH,

-tim








Can I delete this control sequence?

2007-01-13 Thread Anthony Campbell
I've imported a lot of files from a DOS word processor. 
These have lots of control sequences of the form M-J ) New 
lines I think). I can search for the M, which is Return, 
but I don't see any way to get the -J. Is it possible?


Anthony


This message has been scanned for viruses by BlackSpider MailControl - 
www.blackspider.com


Re: use mesg/write out from Vim

2007-01-13 Thread danpopovic
Hello list, Tony and Albie,

thanks for your suggestions. Till today I didn't know for the reasonable 
restrictions on
allowing interactive programs in Vim .
It seems to me that the vim_shell extension/script should satisfy my wishes.

Best regards,
Dan


> -Ursprüngliche Nachricht-
> Von: "A.J.Mechelynck" <[EMAIL PROTECTED]>
> Gesendet: 13.01.07 14:17:20
> An: Popovic Dan <[EMAIL PROTECTED]>
> CC: vim@vim.org
> Betreff: Re: use mesg/write out from Vim


> Popovic Dan wrote:
> > Hi dear list memebers,
> > 
> > i was wondering wether a "chat" whith Vim is possible or if a vim script 
> > for this yet exists:
> > 
> > I often "chat" with other users via the shell command "write". Since I know 
> > one kann execute any shell command inside vim, i ask
> > myself if it is possible to have a "chat"-window within Vim, where one can 
> > see incoming messages (which have to be directed from
> > any tty to Vim then, of course) or where one can write messages to other 
> > users.
> > Has anyone done/used this before?
> > ---
> > Another not Vim-related question I will post for I know you Vimmers are all 
> > very used to this tricky little tools ;):
> > 
> > Using "write" one can see the messages which have been sent until now, 
> > therefor they have to be saved in any (text)file, I suppose.
> > Does anyone know where I can find them?
> > 
> > Thanks so much for your help and best regards to all,
> > Dan 
> 
> 
> "Standard" Vim (as compiled from Bram Moolenaar's "official" sources) does 
> not, and will not, allow embedding an interactive program in one of its 
> windows. This is stated explicitly at ":help shell-window", and I think I can 
> confidently extend it to any interactive program. The shell can be invoked 
> interactively from Vim, but not in a Vim window; _batch_ programs can be 
> invoked from Vim, and even their output pasted into a Vim window.
> 
> See
>   :help filter
>   :help :r!
>   :help :!
>   :help :shell
> 
> In a multiprogram environment like Windows, Mac or X11, you can have gvim 
> running in one window, and any other program running in an other window, next 
> to it or overlapping in any way you choose, and you can transfer text from 
> one 
> to the other via the clipboard.
> 
> This said, there has been some work done, unofficially, to patch the Vim C 
> code in order to allow embedding a shell window into it. I don't know how far 
> the work has gone, nor whether it is kept current with the successive 
> patchlevels of "official" Vim.
> 
> 
> Best regards,
> Tony.
> 

--  
Dan Popovic 
Klausenpfad 22; 69121 Heidelberg 
[EMAIL PROTECTED]; Tel. 06221/7282102 oder 01743036428
http://www.rzuser.uni-heidelberg.de/~dpopovi2/index.html
__
XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!
Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130



Re: use mesg/write out from Vim

2007-01-13 Thread Albie Janse van Rensburg

Popovic Dan wrote:

Hi dear list memebers,

i was wondering wether a "chat" whith Vim is possible or if a vim script for 
this yet exists:

I often "chat" with other users via the shell command "write". Since I know one 
kann execute any shell command inside vim, i ask
myself if it is possible to have a "chat"-window within Vim, where one can see 
incoming messages (which have to be directed from
any tty to Vim then, of course) or where one can write messages to other users.
Has anyone done/used this before?
---
Another not Vim-related question I will post for I know you Vimmers are all 
very used to this tricky little tools ;):

Using "write" one can see the messages which have been sent until now, therefor 
they have to be saved in any (text)file, I suppose.
Does anyone know where I can find them?

Thanks so much for your help and best regards to all,
Dan 







  
Check out vimshell.  It allows you to open a shell in a vim window.  
Unfortunately it doesn't allow you to then use your Vim commands/macros 
in the shell window, but there are good and sensible reasons for that.  
I have not used vimshell myself, as I mainly use Vim on Windows, which 
is not supported.  I might go try it at home sometime.


http://www.wana.at/vimshell/

--
Albie Janse van Rensburg (neonpill)

Registered Linux User 438873 | 


Re: use mesg/write out from Vim

2007-01-13 Thread A.J.Mechelynck

Popovic Dan wrote:

Hi dear list memebers,

i was wondering wether a "chat" whith Vim is possible or if a vim script for 
this yet exists:

I often "chat" with other users via the shell command "write". Since I know one 
kann execute any shell command inside vim, i ask
myself if it is possible to have a "chat"-window within Vim, where one can see 
incoming messages (which have to be directed from
any tty to Vim then, of course) or where one can write messages to other users.
Has anyone done/used this before?
---
Another not Vim-related question I will post for I know you Vimmers are all 
very used to this tricky little tools ;):

Using "write" one can see the messages which have been sent until now, therefor 
they have to be saved in any (text)file, I suppose.
Does anyone know where I can find them?

Thanks so much for your help and best regards to all,
Dan 



"Standard" Vim (as compiled from Bram Moolenaar's "official" sources) does 
not, and will not, allow embedding an interactive program in one of its 
windows. This is stated explicitly at ":help shell-window", and I think I can 
confidently extend it to any interactive program. The shell can be invoked 
interactively from Vim, but not in a Vim window; _batch_ programs can be 
invoked from Vim, and even their output pasted into a Vim window.


See
:help filter
:help :r!
:help :!
:help :shell

In a multiprogram environment like Windows, Mac or X11, you can have gvim 
running in one window, and any other program running in an other window, next 
to it or overlapping in any way you choose, and you can transfer text from one 
to the other via the clipboard.


This said, there has been some work done, unofficially, to patch the Vim C 
code in order to allow embedding a shell window into it. I don't know how far 
the work has gone, nor whether it is kept current with the successive 
patchlevels of "official" Vim.



Best regards,
Tony.


use mesg/write out from Vim

2007-01-13 Thread Popovic Dan
Hi dear list memebers,

i was wondering wether a "chat" whith Vim is possible or if a vim script for 
this yet exists:

I often "chat" with other users via the shell command "write". Since I know one 
kann execute any shell command inside vim, i ask
myself if it is possible to have a "chat"-window within Vim, where one can see 
incoming messages (which have to be directed from
any tty to Vim then, of course) or where one can write messages to other users.
Has anyone done/used this before?
---
Another not Vim-related question I will post for I know you Vimmers are all 
very used to this tricky little tools ;):

Using "write" one can see the messages which have been sent until now, therefor 
they have to be saved in any (text)file, I suppose.
Does anyone know where I can find them?

Thanks so much for your help and best regards to all,
Dan 






-- 
Dan Popovic 
Klausenpfad 22; 69121 Heidelberg 
[EMAIL PROTECTED]; Tel. 06221/7282102 oder 01743036428
http://www.rzuser.uni-heidelberg.de/~dpopovi2/index.html
__
Erweitern Sie FreeMail zu einem noch leistungsstärkeren E-Mail-Postfach!

Mehr Infos unter http://freemail.web.de/home/landingpad/?mc=021131