Re: laststatus=2 anomaly (was: I sometimes have to "double strike" when using gvim7 over Hummingbird Exceed)

2006-06-07 Thread Matthew Winn
On Tue, Jun 06, 2006 at 10:04:14PM -0700, Mun Johl wrote:
> GK> Aha!  That "beta" is actually a German "SS", "ß" ("sz" ligature) 
> iirr.
> GK> 
> GK> The 'X' is a math times ("×" no?).
> GK> 
> GK> All the other (usually) vowels have similar "compounding", eg,
> GK> [aeiou] with accents of various types (try typing "a'" or "a:",
> GK> ferinstance), Polish "l/" (slashed-ell, don't know the sgml entity
> GK> offhand), Spanish "n~" (en-tilde, "ñ"), and so on.
> 
> Very interesting observation!

Did nobody notice when I made much the same observation on Monday
morning?  Hello?  Can anyone hear me?

-- 
Matthew Winn ([EMAIL PROTECTED])


vimgrep only .c/.h/.cpp extensions?

2006-06-07 Thread Denis Perelyubskiy
hello,

what do I :help on to find out how to grep only on, say, .c/.h/.cpp
extensions? I know I can do .c & .h easy:

:vimgrep/foo/j c:/hello/**/*.[ch]

How do I now add .cpp? Or do I have to write out c:/hello/**/*.cpp
again?

thanks,

denis
-- 
// mailto: Denis Perelyubskiy <[EMAIL PROTECTED]>
// icq   : 12359698



-- 
// mailto: Denis Perelyubskiy 
// icq   : 12359698



Re: :X option

2006-06-07 Thread Matthew Winn
On Wed, Jun 07, 2006 at 03:01:15AM -0300, Leandro Melo de Sales wrote:
> I have a important file that I set a encrypt key last year... But I
> forgot the key, but I need to read the file... any way to do that? I'm
> using vim 6.4

There used to be a product called The Cryptographer's Workbench (CWB)
(also known as The Crypt Breaker's Workbench (CBW)) that assisted with
the decyphering of files encoded with the original vi.  I don't know
whether it'll work with Vim; it depends on whether the algorithm has
changed.

I don't know where to find it; I have a copy on quarter inch tape but
no way of reading it.  The source was posted to comp.sources.unix in
the 1980s so it may be possible to find a copy somewhere.

It's not difficult to use, but it's not a "plug in the file and out
comes the plaintext" application: it performs the boring and tedious
part of cracking the encryption but the rest is up to you.

-- 
Matthew Winn ([EMAIL PROTECTED])


Re: vimgrep only .c/.h/.cpp extensions?

2006-06-07 Thread Jürgen Krämer

Hi,

Denis Perelyubskiy wrote:
> 
> what do I :help on to find out how to grep only on, say, .c/.h/.cpp
> extensions? I know I can do .c & .h easy:
> 
> :vimgrep/foo/j c:/hello/**/*.[ch]
> 
> How do I now add .cpp? Or do I have to write out c:/hello/**/*.cpp
> again?

does

  :vimgrep/foo/j c:/hello/**/*.{[ch],cpp}

work for you?

Regards,
Jürgen

-- 
Jürgen Krämer  Softwareentwicklung
HABEL GmbH & Co. KGmailto:[EMAIL PROTECTED]
Hinteres Öschle 2  Tel: +49 / 74 61 / 93 53 - 15
78604 Rietheim-WeilheimFax: +49 / 74 61 / 93 53 - 99


Re: vimgrep only .c/.h/.cpp extensions?

2006-06-07 Thread Yakov Lerner

On 6/7/06, Denis Perelyubskiy <[EMAIL PROTECTED]> wrote:

hello,

what do I :help on to find out how to grep only on, say, .c/.h/.cpp
extensions? I know I can do .c & .h easy:

:vimgrep/foo/j c:/hello/**/*.[ch]

How do I now add .cpp? Or do I have to write out c:/hello/**/*.cpp
again?


If your shell is bash or tcsh, and os is unix/linux, the following will work:

   :vimgrep/foo/j c:/hello/**/*.{c,h,cpp}

I tested this syntax with :args, and it works. The explanation is that on
unix, vim relies on your shell for globbing (except ** part). The *{x,y,z}*
globbing syntax is tcsh and bash extension over older posix shell globbing.

Yakov


comment out block for perl program

2006-06-07 Thread Ken Perl

hi,
how to comment out or uncomment out a block for perl program file?

--
perl -e 'print unpack(u,"62V5N\"FME;G\!E

Color for matched patterns

2006-06-07 Thread Fabien Meghazi

Hi,

I'm correcting my color syntax for terminal but I can't find the
syntax name of an highlighted string after searching in vim. Can
someone tell me what is the name I'm searching for ?

Thanks.

--
Fabien Meghazi

Website: http://www.amigrave.com
Email: [EMAIL PROTECTED]
IM: [EMAIL PROTECTED]


Re: Color for matched patterns

2006-06-07 Thread Jürgen Krämer

Hi,

Fabien Meghazi wrote:
> 
> I'm correcting my color syntax for terminal but I can't find the
> syntax name of an highlighted string after searching in vim. Can
> someone tell me what is the name I'm searching for ?

do you mean

  highlight Search ...

Regards,
Jürgen

-- 
Jürgen Krämer  Softwareentwicklung
HABEL GmbH & Co. KGmailto:[EMAIL PROTECTED]
Hinteres Öschle 2  Tel: +49 / 74 61 / 93 53 - 15
78604 Rietheim-WeilheimFax: +49 / 74 61 / 93 53 - 99


Re: :ha printouts - fontsize

2006-06-07 Thread A.J.Mechelynck

cga2000 wrote:

On Mon, Jun 05, 2006 at 03:11:08AM EDT, A.J.Mechelynck wrote:
  

cga2000 wrote:



[..]
  
Well, here I am a "comparatively new" user of SuSE Linux, and I found it 
remarkably easy to compile Vim 7 on it. If you decide you want to try 
your hand at it, 



I was contemplating switching to gentoo at some point in the future. My
understanding is that it is a source-packaged distro .. should make it
easier to deal with compile-time customization. I've used SuSE (briefly)
in the past and found it rather confusing - at the time. Among other
things I had problems with the doc. It looked very nice at first glance
but reading it was rather painful. Seems that rather than writing doc
from scratch in English some non-native speakers had translated it from
the original German doc.. Not sure.. I also found the curses config
tools difficult to figure out. But then I prefer to do most
configuration tasks by editing config files (things like fonts..
colors.. etc. are the exception because it's a trial and error process
and some form of instant feedback is invaluable..)

  
subscribe to the vim-dev list and ask advice there, 
I'll answer if no one else jumps in before me. Also, some day I should 
write a HowTo page for Vim on Unix, similar to the one I already have 
for Vim on Windows, and post it on my "Vim" site 
http://users.skynet.be/antoine.mechelynck/vim/




That would be very useful. The Vim book doesn't say much about these
aspects and learning by just reading the Vim help is not very
efficient.. for one you run into so much good stuff that you get
sidetracked and forget what you were initially looking for.

:-)

Thanks Tony, I really appreciate all your help..

cga


  
In the meantime I did write a Unix HowTo. There is now a link to it on 
my above-mentioned Vim site, and I'm repeating the Unix HowTo URL here: 
http://users.skynet.be/antoine.mechelynck/vim/compunix.htm


If you have difficulties, please remember that discussion of Vim 
compilation belongs in the vim-dev mailing list, not the general Vim 
mailing list.



Best regards,
Tony.


Re: Upgrading to Vim 7.0 in Debian (was Re: :ha printouts - fontsize)

2006-06-07 Thread A.J.Mechelynck

cga2000 wrote:
[...]

Very clear explanation. What I am worried about when doing this sort of
thing is that since I don't know the debian packaging system this may
have side-effects that will bite me at some point in the future. In
other words I do not understand the implications. Such as what happens
to my current vim 6.4 install? Obviously you would know how to handle
any problem that might crop up at some point in the future.. I wouldn't.
  

[...]

At the shell prompt (not from within Vim) type:
echo $VIMRUNTIME

If the answer (or lack of one) shows that it is undefined (the normal 
case), then Vim 6.4 and Vim 7.0 can live peacefully together on your 
system and not make each other fall head over heels. You just may want 
to rename the Vim 6.4 in the $PATH (as shown by "ls -l `which vim` 
`which gvim`", using the one that isn't a link to the other) to 
something else (e.g. vim64) so it won't be overwritten (in 
/usr/local/bin or wherever) when you install Vim 7.0. Thereafter, "vim" 
or "gvim" (etc.) will invoke Vim 7.0 and use runtime files in $VIM/vim70 
while "vim64" or "vim64 -g" (etc.) will invoke Vim 6.4 and use runtime 
files in $VIM/vim64. Both will use the same ~/.vimrc, ~/.gvimrc, ~/.vim/ 
and $VIM/vimfiles/ (if present: normally they aren't unless you create 
them) so if you use constructs there that are peculiar to Vim 7, you 
should wrap them in an ":if" statement such as "if version >= 700", "if 
exists('+tabline')", etc.


All this, of course, assuming that installing Vim 7.0 doesn't uninstall 
Vim 6.4. If the installer is "polite", it should either leave the Vim 
6.4 installation alone or ask you if you want to keep it or kill it. If 
it isn't, the worse that should happen is that your Vim 6.4 gets 
(cleanly) uninstalled, leaving your ~/.vimrc (etc.) unchanged. After you 
install Vim 7.0, ":e $VIM" will show it to you: if there is a 
subdirectory "vim64", and it is nonempty, then the 6.4 installation 
wasn't removed.



Best regards,
Tony.


Vim 7 Problems

2006-06-07 Thread Ankur Jain

Hi,

I installed vim 7.0 on windows. But, I am facing 2 weird problems, please help:

1. Vim is creating backup files even when I've switched it off. I've specified
  set nobackup
  set nowritebackup
   in my _vimrc. Still, it creates a backup file everytime I
modify/write a file.

2. I cannot see a drop-down auto-completion window. I tried using
Ctrl-p/Ctrl-n keys as well, but it's not working. Do I need to specify
any specific setting on/off?

Please help

Regards
Ankur Jain


Re: Color for matched patterns

2006-06-07 Thread A.J.Mechelynck

Fabien Meghazi wrote:

Hi,

I'm correcting my color syntax for terminal but I can't find the
syntax name of an highlighted string after searching in vim. Can
someone tell me what is the name I'm searching for ?

Thanks.

To find which syntax group is assigned to the character under the 
cursor, plug line(".") and col(".") into the synId() function, then plug 
the result into either synIdattr() or synIdtrans().


See
   :help line()
   :help col()
   :help synId()
   :help synIdattr()
   :help synIdtrans()

HTH,
Tony.


test message; please ignore

2006-06-07 Thread Yakov Lerner

When I type this in vim 4.2, the screen blows up into tiny sparkling pieces:
i
 Get mortgage approval immediately!
 Buy V1agra cheap!
 Increase your phoenix size !

Do I need to stop using 4.2, or what ?


Re: Color for matched patterns

2006-06-07 Thread Fabien Meghazi

To find which syntax group is assigned to the character under the
cursor, plug line(".") and col(".") into the synId() function, then plug
the result into either synIdattr() or synIdtrans().


Thanks, I was using this

map  :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name")
. '> trans<' . synIDattr(synID(line("."),col("."),0),"name") ."> lo<"
. synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"

in order to find color, but for the search it was a problem as synId()
returned the syntax that was under the search highlight (eg: a string
if the search match was over a string)

Anyway, I'm sorry I didn't thought the answer (as Jurgen pointed out)
is "Search" and it was just as logic as it should be. My two neurons
didn't met yet today.


Re: Color for matched patterns

2006-06-07 Thread Yakov Lerner

Command
:hi
helps in such cases.

Yakov

On 6/7/06, Fabien Meghazi <[EMAIL PROTECTED]> wrote:

Hi,

I'm correcting my color syntax for terminal but I can't find the
syntax name of an highlighted string after searching in vim. Can
someone tell me what is the name I'm searching for ?


Re: syntax match question

2006-06-07 Thread Robert Hicks

Peter Hodge wrote:

Hi,

So you want something like:

  " highlight all var options using this match
  syntax match allVarOptions "\%(\s\|^\)\zs-\w\+"

  " highlight the keywords within allVarOptions:
  " note: because '-' is an iskeyword character, you have to
  " use a match instead.
  syntax match allVarOptionKeywords contained containedin=allVarOptions
  \ "\v%(command|fill|pady|padx|)"

Hope that helps,

regards,
Peter


Nada on that working as well. Ah well.

:Robert



Re: comment out block for perl program

2006-06-07 Thread Thor Andreassen
On Wed, Jun 07, 2006 at 04:37:48PM +0800, Ken Perl wrote:
> how to comment out or uncomment out a block for perl program file?

There is of course the generic way with visual-block-mode, see

:help visual.txt

Basically it involves using , highlight what you want to comment
and hit I#. Highlight the # chars and use x to delete them when
uncommenting.

Other than that "The NERD Commenter"[1] looks pretty promising, haven't
used it much yet though.

[1] http://www.vim.org/scripts/script.php?script_id=1218 

-- 
with kind regards
Thor Andreassen


Re: Changing a long list of entries with corresponding index

2006-06-07 Thread Charles E Campbell Jr

Gerald Lai wrote:


Visincr pads trailing spaces as the number of characters needed to
represent the end number increases. What I mean is, for the above
example, we will be left with:

  cities[0   ] = ...
  .
  .
  cities[2039] = ...

Could it be made to pad nothing? Or, in addition, even leading
zeros/spaces/other characters?

Also, are there plans for incrementing/decrementing hex & octal?


As of v13, a zfill of '' or "" will work to "pad nothing":

  :[visual-block range]II 1 ""

You may use other characters, too.

As of v14b, the :IX (and :IIX) commands do hexadecimal incrementing.

I haven't done octal (yet).  Guess that'll be :[visual-block range]IO 
(and IIO).

Version v14b is available at my website:

 http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
 as "Visual Incrementing".

Regards,
Chip Campbell


Re: syntax match question

2006-06-07 Thread Charles E Campbell Jr

Robert Hicks wrote:

According to the isk help file "-" is a keyword character. I am trying 
to update the Tcl syntax file a bit. Tk has lots of options that start 
with the "-" character. I was hoping that the above would make it easy 
to highlight all of the options without a lot of fuss.


Is it possible to create a keyword group and then do a match with 
those words and if they are prefixed with a "-" to color them a 
certain way? A couple of the actual ones would be:


-command
-menu
-fill
-pady
-padx
-tearoff
-label
-text
-height
-width
-justify

and the list goes on. And you can see why I was hoping a simple match 
would do it.  :-)



You can get the effect I think you want with:

syn match OptionMatcher "\%(^\|\s\)\zs-\w\+" 
contains=SpecificOptionList,OptionStarter
syn keyword SpecificOptionList contained command menu fill pady padx 
tearoff label text height width justify

syn match OptionStarter contained "-"

hi link OptionMatcher Error
hi link SpecificOptionList Statement
hi link OptionStarter SpecificOptionList

These commands will highlight your options; ones that aren't in the 
keyword list (ex.  -junk) would get highlighted as Error.


Regards,
Chip Campbell



Re: :X option

2006-06-07 Thread Leandro Melo de Sales

2006/6/7, Matthew Winn <[EMAIL PROTECTED]>:

On Wed, Jun 07, 2006 at 03:01:15AM -0300, Leandro Melo de Sales wrote:
> I have a important file that I set a encrypt key last year... But I
> forgot the key, but I need to read the file... any way to do that? I'm
> using vim 6.4

There used to be a product called The Cryptographer's Workbench (CWB)
(also known as The Crypt Breaker's Workbench (CBW)) that assisted with
the decyphering of files encoded with the original vi.  I don't know
whether it'll work with Vim; it depends on whether the algorithm has
changed.

I don't know where to find it; I have a copy on quarter inch tape but
no way of reading it.  The source was posted to comp.sources.unix in
the 1980s so it may be possible to find a copy somewhere.

It's not difficult to use, but it's not a "plug in the file and out
comes the plaintext" application: it performs the boring and tedious
part of cracking the encryption but the rest is up to you.

--
Matthew Winn ([EMAIL PROTECTED])



OK... Thank you, I'll try it!

Leandro


Re: Script dbext.vim no longer working with Vim 7.x?

2006-06-07 Thread Matthias Pitzl
Hello David!

I have installed the latest version from vim.org and also the too needed
plugins genutils.vim and the other one whose name i can't remember at
moment.
Everything is done like you describe it with the dbext.vim plugin.

Greetings,
Matthias

David Fishburn wrote:
>  
>
>   
>> -Original Message-
>> From: Matthias Pitzl [mailto:[EMAIL PROTECTED] 
>> Sent: Tuesday, June 06, 2006 8:37 AM
>> To: vim@vim.org
>> Subject: Script dbext.vim no longer working with Vim 7.x?
>>
>> Hello!
>>
>> I just installed the dbext.vim script as it's features really 
>> sound nice to me. Unfortunately i fail yet at the database 
>> connection dialogs.
>> When running the :DBPromptForBufferParameters command i get 
>> following error messages:
>> --
>> Please choose # of database type:
>> 0. None
>> 1. ASA
>> 2. ASE
>> 3. DB2
>> 4. INGRES
>> 5. INTERBASE
>> 6. MYSQL
>> 7. ORA
>> 8. PGSQL
>> 9. SQLSRV
>> 10. SQLITE
>> Error detected while processing function 
>> 8_DB_execFuncWCheck..8_DB_resetBufferParameters..> R>8_DB_promptForParameters..8_DB_getInput:
>> line2:
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> Connection parameters have been defaulted
>>
>> Please choose # of database type:
>> 0. None
>> 1. ASA
>> 2. ASE
>> 3. DB2
>> 4. INGRES
>> 5. INTERBASE
>> 6. MYSQL
>> 7. ORA
>> 8. PGSQL
>> 9. SQLSRV
>> 10. SQLITE
>> Error detected while processing function 
>> 8_DB_execFuncWCheck..8_DB_promptForParameters..
>> 8_DB_getInput:
>> line2:
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>> E180: Invalid complete value: -1
>>
>> --
>>
>> Does anyone of you know what's wrong here or if this nice 
>> sounding plugin just doesn't work with Vim 7.x yet?
>> 
>
> I thought I had already fixed this issue.  It should be part of the
> dbext.vim 3.0 release.
>
> What version did you install?
>
> Did you also install the dependent script files from Hari?  
>
> They are listed in the same page:
> Dbext.vim 3.0 - http://www.vim.org/scripts/script.php?script_id=356
> Hari Krishna Dara's two plugins:
> multvals.vim (3.5.1) - http://www.vim.org/script.php?script_id=171
> genutils.vim (1.10.1) - http://www.vim.org/script.php?script_id=197 
>
> Thanks,
> Dave
>  
>   


Re: syntax match question

2006-06-07 Thread Robert Hicks

Charles E Campbell Jr wrote:

Is it possible to create a keyword group and then do a match with 
those words and if they are prefixed with a "-" to color them a 
certain way? A couple of the actual ones would be:


-command
-menu
-fill
-pady
-padx
-tearoff
-label
-text
-height
-width
-justify

and the list goes on. And you can see why I was hoping a simple match 
would do it.  :-)



You can get the effect I think you want with:

syn match OptionMatcher "\%(^\|\s\)\zs-\w\+" 
contains=SpecificOptionList,OptionStarter
syn keyword SpecificOptionList contained command menu fill pady padx 
tearoff label text height width justify

syn match OptionStarter contained "-"

hi link OptionMatcher Error
hi link SpecificOptionList Statement
hi link OptionStarter SpecificOptionList

These commands will highlight your options; ones that aren't in the 
keyword list (ex.  -junk) would get highlighted as Error.


Well that kind of worked. Every word that start with "-" is highlighted 
as an "Error", including those in the "SpecificOptionList".


:Robert



Re: syntax match question

2006-06-07 Thread Robert Hicks

If I do this:

syn match OptionMatcher "\%(^\|\s\)\zs-\w\+" contains=OptionStarter
syn match OptionStarter contained "-"

hi link OptionMatcher Special

That colorizes all the words that start with "-". So in a round about 
way, it works! :-)


:Robert



Re: Vim 7 Problems

2006-06-07 Thread A.J.Mechelynck

Ankur Jain wrote:

Hi,

I installed vim 7.0 on windows. But, I am facing 2 weird problems, 
please help:


1. Vim is creating backup files even when I've switched it off. I've 
specified

  set nobackup
  set nowritebackup
   in my _vimrc. Still, it creates a backup file everytime I
modify/write a file.


Are your setting somehow tampered with? Try

   :verbose set backup? writebackup?

(Don't forget the question marks, otherwise you would be setting them to 
TRUE).




2. I cannot see a drop-down auto-completion window. I tried using
Ctrl-p/Ctrl-n keys as well, but it's not working. Do I need to specify
any specific setting on/off?

Please help

Regards
Ankur Jain


You need _one_ of the following in your vimrc to set filetype detection 
on with filetype-plugins enabled:


   filetype plugin on
   filetype plugin indent on
   source $VIMRUNTIME/vimrc_example.vim

-- to check it, use

   :filetype

with no arguments; the answer should include "plugin:ON".

Then you need a filetype whose filetype-plugin supports omni-completion. 
Several of them are shown under ":help compl-omni-filetypes". Or you 
could see them all by doing


   :help ft-*-omni

And finally you trigger omni-completion by using Ctrl-X Ctrl-O in Insert 
mode at a point in the text where there is something that the plugin 
knows how to complete. Note that if there is only one possible 
completion (as after happen without a menu.



HTH,
Tony.


Re: syntax match question

2006-06-07 Thread Charles E Campbell Jr

Robert Hicks wrote:


Charles E Campbell Jr wrote:


Is it possible to create a keyword group and then do a match with 
those words and if they are prefixed with a "-" to color them a 
certain way? A couple of the actual ones would be:


-command
-menu
-fill
-pady
-padx
-tearoff
-label
-text
-height
-width
-justify

and the list goes on. And you can see why I was hoping a simple 
match would do it.  :-)




You can get the effect I think you want with:

syn match OptionMatcher "\%(^\|\s\)\zs-\w\+" 
contains=SpecificOptionList,OptionStarter
syn keyword SpecificOptionList contained command menu fill pady padx 
tearoff label text height width justify

syn match OptionStarter contained "-"

hi link OptionMatcher Error
hi link SpecificOptionList Statement
hi link OptionStarter SpecificOptionList

These commands will highlight your options; ones that aren't in the 
keyword list (ex.  -junk) would get highlighted as Error.



Well that kind of worked. Every word that start with "-" is 
highlighted as an "Error", including those in the "SpecificOptionList".


To test that, I set up two files tmp (with some options contained) and 
tmp.vim (with the syntax).  I then used :so tmp.vim while
editing tmp.  Anyway, the highlighting worked.  I suggest first trying 
it separately as I did; hopefully you'll see its working.
Were you immediately putting that snippet (with adjusted group names) 
into a local copy of syntax/tcl.vim?  Then you'll have
to start worrying about priority and interference from and with other 
syntax highlighting.


Regards,
Chip Campbell



Re: Upgrading to Vim 7.0 in Debian (was Re: :ha printouts - fontsize)

2006-06-07 Thread William O'Higgins Witteman
On Tue, Jun 06, 2006 at 09:51:48PM -0400, cga2000 wrote:

>> I will assume that you, as a relatively new Debian user, are running
>> stable (sarge).  
>
>Yes. But the main reason is that I am a new Debian user on a laptop :-(

I have taken the middle path with Debian, and use testing.  This gives
me newer software with security updates, without the rapid change and
general wobbliness of unstable.

I wanted vim 7.0 though, and I got it from unstable - it works fine, and
I have been doing this for new software for 5 years without anything
upsetting happening.  Here's what I did to get vim 7.0:

# vim /etc/apt/sources.list
:%s/testing/unstable/g
:wq
# apt-get update
# apt-get install vim-full
# vim /etc/apt/sources.list
:%s/unstable/testing/g
:wq
# apt-get update

I don't mess with pinning or anything tricky - I just let some packages
get a head start.  Eventually they are included and upgraded in testing,
and then my regular updates pick them up and move them forward.

Something to note with this approach is that it will overwrite your vim
6.4 installation.  That was the result I wanted, and so I am
unconcerned - I know that I can simply do an "apt-get remove
vim-full;apt-get install vim-full" with my usual setup (with testing as
my version) and I'll be back at 6.4 in a trice, with all of my configs
where I expect them.

Now, to be clear, this doesn't work if you are tracking stable for
getting vim 7.0 - it is a bit too far behind unstable.  For a laptop
(for my laptop, actually) I recommend running testing, because you can 
keep more up to date but you are not working your expensive machine too
much with custom compiling or package churn.

I understand your reticence about doing things you don't understand, and I
am not trying to pressure you into upgrading your OS :-)  I just want
you (and others who may read the archives or lurk) to know how I
overcame my conflict between a stable system and the latest and
greatest vim.
-- 

yours,

William


Re: Color for matched patterns

2006-06-07 Thread Charles E Campbell Jr

Fabien Meghazi wrote:


I'm correcting my color syntax for terminal but I can't find the
syntax name of an highlighted string after searching in vim. Can
someone tell me what is the name I'm searching for ?



I suggest you try my hicolors plugin, available at:

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

or the most up-to-date one at

 http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
 (see "Highlight Colors Help and Editor")

Then a

 :he  hicolors

will show you all the highlighting labels in their own colors (according to
your current colorscheme).  Plus, if you right-click on a label, a 
colorscheme

editor will be invoked.

Regards,
Chip Campbell



Restore cursor to last line not working in Vim 7

2006-06-07 Thread Kevin Old

Hello everyone,

In version 6.3 (and as far as I can remember in Vim versions) it would
return my cursor to the line I was at when I saved a file the next
time I opened that file.

It now returns me to the beginning of the file in Vim 7.

I looked at :help restore-position, but that doesn't do it by default.

The weird thing is that before I never had to set anything special for
it to do it.  It even worked if I didn't have a .vimrc.

Anyone else experiencing this?  Any ideas how to fix it?

Thanks,
Kevin
--
Kevin Old
[EMAIL PROTECTED]


Re: syntax match question

2006-06-07 Thread Robert Hicks

Charles E Campbell Jr wrote:

Robert Hicks wrote:


Charles E Campbell Jr wrote:


Is it possible to create a keyword group and then do a match with 
those words and if they are prefixed with a "-" to color them a 
certain way? A couple of the actual ones would be:


-command
-menu
-fill
-pady
-padx
-tearoff
-label
-text
-height
-width
-justify

and the list goes on. And you can see why I was hoping a simple 
match would do it.  :-)




You can get the effect I think you want with:

syn match OptionMatcher "\%(^\|\s\)\zs-\w\+" 
contains=SpecificOptionList,OptionStarter
syn keyword SpecificOptionList contained command menu fill pady padx 
tearoff label text height width justify

syn match OptionStarter contained "-"

hi link OptionMatcher Error
hi link SpecificOptionList Statement
hi link OptionStarter SpecificOptionList

These commands will highlight your options; ones that aren't in the 
keyword list (ex.  -junk) would get highlighted as Error.



Well that kind of worked. Every word that start with "-" is 
highlighted as an "Error", including those in the "SpecificOptionList".


To test that, I set up two files tmp (with some options contained) and 
tmp.vim (with the syntax).  I then used :so tmp.vim while
editing tmp.  Anyway, the highlighting worked.  I suggest first trying 
it separately as I did; hopefully you'll see its working.
Were you immediately putting that snippet (with adjusted group names) 
into a local copy of syntax/tcl.vim?  Then you'll have
to start worrying about priority and interference from and with other 
syntax highlighting.




Yes I am using syntax/tcl.vim as I am trying to improve upon it. 
Currently there are some options that highlight only a few of the "-" 
commands so when you open a tcl file with more than those it looks like 
it is not highlighting them all and so it comes off as looking funny. I 
was trying to get it to highlight all the "-" options because it will 
get rid of the other options and be a cleaner solution to the problem.


:Robert



Re: Restore cursor to last line not working in Vim 7

2006-06-07 Thread Tim Chase

In version 6.3 (and as far as I can remember in Vim versions) it would
return my cursor to the line I was at when I saved a file the next
time I opened that file.

It now returns me to the beginning of the file in Vim 7.

I looked at :help restore-position, but that doesn't do it by default.

The weird thing is that before I never had to set anything special for
it to do it.  It even worked if I didn't have a .vimrc.


I suspect somewhere along the line the 'viminfo' setting changed 
subtly.  Perhaps in your stock install, perhaps inadvertantly. 
Particularly, you'd want to look at the "f" portion of it:


from ":help 'viminfo'"
f   Whether file marks need to be stored.  If
zero, file marks ('0 to '9, 'A to 'Z) are
not stored.  When not present or when
non-zero, they are all stored.  '0 is used
for the current cursor position (when exiting
or when doing ":wviminfo").


This would be where I'd start...comparing your old 'viminfo' 
setting with your new one.


-tim




Re: Restore cursor to last line not working in Vim 7

2006-06-07 Thread Kevin Old

On 6/7/06, Tim Chase <[EMAIL PROTECTED]> wrote:

This would be where I'd start...comparing your old 'viminfo'
setting with your new one.


Thanks Tim.  I've never edited settings for viminfo, but I've attached
my viminfo's for both 6.3 and 7.  There are File marks in the viminfo
7 file, but it's not using them.  Read the stuff in :help viminfo, but
am unclear on what I need to set in .vimrc to get it to use them?

Any help is appreicated,
Kevin
--
Kevin Old
[EMAIL PROTECTED]
# This viminfo file was generated by Vim 7.0.
# You may edit it if you're careful!

# Value of 'encoding' when this file was written
*encoding=utf-8


# hlsearch on (H) or off (h):
~h
# Last Search Pattern:
~MSle0~/createTextNode

# Last Substitute Search Pattern:
~MSle0&\]

# Last Substitute String:
$

# Command Line History (newest to oldest):
:q!
:help viminfo
:viminfo
:w
:help cursor
:help restore
:help restore-cursor
:q
:help 
:q!\
:!
:help http
:help url
:q!~
:set ruler
:.
:help
:help line
:help column
:q!i

# Search String History (newest to oldest):
? ^\d\{3}\/
?/>
?/col:q!
? ^\d\{-}\/
?/createTextNode
?/added
?/ips
?/UPDATE
?/U
? \]
? \[
? [//g
? [A-Z]
?/\"dbo\"\.
?/Selection
?/ClassName
?/libmad
?/loaded
? ^"=
?/init

# Expression History (newest to oldest):

# Input Line History (newest to oldest):
@pre
@test
@textarea
@textarea id="thetest" cols="80"

# Input Line History (newest to oldest):

# Registers:
"0  LINE0

""1 LINE0

"2  LINE0

"3  LINE0
:help  -:go up dir  D:delete  R:rename  s:sort-by  
x:exec
" 

../
./
DBICSchemamodel.pm
"-  CHAR0
e

# File marks:
'0  1  0  ~/.viminfo
'1  127  4  ~/.viminfo
'2  17  0  ~/jsprettyprinter.html
'3  16  0  ~/jsprettyprinter.html
'4  68  0  ~/projects/encmymsg/lib/encmymsg/C/Root.pm
'5  1  0  ~/projects/encmymsg/lib/encmymsg/C/Root.pm
'6  40  0  ~/projects/encmymsg/lib/encmymsg.pm
'7  7  77  ~/projects/encmymsg/lib/encmymsg
'8  7  6  ~/projects/encmymsg/root/static/index.html
'9  18  0  /tmp/BIOAdmin/script/bioadmin_cgi.pl

# Jumplist (newest first):
-'  1  0  ~/.viminfo
-'  127  4  ~/.viminfo
-'  320  0  ~/.viminfo
-'  17  0  ~/jsprettyprinter.html
-'  16  0  ~/jsprettyprinter.html
-'  1  0  ~/jsprettyprinter.html
-'  68  0  ~/projects/encmymsg/lib/encmymsg/C/Root.pm
-'  1  0  ~/projects/encmymsg/lib/encmymsg/C/Root.pm
-'  40  0  ~/projects/encmymsg/lib/encmymsg.pm
-'  1  0  ~/projects/encmymsg/lib/encmymsg.pm
-'  7  77  ~/projects/encmymsg/lib/encmymsg
-'  8  0  ~/projects/encmymsg/lib/encmymsg
-'  1  0  ~/projects/encmymsg/lib/encmymsg
-'  7  6  ~/projects/encmymsg/root/static/index.html
-'  5  10  ~/projects/encmymsg/root/static/index.html
-'  2  0  ~/projects/encmymsg/root/static/index.html
-'  1  0  ~/projects/encmymsg/root/static/index.html
-'  18  0  /tmp/BIOAdmin/script/bioadmin_cgi.pl
-'  1  0  /tmp/BIOAdmin/script/bioadmin_cgi.pl
-'  1  0  ~/projects/testicrud/lib/DBSchema.pm
-'  8  0  ~/projects/testicrud/lib/DBSchema
-'  1  0  ~/projects/testicrud/lib/DBSchema
-'  1  0  /usr/local/tt2/examples/lib/menu
-'  1  0  /usr/local/tt2/examples/ttree.cfg
-'  1  0  /usr/local/tt2/templates/html/menu
-'  1  0  /usr/local/tt2/templates/html/html
-'  1  0  ~/projects/testapp/script/lighttpd.conf
-'  2  0  ~/projects/BIOAdmin/script/cd
-'  1  0  ~/projects/BIOAdmin/script/cd
-'  1  0  ~/projects/kdorails/Rakefile
-'  1  0  ~/tmpscripts/testdateregex.pl
-'  10  36  ~/tmpscripts/testdateregex.pl
-'  12  6  ~/tmpscripts/testdateregex.pl
-'  5  51  ~/tmpscripts/testdateregex.pl
-'  24  0  ~/bizjdocs/mysql_samples.sql
-'  1  0  ~/bizjdocs/mysql_samples.sql
-'  50  0  ~/qref.txt
-'  1  0  ~/qref.txt
-'  39  0  ~/.vimrc
-'  29  0  ~/.vimrc
-'  60  0  ~/.vimrc
-'  1  0  ~/.vimrc
-'  5  0  ~/July06Web.csv
-'  1  0  ~/July06Web.csv
-'  1  0  ~/bin/mk
-'  1  0  ~/projects/mpr/Makefile.PL
-'  1  0  ~/projects/mpr/Changes
-'  1  0  ~/projects/mpr/README
-'  11  0  ~/projects/mpr/lib/mpr/C/Root.pm
-'  1  0  ~/projects/mpr/lib/mpr/C/Root.pm
-'  40  0  ~/projects/mpr/lib/mpr.pm
-'  1  0  ~/projects/mpr/lib/mpr.pm
-'  1  0  ~/projects/mpr/mpr.yml
-'  21  0  ~/projects/testicrud/lib/testicrud/Model/DBICSchemamodel.pm
-'  1  0  ~/projects/testicrud/lib/testicrud/Model/DBICSchemamodel.pm
-'  1  0  ~/projects/testicrud/lib/testicrud/View/TT.pm
-'  100  0  ~/projects/testicrud/lib/testicrud/Controller/User.pm
-'  1  0  ~/projects/testicrud/lib/testicrud/Controller/User.pm
-'  1  0  ~/projects/testicrud/lib/testicrud/Controller/Testkdo.pm
-'  8  0  ~/projects/testicrud/root/InstantCRUD/Testkdo
-'  1  0  ~/projects/testicrud/root/InstantCRUD/Testkdo
-'  2  0  ~/projects/testicrud/lib/DBSchema/Testkdo.pm
-'  1  0  ~/projects/testicrud/lib/DBSchema/Testkdo.pm
-'  1  0  ~/projects/testicrud/lib/DBSchema/Role.pm
-'  7  0  ~/projects/testicrud/lib/testicrud
-'  1  0  ~/projects/testicrud/lib/testicrud
-'  9  0  ~/projects/test

Re: Restore cursor to last line not working in Vim 7

2006-06-07 Thread James Vega
On Wed, Jun 07, 2006 at 10:26:36AM -0400, Kevin Old wrote:
> Anyone else experiencing this?  Any ideas how to fix it?

If Tim's suggestion does not solve the problem, I'd suggest checking if
your system-wide vimrc has changed.  The code snippet at ":help
last-position-jump" may have previously been in the system-wide vimrc
but was removed or replaced by a new vimrc.

James
-- 
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[EMAIL PROTECTED]>


signature.asc
Description: Digital signature


Re: Restore cursor to last line not working in Vim 7

2006-06-07 Thread Tim Chase

Thanks Tim.  I've never edited settings for viminfo, but I've attached
my viminfo's for both 6.3 and 7.  There are File marks in the viminfo
7 file, but it's not using them.  Read the stuff in :help viminfo, but
am unclear on what I need to set in .vimrc to get it to use them?


Sorry...I had hoped to get a comparison of your 'viminfo' 
*options*, not the contents of your viminfo files. :)


An easy way to compare them *should* be to

:let @+ = &viminfo

which will put your viminfo setting into the system clipboard. 
Or if you just want to print them, you can use


:set viminfo

which will return the results.

You can then paste the results into your reply.  Particularly of 
interest is any bits of that option that involve an "f".


You can also check

:verbose set viminfo

on each one...perhaps something is getting misset each time, or 
one is getting set differently than the other due to some plugin, 
script, or subtle diff. in your vimrc file.


This might be a wild goose-chase, but it's where I'd start in 
hunting down the matter.  :)


-tim






Re: Restore cursor to last line not working in Vim 7

2006-06-07 Thread A.J.Mechelynck

Kevin Old wrote:

On 6/7/06, Tim Chase <[EMAIL PROTECTED]> wrote:

This would be where I'd start...comparing your old 'viminfo'
setting with your new one.


Thanks Tim.  I've never edited settings for viminfo, but I've attached
my viminfo's for both 6.3 and 7.  There are File marks in the viminfo
7 file, but it's not using them.  Read the stuff in :help viminfo, but
am unclear on what I need to set in .vimrc to get it to use them?

Any help is appreicated,
Kevin


If your 'viminfo' option includes the required setting, then maybe you 
aren't restoring the cursor at the BufReadPost autocommand. The 
necessary autocommand is included in the vimrc_example, so if your vimrc 
includes


   source $VIMRUNTIME/vimrc_example.vim

it should restore the cursor to its last position (unless you have 
edited so many other files since then that the file has been bumped out 
of history).


See
   :help 'viminfo'
  with the single quotes

Note also that if the viminfo feature hasn't been compiled-in, it won't 
work. To check it, use


   :echo has("viminfo")

The reply should be non-zero (normally 1).


HTH,
Tony.


Re: Restore cursor to last line not working in Vim 7

2006-06-07 Thread Kevin Old

On 6/7/06, Tim Chase <[EMAIL PROTECTED]> wrote:

> Thanks Tim.  I've never edited settings for viminfo, but I've attached

:set viminfo


Sorry, had never needed to look at my viminfo settings until now.

Here's the options running under 6.3:
viminfo='20,"50

Here's the options running under 7:
viminfo='20,<50,s10,h

I see the differences (obviously), but don't understand what they mean.

Thanks for your help,
Kevin
--
Kevin Old
[EMAIL PROTECTED]


unable to unsubscribe

2006-06-07 Thread Kamaraju Kusumanchi
I was previously subscribed to this list via kamaraju at gmail dot com. I 
would like to unsubscribe that address.

However when I send the email to [EMAIL PROTECTED] (from kamaraju at 
gmail dot com) nothing happens and I still keep getting emails from the vim 
list. 

If I send an email to vim@vim.org (from kamaraju at gmail dot com) the 
messages are bouncing. The kamaraju at gmail dot com account is working fine. 
What else could be the problem? Please help me unsubscribe.

thanks
raju

-- 
http://kamaraju.googlepages.com/cornell-bazaar
http://groups.google.com/group/cornell-bazaar/about


Re: Restore cursor to last line not working in Vim 7

2006-06-07 Thread Charles E Campbell Jr

Kevin Old wrote:


In version 6.3 (and as far as I can remember in Vim versions) it would
return my cursor to the line I was at when I saved a file the next
time I opened that file.

It now returns me to the beginning of the file in Vim 7.



Check out tip http://vim.sourceforge.net/tips/tip.php?tip_id=80 -- 
perhaps that'll help.


Regards,
Chip Campbell



some ideas.... Re: unable to unsubscribe

2006-06-07 Thread Robert Michel
Salve Kamaraju!

Do you know
http://www.vim.org/maillist.php#help 
?

On Wed, 07 Jun 2006, Kamaraju Kusumanchi wrote:

> However when I send the email to [EMAIL PROTECTED] (from kamaraju at 
> gmail dot com) nothing happens and I still keep getting emails from the vim 
> list. 
> 
> If I send an email to vim@vim.org (from kamaraju at gmail dot com) the 
> messages are bouncing. The kamaraju at gmail dot com account is working fine. 
> What else could be the problem? Please help me unsubscribe.

#0#
Do you use any mailfilter?

#1#
what happens when you first subscribe you again
[EMAIL PROTECTED] (from kamaraju at...)
and then send a mail to 
[EMAIL PROTECTED] (from kmaraju at...)

Just sending an email unsubscribe is not engough,
you have to confirm this request.

#2#
try the same with
" You can start a subscription for an alternate address,"

#3#
if this doesen't help, contact
[EMAIL PROTECTED]

rob


syntax region question

2006-06-07 Thread Robert Hicks

In Tcl if you do this:

if {0} {
Other code you want to comment
out is in here.
}

That if statement works just like a multi-line comment (i.e. /*  */ ) in 
 other languages.


Is it possible to color that the same way as a comment?

:Robert



RE: Tab complete filenames

2006-06-07 Thread Max Dyckhoff
> You're working on a large project, so I would advise caution when
doing
> tab completion. If you happened to be waiting on an accidental (slow)
> completion like a, then hit Ctrl-c to stop it.

Yes, I love how vim is nice and intuitive if Linux stuff is ingrained in
your every move :)


> Nope, no (easy) way. That's just how Vim was implemented. You could
hack
> the source code though.
> 
> If you don't have any other commands besides :Sfind beginning with
"Sf",
> you can just do :Sf instead of the full :Sfind. It's an extra Shift
> keystroke.

That is a shame. Regrettably I have enough coding to do without hacking
through the source for vim and getting it to compile on Windows; I'm
sure I could do it in Linux in a couple of minutes but that wouldn't
help me at work much! Curses. However I have found a rather nice
solution (see below).


> An (untested) alternative I just thought of is to do something like
this
> (Vim 7):
> 
>cnoremap :
getcmdpos()==1?toupper(nr2char(getchar())):':'

That is rather great, although it doesn't work with the  tag in
there. That is, it DOES work, but it is somewhat confusing. Because of
the  the result of the ":getchar()" will not be displayed in the
command line, meaning if you enter "::sf" then you will see on the
command line ":f ". Note the space after the "f". If you now press
backspace the command line changes to ":S". Removing the  makes
the remapping of : work perfectly.

However I was playing around and came up with an alternative mapping
which makes me grin all over. It is a really logical continuation of the
remapping of : that you provided:

cnoremap sf getcmdpos()==1?'Sf':'sf'

Brilliant! It works exactly as I want, and if you pause after the "s"
before typing the "f" (for timeoutlen) then it aborts the remap and
gives you a lowercase "sf".

Thanks for your help Gerald, I hope this thread helps others in their
time of need!

Max


Re: some ideas.... Re: unable to unsubscribe

2006-06-07 Thread Kamaraju Kusumanchi
On Wednesday 07 June 2006 11:55, Robert Michel wrote:
> Salve Kamaraju!
>
> Do you know
> http://www.vim.org/maillist.php#help
> ?

Thanks for the link. I knew about it before. That is how I learned about 
[EMAIL PROTECTED] in the first place. However, I missed the following 
piece of information during the first read.

You can start a subscription for an alternate address,
for example "[EMAIL PROTECTED]", just add a hyphen and your
address (with '=' instead of '@') after the command word:
<[EMAIL PROTECTED]>

Now I unsubscribed kamaraju at gmail dot com using another address.


>
> #0#
> Do you use any mailfilter?

For list messages yes. But not for [EMAIL PROTECTED]

>
> #1#
> what happens when you first subscribe you again
> [EMAIL PROTECTED] (from kamaraju at...)

nothing happens. I do not receive any confirmation email.

> and then send a mail to
> [EMAIL PROTECTED] (from kmaraju at...)
>

when I send a message to that, nothing happens. I do not receive the 
confirmation email. I checked the spam folder as well.

> Just sending an email unsubscribe is not engough,
> you have to confirm this request.
>

But I was not getting the confirmation request.


> #2#
> try the same with
> " You can start a subscription for an alternate address,"

Yes. this worked and I got a confirmation message and successfully 
unsubscribed kamaraju at gmail dot com.


Thanks for all the help
raju

-- 
http://kamaraju.googlepages.com/cornell-bazaar
http://groups.google.com/group/cornell-bazaar/about


Re: what is wrong with this autoload var usage?

2006-06-07 Thread Hari Krishna Dara

On Wed, 7 Jun 2006 at 8:10am, Jürgen Krämer wrote:

>
> Hi,
>
> Hari Krishna Dara wrote:
> >
> > I am trying to use the new vim7 "object-based" features and am stuck
> > with an issue in using autoload style variables. Save the below as t.vim
> > in your autoload directory and execute it (:runtime autoload/t.vim).
> >
> > let t#var = 'something'
> >
> > let s:hash = {}
> > function! s:hash.func()
> >   echomsg 'from numbered function scope: '. g:t#var
> > endfunction
> >
> > echomsg 'from global scope: '. t#var
> > call s:hash.func()
> > 
> >
> > you get the below output:
> >
> > from global scope: something
> > Error detected while processing function 3:
> > line1:
> > E121: Undefined variable: t#var
> > E15: Invalid expression: 'from numbered function scope: '. t#var
> >
> > Is there something wrong that I am doing or is this a bug?
>
> inside a function you have to reference global variables with the "g:"
> prefix even if it's an autoload variable, i.e.
>
>   function! s:hash.func()
> echomsg 'from numbered function scope: '. g:t#var
>   endfunction
>
> Regards,
> Jürgen

Strange... according to the documentation at |autoload|, you can access
them without the g: prefix.


This also works when reading a variable that has not been set yet: >

:let l = foo#bar#lvar

However, when the autoload script was already loaded it won't be loaded again
for an unknown variable.


I am still thinking that it is a bug in the code or in the documentation
(or at least needs to be clarified for poor souls like me). Anyway, it
works with the g: prefix, so thanks for pointing this out.

-- 
Thanks,
Hari

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: Restore cursor to last line not working in Vim 7

2006-06-07 Thread Kevin Old

On 6/7/06, Charles E Campbell Jr <[EMAIL PROTECTED]> wrote:

Kevin Old wrote:

> In version 6.3 (and as far as I can remember in Vim versions) it would
> return my cursor to the line I was at when I saved a file the next
> time I opened that file.
>
> It now returns me to the beginning of the file in Vim 7.


Check out tip http://vim.sourceforge.net/tips/tip.php?tip_id=80 --
perhaps that'll help.

Regards,
Chip Campbell




Hi Charles,

Thanks for this, but I still don't understand.

I've set my viminfo in .vimrc to:

viminfo='20,"50

and it doesn't take me back to the line.  This is exactly how it was
set agains Vim 6.3.

I've read all the docs, but still for some weird reason, don't get why
it's not doing what I want it to.

Any help is appreciated,
Kevin
--
Kevin Old
[EMAIL PROTECTED]


Re: matchparen bug?

2006-06-07 Thread Jared
On 06/06/2006 23:47, Benji Fisher wrote:
> I am stumped.  I tried it with
> 
> $ vim -u NONE
> :set nocp
> :runtime plugin/matchparen.vim
> 
> and I still get the cursor on the "o" in the third line.

Benji, Ilya,

I appreciate both of you taking the time to investigate.  I'm a little
puzzled why Benji and I are seeing this issue, but Ilya is not.

Can anyone else either confirm or refute this?  Is it perhaps a
Windows-specific bug?  I only currently have access to Vim 7 on a Windows
system, so I'm unable to test it under Linux.

--
Jared Breland
[EMAIL PROTECTED]
http://www.legroom.net/



RE: Tab complete filenames

2006-06-07 Thread Hari Krishna Dara

On Wed, 7 Jun 2006 at 9:29am, Max Dyckhoff wrote:

> > You're working on a large project, so I would advise caution when
> doing
> > tab completion. If you happened to be waiting on an accidental (slow)
> > completion like a, then hit Ctrl-c to stop it.
>
> Yes, I love how vim is nice and intuitive if Linux stuff is ingrained in
> your every move :)
>
>
> > Nope, no (easy) way. That's just how Vim was implemented. You could
> hack
> > the source code though.
> >
> > If you don't have any other commands besides :Sfind beginning with
> "Sf",
> > you can just do :Sf instead of the full :Sfind. It's an extra Shift
> > keystroke.
>
> That is a shame. Regrettably I have enough coding to do without hacking
> through the source for vim and getting it to compile on Windows; I'm
> sure I could do it in Linux in a couple of minutes but that wouldn't
> help me at work much! Curses. However I have found a rather nice
> solution (see below).
>
>
> > An (untested) alternative I just thought of is to do something like
> this
> > (Vim 7):
> >
> >cnoremap :
> getcmdpos()==1?toupper(nr2char(getchar())):':'
>
> That is rather great, although it doesn't work with the  tag in
> there. That is, it DOES work, but it is somewhat confusing. Because of
> the  the result of the ":getchar()" will not be displayed in the
> command line, meaning if you enter "::sf" then you will see on the
> command line ":f ". Note the space after the "f". If you now press
> backspace the command line changes to ":S". Removing the  makes
> the remapping of : work perfectly.
>
> However I was playing around and came up with an alternative mapping
> which makes me grin all over. It is a really logical continuation of the
> remapping of : that you provided:
>
>   cnoremap sf getcmdpos()==1?'Sf':'sf'
>
> Brilliant! It works exactly as I want, and if you pause after the "s"
> before typing the "f" (for timeoutlen) then it aborts the remap and
> gives you a lowercase "sf".
>
> Thanks for your help Gerald, I hope this thread helps others in their
> time of need!
>
> Max

I wasn't tracking the thread initially, but here is my input. Maps are
not the best approach for tasks like this, you should use abbreviations.
With maps, if you type sf anywhere on the commandline, it will become
Sf. You don't want that to happen in a filename right (well, if you are
on windows you might not care most of the time, but there are enough
other cases you should). I suggest you take a look at the cmdalias.vim
plugin that I wrong just for these cases. If you create an alias like
this:

call CmdAlias('sf', 'Sf')
call CmdAlias('sfind', 'Sfind')

it creates abbreviations such that they get changed only when they are
typed at the start of the command-line and when they are by themselves
(e.g, :sfix will not become :Sfix). I also added a tip recently which
shows how to use cmdalias.vim:

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

I use cmdalias plugin heavily and haven't faced any issues.

I was also experimenting with a plugin that would lookup filenames as
you type. Except for a bug in Vim completion bothering me, it works
well, and is usable. Instead of using the 'path' setting, it uses tags
created specially for filenames, so it is a lot faster, you can use
regular expressions and you get a dropdown with all the matching
filenames. If you are interested, let me know I will send you a zip.

-- 
HTH,
Hari

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: what is wrong with this autoload var usage?

2006-06-07 Thread A.J.Mechelynck

Hari Krishna Dara wrote:

On Wed, 7 Jun 2006 at 8:10am, Jürgen Krämer wrote:

  

Hi,

Hari Krishna Dara wrote:


I am trying to use the new vim7 "object-based" features and am stuck
with an issue in using autoload style variables. Save the below as t.vim
in your autoload directory and execute it (:runtime autoload/t.vim).

let t#var = 'something'

let s:hash = {}
function! s:hash.func()
  echomsg 'from numbered function scope: '. g:t#var
endfunction

echomsg 'from global scope: '. t#var
call s:hash.func()


you get the below output:

from global scope: something
Error detected while processing function 3:
line1:
E121: Undefined variable: t#var
E15: Invalid expression: 'from numbered function scope: '. t#var

Is there something wrong that I am doing or is this a bug?
  

inside a function you have to reference global variables with the "g:"
prefix even if it's an autoload variable, i.e.

  function! s:hash.func()
echomsg 'from numbered function scope: '. g:t#var
  endfunction

Regards,
Jürgen



Strange... according to the documentation at |autoload|, you can access
them without the g: prefix.
  


According to the documentation at |global-variables|, omitting g: within 
a function definition gives you a variable local to the function:


   *global-variable* *g:var*
Inside functions global variables are accessed with "g:".  Omitting this 
will
access a variable local to a function.  But "g:" can also be used in any 
other

place if you like.


  
This also works when reading a variable that has not been set yet: >


:let l = foo#bar#lvar

However, when the autoload script was already loaded it won't be loaded again
for an unknown variable.


I am still thinking that it is a bug in the code or in the documentation
(or at least needs to be clarified for poor souls like me). Anyway, it
works with the g: prefix, so thanks for pointing this out.

  



Best regards,
Tony.


RE: Tab complete filenames

2006-06-07 Thread Max Dyckhoff
I completely forgot about abbreviations, although the remap that I came
up with doesn't work badly at all because it does check the command pos,
and I never use any other :sf* command than sfind.

If you could send me a zip of your experimental plugin that would be
great, I'd love to give it a go! I'm using vim 7, if that helps.

Thanks!

Max

> -Original Message-
> From: Hari Krishna Dara [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 07, 2006 11:16 AM
> To: Max Dyckhoff
> Cc: Gerald Lai; vim org
> Subject: RE: Tab complete filenames
> 
> 
> On Wed, 7 Jun 2006 at 9:29am, Max Dyckhoff wrote:
> 
> > > You're working on a large project, so I would advise caution when
> > doing
> > > tab completion. If you happened to be waiting on an accidental
(slow)
> > > completion like a, then hit Ctrl-c to stop it.
> >
> > Yes, I love how vim is nice and intuitive if Linux stuff is
ingrained in
> > your every move :)
> >
> >
> > > Nope, no (easy) way. That's just how Vim was implemented. You
could
> > hack
> > > the source code though.
> > >
> > > If you don't have any other commands besides :Sfind beginning with
> > "Sf",
> > > you can just do :Sf instead of the full :Sfind. It's an extra
Shift
> > > keystroke.
> >
> > That is a shame. Regrettably I have enough coding to do without
hacking
> > through the source for vim and getting it to compile on Windows; I'm
> > sure I could do it in Linux in a couple of minutes but that wouldn't
> > help me at work much! Curses. However I have found a rather nice
> > solution (see below).
> >
> >
> > > An (untested) alternative I just thought of is to do something
like
> > this
> > > (Vim 7):
> > >
> > >cnoremap :
> > getcmdpos()==1?toupper(nr2char(getchar())):':'
> >
> > That is rather great, although it doesn't work with the  tag
in
> > there. That is, it DOES work, but it is somewhat confusing. Because
of
> > the  the result of the ":getchar()" will not be displayed in
the
> > command line, meaning if you enter "::sf" then you will see on the
> > command line ":f ". Note the space after the "f". If you now press
> > backspace the command line changes to ":S". Removing the 
makes
> > the remapping of : work perfectly.
> >
> > However I was playing around and came up with an alternative mapping
> > which makes me grin all over. It is a really logical continuation of
the
> > remapping of : that you provided:
> >
> > cnoremap sf getcmdpos()==1?'Sf':'sf'
> >
> > Brilliant! It works exactly as I want, and if you pause after the
"s"
> > before typing the "f" (for timeoutlen) then it aborts the remap and
> > gives you a lowercase "sf".
> >
> > Thanks for your help Gerald, I hope this thread helps others in
their
> > time of need!
> >
> > Max
> 
> I wasn't tracking the thread initially, but here is my input. Maps are
> not the best approach for tasks like this, you should use
abbreviations.
> With maps, if you type sf anywhere on the commandline, it will become
> Sf. You don't want that to happen in a filename right (well, if you
are
> on windows you might not care most of the time, but there are enough
> other cases you should). I suggest you take a look at the cmdalias.vim
> plugin that I wrong just for these cases. If you create an alias like
> this:
> 
> call CmdAlias('sf', 'Sf')
> call CmdAlias('sfind', 'Sfind')
> 
> it creates abbreviations such that they get changed only when they are
> typed at the start of the command-line and when they are by themselves
> (e.g, :sfix will not become :Sfix). I also added a tip recently which
> shows how to use cmdalias.vim:
> 
> http://www.vim.org/tips/tip.php?tip_id=1247
> 
> I use cmdalias plugin heavily and haven't faced any issues.
> 
> I was also experimenting with a plugin that would lookup filenames as
> you type. Except for a bug in Vim completion bothering me, it works
> well, and is usable. Instead of using the 'path' setting, it uses tags
> created specially for filenames, so it is a lot faster, you can use
> regular expressions and you get a dropdown with all the matching
> filenames. If you are interested, let me know I will send you a zip.
> 
> --
> HTH,
> Hari
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com


Re: Restore cursor to last line not working in Vim 7

2006-06-07 Thread A.J.Mechelynck

Kevin Old wrote:

On 6/7/06, Charles E Campbell Jr <[EMAIL PROTECTED]> wrote:

Kevin Old wrote:

> In version 6.3 (and as far as I can remember in Vim versions) it would
> return my cursor to the line I was at when I saved a file the next
> time I opened that file.
>
> It now returns me to the beginning of the file in Vim 7.


Check out tip http://vim.sourceforge.net/tips/tip.php?tip_id=80 --
perhaps that'll help.

Regards,
Chip Campbell




Hi Charles,

Thanks for this, but I still don't understand.

I've set my viminfo in .vimrc to:

viminfo='20,"50

and it doesn't take me back to the line.  This is exactly how it was
set agains Vim 6.3.

I've read all the docs, but still for some weird reason, don't get why
it's not doing what I want it to.

Any help is appreciated,
Kevin
Does your vimrc source the vimrc_example, as I mentioned? If it doesn't, 
and you don't want to add


   source $VIMRUNTIME/vimrc_example.vim

near the top of your vimrc (which is what I would do), then an alternate 
possibility (IMHO not as good, but tastes vary) is to copy into your 
vimrc the autocommand found near line 70 of the vimrc_example.vim


Best regards,
Tony.


Re: Restore cursor to last line not working in Vim 7

2006-06-07 Thread Yegappan Lakshmanan

Hi Kevin,

On 6/7/06, Kevin Old <[EMAIL PROTECTED]> wrote:

>
> > In version 6.3 (and as far as I can remember in Vim versions) it would
> > return my cursor to the line I was at when I saved a file the next
> > time I opened that file.
> >
> > It now returns me to the beginning of the file in Vim 7.
>
>
> Check out tip http://vim.sourceforge.net/tips/tip.php?tip_id=80 --
> perhaps that'll help.
>
>
>

Hi Charles,

Thanks for this, but I still don't understand.

I've set my viminfo in .vimrc to:

viminfo='20,"50



Setting the 'viminfo' option with the above value configures Vim to
save the file bookmarks in the viminfo file. You still need to define
the autocmd to use this saved file mark and jump to it.



and it doesn't take me back to the line.  This is exactly how it was
set agains Vim 6.3.



In Vim 6.3, either you sourced the vimrc_example.vim file or the
system vimrc file in your system was defining the autocmd.



I've read all the docs, but still for some weird reason, don't get why
it's not doing what I want it to.



You can add the autocmd described under ":help last-position-jump"
to your .vimrc file.

- Yegappan


Re: Restore cursor to last line not working in Vim 7

2006-06-07 Thread Charles E Campbell Jr

Kevin Old wrote:


On 6/7/06, Charles E Campbell Jr <[EMAIL PROTECTED]> wrote:


Check out tip http://vim.sourceforge.net/tips/tip.php?tip_id=80 --
perhaps that'll help.



Thanks for this, but I still don't understand.

I've set my viminfo in .vimrc to:

viminfo='20,"50

and it doesn't take me back to the line.  This is exactly how it was
set agains Vim 6.3.



I've read all the docs, but still for some weird reason, don't get why
it's not doing what I want it to.


The viminfo setting is not the only thing it says to do!  Quoting the 
first example:


|  set viminfo='10,\"100,:20,%,n~/.viminfo
 au BufReadPost * if line("'\"") > 0|if line("'\"") <= 
line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif


|
|That autocmd is needed!

||Regards,||
Chip Campbell
|||



Re: syntax region question

2006-06-07 Thread Eric Arnold

Just a suggestion:  the C syntax knows enough to color

#if 0
...
#endif

as a comment.  You can look at how it does that.

It's easy to do if you don't have anything nested inside the if block.
I.e. something like

syntax match comment /if\s*(\s*0\s*)\s*{[^}]\_*}/

Otherwise, it gets more complicated, and I haven't figured that out yet.



On 6/7/06, Robert Hicks <[EMAIL PROTECTED]> wrote:

In Tcl if you do this:

if {0} {
 Other code you want to comment
 out is in here.
}

That if statement works just like a multi-line comment (i.e. /*  */ ) in
  other languages.

Is it possible to color that the same way as a comment?

:Robert




Re: syntax region question

2006-06-07 Thread Yakov Lerner

On 6/7/06, Robert Hicks <[EMAIL PROTECTED]> wrote:

In Tcl if you do this:

if {0} {
Other code you want to comment
out is in here.
}

That if statement works just like a multi-line comment (i.e. /*  */ ) in
 other languages.

Is it possible to color that the same way as a comment?


1. Must be possible because in C syntax, there is an option for
coloring '#if 0'\n...#endif' blocks as comments. In C syntax,
it's optional. You can switch it on/off by setting/unsetting the
variable  g:c_no_if0   in your vimrc.

2. Now to the question whether existing tcl.vim (syntax) has such thing.
I don't see it in vim6.4. (I dont have vim7 on this computer).

3. You could either ask tcl.vim syntax maintainer,
Dean Copsey <[EMAIL PROTECTED]>, to add it, or
flex your syntax muscles and do it yourself by analogy with how
C colors '#if 0'\n...#endif' blocks. Here is how c.vim does it:


if !exists("c_no_if0")
 syn regioncCppOut start="^\s*\(%:\|#\)\s*if\s\+0\+\>" end="[EMAIL 
PROTECTED]|$
" contains=cCppOut2
 syn regioncCppOut2contained start="0" end="^\s*\(%:\|#\)\s*\(endif
\>\|else\>\|elif\>\)" contains=cSpaceError,cCppSkip
 syn regioncCppSkipcontained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>
\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>"
contains=cSpaceError,cCppSkip
endif
-

Yakov


Re: matchparen bug?

2006-06-07 Thread Gary Johnson
On 2006-06-07, Jared <[EMAIL PROTECTED]> wrote:
> On 06/06/2006 23:47, Benji Fisher wrote:
> > I am stumped.  I tried it with
> > 
> > $ vim -u NONE
> > :set nocp
> > :runtime plugin/matchparen.vim
> > 
> > and I still get the cursor on the "o" in the third line.
> 
> Benji, Ilya,
> 
> I appreciate both of you taking the time to investigate.  I'm a little
> puzzled why Benji and I are seeing this issue, but Ilya is not.
> 
> Can anyone else either confirm or refute this?  Is it perhaps a
> Windows-specific bug?  I only currently have access to Vim 7 on a Windows
> system, so I'm unable to test it under Linux.

I haven't been following this discussion very closely, but I just 
tried the experiment on Red Hat Linux 9, SunOS 5.8 and Windows XP 
with vim 7.0, no patches, and the cursor always goes to the 'o' in 
the third line.  Is that what you were looking for?

HTH,
Gary

-- 
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
 | Spokane, Washington, USA


Re: Spell check in Portuguese

2006-06-07 Thread Jakson A. Aquino
On Mon, Jun 05, 2006 at 01:05:25PM -0300, Jakson A. Aquino wrote:
> [...] the list of words for the Portuguese language as
> spoken in Brazil is a bit incomplete (I've got it from
> http://ftp.vim.org/pub/vim/runtime/spell/). A possible
> solution to the problem is the use of the new list released
> by BrOffice, the Brazilian branch of OpenOffice:
> 
>   the files .dic and .aff:
>   http://www.deso-se.com.br/downloads/pt_br-1400.zip
> 
>   the website (in Portuguese):
>   http://www.openoffice.org.br/?q=verortografico
> 
> According to the BrOffice team, this new list has 1.400.000
> words, and fixes many errors of the old list.  The problem is
> that the command ":mkspell pt pt_BR" produce the pt.utf8.spl
> file, but the following error message is repeated hundreds of
> times (with different line numbers):
> 
>   "Unrecognized or duplicate item in pt_BR.aff line 548: SXF"

I downloaded the OpenOffice source code and, then, discovered what was
happening. All instances of "SXF" in the pt_BR.aff file must be
replaced with "SFX". The invalid flag is not causing problems for
OpenOffice because myspell ignores the first field of all lines but
the first of a rule of expansion, and the "SXF" flag never appears in
the first line. Vim reads the first field of all lines and, thus, it
was able to spot the invalid flag.




Re: Upgrading to Vim 7.0 in Debian (was Re: :ha printouts - fontsize)

2006-06-07 Thread cga2000
On Wed, Jun 07, 2006 at 10:20:56AM EDT, William O'Higgins Witteman wrote:
> On Tue, Jun 06, 2006 at 09:51:48PM -0400, cga2000 wrote:
> 
> >> I will assume that you, as a relatively new Debian user, are running
> >> stable (sarge).  
> >
> >Yes. But the main reason is that I am a new Debian user on a laptop :-(
> 
> I have taken the middle path with Debian, and use testing.  This gives
> me newer software with security updates, without the rapid change and
> general wobbliness of unstable.
> 
> I wanted vim 7.0 though, and I got it from unstable - it works fine, and
> I have been doing this for new software for 5 years without anything
> upsetting happening.  Here's what I did to get vim 7.0:
> 
> # vim /etc/apt/sources.list
> :%s/testing/unstable/g
> :wq
> # apt-get update
> # apt-get install vim-full
> # vim /etc/apt/sources.list
> :%s/unstable/testing/g
> :wq
> # apt-get update
> 
> I don't mess with pinning or anything tricky - I just let some packages
> get a head start.  Eventually they are included and upgraded in testing,
> and then my regular updates pick them up and move them forward.
> 
> Something to note with this approach is that it will overwrite your vim
> 6.4 installation.  That was the result I wanted, and so I am
> unconcerned - I know that I can simply do an "apt-get remove
> vim-full;apt-get install vim-full" with my usual setup (with testing as
> my version) and I'll be back at 6.4 in a trice, with all of my configs
> where I expect them.
> 
> Now, to be clear, this doesn't work if you are tracking stable for
> getting vim 7.0 - it is a bit too far behind unstable.  For a laptop
> (for my laptop, actually) I recommend running testing, because you can 
> keep more up to date but you are not working your expensive machine too
> much with custom compiling or package churn.
> 
> I understand your reticence about doing things you don't understand, and I
> am not trying to pressure you into upgrading your OS :-)  I just want
> you (and others who may read the archives or lurk) to know how I
> overcame my conflict between a stable system and the latest and
> greatest vim.
> -- 
> 
> yours,
> 
> William

Thanks. 

Just for the record: I tried installing "etch" about three months ago
but the installer was unable to detect my PC card. I fooled him by going
back and forth in the menus, loading the relevant module manually and
the first part of the installation completed successfully. But when I
rebooted into the base system to complete the install - the second phase
where you download whatever applications you plan to use - etch
stubbornly refused to connect me. There was apparently a problem with
DHCP - I was never able to obtain a lease. I spent about a month trying
to get this to work and eventually abandoned the install. I just could
not afford to spend more time with this. So I'll stick with stable for
the foreseeable future.. maybe give it another shot some time later this
year - see if the pcmcia-related problems have been fixed.

Thanks,

cga


Re: Upgrading to Vim 7.0 in Debian (was Re: :ha printouts - fontsize)

2006-06-07 Thread William O'Higgins Witteman
On Wed, Jun 07, 2006 at 08:36:08PM -0400, cga2000 wrote:
>Just for the record: I tried installing "etch" about three months ago
>but the installer was unable to detect my PC card. I fooled him by going

Ah, I can see where that might be a problem.  I've never installed in
that manner - I install into stable, as you did, and once I'm up and
running with a minimal system I edit my /etc/apt/sources.list to testing
and do "apt-get update; apt-get dist-upgrade" which moves my whole
system up to testing.  Once Debian is installed there is never (in my
experience) a reason to reinstall.
-- 

yours,

William


Re: syntax region question

2006-06-07 Thread Robert Hicks

Eric Arnold wrote:

Just a suggestion:  the C syntax knows enough to color

#if 0
...
#endif

as a comment.  You can look at how it does that.

It's easy to do if you don't have anything nested inside the if block.
I.e. something like

syntax match comment /if\s*(\s*0\s*)\s*{[^}]\_*}/

Otherwise, it gets more complicated, and I haven't figured that out yet.





I will look into that.

:Robert




Updated PHP syntax file

2006-06-07 Thread Peter Hodge
Hello all,

I have recently been given the go-ahead to take over maintenance of the PHP
syntax
file (
http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/2006-May/002857.html
), and have added several modifications, but I'm unable to host the file on my
own web server.  Stefano mentioned I should email the updated file to Bram,
should I also add it to vim.org/scripts/ as a syntax script? (So that I can
include a URL in the file for people to find updates.)

regards,
Peter

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


RE: Updated PHP syntax file

2006-06-07 Thread David Fishburn
 

> -Original Message-
> From: Peter Hodge [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, June 07, 2006 9:38 PM
> To: vim@vim.org
> Subject: Updated PHP syntax file
> 
> Hello all,
> 
> I have recently been given the go-ahead to take over 
> maintenance of the PHP syntax file ( 
> http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/2
> 006-May/002857.html
> ), and have added several modifications, but I'm unable to 
> host the file on my own web server.  Stefano mentioned I 
> should email the updated file to Bram, should I also add it 
> to vim.org/scripts/ as a syntax script? (So that I can 
> include a URL in the file for people to find updates.)

Yes, adding the file to vim.org as a syntax script is the right way of doing
this.  Have a look for other syntax scripts to get the idea.

You can start with one of mine:
http://www.vim.org/scripts/script.php?script_id=498

HTH,
Dave



Re: Restore cursor to last line not working in Vim 7

2006-06-07 Thread Benji Fisher
On Wed, Jun 07, 2006 at 11:53:40AM -0700, Yegappan Lakshmanan wrote:
> 
> In Vim 6.3, either you sourced the vimrc_example.vim file or the
> system vimrc file in your system was defining the autocmd.

 I suspect that Yegappan and Tony are right.  I will go further and
guess that you installed Vim 6.3 from an RPM or some other binary
distribution, but compiled vim 7.0 yourself.

 If you read the output of

:version

it will tell you where vim looks for the system vimrc file.  There is no
such thing if you compiled yourself, and there likely is a system vimrc
file if you installed from an RPM.

HTH --Benji Fisher


Re: Upgrading to Vim 7.0 in Debian (was Re: :ha printouts - fontsize)

2006-06-07 Thread cga2000
On Wed, Jun 07, 2006 at 09:10:21PM EDT, William O'Higgins Witteman wrote:
> On Wed, Jun 07, 2006 at 08:36:08PM -0400, cga2000 wrote:
> >Just for the record: I tried installing "etch" about three months ago
> >but the installer was unable to detect my PC card. I fooled him by going
> 
> Ah, I can see where that might be a problem.  I've never installed in
> that manner - I install into stable, as you did, and once I'm up and
> running with a minimal system I edit my /etc/apt/sources.list to testing
> and do "apt-get update; apt-get dist-upgrade" which moves my whole
> system up to testing.  Once Debian is installed there is never (in my
> experience) a reason to reinstall.
> -- 
> 
Sounds like something I could try. The reason I tried to install
testing directly is that I used to run RedHat. I freed up a 4G
partition on my HD and did a chroot install of sarge - testing at the
time.. so I could take my time evaluating debian while keeping my
'live' system (and switching from RH to debian and back via a swift
Ctrl+Alt+F7/F8..)

Now 18 months later the RH system is long gone and I'm a pretty
satisfied user of debian. 

The reason I tried doing a new install instead of upgrading my current
system was mainly that I wanted more space - the space freed up by
former RH system - about 10G - and that I prefer to keep stuff like
/var.. /tmp in separate partitions.

So the current situation is that I have about 2/3 of my hard drive
dedicated to a system that's half installed - the only useful part of
it is the grub conf file :-) - and no time at all right now to revive
this install.

But thanks much for the reminder. I had read about this approach being
the "debian way" of upgrading and I will keep it in mind. When I have
the time I will try installing etch - see if they have fixed the
installer - and if not try to install sarge and upgrade.

Thanks,

cga

PS. Apologies to the list for the [OT].


Re: display tweaks - tilde lines, statusline..

2006-06-07 Thread cga2000
On Mon, Jun 05, 2006 at 03:02:26AM EDT, A.J.Mechelynck wrote:
> cga2000 wrote:
> >On Sun, Jun 04, 2006 at 08:50:18PM EDT, A.J.Mechelynck wrote:
> >  
> >>cga2000 wrote:
> >>
> >>>On Sun, Jun 04, 2006 at 03:11:10PM EDT, A.J.Mechelynck wrote:
> >>> 
> >>>[...]
> >>> 
> >>>  
> Note that the same highlight group also governs the @ or @@@ for a 
> partial line at the end of a window, and possibly other things too.
>    
> 
> >>>I had thought of that while experimenting - although I have no idea
> >>>what the "@" and "@@@" are .. or the "partial lines".
> >>> 
> >>>  
> >>When using 'wrap', one "file line" can be wrapped onto several "screen 
> >>lines". When the last "file line" in a buffer window overflows below the 
> >>bottom of the window, then one of two things can happen:
> >>
> >>- if 'display' includes "lastline", the bottom three characters at lower 
> >>right of the window are replaced by @@@, the rest of that "file line" is 
> >>displayed, or as much of it as fits into the window.
> >>- Otherwise (the default) the last "file line" in the window is replaced 
> >>by as many "screen lines" as necessary consisting of @ at left, the rest 
> >>empty.
> >>
> >>
> >Thanks. Great explanation.
> >
> >  
> >>>Is there any way I can query vim to find out what a group (?) like
> >>>NonText actually covers?
> >>> 
> >>>  
> >>:help NonText
> >>
> >>
> >Looks like setting it to "invisible" the way you recommend is fairly
> >harmless. Hope it doesn't come back and bite me when I've forgotten all
> >about it.
> >
> >I think I should stick these doubtful customizations of mine in some
> >separate file rather than modifying individual colorschemes. I've just
> >tested: 
> >
> >:set FoldColumn=2
> >:hi  Foldcolumn ctermbg=black
> >
> >.. and it adds a 2-column margin to the left of my display and thought
> >I could add these to my .vimrc but then this will be lost whenever I
> >change colorscheme on the fly.
> >  
> 
> About 'foldcolumn', you can keep that in your vimrc, or, if you want it 
> for some particular filetype only, create a filetype-plugin (for 
> instance for HTML, in $HOME/vimfiles/after/ftplugin/html.vim for 
> Windows, $HOME/.vim/after/ftplugin/html.vim for Unix). An "after-plugin" 
> means it runs after the standard plugin, which you can let run its course.

so much stuff in vim. I'll make sure I remember the general idea at
least.
> 
> About :hi statements, you can set up your own colorscheme: copy some 
> existing colorscheme (for the default colors, 
> $VIMRUNTIME/colors/default.vim) to your "colors" directory under another 
> name (for instance $HOME/vimfiles/colors/cga2000.vim for Windows, 
> $HOME/.vim/colors/cga2000.vim for Unix), modify it there, and add 
> "colorscheme cga2000" to your vimrc. You can set colors for all three 
> modes (B&W console, color console, GUI) in a single colorscheme by using 
> the appropriate term= cterm= ctermfg= ctermbg= gui= guifg= guibg= 
> arguments. Normally you will stick to a single colorscheme which "fits 
> you best" so this shouldn't be a problem.
> 
> Note that anything in or under $VIMRUNTIME can be added, deleted or 
> modified silently by any upgrade, so it is best not to change anything 
> there -- any changes you make could disappear without warning at an 
> unspecified future time.

.. isn't there a way one could add the customization - once it's duly
tested - to a system-wide tree so other users of the system could
benefit by it? Some sort of $VIMRUNTIME/local so-to-speak..?
> 
> >  
> >>>[...]
> >>>  
> >awful thing about vim is that the more you learn the more you realize
> >how complex it is and how much more there is to learn.. But thanks to
> >all the help I am getting on this list I am now a bit more able to find
> >my own answers. The help files are great but it's really a maze.. You
> >could spend hours and hours just following these tags.. Sometimes it
> >gets to the point where I can't remember what I was looking for in the
> >first place.  
> >
> >:-)
> >  
> >>Best regards,
> >>Tony.
> >>
> >
> >Thanks,
> >
> >cga
> >
> >
> >  
> Vim is a complex (read: powerful) tool, and it does take some time to 
> learn all its capabilities. 

like.. forever..? :-)

sometimes I think Bram himself cannot know everything that's in it..

> It is also the best-documented piece of 
> software that I've ever seen (hence the needle-and-haystack problem), it 
> has great tools for searching its own help (such as helptag completion 
> and the :helpgrep command) and if there is something you still can't 
> find in the help (usually it is there but you can't find it) there are 
> these mailing lists which I've found very useful too; nowadays I take my 
> part of answering questions but I am still learning, mostly from the 
> questions that other people are asking and to which I don't know the answer.
> 
> see
> :help :help
> :help {subject}
> the above is not just any subject but the word "subject" itself,

Re: display tweaks - tilde lines, statusline..

2006-06-07 Thread cga2000
On Mon, Jun 05, 2006 at 08:27:17AM EDT, James Vega wrote:
> On Mon, Jun 05, 2006 at 01:09:41AM -0400, cga2000 wrote:
> > I think I should stick these doubtful customizations of mine in some
> > separate file rather than modifying individual colorschemes. I've just
> > tested: 
> > 
> > :set FoldColumn=2
> > :hi  Foldcolumn ctermbg=black
> > 
> > .. and it adds a 2-column margin to the left of my display and thought
> > I could add these to my .vimrc but then this will be lost whenever I
> > change colorscheme on the fly.
> 
> As Tony mentioned, setting 'foldcolumn' can be done in your vimrc.  The
> highlighting can also be done there by taking advantage of autocommands.
> 
>   :au ColorScheme * hi FoldColumn ctermbg=black
> 
> This only works in vim7 though since that's when the ColorScheme event
> was introduced.  It may also be better to set ctermbg=NONE in case you
> change which colorscheme you use in the future to one that does not have
> a black background.
> 
.. yet another thing I need to worry about.. not introducing doubtful
customization that will break when I upgrade.

Thanks

cga


Re: display tweaks - tilde lines, statusline..

2006-06-07 Thread A.J.Mechelynck

cga2000 wrote:
[...]

.. isn't there a way one could add the customization - once it's duly
tested - to a system-wide tree so other users of the system could
benefit by it? Some sort of $VIMRUNTIME/local so-to-speak..?
  


Yes, there is. It is called $VIM/vimfiles/. Check your 'runtimepath' 
option by using


:set runtimepath?

The answer is a comma-separated list of (usually) five directories, 
which are the heads of trees constructed identically. $VIMRUNTIME 
contains all possible subdirectories; the others, with their 
subdirectories, need only exist inasmuch as you have something to put in 
them. Here are the most usual names (given in Vim notation):


$HOME/.vim/ (on Unix)
$HOME/vimfiles/ (on Windows)
full-fledged scripts specific to a single user

$VIM/vimfiles/ (on all platforms)
full-fledged scripts set up system-wide by an admin

$VIMRUNTIME (which is normally $VIM/vim70/ for Vim 7.0, similarly with a 
different suffix for other versions)

anything that was installed with the Vim distribution, and NOTHING ELSE.
A version upgrade (e.g., from 7.0 to a future 7.1 or 8.0) will rebuild 
this completely with a different name.

A patchlevel upgrade may silently overwrite anything in here.

$VIM/vimfiles/after/
system-wide scripts adding small tweaks to scripts of the same name and 
subpath in any of the above


$HOME/.vim/after/ (on Unix)
$HOME/vimfiles/after (on Windows)
user-specific scripts adding small tweaks to scripts of the same name 
and subpath in any of the above
 
  

[...]
 
  

sometimes I think Bram himself cannot know everything that's in it..
  


Maybe, but he knows quite a lot, and he built himsekf the tools to find 
what he forgot or plain doesn't know (see below).


  
It is also the best-documented piece of 
software that I've ever seen (hence the needle-and-haystack problem), it 
has great tools for searching its own help (such as helptag completion 
and the :helpgrep command) and if there is something you still can't 
find in the help (usually it is there but you can't find it) there are 
these mailing lists which I've found very useful too; nowadays I take my 
part of answering questions but I am still learning, mostly from the 
questions that other people are asking and to which I don't know the answer.


see
:help :help
:help {subject}
the above is not just any subject but the word "subject" itself, between 
braces

:help CTRL-]
:help :helptags

and the "wild" options, some of which we spoke about in an earlier post 
on this thread,

:help 'wildchar'
:help 'wildmenu'
:help 'wildmode'
:help 'wildoptions'



I think I need to schedule a sabbatical day once a month to work on
improving my vim skills. Jotted :helpgrep on a piece of paper.. sounds
promising. All the others you mention I already use.. though probably
not to their fullest extent.

Thanks,

cga


  


:-) Best wishes,
Tony.


Re: what is wrong with this autoload var usage?

2006-06-07 Thread Hari Krishna Dara

On Wed, 7 Jun 2006 at 8:16pm, A.J.Mechelynck wrote:

> Hari Krishna Dara wrote:
> > On Wed, 7 Jun 2006 at 8:10am, Jürgen Krämer wrote:
> >
> >
> >> Hi,
> >>
> >> Hari Krishna Dara wrote:
> >>
> >>> I am trying to use the new vim7 "object-based" features and am stuck
> >>> with an issue in using autoload style variables. Save the below as t.vim
> >>> in your autoload directory and execute it (:runtime autoload/t.vim).
> >>>
> >>> let t#var = 'something'
> >>>
> >>> let s:hash = {}
> >>> function! s:hash.func()
> >>>   echomsg 'from numbered function scope: '. g:t#var
> >>> endfunction
> >>>
> >>> echomsg 'from global scope: '. t#var
> >>> call s:hash.func()
> >>> 
> >>>
> >>> you get the below output:
> >>>
> >>> from global scope: something
> >>> Error detected while processing function 3:
> >>> line1:
> >>> E121: Undefined variable: t#var
> >>> E15: Invalid expression: 'from numbered function scope: '. t#var
> >>>
> >>> Is there something wrong that I am doing or is this a bug?
> >>>
> >> inside a function you have to reference global variables with the "g:"
> >> prefix even if it's an autoload variable, i.e.
> >>
> >>   function! s:hash.func()
> >> echomsg 'from numbered function scope: '. g:t#var
> >>   endfunction
> >>
> >> Regards,
> >> Jürgen
> >>
> >
> > Strange... according to the documentation at |autoload|, you can access
> > them without the g: prefix.
> >
>
> According to the documentation at |global-variables|, omitting g: within
> a function definition gives you a variable local to the function:
>
> *global-variable* *g:var*
> Inside functions global variables are accessed with "g:".  Omitting this
> will
> access a variable local to a function.  But "g:" can also be used in any
> other
> place if you like.
>

Sorry, I wasn't clear. I knew about this difference. What I was trying
to say was that the variables and functions that have an autoload prefix
should by default be global. Why would anyone want to create a script
local variable with autoload prefix? a script local variables can only
be accessed from with in the same script, but then if the script is
already loaded, you don't need to autoload it anymore. All the autloader
ids can and should safely be considered as global. I hope I make sense
at least for someone.

-- 
Thanks,
Hari

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


RE: Tab complete filenames

2006-06-07 Thread Hari Krishna Dara

On Wed, 7 Jun 2006 at 11:18am, Max Dyckhoff wrote:

> I completely forgot about abbreviations, although the remap that I came
> up with doesn't work badly at all because it does check the command pos,
> and I never use any other :sf* command than sfind.
>
> If you could send me a zip of your experimental plugin that would be
> great, I'd love to give it a go! I'm using vim 7, if that helps.
>
> Thanks!
>
> Max

Sorry, I forgot that your map also has command position as restriction.
Note that abbreviations have an advantage that they don't timeout
(besides giving an immediate visual feedback, as you see what you are
typing) and you can recover from mistakes. They also provide a way to
enter the token without getting expanded, just in case you ever need to
do that. But if you are happy with this, you probably shouldn't worry
about these advantages.

I will send you a zip of lookupfile.vim and its depenedent file soon.

-- 
Thanks,
Hari

>
> > -Original Message-
> > From: Hari Krishna Dara [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, June 07, 2006 11:16 AM
> > To: Max Dyckhoff
> > Cc: Gerald Lai; vim org
> > Subject: RE: Tab complete filenames
> >
> >
> > On Wed, 7 Jun 2006 at 9:29am, Max Dyckhoff wrote:
> >
> > > > You're working on a large project, so I would advise caution when
> > > doing
> > > > tab completion. If you happened to be waiting on an accidental
> (slow)
> > > > completion like a, then hit Ctrl-c to stop it.
> > >
> > > Yes, I love how vim is nice and intuitive if Linux stuff is
> ingrained in
> > > your every move :)
> > >
> > >
> > > > Nope, no (easy) way. That's just how Vim was implemented. You
> could
> > > hack
> > > > the source code though.
> > > >
> > > > If you don't have any other commands besides :Sfind beginning with
> > > "Sf",
> > > > you can just do :Sf instead of the full :Sfind. It's an extra
> Shift
> > > > keystroke.
> > >
> > > That is a shame. Regrettably I have enough coding to do without
> hacking
> > > through the source for vim and getting it to compile on Windows; I'm
> > > sure I could do it in Linux in a couple of minutes but that wouldn't
> > > help me at work much! Curses. However I have found a rather nice
> > > solution (see below).
> > >
> > >
> > > > An (untested) alternative I just thought of is to do something
> like
> > > this
> > > > (Vim 7):
> > > >
> > > >cnoremap :
> > > getcmdpos()==1?toupper(nr2char(getchar())):':'
> > >
> > > That is rather great, although it doesn't work with the  tag
> in
> > > there. That is, it DOES work, but it is somewhat confusing. Because
> of
> > > the  the result of the ":getchar()" will not be displayed in
> the
> > > command line, meaning if you enter "::sf" then you will see on the
> > > command line ":f ". Note the space after the "f". If you now press
> > > backspace the command line changes to ":S". Removing the 
> makes
> > > the remapping of : work perfectly.
> > >
> > > However I was playing around and came up with an alternative mapping
> > > which makes me grin all over. It is a really logical continuation of
> the
> > > remapping of : that you provided:
> > >
> > >   cnoremap sf getcmdpos()==1?'Sf':'sf'
> > >
> > > Brilliant! It works exactly as I want, and if you pause after the
> "s"
> > > before typing the "f" (for timeoutlen) then it aborts the remap and
> > > gives you a lowercase "sf".
> > >
> > > Thanks for your help Gerald, I hope this thread helps others in
> their
> > > time of need!
> > >
> > > Max
> >
> > I wasn't tracking the thread initially, but here is my input. Maps are
> > not the best approach for tasks like this, you should use
> abbreviations.
> > With maps, if you type sf anywhere on the commandline, it will become
> > Sf. You don't want that to happen in a filename right (well, if you
> are
> > on windows you might not care most of the time, but there are enough
> > other cases you should). I suggest you take a look at the cmdalias.vim
> > plugin that I wrong just for these cases. If you create an alias like
> > this:
> >
> > call CmdAlias('sf', 'Sf')
> > call CmdAlias('sfind', 'Sfind')
> >
> > it creates abbreviations such that they get changed only when they are
> > typed at the start of the command-line and when they are by themselves
> > (e.g, :sfix will not become :Sfix). I also added a tip recently which
> > shows how to use cmdalias.vim:
> >
> > http://www.vim.org/tips/tip.php?tip_id=1247
> >
> > I use cmdalias plugin heavily and haven't faced any issues.
> >
> > I was also experimenting with a plugin that would lookup filenames as
> > you type. Except for a bug in Vim completion bothering me, it works
> > well, and is usable. Instead of using the 'path' setting, it uses tags
> > created specially for filenames, so it is a lot faster, you can use
> > regular expressions and you get a dropdown with all the matching
> > filenames. If you are interested, let me know I will send you a zip.
> >
> > --
> > HTH,
> > Hari
> >
> > 

RE: Tab complete filenames

2006-06-07 Thread Gerald Lai

On Wed, 7 Jun 2006, Hari Krishna Dara wrote:



On Wed, 7 Jun 2006 at 11:18am, Max Dyckhoff wrote:


I completely forgot about abbreviations, although the remap that I came
up with doesn't work badly at all because it does check the command pos,
and I never use any other :sf* command than sfind.

If you could send me a zip of your experimental plugin that would be
great, I'd love to give it a go! I'm using vim 7, if that helps.

Thanks!

Max


Sorry, I forgot that your map also has command position as restriction.
Note that abbreviations have an advantage that they don't timeout

[snip]

That's actually the main reason why I suggested cmapping ':' with the
command position restriction. You don't have to "wait" on it like other
mappings of more than one character. Plus, by default, entering leading
colons on the :cmdline is superfluous. Try "::echo '123'".

Max, my mistake on . I couldn't test the mapping, as I was on my
Linux box with Vim 6.3, so I just fired away. I'm glad that it worked
out :)
--
Gerald


-Original Message-
From: Hari Krishna Dara [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 07, 2006 11:16 AM
To: Max Dyckhoff
Cc: Gerald Lai; vim org
Subject: RE: Tab complete filenames


On Wed, 7 Jun 2006 at 9:29am, Max Dyckhoff wrote:


You're working on a large project, so I would advise caution when

doing

tab completion. If you happened to be waiting on an accidental

(slow)

completion like a, then hit Ctrl-c to stop it.


Yes, I love how vim is nice and intuitive if Linux stuff is

ingrained in

your every move :)



Nope, no (easy) way. That's just how Vim was implemented. You

could

hack

the source code though.

If you don't have any other commands besides :Sfind beginning with

"Sf",

you can just do :Sf instead of the full :Sfind. It's an extra

Shift

keystroke.


That is a shame. Regrettably I have enough coding to do without

hacking

through the source for vim and getting it to compile on Windows; I'm
sure I could do it in Linux in a couple of minutes but that wouldn't
help me at work much! Curses. However I have found a rather nice
solution (see below).



An (untested) alternative I just thought of is to do something

like

this

(Vim 7):

   cnoremap :

getcmdpos()==1?toupper(nr2char(getchar())):':'

That is rather great, although it doesn't work with the  tag

in

there. That is, it DOES work, but it is somewhat confusing. Because

of

the  the result of the ":getchar()" will not be displayed in

the

command line, meaning if you enter "::sf" then you will see on the
command line ":f ". Note the space after the "f". If you now press
backspace the command line changes to ":S". Removing the 

makes

the remapping of : work perfectly.

However I was playing around and came up with an alternative mapping
which makes me grin all over. It is a really logical continuation of

the

remapping of : that you provided:

cnoremap sf getcmdpos()==1?'Sf':'sf'

Brilliant! It works exactly as I want, and if you pause after the

"s"

before typing the "f" (for timeoutlen) then it aborts the remap and
gives you a lowercase "sf".

Thanks for your help Gerald, I hope this thread helps others in

their

time of need!

Max


I wasn't tracking the thread initially, but here is my input. Maps are
not the best approach for tasks like this, you should use

abbreviations.

With maps, if you type sf anywhere on the commandline, it will become
Sf. You don't want that to happen in a filename right (well, if you

are

on windows you might not care most of the time, but there are enough
other cases you should). I suggest you take a look at the cmdalias.vim
plugin that I wrong just for these cases. If you create an alias like
this:

call CmdAlias('sf', 'Sf')
call CmdAlias('sfind', 'Sfind')

it creates abbreviations such that they get changed only when they are
typed at the start of the command-line and when they are by themselves
(e.g, :sfix will not become :Sfix). I also added a tip recently which
shows how to use cmdalias.vim:

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

I use cmdalias plugin heavily and haven't faced any issues.

I was also experimenting with a plugin that would lookup filenames as
you type. Except for a bug in Vim completion bothering me, it works
well, and is usable. Instead of using the 'path' setting, it uses tags
created specially for filenames, so it is a lot faster, you can use
regular expressions and you get a dropdown with all the matching
filenames. If you are interested, let me know I will send you a zip.

--
HTH,
Hari

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com





__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com



Re: Changing a long list of entries with corresponding index

2006-06-07 Thread Gerald Lai

On Wed, 7 Jun 2006, Charles E Campbell Jr wrote:


Gerald Lai wrote:


Visincr pads trailing spaces as the number of characters needed to
represent the end number increases. What I mean is, for the above
example, we will be left with:

  cities[0   ] = ...
  .
  .
  cities[2039] = ...

Could it be made to pad nothing? Or, in addition, even leading
zeros/spaces/other characters?

Also, are there plans for incrementing/decrementing hex & octal?


As of v13, a zfill of '' or "" will work to "pad nothing":

 :[visual-block range]II 1 ""

You may use other characters, too.

As of v14b, the :IX (and :IIX) commands do hexadecimal incrementing.

I haven't done octal (yet).  Guess that'll be :[visual-block range]IO (and 
IIO).

Version v14b is available at my website:

http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
as "Visual Incrementing".


Thanks! I'll install it on my next update cycle. Keep up the good work
:)

1. Can (and should) zfill be made into a global option? I'd imagine most
people would prefer to "pad nothing".

2. How about leading zfills? For example:

   cities[] = ...
   cities[0001] = ...
   .
   .
   cities[2039] = ...

--
Gerald