Netrw: open multiple directories on startup

2007-03-17 Thread Gregory Margo
Netrw can have several directories browsing sessions active at once
if I open them separately.

However, if I use the "-o" option, like
   cd /path/to/vimsource//vim70/
   vim -o libs runtime src
then it does not work as I expect.

I get three open buffers, one says "Scratch" and is the directory
listing for the libs/ directory, but the next two buffers are called "libs"
and are blank.  If I move into those buffers then each buffer
fills out with the same libs/ directory listing.

Obviously not what I want - I want three directory browsers
each in it's own directory.  Is there some way I can make this happen?
I apologize if this has been covered before and I missed it.
I'm using netrw v108l.

thanks
gm


-- 
+
Gregory H. Margo
gmargo at yahoo/com, gmail/com, pacbell/net; greg at margofamily/org


Is the mailing list subscription mechanism broken?

2006-12-28 Thread Gregory Margo
I've been trying to subscribe to both the vim & vim-dev mailing lists
from a different address (to escape the extremely unreliable 
pacbell/sbc/att mail servers).  I get a confirmation message back
right away, but after replying to that, I never receive either a 
"welcome to the list" message or any list messages.

Is the mailing list subscription mechanism broken?

thanks,
gm

-- 
+
Gregory H. Margo
gmargo at yahoo/com, gmail/com, pacbell/net; greg at margofamily/org


Re: error reading from stdin, vim 7.0.164

2006-11-22 Thread Gregory Margo
On Tue, Nov 21, 2006 at 09:34:45AM -0500, Adam Mercer wrote:
> On 21/11/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:
> >In the latest vim (7.0.164), I am getting "error reading
> >from stdin":
> >ls | vim -u NONE -
> >
> >Vim: Reading from stdin...
> >Vim: Error reading input, exiting...
> 
> Works fine for me on Mac OS X, as in is opens a vim session with the
> listing of the current directory in the current buffer.
> 

Also works fine for me on Debian Stable i386.
I tried 7.0.164 and 7.0.168.

-- 
+
Gregory H. Margo


Re: substitude, write and close with one command

2006-10-16 Thread Gregory Margo
Most commands may be separated by a vertical bar (|), see :help :bar
This will do what you want:
:s/a/b/g | w | q

On Mon, Oct 16, 2006 at 01:34:31PM +0100, Tomas Lovetinsky wrote:
> Hi,
> I would like to ask you for help with my problem. I think it is simple but 
> in fact I'm not able to find the solution as quickly as I need.
> I need to do sometink like
> :s/a/b/g :wq
> It means to substitute, write and close file.
> 
> Is there any solution?
> 
> Thank you all in advance
> 
> Tomas Lovetinsky

-- 
+
Gregory H. Margo
gmargo at yahoo/com, gmail/com, pacbell/net; greg at margofamily/org


Re: how to detect c99 vs c89 (//-comments vs /*-comments)

2006-06-21 Thread Gregory Margo
Sorry for my misunderstanding.  You comment just rang a bell with me.
There have been times when I was working with dreaded emacs users,
and wanted to use one modeline section that covered both vim and emacs,
but could never figure out the emacs side.

gm

On Wed, Jun 21, 2006 at 08:57:25AM -0600, Russell Bateman wrote:
> Ah, pardon me, I didn't say I had one that covered all three editors, 
> only that I respected the right of non-Vim users not to have to look at 
> my Vim modeline which I put at the bottom.
> 
> Gregory Margo wrote:
> >For my own future reference, could you post an example of your modeline
> >footer that covers all three editors?
> >
> >thanks,
> >gm
> >
> >On Wed, Jun 21, 2006 at 07:48:26AM -0600, Russell Bateman wrote:
> >  
> >>We keep hearing about how placing a modeline at the top of the file...
> >>
> >>Because I work in a multitabbed environment (i.e.: there are more than 
> >>one tab standard), I have to use a modeline to sort out tabstop and 
> >>shiftwidth. I put this modeline AT THE BOTTOM of my file where it works 
> >>just fine and doesn't interfere with the copyright header or anything 
> >>else going on at the top. As there are also emacs and VSE consumers of 
> >>these same files, anything Vim-only would constitute an affront to them 
> >>(the little bastards, hehehe).
> >>
> >>Just wanted to go on record about how a modeline can be placed at the 
> >>bottom or the top of a file.
> >>
> >>Thanks,
> >>
> >>Russ
> >>
> >>
> >>Mike Williams wrote:
> >>
> >>>Hi,
> >>>
> >>>In general you cannot detect which version of the standard some C has 
> >>>been written against since C89 code should still compile with a C99 
> >>>compiler.  There are new keywords, but some developers use macros to 
> >>>emulate C99 like features in C89 code.  Your best bet is a mode line, 
> >>>possible a good ol' human one as a comment at the top of the file - /* 
> >>>This file developed against C99/C89 [delete as applicable] */ - so 
> >>>that the code is self documenting, and it can be picked up by VIM on 
> >>>loading to set whatever settings you want.
> >>>
> >>>
> >>>While not helping with detecting whether C source is C89 or C99, my 
> >>>alternate C syntax file helps with developing portable C for a 
> >>>particular C standard.
> >>>
> >>>http://www.vim.org/scripts/script.php?script_id=234
> >>>
> >>>
> >>>
> >>>TTFN
> >>>
> >>>Mike
> >>>  
> >
> >  

-- 
+
Gregory H. Margo
gmargo at yahoo/com, gmail/com, pacbell/net; greg at margofamily/org


Re: how to detect c99 vs c89 (//-comments vs /*-comments)

2006-06-21 Thread Gregory Margo
For my own future reference, could you post an example of your modeline
footer that covers all three editors?

thanks,
gm

On Wed, Jun 21, 2006 at 07:48:26AM -0600, Russell Bateman wrote:
> We keep hearing about how placing a modeline at the top of the file...
> 
> Because I work in a multitabbed environment (i.e.: there are more than 
> one tab standard), I have to use a modeline to sort out tabstop and 
> shiftwidth. I put this modeline AT THE BOTTOM of my file where it works 
> just fine and doesn't interfere with the copyright header or anything 
> else going on at the top. As there are also emacs and VSE consumers of 
> these same files, anything Vim-only would constitute an affront to them 
> (the little bastards, hehehe).
> 
> Just wanted to go on record about how a modeline can be placed at the 
> bottom or the top of a file.
> 
> Thanks,
> 
> Russ
> 
> 
> Mike Williams wrote:
> >Hi,
> >
> >In general you cannot detect which version of the standard some C has 
> >been written against since C89 code should still compile with a C99 
> >compiler.  There are new keywords, but some developers use macros to 
> >emulate C99 like features in C89 code.  Your best bet is a mode line, 
> >possible a good ol' human one as a comment at the top of the file - /* 
> >This file developed against C99/C89 [delete as applicable] */ - so 
> >that the code is self documenting, and it can be picked up by VIM on 
> >loading to set whatever settings you want.
> >
> >
> >While not helping with detecting whether C source is C89 or C99, my 
> >alternate C syntax file helps with developing portable C for a 
> >particular C standard.
> >
> >http://www.vim.org/scripts/script.php?script_id=234
> >
> >
> >
> >TTFN
> >
> >Mike

-- 
+
Gregory H. Margo
gmargo at yahoo/com, gmail/com, pacbell/net; greg at margofamily/org


Re: how to detect c99 vs c89 (//-comments vs /*-comments)

2006-06-20 Thread Gregory Margo
I can confirm that Yakov is correct; the // is allowed in C99, and not
in the older standard.

FYI, the C99 standard (ISO/IEC 9899-1999) is available on Amazon or
Bookpool, and probably other sites, for about $75 list.

http://www.amazon.com/gp/product/0470845732/ref=sr_11_1/102-4132906-9254519?%5Fencoding=UTF8
http://www.bookpool.com/sm/0470845732

I don't know if the older standard (ANSI X3.159-1989) is still available 
anywhere.
It's a shame really.  Everyone should have it right next to the K&R.

In the end though, IMHO, if you're writing C code you should use the
/**/ syntax.  If you have a choice, always code for maximum portability
and maintainability.

gm

On Tue, Jun 20, 2006 at 10:02:09AM -0600, Russell Bateman wrote:
> You know, I worked with this formally for years, but it's not impossible 
> that I missed something.
> 
> The last time I looked at the spec (and I no longer have access to one 
> because I've changed jobs and companies and the thing costs about $250), 
> it seemed to me that it was in the C++ part of the document.  I am 
> certain of the "strict ANSI compliance" thing because I demonstrated it 
> to myself  once when it was important to be strictly ANSI compliant in 
> something I was doing (unless things have changed with recent compiler 
> versions). Here, where I work now, we're strictly ANSI compliant and 
> that includes no C++ style comments, but truly, I haven't tested that 
> assertion since I'd get crucified if I did. Maybe I'll try it before 
> checking something in.
> 
> Russ
> 
> Yakov Lerner wrote:
> >On 6/20/06, Russell Bateman <[EMAIL PROTECTED]> wrote:
> >>Formally speaking, C99 (ISO/IEC 9899:1999) still refers to "ANSI C"
> >>which does not tolerate the C++ style comment operator.
> >
> >In the draft standard c99 (*1), 6.4.9.2, page 66, // is
> >defined as a comment.
> >
> >Is this something that was changed/removed
> >from the final standard ?
> >
> >Yakov
> >
> >(*1) http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1124.pdf
> >
> >>Yakov Lerner wrote:
> >>> Some C sources that I have are c99, other are c89.
> >>>
> >>> The c99 sources can use //-style comments.
> >>> The c89 sources can use only /**/-style comments.
> >>>
> >>> I'd like to have my "commentify" macro to
> >>> use // in c99 sources, and /**/ in c89 sources.
> >>>
> >>> But how to tell those two types apart ? Any ideas ?
> >>> I'm thinking about searching the file for pre-existing //.
> >>> That's crude but I can't think of anything else.
> >>> What would be good method to detect c99 vs c89 ?
> >>>
> >>> Yakov
> >>>
> >>>
> >>
> >>
> >
> >

-- 
+
Gregory H. Margo
gmargo at yahoo/com, gmail/com, pacbell/net; greg at margofamily/org


Re: How to use customized function in statusline?

2006-06-14 Thread Gregory Margo
On Wed, Jun 14, 2006 at 05:20:50PM +0800, Edward L. Fox wrote:
> Hi VIMmers,
> 
> According to the user manual ":h statusline", we should be able to
> evaluate a customized function to generate the statusline text:
> 
>  8< 
>When the option starts with "%!" then it is used as an expression,
>evaluated and the result is used as the option value.  Example:
>:set statusline=%!MyStatusLine()
> The result can contain %{} items that will be evaluated too.
>  8< 
> 
> But...
> 
>  8< 
> :function! MyStatusLine()
> :return 'test'
> :endfunction
> :set statusline=%!MyStatusLine()
>  8< 
> 
> VIM complains:
> 
> E539: Illegal character : statusline=%!MyStatusLine()
> 
> What seems to be the matter?
> 
> 
> Regards,
> 
> 
> Edward L. Fox


Looks like a bug to me.  The code to evaluate the "%!" is in
there but the option processing rejects the statusline with a
bang(!) in it.

This is probably not the best patch to the source, but it allows
the statusline string to make it through the option check:


--- src/option.h.00 2006-04-24 06:20:49.0 -0700
+++ src/option.h2006-06-14 07:46:06.845082413 -0700
@@ -282,7 +282,7 @@
 #define STL_HIGHLIGHT  '#' /* highlight name */
 #define STL_TABPAGENR  'T' /* tab page label nr */
 #define STL_TABCLOSENR 'X' /* tab page close nr */
-#define STL_ALL((char_u *) "fFtcvVlLknoObBrRhHmYyWwMpPaN{#")
+#define STL_ALL((char_u *) "fFtcvVlLknoObBrRhHmYyWwMpPaN{#!")
 
 /* flags used for parsed 'wildmode' */
 #define WIM_FULL   1



Alternatively, if your status line function is returning a string and
not another status line to be evaluated, you could use:

:set statusline=%{MyStatusLine()}


gm
-- 
+
Gregory H. Margo
gmargo at yahoo/com, gmail/com, pacbell/net; greg at margofamily/org


Re: Goto file under cursor with line number

2006-06-02 Thread Gregory Margo
On Fri, Jun 02, 2006 at 12:08:42PM +0530, Srinivas Rao. M wrote:
> Hello vimmers,
>I want to know if there is a way i can use 'gf' command to goto the
> file under the cursor, which is having the 
> 
> I have a string under my cursor as :
> 
> somefile.c:1022
> 
> Where the field after ':' is the line number. Can i use the 'gf' command
> to goto that line number of that file. Assume that somefile.c's folder
> is added to "path" variable.
> 
> 
> Thanks,
> srini...

I posted a function to do this back in 2004.  It respects the 'path'
variable and overrides 'gf', '^Wf', '^W^F'.  Here's an archive link:

http://marc.theaimsgroup.com/?l=vim&m=108273507828349&w=2

-- 
+
Gregory H. Margo
gmargo at yahoo/com, gmail/com, pacbell/net; greg at margofamily/org


Re: Syntax Highlighting: Vim 7, perl not working

2006-05-30 Thread Gregory Margo
On Tue, May 30, 2006 at 07:21:47PM -0400, Jack Donohue wrote:
> Just started using vim7, quite happy so far.  Major problem is that syntax 
> highlighting doesn't work for *.pl files.
> 
> I see filetype=conf rather than perl, which I don't understand.
> 
> Here are the scripts loaded:
> 
>  1: c:/vim/_vimrc
>  2: c:/vim/vimfiles/plugin/SpellChecker.vim
>  3: c:/vim/vimfiles/plugin/ccase.vim
>  4: c:/vim/vimfiles/plugin/closetag.vim
>  5: c:/vim/vimfiles/plugin/matchit.vim
>  6: c:/vim/vimfiles/plugin/mru.vim
>  7: c:/vim/_vim_mru_list
>  8: c:/vim/vimfiles/plugin/taglist.vim
>  9: c:/vim/vimfiles/plugin/TagsMenu.vim
> 10: c:/vim/vim70/plugin/getscript.vim
> 11: c:/vim/vim70/plugin/gzip.vim
> 12: c:/vim/vim70/plugin/matchparen.vim
> 13: c:/vim/vim70/plugin/netrwPlugin.vim
> 14: c:/vim/vim70/plugin/rrhelper.vim
> 15: c:/vim/vim70/plugin/spellfile.vim
> 16: c:/vim/vim70/plugin/tarPlugin.vim
> 17: c:/vim/vim70/plugin/tohtml.vim
> 18: c:/vim/vim70/plugin/vimballPlugin.vim
> 19: c:/vim/vim70/plugin/zipPlugin.vim
> 20: c:/vim/vim70/menu.vim
> 21: c:/vim/vim70/autoload/paste.vim
> 22: c:/vim/_gvimrc
> 23: c:/vim/abbreviations.vim
> 24: c:/vim/vim70/syntax/syntax.vim
> 25: c:/vim/vim70/syntax/synload.vim
> 26: c:/vim/vim70/syntax/syncolor.vim
> 27: c:/vim/vim70/filetype.vim
> 28: c:/vim/vim70/ftplugin.vim
> 29: c:/vim/vim70/indent.vim
> 30: c:/vim/jmd.vim
> 31: c:/vim/vim70/syntax/perl.vim
> 32: c:/vim/vimfiles/ftplugin/perl_jmd.vim
> 33: c:/vim/vim70/ftplugin/perl.vim
> 34: c:/vim/vim70/indent/perl.vim
> 35: c:/vim/vim70/scripts.vim
> 36: c:/vim/vim70/syntax/conf.vim
> 37: c:/vim/vim70/ftplugin/conf.vim
> 38: c:/vim/vim70/autoload/netrw.vim
> 39: c:/vim/vim70/syntax/netrw.vim
> 40: c:/vim/vim70/syntax/html.vim
> 41: c:/vim/vim70/syntax/javascript.vim
> 42: c:/vim/vim70/syntax/vb.vim
> 43: c:/vim/vim70/syntax/css.vim
> 44: c:/vim/vimfiles/ftplugin/html.vim
> 45: c:/vim/vimfiles/ftplugin/htm.vim
> 46: c:/vim/vimfiles/ftplugin/html_jmd.vim
> 47: c:/vim/vim70/ftplugin/html.vim
> 48: c:/vim/vim70/indent/html.vim
> 49: c:/vim/vim70/ftplugin/javascript.vim
> 50: c:/vim/vim70/syntax/help.vim
> 51: c:/vim/vim70/ftplugin/help.vim
> 
> Anything there that could be causing problems?
> 
> Thanks,
> 
> 
> Jack

Do you have a variable "g:filetype_pl" set?  If so, this overrides the
filetype default for perl.  See ":help filetype-overrule", and
filetype.vim.

-- 
+
Gregory H. Margo
gmargo at yahoo/com, gmail/com, pacbell/net; greg at margofamily/org


Re: Syntax Highlighting: Vim 7, Debian

2006-05-30 Thread Gregory Margo
On Tue, May 30, 2006 at 02:44:17PM -0400, Chisum Lindauer wrote:
> Hello all I've just worked on trying to get this to work a few hours 
> with no luck, so I thought I'd consult the community.
> 
> In short, my syntax highlighting doesn't work.  Not in vim or vim 
> -g/gvim.  I've tried the easy things like :snytax enable or :syntax on 
> and manually loading a colorscheme but to no effect.
> I recently did an apt-get upgrade which broke my X install.
> Once I had fixed that and returned to the world of GUI's I found my 
> syntax highlighting didn't work.  The color test shows all the colors 
> properly however. (Select it from the syntax menu in gvim).
> At first I thought it might be because of my terminal, but changing that 
> using tset and/or setting my TERM environment variable to xterm-color 
> helped not in the least.  It's not just a color problem anyhow, as bold 
> and italics don't work on syntax either.  It's not a colorscheme bug 
> either, as I've tried using several colorschemes and get the same 
> results (though it will change the bgcolor an fgcolor in gvim).
> 
> I tried removing and reinstalling gvim as well, but the problem 
> persists.  Needless to say, now that I'm used to syntax highlighting 
> being without it feels like losing an arm.
> 
> The only error message I've ever seen regarding the syntax is when I 
> opened up gvim and select on/off for This file under the syntax menu, it 
> tells me that my colorscheme can not be found when parsing 
> syntax/synload.vim.  This error doesn't happen except when I first load 
> vim, and only if I don't change the colorscheme before hand.  This might 
> be a clue for someone, but probably not.
> 
> Also if I log into our server ssh -X and use gvim over the network, 
> syntax highlighting does work, of course, that doesn't say a damn thing 
> either.  It just makes me think that it's probably a configuration file 
> of some sort...
> 
> I hope someone has an idea, I sure as hell don't.
> Thanks,
> Chisum Lindauer

If you have both vim-6 and vim-7 installed, there may be a conflict,
especially if you try to share a ~/.vim directory.  I'm running under
Debian Stable, and have the default vim-6.3.82 installed, and have a
locally compiled vim-7.0.15 installed also (with binary name 'vim7').
Syntax highlighting works find under either.  However,
I've kept them seperated with different .vimrc files, and different
'runtimepath' variables.

Try this: in an xterm (version 4.3.0.dfsg.1-14sarge1) run
"/path/to/your/vim7 -u NONE".

Now type ":help" - you should see black-n-white help text.
Now type ":syntax on" - you should see the help with syntax highlighting.

If does not work, it could be the color settings of the xterm itself.

Since you mentioned breaking your X setup, could it be that you're
running a bleeding edge Debian Unstable (etch) system?

-- 
+
Gregory H. Margo
gmargo at yahoo/com, gmail/com, pacbell/net; greg at margofamily/org