Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

vim · Vim (Vi IMproved) text editor users list

The Yahoo! Groups Product Blog

Check it out!

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 50585 - 50614 of 137716   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#50585 From: "Antoine J. Mechelynck" <antoine.mechelynck@...>
Date: Sat May 29, 2004 11:44 am
Subject: Re: use vim to "translate" Chinese (simplified/traditional)
antoine.mechelynck@...
Send Email Send Email
 
Xiangjiang Ma <maxiangjiang@...> wrote:
> Hi,
>
> I am interested in "translating" between the simplified Chinese
> and the traditional Chinese using vim functions/scripts. This is
> more like what "gu" and "gU" do for ASCII. Anyone out there can
> help with the following task 3?
>
> I will add it to http://vim.sourceforge.net/tips
> if it can be done successfully.
>
>
> Assumptions:
>
> 1. There is one-to-one map between the Simplified Chinese and the
>    Traditional Chinese  (80% true in real life?)
> 2. The encoding is set to be utf-8
>
>
> Tasks:
>
> 1. define a Simplified_Chinese_String, with 6000 unicode point (DONE)
> 2. define a Traditional_Chinese_String, with 6000 unicode point (DONE)
> 3. write one function to do transform from Simplified to Traditional
>    a) loop through the whole vim buffer
>    b) for every char, find its index in the Simplified_Chinese_String

see ":help stridx()"

>    c) use the index to replace the char with the corresponding
>       Traditional which can be found from the
> Traditional_Chinese_String
> 4. write one function to do transform from Traditional to Simplified

should be the same in reverse (i.e. reversing the roles of the two arrays)
[...]

Seems interesting. I suppose it can be assumed that anything "not found in
table" is to be kept without change. To speedup the conversion, "codepoint
ranges" might be defined, so that out-of-range values would be left
unchanged with no lookup.

I look forward to seeing this in vim script.
Tony.

#50586 From: "Antoine J. Mechelynck" <antoine.mechelynck@...>
Date: Sat May 29, 2004 2:28 pm
Subject: Bug or feature? [-] for helpfiles when 'statusline' nonempty
antoine.mechelynck@...
Send Email Send Email
 
With 'statusline' empty, "normal" files have [+] when modified, otherwise
nothing at that position; help files, at least when not modified (the usual
case), have nothing.

After

       set statusline=%<%f\
%h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\
&bomb)?\",B\":\"\").\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P

(all on one line), "normal" unmodified files still have nothing. Help files
have [-] even though ":setl mod?" answers "nomodified".

Bug or feature? My understanding was that %m means

print nothing if 'nomodified'
print [+] if 'modified' and 'noreadonly'
print [-] if 'modified' but 'readonly' (the help says if 'nomodifiable' but
how can we have 'modified' if 'nomodifiable'?)

Apparently I misunderstood? Does [-] mean 'nomodifiable' then, regardless of
'modified' status (which will be off)? If so, why does that flag _not_
appear on helpfiles with 'statusline' empty?

Regards,
Tony.

#50587 From: "jonah" <jonahgoldstein@...>
Date: Sun May 30, 2004 7:24 am
Subject: hotkey parameters
jonahgoldstein@...
Send Email Send Email
 
Hi,

I have a custom function that takes a single
parameter, which can be called as follows:

:call MyFunction(integerParameter)

But the function is something I use alot and I'd like
to be able to call it from normal mode with a hotkey
but still pass it a parameter.  Eg, type:

4<F8>

as a shorthand for the call:

:call MyFunction(8)

Is there any way to do this?

Thanks,
Jonah

#50588 From: Jacob Lerner <qlerner@...>
Date: Sun May 30, 2004 10:00 am
Subject: Re: hotkey parameters
qlerner@...
Send Email Send Email
 
jonah wrote:

>I have a custom function that takes a single
>parameter, which can be called as follows:
>
>:call MyFunction(integerParameter)
>
>But the function is something I use alot and I'd like
>to be able to call it from normal mode with a hotkey
>but still pass it a parameter.  Eg, type:
>
>4<F8>
>
>as a shorthand for the call:
>
>:call MyFunction(8)
>
>Is there any way to do this?
>
>
>
I believe the solution is to use v:count or v:count1:

    :nmap <F8> :call MyFunction(v:count1)<cr>

see :help v:count1

Yakov

#50589 From: Yakov Lerner <qlerner@...>
Date: Sun May 30, 2004 2:18 pm
Subject: delay doing 60i-<esc>
qlerner@...
Send Email Send Email
 
Hello,

I have noticeable delay when I do 60i-<esc>
(to insert 60 minuses; The delay occurres after I type <esc>)

Is there a trick to make vim show which mapping(s)
are causing the delay?
How do I find out which mappings cause the delay ?
Is there any trick to quickly find this out ?

I have about hundred of mappings, and I really don't want to
start disabling the mappings one-by-one. But I want to
find out which mappings causes the delay.

I don't have any mapping that starts with <esc>, and I removed
all mapping for Fx functional keys; still have delay. I don't
have mapping for 'i', nor for '-', nor for numbers. Delay doesn't
happen in 'vim -u NONE'; but I still have ~100 of mappings.

How do I go about finding mapping causes the delay, without
disabling the mappings one-by-one ?

Yakov

#50590 From: "Antoine J. Mechelynck" <antoine.mechelynck@...>
Date: Sun May 30, 2004 1:58 pm
Subject: Re: delay doing 60i-<esc>
antoine.mechelynck@...
Send Email Send Email
 
Yakov Lerner <qlerner@...> wrote:
> Hello,
>
> I have noticeable delay when I do 60i-<esc>
> (to insert 60 minuses; The delay occurres after I type <esc>)
>
> Is there a trick to make vim show which mapping(s)
> are causing the delay?
> How do I find out which mappings cause the delay ?
> Is there any trick to quickly find this out ?
>
> I have about hundred of mappings, and I really don't want to
> start disabling the mappings one-by-one. But I want to
> find out which mappings causes the delay.
>
> I don't have any mapping that starts with <esc>, and I removed
> all mapping for Fx functional keys; still have delay. I don't
> have mapping for 'i', nor for '-', nor for numbers. Delay doesn't
> happen in 'vim -u NONE'; but I still have ~100 of mappings.
>
> How do I go about finding mapping causes the delay, without
> disabling the mappings one-by-one ?
>
> Yakov

Maybe the going back-and-forth between Normal and Insert mode 60 times is
causing the delay? Try

     60"="-"<CR>p

(60 puts of a dash from the expression register).

HTH,
Tony.

#50591 From: Klaus Bosau <kbosau@...>
Date: Sun May 30, 2004 4:26 pm
Subject: Unable to set font-attribute
kbosau@...
Send Email Send Email
 
Hi,

to set filetype-specific font attributes (among other things)
I recently added this to .vimrc

      fun! s:Init_vim()
        ...
        set gfn=Courier_New:h12:b:cANSI
        ...
      endfun

      set gfn=Courier_New:h14:b:cANSI
      " for all

      augroup vimfile
        au!
        au BufNewFile,BufRead *.vim call s:Init_vim()
      augroup END
      " scripts only

what to my surprise had the effect that Vim mixed up several fonts and
font-attributes in one and the same (script) file. - Has anybody seen
this too? Are there restrictions on the number of font-attribute
changes during start-up (or the particular context this happens in..)?
(v. 6.2)

TIA

Klaus

#50592 From: Bram Moolenaar <Bram@...>
Date: Sun May 30, 2004 5:52 pm
Subject: Re: Bug or feature? [-] for helpfiles when 'statusline' nonempty
Bram@...
Send Email Send Email
 
Antoine J. Mechelynck wrote:

> With 'statusline' empty, "normal" files have [+] when modified, otherwise
> nothing at that position; help files, at least when not modified (the usual
> case), have nothing.
>
> After
>
>       set statusline=%<%f\
> %h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).((exists(\"+bomb\")\ &&\
> &bomb)?\",B\":\"\").\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P
>
> (all on one line), "normal" unmodified files still have nothing. Help files
> have [-] even though ":setl mod?" answers "nomodified".
>
> Bug or feature? My understanding was that %m means
>
> print nothing if 'nomodified'
> print [+] if 'modified' and 'noreadonly'
> print [-] if 'modified' but 'readonly' (the help says if 'nomodifiable' but
> how can we have 'modified' if 'nomodifiable'?)
>
> Apparently I misunderstood? Does [-] mean 'nomodifiable' then, regardless of
> 'modified' status (which will be off)? If so, why does that flag _not_
> appear on helpfiles with 'statusline' empty?

I don't know why you expected %m to behave this way.  The docs mention:

	 m F   Modified flag, text is " [+]" or " [-]" if 'modifiable' is off.

The idea is that a "normal" file doesn't show anything.  It is not
normal for a file to be not modifiable.

With 'statusline' empty something a bit more clever is done, mentioning
"help" is enough to let the user know what kind of buffer it is.

--
A)bort, R)etry, B)ang it with a large hammer

  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///

#50593 From: "Antoine J. Mechelynck" <antoine.mechelynck@...>
Date: Sun May 30, 2004 6:36 pm
Subject: Re: Bug or feature? [-] for helpfiles when 'statusline' nonempty
antoine.mechelynck@...
Send Email Send Email
 
Bram Moolenaar <Bram@...> wrote:
[...]
> I don't know why you expected %m to behave this way.  The docs
> mention:
>
> m F   Modified flag, text is " [+]" or " [-]" if 'modifiable' is off.
>
> The idea is that a "normal" file doesn't show anything.  It is not
> normal for a file to be not modifiable.
>
> With 'statusline' empty something a bit more clever is done,
> mentioning "help" is enough to let the user know what kind of buffer
> it is.

So I was mistaken. No way to reproduce the behaviour of the empty option
(let's say I want to make a small change at another point of the status
line), other than by means of an explicit expression, is there? Oh, well.
Every day brings its bit of learning. Guess I'll have to nest (?:) operators
there.

>
> --
> A)bort, R)etry, B)ang it with a large hammer
>
>  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net
> \\\ ///        Sponsor Vim, vote for features --
> http://www.Vim.org/sponsor/ \\\ \\\              Project leader for
>  A-A-P -- http://www.A-A-P.org        /// \\\  Buy at Amazon and help
> AIDS victims -- http://ICCF.nl/click1.html ///

Best regards,
Tony.

#50594 From: Paul Jolly <paul@...>
Date: Sun May 30, 2004 10:28 pm
Subject: TOhtml error with ft=bib
paul@...
Send Email Send Email
 
Dear list,

$ cat ~/.vimrc
...
let html_use_css = 1
...

$ vi test.bib

[ insert the following ]

@book{test,
    url = {http://www.test.com/},
}

[ invoke :TOhtml ]

Notice, the following output:

...
@<span class="Identifier">book</span>{<span class="Special">test</span>,
      <span class="PreProc">url</span> = {<A
HREF="http://www.test.com/}">http://www.test.com/}</A>,
}
...

The HREF attribute has incorrectly been populated with
"http://www.test.com/}" as opposed to "http://www.test.com/".



Many thanks,


Paul
--
Department of Computing, Imperial College London
http://myitcv.org.uk/

#50595 From: "David Fishburn" <fishburn@...>
Date: Sun May 30, 2004 11:14 pm
Subject: Generating lists from buffer variables
fishburn@...
Send Email Send Email
 
Vim 6.3b WinXP

My plugin creates a buffer variables.
Each buffer variable is prefixed with dbext_default_[name].

What I would like to do is get a dynamic list of all these variables (since
they can be dynamic if you override or set new ones from your vimrc).

This part isn't hard:
             let saveA = @a
             redir  @a
                 silent! exec 'let'
             redir END

But :let returns all variables.
From this string I want to remove all non-dbext variables.
I tried something like this:
echo substitute(@w, '\n.\{-}\(dbext_default_profile\)\@!.\{-}\n', '\n', 'g')

Since :let returns something like this:

...
Grep_Path              c:\vim\Tools\grep
Fgrep_Path             c:\vim\Tools\fgrep
Egrep_Path             c:\vim\Tools\egrep
Agrep_Path             c:\vim\Tools\agrep
...
dbext_default_profile_ASA  type=ASA,user=DBA,passwd=SQL
dbext_default_profile_MSS  type=SQLSRV,user=sa,passwd=test,dbname=CustDB
dbext_default_profile_ORA  type=ORA,srvname=ffs42ga,user=mbt,passwd=Leader
dbext_default_profile_ASE
type=ASE,user=sa,passwd=sysadmin,srvname=regd120,dbname=ml8
dbext_default_profile_DB2  type=DB2,user=db2admin,passwd=Leader03,dbname=SSD
dbext_default_profile_ORA_REG  type=ORA,srvname=reg9i,user=system,passwd=sql
dbext_default_profile_PG  type=PGSQL,dbname=mydb
...


So what I want back is:
ASA  type=ASA,user=DBA,passwd=SQL
MSS  type=SQLSRV,user=sa,passwd=test,dbname=CustDB
ORA  type=ORA,srvname=ffs42ga,user=mbt,passwd=Leader


From there, I want to create a numbered list.
So:
1.  ASA
2.  MSS
3.  ORA

So I can display this via the inputdialog() function, and allow the user to
choose a # to set which profile they want to use.
1.  type=ASA,user=DBA,passwd=SQL
2.  type=SQLSRV,user=sa,passwd=test,dbname=CustDB
3.  type=ORA,srvname=ffs42ga,user=mbt,passwd=Leader

I am using Hari's Multval plugin, so I think I can get some of the number
lists features through it.
Hari, is there anyway that I can figure out which entry # I am at?

Consider this case, I would create 2 multvals arrays,
profile_names:
ASA
MSS
ORA

profile_values
type=ASA,user=DBA,passwd=SQL
type=SQLSRV,user=sa,passwd=test,dbname=CustDB
type=ORA,srvname=ffs42ga,user=mbt,passwd=Leader


So if I user choose entry 2, I was hoping to go directly to the 2nd entry,
instead of having to do a MvIterNext() x-times to get to the right entry.
Multvals has MvElementAt() which takes an index entry, but it is an offset,
not an element.  So it would take offset 45 (meaning 45 characters into it)
instead of the 2nd entry in the array.

Thanks in advance for any help.

Dave

#50596 From: Gareth Redman <gredman@...>
Date: Sun May 30, 2004 11:37 pm
Subject: Re: delay doing 60i-<esc>
gredman@...
Send Email Send Email
 
On Sun, May 30, 2004 at 04:18:34PM +0200, Yakov Lerner wrote:
> Hello,
>
> I have noticeable delay when I do 60i-<esc>
> (to insert 60 minuses; The delay occurres after I type <esc>)
>

Hi,

Does this have anything to do with 'timeout' and friends?  I have the
following in my .vimrc:

     :set timeout timeoutlen=3000 ttimeoutlen=100

HTH.

#50597 From: "Xiangjiang Ma" <maxiangjiang@...>
Date: Sun May 30, 2004 11:59 pm
Subject: Announcement: script for transfering Chinese to Chinese is created
maxiangjiang@...
Send Email Send Email
 
Hi,


My initial version of TransferChinese.vim was just uploaded as
a vim plugin. It can be found in
http://vim.sourceforge.net/scripts/script.php?script_id=999

In summary, it offers
-----------------------------------------------------------
   (a) "quick and dirty" way to transfer Chinese to Chinese
   (b) 20% of efforts for solving 80% of problems
   (c) 2172 Chinese pairs are used for one-to-one map
   (d) cursor positions are kept after gS and gT
   (e) [range] for visual mode is supported
-----------------------------------------------------------

I have received quite of few individual responses,
unfortunately, I deleted all messages by accident.
The only I can do is to apply to all here:

(1) First, thanks for offering me the following key logic

     ----------------------------------------
      let s:simp = 'abc'
      let s:trad = 'ABC'
      fun! Cvt()
        fun! s:Eq(char)
          let i = match(s:simp, a:char)
          return (i >= 0 ? s:trad[i] : a:char)
        endfun
        %s/./\=s:Eq(submatch(0))/g
      endfun
     ----------------------------------------

     However, s:trad[i] does not work for multi-byte.
     :help expr8 points out this limitation.

     I figured out a workaround after many tries:
         let i = match(s:simp, a:char)
         let m = strpart(s:trad, i, 3)
         return (i >= 0 ? m : a:char)
     (assuming utf-8 encoding is used, and cjk is stored as 3 code units)

(2) I am in California, where US_en is set by default.
     I never have chance to use BIG5 or GB operating systems.
     Also, my job has nothing to do with Chinese language :)

(3) I am in favor of storing/processing all CJK text files in
     UTF-8, which can then be displayed on browser in Big5 or GB
     environments without any extra work. I also found gvim is
     excellent in processing CJK unicode.

(4) Please provide me the drawbacks of using utf-8
     (a) 50% more diskspace. (I understand, but it is worthwhile.)
     (b) slow indexing --- (yes, but)
         Can somebody show me some real-life examples?
     (c) Is it political reasons against using UTF-8 there?
     (d) Is it economic reasons against using UTF-8 there?
     (e) Or is it a future direction to use UNICODE there?

(5) For http://groups.yahoo.com/group/vim/message/50585

Tony> so that out-of-range values would be left
Tony> unchanged with no lookup.

Tony, any better way to do it than my following try?
   if char2nr(a:char) < 19968
       return a:char
   endif

It saves one processing step for mapping, but I still need to
replace the unicode point to itself.


Thanks to all


--
Xiangjiang Ma
maxiangjiang@...

_________________________________________________________________
Watch LIVE baseball games on your computer with MLB.TV, included with MSN
Premium! http://join.msn.click-url.com/go/onm00200439ave/direct/01/

#50598 From: "Antoine J. Mechelynck" <antoine.mechelynck@...>
Date: Mon May 31, 2004 12:57 am
Subject: ANN: Nightly builds available for W32
antoine.mechelynck@...
Send Email Send Email
 
Hi Vimmers,

I've decided to make my W32 "nightly builds" available to y'all.

No Warranty of Marchantability or Fitness for Any Particular Purpose (You
know the blurb) ;-).

Unlike Steve Hall's distributions, what I'm publishing is an "incremental
zipfile" to be unpacked over the official 6.3b.0. It contains only the
changes (at the moment: gvim.exe, vim.exe, mswin.vim, plugin/rrhelper.vim).

For more details, see http://users.skynet.be/antoine.mechelynck/vim/

Happy Vimming! (and good night: it's 3 AM here).
Tony.

#50599 From: george@...
Date: Mon May 31, 2004 1:31 am
Subject: read it immediatelly
george@...
Send Email Send Email
 
did you sent it to me?

#50600 From: "vim" <vim9527@...>
Date: Mon May 31, 2004 3:20 am
Subject: S-record syntax and ftplugin file
vim9527@...
Send Email Send Email
 
I wrote a S-record syntax file, based on Hex's syntax, and a companion
ftplugin file. the plugin can detect whether the current record's format is
correct,
if the data count is wrong, it will produce a message:
========================
     The data count of this record(3) is wrong!
========================
in which the 3 is the line number of the record.
if the checksum is absense, the message will be:
========================
This record looks have no checksum, press <C-K> to generate checksum for it
========================
If the checksum is present, but wrong, it will complain about:
========================
The Check sum is wrong!, should be: 0x27, Press <C-K> to correct it
========================
  the 0x27 is the right CheckSum for it.

At anytime You can press <C-K> to correct the checksum. regardless the
checksum is already contained in the recorder. but if the data count is
incorrect, it'll do nothing

The check is driven by a CursorHold event.

#50601 From: Leslie Everett <leslie.o.everett@...>
Date: Mon May 31, 2004 4:23 am
Subject: vi: fatal - missing octree argument
leslie.o.everett@...
Send Email Send Email
 
Hi,

Recently installed Radiance 3.5 (an open-source, unix-based,
ray-tracing program) on my PowerBook G4 with Mac OS X. The ray-tracing
program works fine but (Vim 6.2) part of the default installation of OS
X, is now broken. When I type "vi" or "vim"

vi: fatal - missing octree argument

if I type: "$EDITOR"

/usr/bin/vi: fatal - missing octree argument

If I type: "vi help"

"vi - system - cannot open octree file "help": no such  file  or
directory"      # it does this instead of creating a new file, called
"help" in this case ...

I've checked:

.vmrc
/usr/share/vim/vimrc
/usr/share/vim/vim62/syntax/viminfo.vim
/usr/bin/vi

Upgraded from OS X 10.3.3. to 10.3.4 hoping it might fix vim, but it
didn't. Hopefully someone on this list can offer a possible answer. Do
I need to reinstall vim, or is there an init file I can reconfigure to
invoke vim instead of this error? Someone suggested the ray-tracing
program may have a vi that is evoked? I looked, didn't see one. Ideas
much appreciated.
TIA

- Leslie

#50602 From: dany.stamant@...
Date: Mon May 31, 2004 4:31 am
Subject: Re: thanks!
dany.stamant@...
Send Email Send Email
 
Your file is attached.

++++ Attachment: No Virus found
++++ Norman AntiVirus - www.norman.com

#50603 From: "Antoine J. Mechelynck" <antoine.mechelynck@...>
Date: Mon May 31, 2004 9:15 am
Subject: Re: Announcement: script for transfering Chinese to Chinese is created
antoine.mechelynck@...
Send Email Send Email
 
Xiangjiang Ma <maxiangjiang@...> wrote:
[...]
> Tony, any better way to do it than my following try?
>   if char2nr(a:char) < 19968
>       return a:char
>   endif
>
> It saves one processing step for mapping, but I still need to
> replace the unicode point to itself.
>
>
> Thanks to all
>
>
> --
> Xiangjiang Ma
> maxiangjiang@...

1) IMHO, it might be worthwhile to also set an upper range to avoid
accidentally "converting" Mongolian, Cuneiform, etc.

2) The condition "not found in table" is (IIUC) not an error, we assume in
that case that no conversion is necessary.

3) Don't forget that there may quite possibly be ASCII text (digits 0-9, for
instance) intermixed with CJK text. In that case the number of data bytes
occupied by a single character is other than 3.

3) Maybe you know the following, but "just in case" here is how to "exactly"
determine how many bytes there are in a given UTF-8 byte sequence by looking
at its first byte.

a) 0x80 to 0xBF can never be the first byte of a sequence, they contribute 6
bits to the codepoint value. Other bytes can never be anything but the first
of a sequence.
b) 0x00 to 0x7F is the only byte of a single-byte sequence and contributes 7
bits to the codepoint value.
c) 0xC0 to 0xDF is the first byte of a 2-byte sequence and contributes 5
bits to the codepoint value.
d) 0xE0 to 0xEF ... 3-byte ... 4 bits ...
e) 0xF0 to 0xF7 ... 4-byte ... 3 bits ...
The following will not be used "in any foreseeable future" and may be
regarded as illegal bytes:
f) 0xF8 to 0xFB ... 5-byte ... 2 bits ...
g) 0xFC and 0xFD ... 6-byte ... 1 bit ...
h) 0xFE and 0xFF are illegal in UTF-8.

IOW, the first byte of a sequence of 2 or more has as many "high" one-bits
as there are bytes in the sequence, then a single zero-bit, then as many
data bits as there is room for.

Regards,
Tony.

#50604 From: dany.stamant@...
Date: Mon May 31, 2004 9:31 am
Subject: Re: document
dany.stamant@...
Send Email Send Email
 
Please read the document.

#50605 From: Bram Moolenaar <Bram@...>
Date: Mon May 31, 2004 10:00 am
Subject: Re: vi: fatal - missing octree argument
Bram@...
Send Email Send Email
 
Leslie Everett wrote:

> Recently installed Radiance 3.5 (an open-source, unix-based,
> ray-tracing program) on my PowerBook G4 with Mac OS X. The ray-tracing
> program works fine but (Vim 6.2) part of the default installation of OS
> X, is now broken. When I type "vi" or "vim"
>
> vi: fatal - missing octree argument
>
> if I type: "$EDITOR"
>
> /usr/bin/vi: fatal - missing octree argument

This very much looks like /usr/bin/vi was replaced by another program.
Vim does not give an "octree argument" error message.

To be sure, execute "/usr/bin/vi --version".

You might have to restore /usr/bin/vi from the 10.3 installation disk.

--
hundred-and-one symptoms of being an internet addict:
12. You turn off your modem and get this awful empty feeling, like you just
     pulled the plug on a loved one.

  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///

#50606 From: Bram Moolenaar <Bram@...>
Date: Mon May 31, 2004 10:00 am
Subject: Re: TOhtml error with ft=bib
Bram@...
Send Email Send Email
 
Paul Jolly wrote:

> Dear list,
>
> $ cat ~/.vimrc
> ...
> let html_use_css = 1
> ...
>
> $ vi test.bib
>
> [ insert the following ]
>
> @book{test,
>    url = {http://www.test.com/},
> }
>
> [ invoke :TOhtml ]
>
> Notice, the following output:
>
> ...
> @<span class="Identifier">book</span>{<span class="Special">test</span>,
>      <span class="PreProc">url</span> = {<A
> HREF="http://www.test.com/}">http://www.test.com/}</A>,
> }
> ...
>
> The HREF attribute has incorrectly been populated with
> "http://www.test.com/}" as opposed to "http://www.test.com/".

Can we assume that a "}" does not appear in a URL?  I suppose we can.
Then this patch should make 2html work better:

*** ../vim-6.3b.017/runtime/syntax/2html.vim Sun May 16 22:38:49 2004
--- runtime/syntax/2html.vim Mon May 31 11:38:19 2004
***************
*** 377,383 ****
   endwhile

   " Add hyperlinks
! %s+\(http://\S\{-}\)\(\([.,;:]\=\(\s\|$\)\)\|[\\"'<>]\|>\|<\)+<A
HREF="\1">\1</A>\2+ge

   " The DTD
   if exists("html_use_css")
--- 377,383 ----
   endwhile

   " Add hyperlinks
! %s+\(http://\S\{-}\)\(\([.,;:}]\=\(\s\|$\)\)\|[\\"'<>]\|>\|<\)+<A
HREF="\1">\1</A>\2+ge

   " The DTD
   if exists("html_use_css")


--
hundred-and-one symptoms of being an internet addict:
9. All your daydreaming is preoccupied with getting a faster connection to the
    net: 28.8...ISDN...cable modem...T1...T3.

  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///

#50607 From: Paul Jolly <paul@...>
Date: Mon May 31, 2004 10:08 am
Subject: Re: TOhtml error with ft=bib
paul@...
Send Email Send Email
 
Bram Moolenaar wrote:

[...]

> Can we assume that a "}" does not appear in a URL?  I suppose we can.

In *this* (i.e with ft=bib) limited case we can; {} are the delimiters
for every RHS value in a bib entry.

[...]

Many thanks for the patch.



Paul
--
Department of Computing, Imperial College London
http://myitcv.org.uk/

#50608 From: Paul Jolly <paul@...>
Date: Mon May 31, 2004 12:56 pm
Subject: db2vim and Vim documentation
paul@...
Send Email Send Email
 
Hi list,

Over the past few days, I have been contemplating the problem of vim
documentation. In particular, the rigidity of the online (:help) format.
Note, this is not a failing of Vim, rather an unintended side effect of
confusion caused by its power and capability: there is simply too much
documentation!

Many problems/questions posted to the list would be solved by a more
user-driven manual, much like the PHP online (http) manual pages at
http://uk.php.net/manual/en/index.php. For example, consider the page:

http://uk.php.net/atan

This is just a short example of the power of user-contributed notes.

Another problem of :help, is solved by this approach: users can
arbitrarily add links to other sections of the documentation they found
useful in studying their respective topic. For example, the other day I
was wondering how to make my / search case insensitive using a switch,
much like /i for :s. To my surprise, no such switch exists: one has to
use \c. Mine will be a common mistake, no doubt, for people from a Perl
background, hence a link from :help / and :help :s to :help
perl-patterns would answer this question for most.

This brought me around to the question of how such pages could
efficiently be produced in parallel with the existing :help manuals. I
stumbled across db2vim at this point:

http://cvs.sourceforge.net/viewcvs.py/vim-latex/db2vim/

The XML storage format is a good starting point for producing multiple
target formats.

Before I start investigating this further, what are peoples' thoughts on
the subject? Would this be worthwhile, or are the numbers so small that
my effort (and that of others) would be wasted?



Paul
--
Department of Computing, Imperial College London
http://myitcv.org.uk/

#50609 From: Lars Wilke <lars_wilke@...>
Date: Mon May 31, 2004 2:25 pm
Subject: sh syntax bug? and questions
lars_wilke@...
Send Email Send Email
 
Moin,

i just started to cleaup my .vim dir. While doing so i
stumbled over the variable g:fold_sh_enabled in
$VIMRUNTIME/syntax/sh.vim but this variable is not mentioned
in the help file syntax.txt.gz section 4 under SH. Is this
intentional or am i using just an old version?[1]

Also some questions came up:

1. Is it enough to put g:fold_sh_enabled=1 in my
    ~/.vim/after/ftplugin/sh.vim file to enbable syntax folds?
    Or has it really to be in .vimrc?

2. Is it possible to use syntax folding without actually doing
    the colorizing?


Thank you very much for your time.

    --lars



[1] This is Debian package vim 6.2-426+1
:version says:

VIM - Vi IMproved 6.2 (2003 Jun 1, compiled Apr  1 2004 23:32:52)Included
patches: 1-298, 300-426Compiled by Norbert Tretkowski
<nobse@...>Normal version without GUI.  Features included (+) or not
(-):-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset
+cindent -clientserver -clipboard +cmdline_compl +cmdline_hist
+cmdline_info +comments +cryptv +cscope +dialog_con +diff +digraphs -dnd
-ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path
+find_in_path +folding -footer +fork() +gettext -hangul_input +iconv
+insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent
+listcmds +localmap +menu +mksession +modify_fname +mouse -mouseshape
-mouse_dec +mouse_gpm -mouse_jsbterm -mouse_netterm +mouse_xterm
+multi_byte +multi_lang -netbeans_intg -osfiletype +path_extra -perl
+postscript +printer -python +quickfix -rightleft -ruby +scrollbind -signs
+smartindent -sniff +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects
+title -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra
+viminfo +vreplace +wildignore +wildmenu +windows +writebackup -X11
-xfontset -xim -xsmp -xterm_clipboard -xterm_save    system vimrc file:
"$VIM/vimrc"     user vimrc file: "$HOME/.vimrc"      user exrc file:
"$HOME/.exrc"  fall-back for $VIM: "/usr/share/vim"Compilation: gcc -c -I.
-Iproto -DHAVE_CONFIG_H     -O2 -DFEAT_LANGMAP -DFEAT_KEYMAP -DAUTOCMD
-DWANT_EVAL -DWANT_MODIFY_FNAME       Linking: gcc   -L/usr/local/lib -o
vim       -lncurses -lgpm -ldl

#50610 From: "David Fishburn" <fishburn@...>
Date: Mon May 31, 2004 5:23 pm
Subject: Matchit configuration question
fishburn@...
Send Email Send Email
 
Vim 6.3b WinXP

I am trying to extend the ftplugin/sql.vim for a few additional cases.

Here is what I currently have:
let b:notend = '\%(\<end\s\+\)\@<!'

" Define patterns for the matchit macro
if !exists("b:match_words")
     " SQL is generally case insensitive
     let b:match_ignorecase = 1
     let b:match_words =
                 \ '\<begin\>:\<end\>\(;\)\?$,'.
                 \ b:notend . '\<if\>:'.
                 \ '\<elsif\>:\<elseif\>:\<else\>:\<end\s\+if\>,'.
                 \ b:notend . '\<loop\>:\<break\>:\<continue\>:'.
                 \ '\<exit\>:\<end\s\+loop\>,'.
                 \ '\<while\>:\<break\>:\<continue\>:\<exit\>:'.
                 \ '\<end\s\+loop\>,'.
                 \ b:notend . '\<for\>:\<break\>:\<continue\>:'.
                 \ '\<end\s\+for\>,'.
                 \ b:notend . '\<case\>:\<when\>:\<default\>:\<else\>:'.
                 \ '\<end\s\+case\>,' .
                 \ '\<merge\>:\<when\s\+\(not\s\+\)\?matched\>,' .
                 \
'\<exception\>:\<when\>\%(\s\+\<others\>\)\@<!:\<when\s\+others\>'
endif

Now, when I use it on the following, it will cycle around case .. when.. end
case and hit it once more time and I go to case again (good).

case
when
when
end case

I can't figure out how to get it to cycle for the exception clause when it
hits "when others".  That can be considered the "end" clause.  With the
above settings, when I get to when others, and hit % again, it moves to the
next when clause in an unrelated exception statement (somewhere in the
file).

exception
when ...
when ...
when others

Is this possible?

Thanks,
Dave

#50611 From: "George V. Reilly" <george@...>
Date: Mon May 31, 2004 7:11 pm
Subject: Re: TOhtml error with ft=bib
george@...
Send Email Send Email
 
----- Original Message -----
From: "Paul Jolly" <paul@...>
> Bram Moolenaar wrote:
> > Can we assume that a "}" does not appear in a URL?  I suppose we can.
>
> In *this* (i.e with ft=bib) limited case we can; {} are the delimiters
> for every RHS value in a bib entry.

According to RFCs 2396 (http://www.faqs.org/rfcs/rfc2396.html, URI Generic
Syntax) and 2732 (http://www.faqs.org/rfcs/rfc2732.html, IPv6 literals), '{'
and '}' are considered "unwise":

    Other characters are excluded because gateways and other transport
    agents are known to sometimes modify such characters, or they are
    used as delimiters.

    unwise      = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`"

    Data corresponding to excluded characters must be escaped in order to
    be properly represented within a URI.

--
"A congressionally-funded study has determined that many smokers
are ignoring the warning labels on cigarette packages"
  -- from a newspaper article
(Get Witty Auto-Generated Signatures from http://SmartBee.org)
George V. Reilly  george@...

#50612 From: "David Fishburn" <fishburn@...>
Date: Tue Jun 1, 2004 2:24 am
Subject: searchpair with comments
fishburn@...
Send Email Send Email
 
Vim 6.3b WinXP

I have the following buffer:

If (pCodeFeatureTypeId = something
     if pAddressIn is not null then
     else -- pAddressIn is null then disable if it is enabled
     end if
     end if

If I put my cursor at the beginning of the final "end if" (on the "e") and
run this command:
:echo searchpair('\%(\%(\<end\s\+\)\@<!\<if\>\)', '', '\<end\>\zs', 'bnW')

It reports line 2, when it should report line 1.

If I replace the above code with:
If (pCodeFeatureTypeId = something
     if pAddressIn is not null then
     else
     end if
     end if

And position the cursor at the same spot, it correctly reports line 1.

Can anyone suggest why this might be the case?
Using the "r" flag corrects the problem but it should not be required.
In more complicated cases, it makes things worse.

TIA,
Dave

#50613 From: fisherbb <fisherbb@...>
Date: Tue Jun 1, 2004 3:22 am
Subject: RE: Matchit configuration question
fisherbb@...
Send Email Send Email
 
>===== Original Message From "David Fishburn" <fishburn@...> =====
>Vim 6.3b WinXP
>
>I am trying to extend the ftplugin/sql.vim for a few additional cases.
>
>Here is what I currently have:
>let b:notend = '\%(\<end\s\+\)\@<!'
>
>" Define patterns for the matchit macro
>if !exists("b:match_words")
>    " SQL is generally case insensitive
>    let b:match_ignorecase = 1
>    let b:match_words =
>                \ '\<begin\>:\<end\>\(;\)\?$,'.
>                \ b:notend . '\<if\>:'.
>                \ '\<elsif\>:\<elseif\>:\<else\>:\<end\s\+if\>,'.
>                \ b:notend . '\<loop\>:\<break\>:\<continue\>:'.
>                \ '\<exit\>:\<end\s\+loop\>,'.
>                \ '\<while\>:\<break\>:\<continue\>:\<exit\>:'.
>                \ '\<end\s\+loop\>,'.
>                \ b:notend . '\<for\>:\<break\>:\<continue\>:'.
>                \ '\<end\s\+for\>,'.
>                \ b:notend . '\<case\>:\<when\>:\<default\>:\<else\>:'.
>                \ '\<end\s\+case\>,' .
>                \ '\<merge\>:\<when\s\+\(not\s\+\)\?matched\>,' .
>                \
>'\<exception\>:\<when\>\%(\s\+\<others\>\)\@<!:\<when\s\+others\>'
>endif
>
>Now, when I use it on the following, it will cycle around case .. when.. end
>case and hit it once more time and I go to case again (good).
>
>case
>when
>when
>end case
>
>I can't figure out how to get it to cycle for the exception clause when it
>hits "when others".  That can be considered the "end" clause.  With the
>above settings, when I get to when others, and hit % again, it moves to the
>next when clause in an unrelated exception statement (somewhere in the
>file).
>
>exception
>when ...
>when ...
>when others
>
>Is this possible?
>
>Thanks,
>Dave

      I am away from home, and I think I am not sending this from the right
address, so I think it will not make it through to the list.

      The script has to be able to tell what group of patterns to use.  When
you put the cursor on a "when", how is it supposed to tell whether it is part
of the 'case:when:end case' group or the 'exception:when:when others' case?

      First, instead of just 'when', use
'when\%(\s\+others\>\%)\@!' (not '\@<!') in the pattern for 'case:...' as
well as in the pattern for 'exception:...'.  Second, since some keywords
("when", "else") are used in more than one group, you have to combine those
groups.

      I think you have to do something like this.  (Put in word boundaries
and notend.  BTW, notend is usually made a script-local variable, not
buffer-local.)
'\%(if\|case\|merge\|exception\%)'
\ . ':when\%(\s\+others\%)\@!'
\ . ':elseif:else:default'
\ . ':\%(end\s\+if\|end\s\+case'
\ .   '\|when\s\+\%(not\s\+\%)\?matched\|when\s\+others'

In fact, you will have to add something (another '\@!' item) to the 'when'
part so that "when matched" and "when not matched" are not mistaken for the
middle of a "cacse ... when ... end case" construction.  Also, you will have
to combine the groups that use "break".

HTH     --Benji Fisher

#50614 From: Charles H. Shooshan III <chasshoo@...>
Date: Tue Jun 1, 2004 4:47 am
Subject: Re: 2html.vim script question
chasshoo@...
Send Email Send Email
 
As follow-up to my own question, I played with the 2html.vim script so
that I could use it to produce html files that can be exchanged with
the "html source files" that are produced with the Java API Document
Generator (javadoc) -linksource option.

The purpose is to get syntax-highlighted source files into the javadocs.

I posted my modified script at http://www.vim.org/scripts/ as htmlj.vim.

The key change is adding the "id" attribute at the beginning of each
line of code so that:
<span class="lnr"> 11</span>

becomes:
<span id="line.11" class="lnr"> 11</span>

Even though this is for javadoc, it might be useful for anyone
interested in producing html versions of source files that can display
a particular code line at the top.

The above example if contained in the file, Hello.html, would get you
to line 11 of the code using Hello.html#line.11 .

I would appreciate any comments (I tried hard not to break anything in
the script).

Thanks,
Charlie

P.S. Since the gvim script is now working on my Mac and I replaced the
2html.vim script with my modified version (keeping the original of
course), I can generated the "javadoc" version of Hello.java (called
Hello.html) from the Terminal with this command:

gvim -c "let javadoc = 1" -c "runtime! syntax/2html.vim" -c "wq" -c "q"
Hello.java

Messages 50585 - 50614 of 137716   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help