Re: help file: where I can get it?

2007-02-14 Thread A.J.Mechelynck

Dr. Uwe Schneider wrote:

Dear Tony!

Thanx for your detailed answer.

":echo $VIMRUNTIME" results in: "/usr/local/share/vim/vim70" as expected.

But, ":verbose set helpfile?" produces: 
"helpfile=/usr/local/share/vim/vim70/vim.hlp"

[...]

What does it print below that ("Last set from...")? That vim.hlp value is not 
the default, it must be set somewhere. If it's in your $HOME/.vimrc, you 
should find and remove the offensive line. If it's in some (misguided) system 
vimrc such as /usr/share/vim/vimrc, you should be able to override it with


set helpfile&

in your vimrc, but it would be better to talk to the sysadmin about removing 
that line from the system vimrc. If it's in some custom plugin, you may be 
able to override it with


autocommand VimEnter * set helpfile&

in your vimrc.

Oh, and next time, please use "Reply to all" (or "Reply to List" if your 
mailer offers it). "Reply to sender" sends your reply only to the author, not 
to the list.


Best regards,
Tony.
--
There's an old proverb that says just about whatever you want it to.



Re: Web-based editing [Was :wq vs ZZ]

2007-02-14 Thread Cameron Simpson
On 15Feb2007 17:32, Peter Hodge <[EMAIL PROTECTED]> wrote:
| Mozex (http://mozex.mozdev.org/) is working quite well for me on Windows and
| Mac.

It's good, but buries the edit function in a submenu of the context
menu. It's also not "live" - you need to quit the editor then click in
the text area to update; IAT! monitors the text file and updates the
textarea as yo uedit (tunable polling frequency).

I used to rely on mozex for editing and mailto: links, but now the
mailto: is controlled by the GTK libraries (Linux) and I'm using IAT!
for editing.
-- 
Cameron Simpson <[EMAIL PROTECTED]> DoD#743
http://www.cskk.ezoshosting.com/cs/

Getting information off the Internet is like drinking from a fire hydrant.
- Mitchell Kapor (Lotus)


Re: Web-based editing [Was :wq vs ZZ]

2007-02-14 Thread Peter Hodge
--- Bram Moolenaar <[EMAIL PROTECTED]> wrote:

> 
> Pete Johns wrote:
> 
> > On Tue, 2007-02-13 at 16:07:32 -0700, <[EMAIL PROTECTED]> sent:
> > >>(Sorry guys, my web-based editor, which I must use at work
> > >>becauseof IT paranoia about SMTP, simply will not let me reply
> > >>at the end rather than beginning of the thread.)=20
> > >>
> > Web-based editor? Why not use Vim as your editor from within
> > Firefox? Works a treat for me!
> > 
> > ViewSourceWith 
> 
> Don't see something about Vim here...
> 
> I'm using "It's All Text!" now.  Just had to create a shell script to
> start gvim, because it doesn't allow you to give arguments to the
> command.

Mozex (http://mozex.mozdev.org/) is working quite well for me on Windows and
Mac.

regards,
Peter


Send instant messages to your online friends http://au.messenger.yahoo.com 


Problem with the expand() function

2007-02-14 Thread Yegappan Lakshmanan

Hi all,

I am seeing a problem using the expand() function and the netrw
plugin.

I have the following autocmd:

autocmd BufEnter * echomsg "Entering buffer " . expand(":p")

I edit the current directory using the "e ." command and select a file
for editing and then go back to editing the directory.

Few times when entering the netrw directory listing buffer, I see that
filename returned by the expand() function has some garbage
characters.

Is anyone else seeing this problem?

Thanks,
Yegappan


RE: File name completion for files residing in multiple directories

2007-02-14 Thread Hari Krishna Dara

On Mon, 12 Feb 2007 at 8:07pm, Max Dyckhoff wrote:

> This is a bug which I have actually informed Hari of a while ago, but
> perhaps my bug email got lost :)

The email is not lost, just extremely busy with work and personal life
:)

Also, lately I have been using eclipse more and more at my new job,
and haven't been spending much time in vim. The java specific features
of the IDE are extremely productive, but I wish I can plug right gvim into
the editor and still be able to use all the java specific features such
as quick fixes, completions etc.

> The default mapping for LookupFile is F5. What this error message
> means is that you already have a mapping for F5 in your .vimrc file,
> and you haven't specified a mapping for LookupFile. In this
> situations, LookupFile will try to map F5 to LookupFile, which
> fails with the error message that you get.
>
> This is annoying, and this is my work around for it until Hari fixes
> it. All you need is the final line, some random unused mapping to
> LookupFile, and that will stop the error from firing.
>
> :map   :LookupFile  " enter LookupFile
explicitly
> :map   :LUWalk" enter LUWalk
explicitly
> :map   :LUPath" enter LUPath
explicitly
> :imap   LookupFile   " exit LookupFile
> :map   LookupFile   " something random to
remove the error!

The plugin just follows the suggested  mapping approach (see
|write-plugin|), and this is not usually a nuisance, as you would expect
the user to always create a mapping, even if the default is undesirable.
However, in this specific case, I realize you didn't want to map 
directly to LookupFile because you don't like the default behavior
of remapping  to whatever is the latest operation. In fact, this has
been bugging me also, but haven't taken the time to think of the right
alternative. It might be best to create a different plug mapping for
this purpose and have a flag to disable it altogether. Suggestions
welcome.

-- 
Thanks,
Hari
>
>
> > -Original Message-
> > From: Meino Christian Cramer [mailto:[EMAIL PROTECTED]
> > Sent: Monday, February 12, 2007 7:30 PM
> > To: Max Dyckhoff
> > Cc: [EMAIL PROTECTED]; vim@vim.org
> > Subject: Re: File name completion for files residing in multiple
> > directories
> >
> > From: Max Dyckhoff <[EMAIL PROTECTED]>
> > Subject: RE: File name completion for files residing in multiple
> > directories
> > Date: Mon, 12 Feb 2007 11:58:35 -0800
> >
> > I installed lookupfile and got back this error message while starting
> > vim (console):
> >
> > Error detected while processing
> > /home/mccramer/.vim/plugin/lookupfile.vim:
> > line  105:
> > E227: mapping already exists for [EMAIL PROTECTED]
> > Press ENTER or type command to continue
> >
> > ???
> >
> >
> >
> > > You want Hari's LookupFile plugin, which you can find on vim.org.
> > It's awesome, and has speeded up my development massively. It does
> > exactly what you want, in almost exactly the way you suggest.
> > >
> > > Max
> > >
> > > > -Original Message-
> > > > From: Erik Bergman [mailto:[EMAIL PROTECTED]
> > > > Sent: Monday, February 12, 2007 10:53 AM
> > > > To: vim@vim.org
> > > > Subject: File name completion for files residing in multiple
> > > > directories
> > > >
> > > > I've been searching for a nice way to quickly open files that may
> > > > reside in
> > > > any of number of directories, similar to the "quick open" feature
> > you
> > > > find
> > > > in some other editors. One solution is to mess around with the **
> > and *
> > > > wildcards, but this gets terribly slow for large projects. Another
> > > > "solution" is to set the 'path' variable, but vim does not perform
> > > > completion on files opened that way. A third solution is to
> > generate
> > > > file
> > > > name tags and use :tag to jump to files, but in that case you will
> > > > perform
> > > > completion on just not file names, but other tags as well. Finally,
> > you
> > > > can
> > > > open all files you need to switch between and use :b, but for
> > obvious
> > > > reasons this isn't very practical.
> > > >
> > > > What I think would be an nice solution is if there was some way to
> > make
> > > > vim
> > > > perform file name completion using 'file' tags from the tag file.
> > That
> > > > way
> > > > you could still use tags for other things, and most often the files
> > you
> > > > generate tags for are exactly the files you want to be able to open
> > and
> > > > switch between quickly.
> > > >
> > > > Can anyone think of a better solution? Would it be possible to
> > > > integrate
> > > > this feature into vim in a nice way?
> > > >
> > > > /Erik Berman
>
>


 

Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index


Re: help file: where I can get it?

2007-02-14 Thread A.J.Mechelynck

Dr. Uwe Schneider wrote:

Hi!

Thanx a lot for your fast response!

At my PC at home, ":help" works (that's why I can't tell you more about the missing help 
feature in the moment), but at my office PC (there I ran vim per X-Term under Unix, SunSolaris), 
there comes an error message, like "no help file found in 
/usr/local/share/vim7.0/vim/.../vim.hlp". The directory exists and all files, like the syntax 
files, are already there, but no vim.hlp.

What's wrong?

Best Regards, Doc


*There* *is* *no* *vim.hlp*

The default $VIMRUNTIME on Unix (as shown by ":echo $VIMRUNTIME" in Vim) is 
/usr/local/share/vim/vim70/. That directory should have a doc/ subdirectory 
containing the help files as a number of .txt files, plus a file named "tags" 
which is the help index.


Similarly, on Windows the default $VIMRUNTIME is "C:\Program Files\vim\vim70". 
That directory should also have a "doc" subdirectory containing many *.txt 
files and one "tags" file. *That* is the Vim help system.


There are several possibilities. If the *.txt and tags files mentioned above 
are present, try


:verbose set helpfile?

The reply (on Unix) should be

  helpfile=/usr/local/share/vim/vim70/doc/help.txt

If it is anything else, the next line will tell you where that setting was 
last changed. In that case, that's the culprit.


If the *.txt files are there but the "tags" file isn't, you can regenerate it 
by doing


:helptags $VIMRUNTIME/doc

(assuming of course that you have file-creation rights in 
/usr/share/vim/vim70/doc/) which can take some time: when the cursor goes back 
to your edit buffer and starts blinking again, you know that it is done.



Best regards,
Tony.
--
It is easier to get forgiveness than permission.


Re: Security Center Advisory !

2007-02-14 Thread Bram Moolenaar

Tony Mechelynck wrote:

> If you delete a message _unopened_ it cannot harm you.

If your email application shows the subject, it means it must open the
email to find it.  Usually it only reads the header, but it may do more.
E.g., if it displays an icon to indicate there is an attachment it reads
the whole message.  If there is a bug in parsing the e-mail potentially
this could already do harm.

Best solution still is to leave your computer switched off.

-- 
I have a watch cat! Just break in and she'll watch.

 /// 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///


weird autotab action

2007-02-14 Thread Simon Jackson

when i start to write a php function with gvim..

function dostuff()
{

..as soon as i hit return it inserts a tab with an aditional 2 spaces

how do i get rid of those extra spaces?
and for that matter is there a way to close off the function
automatically?..

function dostuff()
{

}


Re: Web-based editing [Was :wq vs ZZ]

2007-02-14 Thread Pete Johns
On Thu, 2007-02-15 at 14:21:46 +1100, Cameron Simpson sent:
>I'sAT puts a little edit button on the bottom right corner of
>the text area. An ergonomic win. 
>
I shall be trying it next time I get ten minutes :-)


Best;

--paj


-- 
Pete Johns   
Contact Information  
The Greatest Gig In The Sky!   
2007-02-04 Eric Clapton 015  


pgpAvPHoEaCUF.pgp
Description: PGP signature


Re: Web-based editing [Was :wq vs ZZ]

2007-02-14 Thread Cameron Simpson
On 15Feb2007 13:39, Pete Johns <[EMAIL PROTECTED]> wrote:
| [...] It provides a menu item for you to launch
| your favourite text editor (Vim) from a textarea. [...]

I'sAT puts a little edit button on the bottom right corner of the text
area. An ergonomic win.
-- 
Cameron Simpson <[EMAIL PROTECTED]> DoD#743
http://www.cskk.ezoshosting.com/cs/

...don't permit your spirit to be dampened by pinheaded bottom liners who
feel the proper work environment is one that resembles a benign prison camp.
- a Good Times horoscope


Re: Web-based editing [Was :wq vs ZZ]

2007-02-14 Thread Pete Johns
On Thu, 2007-02-15 at 03:31:21 +0100, Bram Moolenaar sent:
>>Web-based editor? Why not use Vim as your editor from within
>>Firefox? Works a treat for me!  ViewSourceWith
>>
>
>Don't see something about Vim here...
>
Sorry, Bram, I should have mentioned that a little configuration
is required here. I should also mention that ViewSourceWith does
more than it says on the tin, insofar as you can do more than
viewing source with it. It provides a menu item for you to launch
your favourite text editor (Vim) from a textarea. I've been using
it for a while now under Windows. I suspect that to use it under
Linux then a shell script like the one you provided would be
needed.

Cheers;

--paj

Pete Johns   
Contact Information  
The Greatest Gig In The Sky!   
2007-02-04 Eric Clapton 015  


pgpOKQCYeEsd0.pgp
Description: PGP signature


Re: Web-based editing [Was :wq vs ZZ]

2007-02-14 Thread Bram Moolenaar

Pete Johns wrote:

> On Tue, 2007-02-13 at 16:07:32 -0700, <[EMAIL PROTECTED]> sent:
> >>(Sorry guys, my web-based editor, which I must use at work
> >>becauseof IT paranoia about SMTP, simply will not let me reply
> >>at the end rather than beginning of the thread.)=20
> >>
> Web-based editor? Why not use Vim as your editor from within
> Firefox? Works a treat for me!
> 
> ViewSourceWith 

Don't see something about Vim here...

I'm using "It's All Text!" now.  Just had to create a shell script to
start gvim, because it doesn't allow you to give arguments to the
command.  I'm using this (on Unix, obviously):

#!/bin/sh
gvim -f "$@"

Store this in a file, make it executable, and set it from
Tools/Add-ons/It's All Text/Preferences

The plugin can be found here:
https://addons.mozilla.org/firefox/4125/

Warning: If you set the preferences to use Vim firefox gets stuck.

I'll document it somewhere when I have used it a bit more.

-- 
hundred-and-one symptoms of being an internet addict:
123. You ask the car dealer to install an extra cigarette lighter
 on your new car to power your notebook.

 /// 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: help file: where I can get it?

2007-02-14 Thread Dr. Uwe Schneider
Hi!

Thanx a lot for your fast response!

At my PC at home, ":help" works (that's why I can't tell you more about the 
missing help feature in the moment), but at my office PC (there I ran vim per 
X-Term under Unix, SunSolaris), there comes an error message, like "no help 
file found in /usr/local/share/vim7.0/vim/.../vim.hlp". The directory exists 
and all files, like the syntax files, are already there, but no vim.hlp.

What's wrong?

Best Regards, Doc

>Dr. Uwe Schneider wrote:
>> Hi!
>> 
>> I have vim version 7.0 installed, but unfortunately no vim.hlp is delivered 
>with the package. Where I can get vim.hlp?
>> 
>> Any idea?
>> 
>> I would appreciate to get a hint on where I can download the help file or to 
>simply receive it per email attachment.
>> 
>> Thanx in advance!
>> 
>> Regards, Doc
>> 
>
>There is no vim.hlp. The vim help is called from within Vim using
>
>   :help
>
>or
>
>   
>
>or
>
>   :help 
>
>The help system consists of a number of text files located in 
>$VIMRUNTIME/doc/*.txt and indexed by $VIMRUNTIME/doc/tags
>
>If you are a beginner to Vim, you can also start the "vimtutor" program, which 
>
>should have been installed together with Vim. It accepts one optional argument 
>
>which is a two-letter language code such as fr for French, nl for Dutch, etc. 
>
>If it doesn't find a tutor script in the required language, or if you omit the 
>
>language, you get the English tutor.
>
>
>Best regards,
>Tony.
>-- 
>Save Soviet Jewry -- Win Valuable Prizes


Re: help file: where I can get it?

2007-02-14 Thread A.J.Mechelynck

Dr. Uwe Schneider wrote:

Hi!

I have vim version 7.0 installed, but unfortunately no vim.hlp is delivered 
with the package. Where I can get vim.hlp?

Any idea?

I would appreciate to get a hint on where I can download the help file or to 
simply receive it per email attachment.

Thanx in advance!

Regards, Doc



There is no vim.hlp. The vim help is called from within Vim using

:help

or



or

:help 

The help system consists of a number of text files located in 
$VIMRUNTIME/doc/*.txt and indexed by $VIMRUNTIME/doc/tags


If you are a beginner to Vim, you can also start the "vimtutor" program, which 
should have been installed together with Vim. It accepts one optional argument 
which is a two-letter language code such as fr for French, nl for Dutch, etc. 
If it doesn't find a tutor script in the required language, or if you omit the 
language, you get the English tutor.



Best regards,
Tony.
--
Save Soviet Jewry -- Win Valuable Prizes


help file: where I can get it?

2007-02-14 Thread Dr. Uwe Schneider
Hi!

I have vim version 7.0 installed, but unfortunately no vim.hlp is delivered 
with the package. Where I can get vim.hlp?

Any idea?

I would appreciate to get a hint on where I can download the help file or to 
simply receive it per email attachment.

Thanx in advance!

Regards, Doc


Re: how to read the file created in PC in Linux correctly?

2007-02-14 Thread frank wang

Thanks for the help.

My gvim version is 7.0. The files are edited by Matlab editor. gvim
cannot automatically handle the ^M. No matter what file format I set.
The only thing to do is repleace them with

%s/\r/\r/g.


Frank

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

frank wang wrote:
> Hi,
>
> I have a lot of text files created in PC. When I open them in Linux
> using gvim, I get a lot of ^M and no line breaking. It is messy. How
> can I read the file correctly in Linux?
>
> Thanks
>
> Frank
>

   :set fileformats=dos,unix
or
   :set fileformats=dos,unix,mac

If a file has mixed ends-of-lines (CR+LF mixed with LF only) you may have to do

   :e ++ff=dos filename

and, if that isn't enough

   :1,$s/\r$//

which means

   :1  from first line
   ,$  to last line
   s/  substitute
   \r$ a ^M at end-of-line
   //  by nothing

However, ^M (CR) *alone* and _no_ linefeeds is typical of Mac rather than PC.
If 'fileformats' includes "mac" Vim should still recognise them correctly. If
it doesn't, you may try

   :e ++ff=mac filename

and if that _still_ doesn't work, you may break the line at every ^M by using

   :1,$s/\r/\r/g

(yes, replace carriage-returns by themselves, because \r in the "replace
what?" pattern matches a ^M but in the "replace by" string it breaks the line).

Once the file has been correctly read (and possibly modified), if you want to
save it in Unix format, use

   :setlocal ff=unix
   :w

(to continue editing the file) or

   :wq ++ff=unix

(to write the file and close the window).

see
   :help 'fileformats'
   :help 'fileformat'
   :help ++opt
   :help :s

Best regards,
Tony.
--
No man is an island, but some of us are long peninsulas.



Re: how to read the file created in PC in Linux correctly?

2007-02-14 Thread A.J.Mechelynck

frank wang wrote:

Hi,

I have a lot of text files created in PC. When I open them in Linux
using gvim, I get a lot of ^M and no line breaking. It is messy. How
can I read the file correctly in Linux?

Thanks

Frank



:set fileformats=dos,unix
or
:set fileformats=dos,unix,mac

If a file has mixed ends-of-lines (CR+LF mixed with LF only) you may have to do

:e ++ff=dos filename

and, if that isn't enough

:1,$s/\r$//

which means

:1  from first line
,$  to last line
s/  substitute
\r$ a ^M at end-of-line
//  by nothing

However, ^M (CR) *alone* and _no_ linefeeds is typical of Mac rather than PC. 
If 'fileformats' includes "mac" Vim should still recognise them correctly. If 
it doesn't, you may try


:e ++ff=mac filename

and if that _still_ doesn't work, you may break the line at every ^M by using

:1,$s/\r/\r/g

(yes, replace carriage-returns by themselves, because \r in the "replace 
what?" pattern matches a ^M but in the "replace by" string it breaks the line).


Once the file has been correctly read (and possibly modified), if you want to 
save it in Unix format, use


:setlocal ff=unix
:w

(to continue editing the file) or

:wq ++ff=unix

(to write the file and close the window).

see
:help 'fileformats'
:help 'fileformat'
:help ++opt
:help :s

Best regards,
Tony.
--
No man is an island, but some of us are long peninsulas.


RE: how to read the file created in PC in Linux correctly?

2007-02-14 Thread Michael Wookey
> I have a lot of text files created in PC. When I open them in Linux
> using gvim, I get a lot of ^M and no line breaking. It is messy. How
> can I read the file correctly in Linux?

There is a good discussion of this topic here:

http://www.vim.org/tips/tip.php?tip_id=26

cheers


Re: how to read the file created in PC in Linux correctly?

2007-02-14 Thread Tom Purl
You can use a third-party tool called dos2unix to convert the files. 
Also, vim has functionality that can do this, but I don't remember it
right now.

HTH!

Tom Purl

> Hi,
>
> I have a lot of text files created in PC. When I open them in Linux
> using gvim, I get a lot of ^M and no line breaking. It is messy. How
> can I read the file correctly in Linux?
>
> Thanks
>
> Frank
>




RE: how to read the file created in PC in Linux correctly?

2007-02-14 Thread Dr. Uwe Schneider
@frank wang

Which version of vim you are using?

I thought, vim can handle different "linefeeds" automatically.

Greetz, Doc

>Hi,
>
>I have a lot of text files created in PC. When I open them in Linux
>using gvim, I get a lot of ^M and no line breaking. It is messy. How
>can I read the file correctly in Linux?
>
>Thanks
>
>Frank


Re: :wq vs ZZ

2007-02-14 Thread Theerasak Photha

On 2/14/07, Matthew Winn <[EMAIL PROTECTED]> wrote:

On Tue, 13 Feb 2007 18:22:34 -0500, "Theerasak Photha"
<[EMAIL PROTECTED]> wrote:

> On 2/13/07, Gene Kwiecinski <[EMAIL PROTECTED]> wrote:
> > >I imagine there is a rationale for 'ZZ', but it's not readily
> > >apparent. (Something to do with C-z in DOS, or the end of the
> > >alphabet?)
> >
> > 'z' is already used, and the  and  keys are adjacent on
> > Murrrcan keyboards, so you can easily just quit out of the editor in
> > almost a single hand-action.
>
> I understand the ergonomic value. Mentally it doesn't make as much sense 
though.

It's supposed to make sense ergonomically, not mnemonically.


LOL, but that's what I said earlier in the thread! :)


Re: Workspace concept ala TextPad

2007-02-14 Thread Eric Leenman

Hi Yeggapan,

[...]

You can try using the workspace manager plugin:

http://vim.sourceforge.net/scripts/script.php?script_id=1410

[...]

I got it so far working.
One question.
When I give the command "af"(AddFile) in the filebuffer, the plugin comes 
with

the message "give file name" (or something like that)
Do you then need to type the complete path (i.e. 
C:\Projects\FPGA\VHDL\test.vhdl)

Or can you browse to it ?

Rgds,
Eric

_
Laugh, share and connect with Windows Live Messenger 
http://clk.atdmt.com/MSN/go/msnnkwme002001msn/direct/01/?href=http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=hmtagline




how to read the file created in PC in Linux correctly?

2007-02-14 Thread frank wang

Hi,

I have a lot of text files created in PC. When I open them in Linux
using gvim, I get a lot of ^M and no line breaking. It is messy. How
can I read the file correctly in Linux?

Thanks

Frank


[OT?] copying on a mac

2007-02-14 Thread Lev Lvovsky
Hello, I'm almost positive that this is OT, but if someone point me  
in the right direction, that would be great - I'm finding (through  
the help of vim actually), that text highlighted and copied from  
Terminal (or even X11 xterm) on OS X ends up with an extra space at  
the end of a line where there was only a new line - this happens when  
I'm ssh'd into a UNIX machine (pasting into vim while with a  
highlighted search of / *$/).


If anyone has any suggestions on how to fix/modify this behavior, it  
would be greatly appreciated!


-lev


Re: [Was :wq vs ZZ] :!start command: need to be root

2007-02-14 Thread Dr. Uwe Schneider
@Régis

> Now, I don't understand at all what this option does ...

The man page says: "This option should be used when Vim is executed by a 
program that will wait for the edit session to finish (e.g. mail)."

This means: if vim usually forks, i.e. creates a new process, another process, 
which invoked vim (e.g. mail). Suppressing the fork, the parent process can 
call wait() in order to block until vim terminates. This is not possible, if 
vim forkes away.

Greetz, Doc

>
>
>
>
>Alright, I found the solution to my problem. Albi, you gave me the idea to
>try to launch gvim from shell, so I launched:
>
>gvim filetoedit.tex
>
>and the \lv command worked, meaning gvim managed to launch kdvi. Fine.
>
>So what was happening when I was opening the file by double-clicking on it?
>gvim was executed with the -f option, meaning the file was started with the
>following command:
>
>gvim -f filetoedit.tex
>
>Here is was the man page of gvim tells us about this option :
>
>-f  Foreground.  For the GUI version, Vim will not  fork  and detach 
>from  the shell it was started in.  On the Amiga,   Vim is
>not restarted to open a new window.   This  option should  be  used  when 
>Vim is executed by a program that   will wait for the edit
>session to finish (e.g. mail).  On the Amiga the ":sh" and ":!" commands
>will not work.
>
>Now, I don't understand at all what this option does but executing gvim
>without it solves the problem. All I had to do was to tell Konqueror that
>after double-clicking on a .tex file the command gvim %U is executed.
>
>Thanks everyone
>Régis B.
>-- 
>View this message in context: 
>http://www.nabble.com/%3A%21start-command%3A-need-to-be-root-tf3226307.html#a89
>64458
>Sent from the Vim - General mailing list archive at Nabble.com.
>


Re: [Was :wq vs ZZ] :!start command: need to be root

2007-02-14 Thread Régis B .




Alright, I found the solution to my problem. Albi, you gave me the idea to
try to launch gvim from shell, so I launched:

gvim filetoedit.tex

and the \lv command worked, meaning gvim managed to launch kdvi. Fine.

So what was happening when I was opening the file by double-clicking on it?
gvim was executed with the -f option, meaning the file was started with the
following command:

gvim -f filetoedit.tex

Here is was the man page of gvim tells us about this option :

-f  Foreground.  For the GUI version, Vim will not  fork  and detach 
from  the shell it was started in.  On the Amiga,   Vim is
not restarted to open a new window.   This  option should  be  used  when 
Vim is executed by a program that   will wait for the edit
session to finish (e.g. mail).  On the Amiga the ":sh" and ":!" commands
will not work.

Now, I don't understand at all what this option does but executing gvim
without it solves the problem. All I had to do was to tell Konqueror that
after double-clicking on a .tex file the command gvim %U is executed.

Thanks everyone
Régis B.
-- 
View this message in context: 
http://www.nabble.com/%3A%21start-command%3A-need-to-be-root-tf3226307.html#a8964458
Sent from the Vim - General mailing list archive at Nabble.com.



Re: [Was :wq vs ZZ] :!start command: need to be root

2007-02-14 Thread Albie Janse van Rensburg

Régis B. wrote:



Albi, Jürgen, thank you,
you are both right: I just realised "start" is a root only specific command
in my Linux, and it is sufficient to execute :!kdvi in order to make it
work.

The reason why I asked this question is because I am trying to use
latex-suite and to view dvi compiled documents with kdvi from inside gvim
with the \lv command; it does not work (no error message) and I just can't
figure out why. So I tested the :!start kdvi, it didn't work and I inferred
this was the problem. But apparently it isn't, so I'm still scratching my
head looking for the real source of the problem.

Thanks again
Régis B.
  
Are you getting any response from executing the command at all? 

If you are running Gvim out of X, there might be (no laughing, I've seen 
this) output in the terminal from which you ran startx.   It's a long 
shot, of course.


I think the problem you are having lies with Vim's ability to pass 
commands to the shell, or accepting the commands from the shell.  We 
probably need more info regarding your setup, such as Vim version, how 
you are running Vim (terminal, X), your shell, etc.


Have you had a look at :help 'shellcmdflag' yet?  There might be 
something you need to set in that variable and associated settings.


--
Albie Janse van Rensburg (neonpill)

Registered Linux User 438873 | 


Re: [Was :wq vs ZZ] :!start command: need to be root

2007-02-14 Thread Régis B .




Albi, Jürgen, thank you,
you are both right: I just realised "start" is a root only specific command
in my Linux, and it is sufficient to execute :!kdvi in order to make it
work.

The reason why I asked this question is because I am trying to use
latex-suite and to view dvi compiled documents with kdvi from inside gvim
with the \lv command; it does not work (no error message) and I just can't
figure out why. So I tested the :!start kdvi, it didn't work and I inferred
this was the problem. But apparently it isn't, so I'm still scratching my
head looking for the real source of the problem.

Thanks again
Régis B.
-- 
View this message in context: 
http://www.nabble.com/%3A%21start-command%3A-need-to-be-root-tf3226307.html#a8962668
Sent from the Vim - General mailing list archive at Nabble.com.



Re: :!start command: need to be root

2007-02-14 Thread Albie Janse van Rensburg

Régis B. wrote:

Hello there,
I use gVim on a Linux computer (KUbuntu), and I am trying to launch a
program from inside gvim with the !start command, so for instance:

:!start kdvi
or
:!start /usr/bin/kdvi

But I get the following error:
start: need to be root
shell returned 1

So obviously I need to be root to execute commands from inside gvim, which
is extremely weird.

You guys have any idea how to solve this?

Thanks
Régis B.
  
From my help files, (:help :!start) I see that :!start is an MS 
Windows-specific command.   Check out


:help :!

for unix-specific alternatives.  You will probably have to set 
'shellcmdflag' to -ic in order to get an asyncronous shell.


Now, assuming you actually want to execute the "start" linux command:

If you have sudo installed on your system, you can execute commands as a 
different user.  So you would go:


:!sudo start kdvi

in order to run kdvi as root.  You will be prompted for the root 
password, after which kdvi will run as root.  Note that this probably 
requires running Vim in a terminal of some sort.  Remember to set 
'shellcmdflag' as needed.


You could also use an X sudo program like kdesu (more fitting, since 
you're running KDE) or gksudo, both of which use a popup dialog to 
prompt for the password.  This you can then couple with Gvim.


See

http://en.wikipedia.org/wiki/Sudo

for more detail about sudo.  Also note that an incorrectly configured 
sudo setup could be insecure.


There should also be a way, probably using piped commands, to do 
something similar with su, but I can not confirm that right now (sending 
from an XP box).


HTH

--
Albie Janse van Rensburg (neonpill)

Registered Linux User 438873 | 


Re: :!start command: need to be root

2007-02-14 Thread Jürgen Krämer

Hi,

Régis B. wrote:
> 
> I use gVim on a Linux computer (KUbuntu), and I am trying to launch a
> program from inside gvim with the !start command, so for instance:
> 
> :!start kdvi
> or
> :!start /usr/bin/kdvi
> 
> But I get the following error:
> start: need to be root
> shell returned 1
> 
> So obviously I need to be root to execute commands from inside gvim, which
> is extremely weird.
> 
> You guys have any idea how to solve this?

I don't know what the "start" command on Linux does, but would it not
suffice to execute

  :!/usr/bin/kdvi

without start?

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)


:!start command: need to be root

2007-02-14 Thread Régis B .

Hello there,
I use gVim on a Linux computer (KUbuntu), and I am trying to launch a
program from inside gvim with the !start command, so for instance:

:!start kdvi
or
:!start /usr/bin/kdvi

But I get the following error:
start: need to be root
shell returned 1

So obviously I need to be root to execute commands from inside gvim, which
is extremely weird.

You guys have any idea how to solve this?

Thanks
Régis B.
-- 
View this message in context: 
http://www.nabble.com/%3A%21start-command%3A-need-to-be-root-tf3226307.html#a8961968
Sent from the Vim - General mailing list archive at Nabble.com.



Re: 8 bit problem

2007-02-14 Thread Ulrich Lauther
> Ulrich Lauther wrote:
> > A problem with German Umlauts
> >
> > Under Linux I have modified my key map in a way that for instance ALT a
> > generates Umlaut a ("a in Tex notation).
> >
> > Now when I start vi like this:
> >
> > /usr/bin/X11 rxvt -meta8 -e vim
> >
> > I can type in Umlauts using the ALT key.
> >
> > This also worked with gvim, at least up to 6.1.88
> >
> > However, with gvim 6.3.86 it does not seem to work anymore.
> >
> > Do I need to set some option to get this functionality back?
> >
> Hi Ulrich
> 
> Have you tried looking at Vim's digraphs?
> 
> :help digraph
> 
> should tell you more.  You could imap ALT-a to :a to get an 
> umlaut a, and so forth for the other letters.  This requires that :ver 
> has +digraphs of course.
> 
yes, I could do that; but why does my approach that worked fine with older
versions of vim not work anymore?

-ulrich


Ulrich Lauther  ph: +49 89 636 48834 fx: ... 636 42284
Siemens CT SE 6 Internet: [EMAIL PROTECTED]

Siemens Aktiengesellschaft:
Vorsitzender des Aufsichtsrats: Heinrich v. Pierer;
Vorstand: Klaus Kleinfeld, Vorsitzender; Johannes Feldmayer, Joe Kaeser,
Rudi Lamprecht, Eduardo Montes, Juergen Radomski, Erich R. Reinhardt,
Hermann Requardt, Uriel J. Sharef, Klaus Wucherer
Sitz der Gesellschaft: Berlin und Muenchen
Registergericht: Berlin Charlottenburg, HRB 12300, Muenchen, HRB 6684
WEEE-Reg.-Nr. DE 23691322




Re: Paste buffer

2007-02-14 Thread Albie Janse van Rensburg

Bin Chen wrote:

Hi,

When I copy a line use yy, then I need to paste it to a line. But 
before the paste, I delete a char using 'x', the paste buffer will be 
overwriten to the deleted word. How can i avoid this?


Thanks.
ABAI


When you use y to copy data, it is usually stored in the unnamed buffer 
AS WELL AS buffer 0.  So you will still be able to paste the yanked data 
using 0p (or in insert mode, ^r0 - that is, ctrl+r; 0)


--
Albie Janse van Rensburg (neonpill)

Registered Linux User 438873 | 


Re: :wq vs ZZ

2007-02-14 Thread Matthew Winn
On Tue, 13 Feb 2007 18:22:34 -0500, "Theerasak Photha"
<[EMAIL PROTECTED]> wrote:

> On 2/13/07, Gene Kwiecinski <[EMAIL PROTECTED]> wrote:
> > >I imagine there is a rationale for 'ZZ', but it's not readily
> > >apparent. (Something to do with C-z in DOS, or the end of the
> > >alphabet?)
> >
> > 'z' is already used, and the  and  keys are adjacent on
> > Murrrcan keyboards, so you can easily just quit out of the editor in
> > almost a single hand-action.
> 
> I understand the ergonomic value. Mentally it doesn't make as much sense 
> though.

It's supposed to make sense ergonomically, not mnemonically.

When starting to use a new product you learn the keys once and use
them many times. The vi approach was to make the useful commands easy
to type rather than easy to remember, hence hjkl to move the cursor
instead of ldur, and ZZ to save changes. Once you've learned the
keys there's no longer any advantage to mnemonics so why punish your
fingers with unnecessarily awkward keystrokes?

(Looking over the keyboard and seeing that just about every key has a
useful function, it seems to me that the ultimate goal of vi evolution
is for a cat to be able to walk across a keyboard and type nothing but
valid editing commands.)

-- 
Matthew Winn


RE: Paste buffer

2007-02-14 Thread Dr. Uwe Schneider
Bin,

there are (at least) two solutions I know:

  a) yank line to a named buffer ("xyy), put named buffer later ("xp)
  b) delete the char into the Null-buffer ("_x), thus avoiding to overwrite the 
yank buffer

Enjoy!

Greetz, Doc

>Hi,
>
>When I copy a line use yy, then I need to paste it to a line. But before 
>the paste, I delete a char using 'x', the paste buffer will be 
>overwriten to the deleted word. How can i avoid this?
>
>Thanks.
>ABAI


Paste buffer

2007-02-14 Thread Bin Chen

Hi,

When I copy a line use yy, then I need to paste it to a line. But before 
the paste, I delete a char using 'x', the paste buffer will be 
overwriten to the deleted word. How can i avoid this?


Thanks.
ABAI