Re: RFE: :amap and :menu buffer

2006-11-10 Thread Benji Fisher
On Thu, Nov 09, 2006 at 12:37:48PM -0700, Christian J. Robinson wrote:
 On Thu, 9 Nov 2006, Bram Moolenaar wrote:
 
  buffer-local menus are complicated.  What about menus that are not
  for the current buffer, hide them?  Would make jumping between
  buffers very slow.
 
 When I've defined menus that are only applicable to a buffer or a
 filetype I've just defined autocommands that does an :amenu disable on
 BufLeave and :amenu enable on BufEnter.  I've found this is usually
 the best compromise and in fact has some advantages; it can be
 confusing and otherwise problematic to have menu items, or entire
 menus--especially toplevel menus--disappear and reappear.
 
 - Christian

 Thanks.  I had forgotten about the :menu disable option.  The
disadvantage is that if I have several different file types open, each
with its own top-level menu, then my menu bar will be crowded with
disabled menus.

--Benji Fisher


Re: ftp'n'patch'n'compile'n'install-script ???

2006-11-10 Thread Yakov Lerner

On 11/10/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:

From: Yakov Lerner [EMAIL PROTECTED]
Subject: Re: ftp'n'patch'n'compile'n'install-script ???
Date: Fri, 10 Nov 2006 13:53:44 +0200

 On 11/10/06, Yakov Lerner [EMAIL PROTECTED] wrote:
  On 11/10/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
   Hi,
  
is there a script around, which downloads the newest patches for vim,
unpack the source (located on my pc), patch the source, build a new
archive for the next time including handling the downloaded patches,
compiles the source and installs the results ?
  
Or a part of that ?
  
Thanks a lot for any help in advance!
Keep editing ! :)
mcc
 
  Try
  http://www.vim.org/scripts/script.php?script_id=1473
  vim7-install.sh : {download + build + install} latest vim7 from svn
  sources in 1 command
  Regarding thr apply patches part, I 'm working on adding the pathing
  functionality. It's not in yet.

 Actually, re-reading your mail, I thik that you meant latest Bram's patches,
 not the external patches. Then I need to correct my previous answer:
 This script,  vim7-install.sh, applies all Bram's patches, up to the
 last an the latest, automatically. This script uses better download
 method than ftp. Namely, it
 uses svn (it's the default method) or cvs (with option -svc).

 When I said I 'm working on adding the 'patching' functionality. It's
 not in yet',
 I meant adding of external patches. But the Bram's patches are included
 automatically by the vim7-install.sh, this is non-optional.

 Yakov


Hi Yakov,

 thanks a lot for your fast replies ! :))

 You confuses me ! ;) ;) ;) ;)  --- Very *BIG* smilies !

 Means:
 The only way to keep my vim uptodate, I know,is to download the
 patches from ftp://ftp.vim.org/pub/vim/patches/7.0/. and apply
 those...


Oh no, this is not the only method.
When you download sources from svn or cvs, you get already patched
sources (all patches applied). This is what  vim7-install.sh does for you,
plus build and install, all in one command.
This is why svn or cvs is much easier method of getting up-to-date
sources than ftp.

BTW early version of vim7-install.sh indeed used ftp and applied
patched one-by-one. This worked, but much slower than svn/cvs.


 Now it seems, that -- before doing anything else -- I have to update
 myself to the newest version of How to update vim. ;)

 Is this correct (?)  :

 correct
  |
  V
 [ ]  The patches I used to use (see above) are called Bram's patches

correct

 [ ]  External patches are patches from any other developper other
  than Bram.

correct

 [ ]  Getting patches from svn instead of the source described above
  (ftp) are not seperated in files.

when you download sources from svn or cvs, you get already patched
sources (all patches applied)
This is why svn or cvs is much easier method of getting up-to-date
sources than ftp.

Yakov


Re: ftp'n'patch'n'compile'n'install-script ???

2006-11-10 Thread Meino Christian Cramer
From: Yakov Lerner [EMAIL PROTECTED]
Subject: Re: ftp'n'patch'n'compile'n'install-script ???
Date: Fri, 10 Nov 2006 14:17:05 +0200

 On 11/10/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
  From: Yakov Lerner [EMAIL PROTECTED]
  Subject: Re: ftp'n'patch'n'compile'n'install-script ???
  Date: Fri, 10 Nov 2006 13:53:44 +0200
 
   On 11/10/06, Yakov Lerner [EMAIL PROTECTED] wrote:
On 11/10/06, Meino Christian Cramer [EMAIL PROTECTED] wrote:
 Hi,

  is there a script around, which downloads the newest patches for vim,
  unpack the source (located on my pc), patch the source, build a new
  archive for the next time including handling the downloaded patches,
  compiles the source and installs the results ?

  Or a part of that ?

  Thanks a lot for any help in advance!
  Keep editing ! :)
  mcc
   
Try
http://www.vim.org/scripts/script.php?script_id=1473
vim7-install.sh : {download + build + install} latest vim7 from svn
sources in 1 command
Regarding thr apply patches part, I 'm working on adding the pathing
functionality. It's not in yet.
  
   Actually, re-reading your mail, I thik that you meant latest Bram's 
   patches,
   not the external patches. Then I need to correct my previous answer:
   This script,  vim7-install.sh, applies all Bram's patches, up to the
   last an the latest, automatically. This script uses better download
   method than ftp. Namely, it
   uses svn (it's the default method) or cvs (with option -svc).
  
   When I said I 'm working on adding the 'patching' functionality. It's
   not in yet',
   I meant adding of external patches. But the Bram's patches are included
   automatically by the vim7-install.sh, this is non-optional.
  
   Yakov
  
 
  Hi Yakov,
 
   thanks a lot for your fast replies ! :))
 
   You confuses me ! ;) ;) ;) ;)  --- Very *BIG* smilies !
 
   Means:
   The only way to keep my vim uptodate, I know,is to download the
   patches from ftp://ftp.vim.org/pub/vim/patches/7.0/. and apply
   those...
 
 Oh no, this is not the only method.
 When you download sources from svn or cvs, you get already patched
 sources (all patches applied). This is what  vim7-install.sh does for you,
 plus build and install, all in one command.
 This is why svn or cvs is much easier method of getting up-to-date
 sources than ftp.
 
 BTW early version of vim7-install.sh indeed used ftp and applied
 patched one-by-one. This worked, but much slower than svn/cvs.
 
   Now it seems, that -- before doing anything else -- I have to update
   myself to the newest version of How to update vim. ;)
 
   Is this correct (?)  :
 
   correct
|
V
   [ ]  The patches I used to use (see above) are called Bram's patches
 correct
   [ ]  External patches are patches from any other developper other
than Bram.
 correct
   [ ]  Getting patches from svn instead of the source described above
(ftp) are not seperated in files.
 when you download sources from svn or cvs, you get already patched
 sources (all patches applied)
 This is why svn or cvs is much easier method of getting up-to-date
 sources than ftp.
 
 Yakov
 

TADA ! ENLIGHTMENT ! :O)

Thanks a lot Yakov! That helps me !

Keep editing!
mcc




set backupext dynamicly

2006-11-10 Thread Eric Leenman

Hi,

I'm new to programming in vim scripts.
I understand from scripts that you can say
set backupext=eric

Is it possible to set backupext dynamicly?
for example the current time?

something like:
string time = 'current-time'  (which changes every second)
set backupext=*time

Rgds,
Eric

_
Get today's hot entertainment gossip  
http://movies.msn.com/movies/hotgossip?icid=T002MSN03A07001




Re: Recall home drive

2006-11-10 Thread Yakov Lerner

On 11/10/06, Eric Leenman [EMAIL PROTECTED] wrote:

Hi

How do I recall my home drive?
When I now tell g:backup_directory=\\temp\\vim_backup
it creates the drive on U: and I would expect C:


You do it by writing:
let g:backup_directory=C:\\temp\\vim_backup

Yakov


Fwd: set backupext dynamicly

2006-11-10 Thread Yakov Lerner

On 11/10/06, Eric Leenman [EMAIL PROTECTED] wrote:

Is it possible to set backupext dynamicly?
for example the current time?


Yes, ':help backupext' contains exactly such example:

   :au BufWritePre * let bex = '-' . strftime(%Y%b%d%X) . '~'

- :help backupext

Yakov


Re: Recall home drive

2006-11-10 Thread Eric Leenman

I then get the following messages

E739: Cannot create directory: U:\/C:\temp
E739: Cannot create directory: U:\/C:\temp\vim_backup

[...]

You do it by writing:
let g:backup_directory=C:\\temp\\vim_backup

Yakov


_
Try the next generation of search with Windows Live Search today!  
http://imagine-windowslive.com/minisites/searchlaunch/?locale=en-ussource=hmtagline




Re: Ctrl-D delete mapping

2006-11-10 Thread A.J.Mechelynck

Jürgen Krämer wrote:

Hi,

Allan Kelly wrote:

Hello, I'd like Ctrl-D to delete a character in insert mode. This does not
work (Ctrl-D continues to do the page down thing):


that might be because you were not in insert mode. the page down thing
is VIM's behaviour when pressing Ctrl-D in normal mode. Ctrl-D in insert
mode should remove one shiftwidth of indent.


Imap Ctrl-D Ctrl-ox

Any ideas?


Did you really write Imap with an upper case I? You should write it
with a lower case i.

Regards,
Jürgen



... and in addition to that, in a mapping you should use C-D and C-O. The 
way you did it, and assuming that you used a lowercase i in imap, the 
sequence less-than uppercase-C-for-Charlie lowercase-t-for-Tango 
lowercase-r-for-Romeo lowercase-l-for-Lima dash-or-minus uppercase-D-for-Delta 
greater-than (eight characters) gets mapped to less-than 
uppercase-C-for-Charlie lowercase-t-for-Tango lowercase-r-for-Romeo 
lowercase-l-for-Lima dash-or-minus uppercase-O-for-Oscar greater-than 
lowercase-x-for-X-ray (nine characters).



Best regards,
Tony.


Re: Recall home drive

2006-11-10 Thread A.J.Mechelynck

Eric Leenman wrote:

Hi

How do I recall my home drive?
When I now tell g:backup_directory=\\temp\\vim_backup
it creates the drive on U: and I would expect C:

Rgds,
Eric


How do you define the home drive?

If it's the first hard drive, then it's C:

If it's the drive containing the Vim distribution, then it is 
fnamemodify(expand($VIMRUNTIME),:p)[0:1]


Similarly with $HOME instead of $VIMRUNTIME for the drive containing your home 
directory.


All this on Dos-like operating systems *only* .

Or you might want to use a different environment variable and do simply

:let g:backup_directory = $TEMP . '\vim_backup'

assuming of course that $TEMP is nonempty.


Best regards,
Tony.


Re: set backupext dynamicly

2006-11-10 Thread Jürgen Krämer

Hi,

Eric Leenman wrote:
 I've tried it but then I get the message :
 Error E510 'Can't backup file (add! to override)
 
 
 
 I have a clean gvim70.exe downloaded today.
 I've added two lines to my _vimrc, see below for the complete file.
 Do I need to do something with backup and write backup?
 
 [start _vimrc]
 set nocompatible
 source $VIMRUNTIME/vimrc_example.vim
 source $VIMRUNTIME/mswin.vim
 behave mswin
 
 set bdir=$VIM/backup
 let bex = '-' . strftime(%Y%b%d%X) . '~'
 [end _vimrc]

%X as part of the strftime parameter generates a time stamp like
14:51:23, but colons are invalid in Windows file names. Better use
something like this:

  let bex = '-' . strftime(%Y%m%d%H%M%S) . '~'

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)


Re: set backupext dynamicly

2006-11-10 Thread A.J.Mechelynck

Eric Leenman wrote:

I've tried it but then I get the message :
Error E510 'Can't backup file (add! to override)



I have a clean gvim70.exe downloaded today.
I've added two lines to my _vimrc, see below for the complete file.
Do I need to do something with backup and write backup?

[start _vimrc]
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin



 Disclaimer: the following is untested
 -
if ! isdirectory($VIM . '/backup')
silent! !mkdir $VIM/backup
if ! isdirectory($VIM . '/backup')
echoerr Backup directory does not exist
\   and cannot be created
endif
endif


set bdir=$VIM/backup
let bex = '-' . strftime(%Y%b%d%X) . '~'
[end _vimrc]


'backupext' is here set to the date-time when the vimrc was sourced. If a file 
is edited and saved several times in a single session, all backups will (IIUC) 
overwrite one another.






For now I've used gvim63.exe
There I used tip 892 (http://www.vim.org/tips/tip.php?tip_id=892)
But this doesn't work anymore in 6.4 and 7.0
I'm trying to get this backup options functional in 7.0 again, but until 
now unsuccesfull.





Best regards,
Tony.


Re: set backupext dynamicly

2006-11-10 Thread Eric Leenman

Thank you all,

This does the trick.
[...]


%X as part of the strftime parameter generates a time stamp like
14:51:23, but colons are invalid in Windows file names. Better use
something like this:

  let bex = '-' . strftime(%Y%m%d%H%M%S) . '~'

Regards,
Jürgen

[...]

_
Stay in touch with old friends and meet new ones with Windows Live Spaces 
http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=createwx_url=/friends.aspxmkt=en-us




Getting matchit to work on html

2006-11-10 Thread Doug Carter

Hi all,

I changed distros and now I can't get matchit to work on html files.
I've spent hours on the net and in help files and have had no success.

Can someone send me some example .vimrc settings to get this working?

I'm currently running vim 6.3 on CentOS.

TIA,

Doug



Re: Creating a custom browser window.

2006-11-10 Thread Alan Young

No idea what a Blogger entails, but since you mention perl, vim and the net, 
take a look at:
http://www.vim.org/scripts/script.php?script_id=1053


Thank you.  I'll see what I can glean from it.

FYI, I hate blogger.com's interface so I'm writing my own in vim.
That's what I mean by blogger.
--
Alan


Re: Getting matchit to work on html

2006-11-10 Thread Doug Carter

Tony,

I have already corrected the problem (thanks to Paul Bolle who's on 
this list).

The *only* thing I needed to do was add:

filetype plugin on

to my .vimrc file.

No copying files, creating directories, sourcing plugins, just this line.

I can't believe this isn't an FAQ. It's either my disto default settings
or there's not too many people using this functionality.

Thanks a lot for your complete explanation below. It's a good reference
for future configuration changes.

Best,

Doug


On Fri, Nov 10, 2006 at 05:44:00PM +0100, A.J.Mechelynck wrote:
 Doug Carter wrote:
 Hi all,
 
 I changed distros and now I can't get matchit to work on html files.
 I've spent hours on the net and in help files and have had no success.
 
 Can someone send me some example .vimrc settings to get this working?
 
 I'm currently running vim 6.3 on CentOS.
 
 TIA,
 
 Doug
 
 
 
 Normally the following are enough (replace .vim by vimfiles and possibly 
 .vimrc by _vimrc on non-Unix-like platforms)
 
 Notes:
 1. I recommend upgrading to version 7.0 (current patchlevel is 7.0.162). In 
 that case the $VIMRUNTIME directory will of course be $VIM/vim70 instead of 
 $VIM/vim63. You might also get a newer version of matchit in the process: 
 current version is (AFAIK) version 1.11 dated May 15 10:00 PM 2006 EDT.
 2. If $VIM is undefined in your shell (which is the normal case) replace it 
 by whatever it would be inside Vim (typically something like 
 /usr/local/share/vim on Unix, C:\Program Files\vim on Windows, etc.)
 
 - ~/.vim/plugin/matchit.vim (full)
 runtime macros/matchit.vim
 -
 
 - do this in the shell (once). I assume a Unix(-like) shell
 - and Unix (or GNU) utilities.
 mkdir -p ~/.vim/doc
 cp -vf $VIM/vim63/macros/matchit.txt ~/.vim/doc
 vim -u NONE -i NONE -N +helptags ~/.vim/doc | q
 -
 
 - .vimrc (partim)
 set nocompatible
  comment out this 'if' block and its content
  to get menus  messages in your 'locale' language
 if has(unix)
   language messages C
 else
   language messages en
 endif
 runtime vimrc_example.vim
  the above sets (among others)
  filetype plugin indent on
  syntax on
  ---
  user customizations come here
 
 -
 
 If matchit still doesn't work after the above have been done, describe your 
 problem *in detail* with (if possible) precise steps to reproduce the 
 problem, what happened, and what should have happened, and send it to the 
 vim-dev list and/or to Benji Fischer (see email address near the top of 
 $VIMRUNTIME/macros/matchit.vim).
 
 
 
 Best regards,
 Tony.


Gtag Plugin

2006-11-10 Thread Neil Gabriel

All,

I have installed both gtags and the gtags plugin.  When I invoke
'Gtags' from the vim command line (ex. :Gtags 'foo'), I get the
following error:

Error detected while processing function SNR14_RunGlobal:
line   80:
E42: No Errors

When I run the GtagsCursor, I get the following:

Error detected while processing function SNR14_GtagsCursor..SNR14_RunGlobal:
line   80:
E42: No Errors



Any suggestions?  (i'm running vim7, Gtags for Win32, and cygwin)

Thanks