RE: Folding Perl POD

2007-04-03 Thread Eric Leenman





From: Bill Moseley <[EMAIL PROTECTED]>

[...]


Is it possible to fold the =head1 or =item sections within a given
=head1 section?


--
Bill Moseley
[EMAIL PROTECTED]



I'm not sure what you want.
I don't know PERL

But this plugin helpt me defining my folds:
http://eigenclass.org/hiki/simplefold+plugin+0.4.0

There's a section specified for Ruby and Java,
I've copied that and tailored it for VHDL.
Rgds,
Eric

_
Mortgage rates near historic lows. Refinance $200,000 loan for as low as 
$771/month* 
https://www2.nextag.com/goto.jsp?product=10035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h27f8&disc=y&vers=689&s=4056&p=5117




Re: how to replace ESC to some other key?

2007-04-03 Thread panshizhu
wangxu <[EMAIL PROTECTED]> 写于 2007-04-04 23:55:55:
> ESC is so far from the center of the keyboard.
> Can I replace this key to Caps Lock,for example?
> Thanks.

This was well discussed on vim online.

Search for tips in vim.sf.net. You'll got all things you need to assign
CapsLock to ESC.

--
Sincerely, Pan, Shi Zhu. ext: 2606

Re: Question about paragraphs: make lines containing only whitespace characters a paragraph separator

2007-04-03 Thread Thomas

Maybe I misunderstand the problem but can't you change those lines
with just blanks to empty lines?


Sure I can remove the whitespace characters. But I'd rather simply not 
have to care about them (but this is filetype-dependent because for some 
filetypes this really could be what I want).


I was just wondering if there maybe already is a (buffer local) option 
to do this.


Regards,
Thomas.



how to replace ESC to some other key?

2007-04-03 Thread wangxu
ESC is so far from the center of the keyboard.
Can I replace this key to Caps Lock,for example?
Thanks.


Re: Vim memory leak

2007-04-03 Thread Tim Chase
>  :sp on a new buffer causes a raise of 4-8K.
>  :q on a split causes a raise of 4-8K.
>  Switching to/from gvim causes a small increase, typically 4-8K for a few 
> switches.
>  Searching (with *) for a word in a .c file (with syntax highlighting) causes 
> it to increase. If you hold down * then you can see the memory usage rocket 
> up.
>  Basically, pretty much any action.
> 
> Any ideas? Will I just have to live with it and restart my vim
> session every couple of days?

A couple things you might try experimenting with:

-does it happen in "naked" vim? (started via "vim -u NONE")

-does it happen when you drastically reduce your 'undolevels'
parameter?  (and what is it set to currently?)

-what sorts of vimscripts are getting run that might be creating
or storing values but not releasing them?

-what sorts of things are being fired on events?  Particularly
the CursorHold-ish events where something is happening with every
movement.

-what sorts of auto-completion options do you have running?  I
would imagine that omni-completion with C/C++ syntax might take a
bit of memory to house.

These would be the first places I'd look for trouble.  I
regularly have vim up almost as long as WinXP at work (disrupted
only by annoying reboots and blue-screens) and rarely have
trouble with it.  Even when I do, it's my own dumb fault for
using vim to edit ISO images, 300+meg SQL scripts or something
equally asinine.  A ":bwipe" usually restores my poor vim session
to fully-functional.

-tim





Re: Newbee question:Why don't I have the syntax highlighting when editing files like *.sh *.xml,etc?

2007-04-03 Thread wangxu

Sure: )I will remeber that next time I post something.
I'v solved the problem. My runtimepath is wrong.
I updated vim to 7.0 using apt-get, but left  the old vimrc  unchanged.
I checked the vimrc and replaced /usr/share/vim/vim63 to 
/usr/share/vim/vim70,

It is OK now.
Thank you All: )

A.J.Mechelynck wrote:

wangxu wrote:

Why don't I have the syntax highlighting when editing files like *.sh
*.xml,etc?
After commands like "syntax on",still nothing happened.
below is my /etc/vim/vimrc,what else should I do to turn the syntax
highlighting on?
Thanks,
shell.

[...]

The ":scriptnames" command will list all scripts that have been 
sourced so far in the current Vim session. They are listed in the 
order of first sourcing. When editing your vimrc, the list should 
include:

- the vimrc near the top;
- $VIMRUNTIME/syntax/vim.vim somewhere lower down. The $VIMRUNTIME 
variable will be resolved; on your system, I expect its value to be 
/usr/share/vim/vim70


/etc/vim/vimrc is a strange location for a system vimrc. If the above 
shows that is wasn't sourced, try putting it at /usr/share/vim/vimrc 
-- if you don't want to move the Debian vimrc you can use a soft link:


cd /usr/share/vim
ln -vs /etc/vim/vimrc


Oh, and next time you post a ":version" listing on the list, please 
first do ":language messages C" (on Unix). I know just enough Chinese 
to understand that 大 on the fourth line means "big", so I can guess 
that that fourth line probably means "Big version with GTK2 GUI. 
Features included (+) or not (-):" but the average subscriber to this 
list cannot even be assumed to know any Chinese at all.



Best regards,
Tony.




Re: bracket completion

2007-04-03 Thread Greg Fitzgerald
On Tue, Apr 03, 2007 at 04:51:46PM -0400, Karl Guertin wrote:

> On 4/3/07, Panos Laganakos <[EMAIL PROTECTED]> wrote:
> >Although, I'd prefer if I could use tab to move outside, instead of
> >the corresponding closing bracket char.
> 
> This should be fairly simple to add. I won't map it, but I'll set up a
>  for you.
> 
> On 4/3/07, Jonas Persson <[EMAIL PROTECTED]> wrote:
> >Is it possible to have the {} pair inserted without disturbing the folds?
> 
> I use marker based folds and the script doesn't disturb them. If
> you're doing syntax folding, I can imagine that the folding might get
> confused, as there's a fair bit of sleight of hand going on. I'll try
> to fix it, but I'm not sure that I can.
> 
> On 4/3/07, Greg Fitzgerald <[EMAIL PROTECTED]> wrote:
> >I do have a issue using it though. Every
> >time i load vim with your script i can no longer use directional keys
> >when in insert mode. This meaning up,down,left,right or h,j,k,l. Anytime
> >i try to use these keys vim starts printing capital letters when i hit
> >the keys instead of moving around. I have to leave insert mode to move
> >around then go back into insert mode to type again. Any ideas about
> >that?
> 
> I can't reproduce this under vim 7.0.122 (debian), gVim 7.0 windows,
> on gVim 7.0.203 windows. Any ideas?

I just played around with this. Using vim 7.0.201 on Gentoo, i have
tried removing all other scripts and even my .vimrc and i still have
the problem only when i load up yours. I looked through your script
thinking i could possibly figure it out and I have no clue. After giving
up on that I uploaded it to my OpenBSD box vim 7 something i'm to lazy
to look for the patch level now. Same issue. Very weird, if you can't
reproduce it i'm sure it's on my end. Just trying to find out what would
cause it. Like i mentioned i go into insert mode type anything. If i try
to use the directional keys while in insert mode i start getting letters
inserted above the line i'm on. It is always the same letters though for
each key.

Left = D
Right = C
Up = A
Down = B

Each time i hit a direction a new letter appears above the (on it's own
line each time, keeps adding to it.) So any ideas would be welcomed. If
i avoid moving around in insert mode it really does work nice. So hope
i'm not giving you the wrong impression. I just have been in the habit
of being about to move around while in insert mode for years now.


Vim memory leak

2007-04-03 Thread Max Dyckhoff
My instance of vim (gvim on Windows) appears to have a memory leak, which makes 
me sad. Is this a common thing for everyone, or is there something in my setup 
which might be causing it? It's pretty serious.

When I start gvim and load my standard session, it will take up about 86MB of 
RAM. This includes dozens of buffers, splits, tabs and syntax, so I'm not 
really worried. After about four hours it will be up to more like 120MB, and 
after a couple of days it will be 200MB+.

Loading a "fresh" copy of gvim with all the plugins and my .vimrc, there are 
various actions I can see that increase the memory usage as reported by the 
Windows Task Manager. I have no idea on the validity of the Task Manager, but 
it's all I have on Windows.

:sp on a new buffer causes a raise of 4-8K.
:q on a split causes a raise of 4-8K.
Switching to/from gvim causes a small increase, typically 4-8K for a 
few switches.
Searching (with *) for a word in a .c file (with syntax highlighting) 
causes it to increase. If you hold down * then you can see the memory usage 
rocket up.
Basically, pretty much any action.

Any ideas? Will I just have to live with it and restart my vim session every 
couple of days?

Thanks,

Max


Re: Esperanto dictionary

2007-04-03 Thread Cyril Slobin

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


Well, I suppose both uppercase and titlecase should be supported then. Cxu ne?
CXU VERE NE? (Kompreneble, ĉiukaze mi preferas "verajn" ĉapelitajn literojn.)


CXU, Cxu and cxu are all passed cheking, CXu doesn't. And I believe
this is a Right Thing.


I suppose texts written in "«Fundamenta» h-stilo" could emphasise the radical
break when needed, as in flug-haveno, chas-hundo, danc-halo, ktp. (er, etc.).


Just checked -- translation table used by my plugin knows about
flughaveno and chashundo, but not about danchalo. I don't write this
table myself, but borrow it from UniRed (another opensource editor).
Anyway you can easy add danchalo and any other such word in the table
by yourself -- it is in simple text format.

BTW x-style is not free from such problems. Pure Esperanto text is OK,
but consider you use the word "Linux" in it!

--
Cyril Slobin <[EMAIL PROTECTED]> `When I use a word,' Humpty Dumpty said,
 `it means just what I choose it to mean'


Esperanto dictionary

2007-04-03 Thread Cyril Slobin

Seems like this letter doesn't reached the list. Reposting. I'm sorry
if it appears twice.

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


Well, I suppose both uppercase and titlecase should be supported then. Cxu ne?
CXU VERE NE? (Kompreneble, ĉiukaze mi preferas "verajn" ĉapelitajn literojn.)


CXU, Cxu and cxu are all passed cheking, CXu doesn't. And I believe
this is a Right Thing.


I suppose texts written in "«Fundamenta» h-stilo" could emphasise the radical
break when needed, as in flug-haveno, chas-hundo, danc-halo, ktp. (er, etc.).


Just checked -- translation table used by my plugin knows about
flughaveno and chashundo, but not about danchalo. I don't write this
table myself, but borrow it from UniRed (another opensource editor).
Anyway you can easy add danchalo and any other such word in the table
by yourself -- it is in simple text format.

BTW x-style is not free from such problems. Pure Esperanto text is OK,
but consider you use the word "Linux" in it!

--
Cyril Slobin <[EMAIL PROTECTED]> `When I use a word,' Humpty Dumpty said,
 `it means just what I choose it to mean'


Re: case of very slow regex search

2007-04-03 Thread Peter Hodge

--- Yakov Lerner <[EMAIL PROTECTED]> wrote:

> I use sometimes the regex that finds paragraphs
> containing given words w1,w2,... in any order ( I define "paragraph"
> as separated by lines, \n\n).
> 
> I use the pattern like this: (two-word example, w1 and w2, but easily
> expandable for N words):
> /\c\(.\|.\n\)*\\&\(.\|.\n\)*\
>(and I set :set maxmempattern=2 )
> This works. But search time is unbelievably slow on big files.
> 
> My question is; is there a rewrite of this  regex that works faster.
> 
> To see the testcase how of how slow this works:
>1. wget http://www.vmunix.com/~gabor/c/draft.html
>   # this is ~1.3 MB file.
>2. vim draft.html
>3. /\c\(.\|.\n\)*\\&\(.\|.\n\)*\

Try this pattern:

  /\c\n\zs\%(\%(.\|.\n\)\{-}\\&\%(.\|.\n\)\{-}\\)

It has the \n at the start so it will match at most once per line and uses \{-}
instead of * to prevent backtracking. That search ends in 30 seconds (on a Dual
1.8ghz G5).  You won't need to tweak maxmempattern either.

regards,
Peter


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


Folding Perl POD

2007-04-03 Thread Bill Moseley
I don't use folding often, but I'm not figuring out if/how to fold
POD documentation in a Perl module.

I have a module that includes:

=head1 METHODS

=over 4

=item wazbat

This method returns the wazbat of the current object.

=cut

sub wazbat {
my $self = shift;
return $self->{wazbat}

=item fromp

This methods implements the fromp operation.

=cut

sub fromp {
return "fromp";
}

=back

=head1 WARNINGS

[...]


Is it possible to fold the =head1 or =item sections within a given
=head1 section?


-- 
Bill Moseley
[EMAIL PROTECTED]



Re: case of very slow regex search

2007-04-03 Thread Andy Wokula

Yakov Lerner schrieb:

I use sometimes the regex that finds paragraphs
containing given words w1,w2,... in any order ( I define "paragraph"
as separated by lines, \n\n).

I use the pattern like this: (two-word example, w1 and w2, but easily
expandable for N words):
   /\c\(.\|.\n\)*\\&\(.\|.\n\)*\
  (and I set :set maxmempattern=2 )
This works. But search time is unbelievably slow on big files.

My question is; is there a rewrite of this  regex that works faster.

To see the testcase how of how slow this works:
  1. wget http://www.vmunix.com/~gabor/c/draft.html
 # this is ~1.3 MB file.
  2. vim draft.html
  3. /\c\(.\|.\n\)*\\&\(.\|.\n\)*\
 This search never finishes for me.

How  can I rewrite the regex to search faster ?

Yakov


Prepeding  \n\n\zs  helps ...

--
Regards,
Andy

EOM


Esperanto dictionary

2007-04-03 Thread Cyril Slobin

On 4/3/07, Hugh Sasse <[EMAIL PROTECTED]> wrote:


I've not encountered "titlecase" before this thread, so I don't
understand its semantics yet.


From http://www.unicode.org/glossary/#T

«Titlecase. Uppercased initial letter followed by lowercase letters in
words. A casing convention often used in titles, headers, and entries,
as exemplified in this glossary.»


My problem is that I mainly work through Windows systems (often ssh into
Solaris, but still) and I don't have a clue what to do with fonts for all
this, E.g. in PuTTY.  I'm not entirely clear how to do this in gvim for that
matter.  I've read some of the help on UTF8 but I'm still rather confused
being very much at the Beginner stage for this in terms of the Dreyfus
model of skills aquistion


Well, I'm now in Windows 98 SE Russian Edition. I've just logged into
Linux site, run Vim and typed "Щ á Ĉ" (Cyrillic capital letter shcha
followed by a with acute accent followed by C with circumflex accent).
All you need is: in putty go to Window -> Translation menu and choose
UTF-8 from list; then go to Window -> Appearance menu and choose some
ttf font instead of fyxedsys (Courier New is fine). Then log into Unix
site, run Vim and set both encoding and termencoding to utf-8.

--
Cyril Slobin <[EMAIL PROTECTED]> `When I use a word,' Humpty Dumpty said,
 `it means just what I choose it to mean'


Re: Question about paragraphs: make lines containing only whitespace characters a paragraph separator

2007-04-03 Thread cga2000
On Tue, Apr 03, 2007 at 02:00:59PM EDT, Thomas wrote:
> Hi,
> 
> This is something that I found annoying quite a time now and I'm
> pretty sure there is a simple solution for this problem.
> 
> Paragraphs are defined as:
> 
> >A paragraph begins after each empty line, and also at each of a set of
> >paragraph macros, specified by the pairs of characters in the 'paragraphs'
> >option.
> 
> I often end up with seemingly blank lines that contain whitespace 
> characters. Is there a way to make vim handle these lines as paragraph 
> boundaries too as ip does?
> 
> One could remap the {} keys but AFAIK these maps would be ignored by
> norm! and noremap commands.
> 
> Does somebody know a way to do this?
> 
> I understand this could also be considered a finesse/feature, but I 
> personally would like to have to choice to treat lines containing only 
> whitespace characters as empty lines.

Maybe I misunderstand the problem but can't you change those lines
with just blanks to empty lines?

If it's just spaces we're talking about .. not tabs or other
unprintables .. maybe something such as:

:%s/^ *$//g

.. would do it.

And map it to something convenient if you use it on a regular basis.

Or do you need to hold on to those spaces for any reason?

Thanks,
cga


case of very slow regex search

2007-04-03 Thread Yakov Lerner

I use sometimes the regex that finds paragraphs
containing given words w1,w2,... in any order ( I define "paragraph"
as separated by lines, \n\n).

I use the pattern like this: (two-word example, w1 and w2, but easily
expandable for N words):
   /\c\(.\|.\n\)*\\&\(.\|.\n\)*\
  (and I set :set maxmempattern=2 )
This works. But search time is unbelievably slow on big files.

My question is; is there a rewrite of this  regex that works faster.

To see the testcase how of how slow this works:
  1. wget http://www.vmunix.com/~gabor/c/draft.html
 # this is ~1.3 MB file.
  2. vim draft.html
  3. /\c\(.\|.\n\)*\\&\(.\|.\n\)*\
 This search never finishes for me.

How  can I rewrite the regex to search faster ?

Yakov


Spellcheck HTML files with syntax on?

2007-04-03 Thread Mitch Wiedemann
I am using Vim 7.0* and I mostly edit HTML files.  I've noticed the
on-the-fly spell checking works great in regular .txt files and such,
but I can't get it working in HTML files without turning the :syntax
off.  Is there a way to get on-the-fly spellchecking with syntax
highlighting as well?


* VIM - Vi IMproved 7.0 (2006 May 7, compiled Mar 29 2007 16:33:16)
Compiled by ...
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 +cursorshape +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 -mzscheme
-netbeans_intg -osfiletype +path_extra -perl +postscript +printer
-profile -python +quickfix +reltime -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/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2
Linking: gcc   -L/usr/local/lib -o vim   -lncurses -lacl -lgpm -ldl



Re: quick query about moving a selection

2007-04-03 Thread shawn bright

cool enough, thanks, tim
sk

On 4/3/07, Tim Chase <[EMAIL PROTECTED]> wrote:

> i know with >> i can move a selection to the right by one
> indent, how can i move a selection just one space ?


Well, if you want to move by "one indent", you can

:set sw=1 ts=1 et

which will then make ">>" and "<<" indent by one space (not one
tab) or, you can

:set sw=1 ts=1 noet

and have it use tabs, but each tab displays as only a single space.

Or, you can use

:s/^/ /

That 2nd one is better used over a range.

A couple ideas to hopefully get you towards what you want.

-tim






Re: Newbee question:Why don't I have the syntax highlighting when editing files like *.sh *.xml,etc?

2007-04-03 Thread Tobia
A.J.Mechelynck wrote:
> /etc/vim/vimrc is a strange location for a system vimrc

It is a very intuitive location.  In Debian all system-wide
configuration files are in /etc//

> I know just enough Chinese to understand that 大 on the fourth line
> means "big", so I can guess that that fourth line probably means "Big
> version with GTK2 GUI. Features included (+) or not (-):"

That would explain the problem.  To the original poster: try adding the
following line to /etc/vim/gvimrc.local (create it if needed)

source /etc/vim/vimrc


Tobia


Re: bracket completion

2007-04-03 Thread Karl Guertin

On 4/3/07, Panos Laganakos <[EMAIL PROTECTED]> wrote:

Although, I'd prefer if I could use tab to move outside, instead of
the corresponding closing bracket char.


This should be fairly simple to add. I won't map it, but I'll set up a
 for you.

On 4/3/07, Jonas Persson <[EMAIL PROTECTED]> wrote:

Is it possible to have the {} pair inserted without disturbing the folds?


I use marker based folds and the script doesn't disturb them. If
you're doing syntax folding, I can imagine that the folding might get
confused, as there's a fair bit of sleight of hand going on. I'll try
to fix it, but I'm not sure that I can.

On 4/3/07, Greg Fitzgerald <[EMAIL PROTECTED]> wrote:

I do have a issue using it though. Every
time i load vim with your script i can no longer use directional keys
when in insert mode. This meaning up,down,left,right or h,j,k,l. Anytime
i try to use these keys vim starts printing capital letters when i hit
the keys instead of moving around. I have to leave insert mode to move
around then go back into insert mode to type again. Any ideas about
that?


I can't reproduce this under vim 7.0.122 (debian), gVim 7.0 windows,
on gVim 7.0.203 windows. Any ideas?


Re: bracket completion

2007-04-03 Thread Jonas Persson
I just downloaded and it works great. I have one wish though. I have 
syntax folding for C++ and usually have a lot of open/closed folds. But 
when I write a {, all folds open. Is it possible to have the {} pair 
inserted without disturbing the folds?


/ Jonas

Karl Guertin skrev:

On 3/31/07, Greg Fitzgerald <[EMAIL PROTECTED]> wrote:

Anyone know of a way to achieve bracket completion?


I've been sitting on a plugin that does this for a month or so. The
main difference between my plugin and the rest of the options here is
that I do the completion without breaking history or repeat.

Freshly uploaded to vim.org:

http://www.vim.org/scripts/script.php?script_id=1849

This plugin was pared down from a larger script that included a set of
less reusable mappings, so let me know if there's a problem.





Re: quick query about moving a selection

2007-04-03 Thread Tim Chase

i know with >> i can move a selection to the right by one
indent, how can i move a selection just one space ?



Well, if you want to move by "one indent", you can

:set sw=1 ts=1 et

which will then make ">>" and "<<" indent by one space (not one 
tab) or, you can


:set sw=1 ts=1 noet

and have it use tabs, but each tab displays as only a single space.

Or, you can use

:s/^/ /

That 2nd one is better used over a range.

A couple ideas to hopefully get you towards what you want.

-tim





quick query about moving a selection

2007-04-03 Thread shawn bright

lo there,

i know with >> i can move a selection to the right by one indent,
how can i move a selection just one space ?
thanks
sk


RE: Executing vimfunctions in background

2007-04-03 Thread Chuck Mason
Well, that sample 'myFunc' was just that- a sample. Imagine now, that it
doesn't depend on cursor location but on a daemon running on your
system.

Chuck

-Original Message-
From: Yakov Lerner [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 03, 2007 12:44 PM
To: Chuck Mason
Cc: vim@vim.org
Subject: Re: Executing vimfunctions in background

On 4/3/07, Chuck Mason <[EMAIL PROTECTED]> wrote:
>
> Yes and no- I think this would work in certain situations, but of
course
> what happens when I don't move the cursor?

If you didn't move the cursor -- then why would you
add the same position to the quicfix list again and again ? What's the
point ?
How is adding same position again and again (seems meaningless to me)
better than reacting to cursor motion ?

Yakov

>
> Actually, why isn't there a Timer autocommand? :)  Feature request?
>
> -Original Message-
> From: Yakov Lerner [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 03, 2007 11:05 AM
> To: Chuck Mason
> Cc: vim@vim.org
> Subject: Re: Executing vimfunctions in background
>
> On 4/3/07, Chuck Mason <[EMAIL PROTECTED]> wrote:
> >
> >
> > I'm interested in writing a plugin that could run in the background
as
> I
> > do some work in a buffer. For instance I have a function that
appends
> a
> > line to :copen. I would like to run it in the background
continuously.
> > How could I do this and continue working in the foreground?
> >
> > func myFunc()
> > while 1
> > exe "caddexpr expand("%") . ":" . line(".") .  ":" .
> > getline(".")"
> > exe "sleep 5"
> > endwhile
> > endfunc
> >
> > "" how do I launch myFunc() to run continuously in the background?
>
> Chuhk,
> You probably want to give the 'au CursorMoved' autocommand
> a try for this task.
> Such tasks are normally solved with autocommands in vim.
> See:
> :help au
> :hep CursorMoved
>
> Good luck
> Yakov
>


Re: Executing vimfunctions in background

2007-04-03 Thread Yakov Lerner

On 4/3/07, Chuck Mason <[EMAIL PROTECTED]> wrote:


Yes and no- I think this would work in certain situations, but of course
what happens when I don't move the cursor?


If you didn't move the cursor -- then why would you
add the same position to the quicfix list again and again ? What's the point ?
How is adding same position again and again (seems meaningless to me)
better than reacting to cursor motion ?

Yakov



Actually, why isn't there a Timer autocommand? :)  Feature request?

-Original Message-
From: Yakov Lerner [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 03, 2007 11:05 AM
To: Chuck Mason
Cc: vim@vim.org
Subject: Re: Executing vimfunctions in background

On 4/3/07, Chuck Mason <[EMAIL PROTECTED]> wrote:
>
>
> I'm interested in writing a plugin that could run in the background as
I
> do some work in a buffer. For instance I have a function that appends
a
> line to :copen. I would like to run it in the background continuously.
> How could I do this and continue working in the foreground?
>
> func myFunc()
> while 1
> exe "caddexpr expand("%") . ":" . line(".") .  ":" .
> getline(".")"
> exe "sleep 5"
> endwhile
> endfunc
>
> "" how do I launch myFunc() to run continuously in the background?

Chuhk,
You probably want to give the 'au CursorMoved' autocommand
a try for this task.
Such tasks are normally solved with autocommands in vim.
See:
:help au
:hep CursorMoved

Good luck
Yakov



RE: Executing vimfunctions in background

2007-04-03 Thread Chuck Mason

Yes and no- I think this would work in certain situations, but of course
what happens when I don't move the cursor? 

Actually, why isn't there a Timer autocommand? :)  Feature request? 

-Original Message-
From: Yakov Lerner [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 03, 2007 11:05 AM
To: Chuck Mason
Cc: vim@vim.org
Subject: Re: Executing vimfunctions in background

On 4/3/07, Chuck Mason <[EMAIL PROTECTED]> wrote:
>
>
> I'm interested in writing a plugin that could run in the background as
I
> do some work in a buffer. For instance I have a function that appends
a
> line to :copen. I would like to run it in the background continuously.
> How could I do this and continue working in the foreground?
>
> func myFunc()
> while 1
> exe "caddexpr expand("%") . ":" . line(".") .  ":" .
> getline(".")"
> exe "sleep 5"
> endwhile
> endfunc
>
> "" how do I launch myFunc() to run continuously in the background?

Chuhk,
You probably want to give the 'au CursorMoved' autocommand
a try for this task.
Such tasks are normally solved with autocommands in vim.
See:
:help au
:hep CursorMoved

Good luck
Yakov


Re: Executing vimfunctions in background

2007-04-03 Thread Yakov Lerner

On 4/3/07, Chuck Mason <[EMAIL PROTECTED]> wrote:



I'm interested in writing a plugin that could run in the background as I
do some work in a buffer. For instance I have a function that appends a
line to :copen. I would like to run it in the background continuously.
How could I do this and continue working in the foreground?

func myFunc()
while 1
exe "caddexpr expand("%") . ":" . line(".") .  ":" .
getline(".")"
exe "sleep 5"
endwhile
endfunc

"" how do I launch myFunc() to run continuously in the background?


Chuhk,
You probably want to give the 'au CursorMoved' autocommand
a try for this task.
Such tasks are normally solved with autocommands in vim.
See:
:help au
:hep CursorMoved

Good luck
Yakov


Question about paragraphs: make lines containing only whitespace characters a paragraph separator

2007-04-03 Thread Thomas

Hi,

This is something that I found annoying quite a time now and I'm
pretty sure there is a simple solution for this problem.

Paragraphs are defined as:


A paragraph begins after each empty line, and also at each of a set of
paragraph macros, specified by the pairs of characters in the 'paragraphs'
option.


I often end up with seemingly blank lines that contain whitespace 
characters. Is there a way to make vim handle these lines as paragraph 
boundaries too as ip does?


One could remap the {} keys but AFAIK these maps would be ignored by
norm! and noremap commands.

Does somebody know a way to do this?

I understand this could also be considered a finesse/feature, but I 
personally would like to have to choice to treat lines containing only 
whitespace characters as empty lines.


Thanks,
Thomas.





Executing vimfunctions in background

2007-04-03 Thread Chuck Mason


I'm interested in writing a plugin that could run in the background as I
do some work in a buffer. For instance I have a function that appends a
line to :copen. I would like to run it in the background continuously.
How could I do this and continue working in the foreground?

func myFunc()
while 1
exe "caddexpr expand("%") . ":" . line(".") .  ":" .
getline(".")"
exe "sleep 5"
endwhile
endfunc

"" how do I launch myFunc() to run continuously in the background?

Chuck



Re: completion menu colors

2007-04-03 Thread Charles E Campbell Jr

fREW wrote:


Is there a way to change the completion menu colors?



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

which both displays the current colors in whatever colorscheme you're using,
plus provides a colorscheme editor (just rightmouse click on a color).  
The colors

you're interested in changing are: Pmenu PmenuSbar PmenuSel PmenuThumb .

(A leftmouse click on a color jumps the associated bit of text in the 
help describing

the highlight's purpose).

To invoke:   :help hicolors

Regards,
Chip Campbell





Re: Esperanto dictionary

2007-04-03 Thread Hugh Sasse
On Tue, 3 Apr 2007, A.J.Mechelynck wrote:

> 
> Some years ago, I wrote the chapter of the Vim FAQ about Unicode: browse to
> http://vimdoc.sourceforge.net/htmldoc/vimfaq.html and scroll to the last
> section, e.g. by searching the page for the string SECTION 37 (which happens
> twice, once in the table of contents and once at the head of the section
> itself).

Yes, there's good stuff there.  I'm not entirely sure how all those things
will interact but having them all together gives me scope for experimentation.
Thank you.

Hugh


Re: bracket completion

2007-04-03 Thread Panos Laganakos

I tried out Karl's plugin, and it works great, good job :)

Although, I'd prefer if I could use tab to move outside, instead of
the corresponding closing bracket char.

Could this be achieved in a future version?

On 4/3/07, David Fishburn <[EMAIL PROTECTED]> wrote:



> -Original Message-
> From: Karl Guertin [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, April 03, 2007 6:42 AM
> To: vim@vim.org
> Subject: Re: bracket completion
>
> On 3/31/07, Greg Fitzgerald <[EMAIL PROTECTED]> wrote:
> > Anyone know of a way to achieve bracket completion?
>
> I've been sitting on a plugin that does this for a month or
> so. The main difference between my plugin and the rest of the
> options here is that I do the completion without breaking
> history or repeat.
>
> Freshly uploaded to vim.org:
>
> http://www.vim.org/scripts/script.php?script_id=1849
>
> This plugin was pared down from a larger script that included
> a set of less reusable mappings, so let me know if there's a problem.

Thanks for the script Karl.

Not a problem, but a suggestion.

Could you make an option to ignore the autoclose if there is a following
character.  If I am typing a line:

If (  <-- here I want the autoclose.

If I have this line:

If (something_is_already_here)
  ^
And I place my cursor on the "i" in "something" I do not want to add the
closing brace since generally if I am inserting that the closing brace will
be placed at the end of the line (or something).

Just a preference, which is why I was hoping it could be an option.
So only complete when the ([[ is the last item on the line (as I am typing).

Thanks,
Dave





--
Panos Laganakos


Re: Esperanto dictionary

2007-04-03 Thread A.J.Mechelynck

Hugh Sasse wrote:
[...]
My problem is that I mainly work through Windows systems (often ssh into 
Solaris, but still) and I don't have a clue what to do with fonts for all

this, E.g. in PuTTY.  I'm not entirely clear how to do this in gvim for that
matter.  I've read some of the help on UTF8 but I'm still rather confused
being very much at the Beginner stage for this in terms of the Dreyfus
model of skills aquistion
http://www.pragmaticprogrammer.com/articles/cook_until_done.html
so if someone has a really gentle introduction to all this I'd be grateful.
I've noticed that Word stores things in UTF-16 (LOTS of nulls :-)) so
this should be achievable, but


Best regards,
Tony.


Thank you,
Hugh


Some years ago, I wrote the chapter of the Vim FAQ about Unicode: browse to 
http://vimdoc.sourceforge.net/htmldoc/vimfaq.html and scroll to the last 
section, e.g. by searching the page for the string SECTION 37 (which happens 
twice, once in the table of contents and once at the head of the section itself).


I just reread that section, which is a series of short explanations about the 
things most important to use Unicode in Vim, with links to the appropriate 
help topics and in a few cases to documentation elsewhere on the Web. Apart 
from a few typos, it can still be regarded as accurate. (I didn't check the 
external links though; if you find one that is broken, report it to Yegappan, 
the maintainer of that FAQ.)


Best regards,
Tony.
--
I'm changing my name to Chrysler
I'm going down to Washington, D.C.
I'll tell some power broker
What they did for Iacocca
Will be perfectly acceptable to me!
I'm changing my name to Chrysler,
I'm heading for that great receiving line.
When they hand a million grand out,
I'll be standing with my hand out,
Yessir, I'll get mine!
-- Tom Paxton


GetLatestVimScripts and compressed scripts

2007-04-03 Thread Guido Van Hoecke
Hi, 


I hope to get some calrification about a recent change in vim's
behaviour. I just started using :GetLatestVimScripts and vim now ignores
any *.gz plugin scripts in my ~/.vim/plugin directory. It e.g. does not
source the project.vim.gz script anymore. When I gunzip it, and it gets
sourced. This seems silly, how would :GetLatestVimScripts cause this
behaviour, and how do I fix this?

TIA,

Guido.

--
http://vanhoecke.org ... and go2 places!


compiler plugin for the ARM compiler

2007-04-03 Thread Sibin P. Thomas
Hi,

Is a compiler plugin for the ARM compiler ("armcc") already available?
(Couldn't find it in the Vim site) 

I am basically looking for the errorformat for the ARM compiler.

Regards,
Sibin



DISCLAIMER:
This message (including attachment if any) is confidential and may be 
privileged. Before opening attachments please check them for viruses and 
defects. MindTree Consulting Limited (MindTree) will not be responsible for any 
viruses or defects or any forwarded attachments emanating either from within 
MindTree or outside. If you have received this message by mistake please notify 
the sender by return  e-mail and delete this message from your system. Any 
unauthorized use or dissemination of this message in whole or in part is 
strictly prohibited.  Please note that e-mails are susceptible to change and 
MindTree shall not be liable for any improper, untimely or incomplete 
transmission.


Re: Esperanto dictionary

2007-04-03 Thread Hugh Sasse
On Mon, 2 Apr 2007, A.J.Mechelynck wrote:

> Cyril Slobin wrote:
> > On 4/2/07, Hugh Sasse <[EMAIL PROTECTED]> wrote:

[Info about plugin trimmed. Thank you.

> > > Also isn't your example often written "CXirkaux" because the CX is
> > > (effectively) one character, capitalized?
> > 
> > I've newer seen this form, and I believe it is ugly. And in unicode
> > terms, this one character is not capitalized, but title-cased.

I've seen it used on the web, but it's net easy to search for :-).
> > 
> 
> Well, I suppose both uppercase and titlecase should be supported then. Cxu ne?

I've not encountered "titlecase" before this thread, so I don't
understand its semantics yet.

> CXU VERE NE? (Kompreneble, ??iukaze mi preferas "verajn" ??apelitajn
> literojn.)
> 
> I suppose texts written in "??Fundamenta?? h-stilo" could emphasise the
> radical break when needed, as in flug-haveno, chas-hundo, danc-halo, ktp. (er,
> etc.). Anyway, I anticipate that all substitution schemes will become less and
> less necessary as Unicode generalizes: e.g., my fr_BE keyboard supports
> consonants with circumflex "out of the box" in openSUSE Linux 10.2 (thus going
> back to the "universality" of the French typewriters of Zamenhof's time ;-) ).

My problem is that I mainly work through Windows systems (often ssh into 
Solaris, but still) and I don't have a clue what to do with fonts for all
this, E.g. in PuTTY.  I'm not entirely clear how to do this in gvim for that
matter.  I've read some of the help on UTF8 but I'm still rather confused
being very much at the Beginner stage for this in terms of the Dreyfus
model of skills aquistion
http://www.pragmaticprogrammer.com/articles/cook_until_done.html
so if someone has a really gentle introduction to all this I'd be grateful.
I've noticed that Word stores things in UTF-16 (LOTS of nulls :-)) so
this should be achievable, but

> 
> Best regards,
> Tony.

Thank you,
Hugh

RE: bracket completion

2007-04-03 Thread David Fishburn
 

> -Original Message-
> From: Karl Guertin [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, April 03, 2007 6:42 AM
> To: vim@vim.org
> Subject: Re: bracket completion
> 
> On 3/31/07, Greg Fitzgerald <[EMAIL PROTECTED]> wrote:
> > Anyone know of a way to achieve bracket completion?
> 
> I've been sitting on a plugin that does this for a month or 
> so. The main difference between my plugin and the rest of the 
> options here is that I do the completion without breaking 
> history or repeat.
> 
> Freshly uploaded to vim.org:
> 
> http://www.vim.org/scripts/script.php?script_id=1849
> 
> This plugin was pared down from a larger script that included 
> a set of less reusable mappings, so let me know if there's a problem.

Thanks for the script Karl.

Not a problem, but a suggestion.

Could you make an option to ignore the autoclose if there is a following
character.  If I am typing a line:

If (  <-- here I want the autoclose.

If I have this line:

If (something_is_already_here)
  ^
And I place my cursor on the "i" in "something" I do not want to add the
closing brace since generally if I am inserting that the closing brace will
be placed at the end of the line (or something).

Just a preference, which is why I was hoping it could be an option.
So only complete when the ([[ is the last item on the line (as I am typing).

Thanks,
Dave



Re: bracket completion

2007-04-03 Thread Charles E Campbell Jr

Panos Laganakos wrote:


One thing that would also be great, was if you were able to "tab" your
way out of it, ie move to the outside of the bracket, once you're
done. Now you need to either press right, to move ahead (which is not
quite vim-ish), or hit escape and Shift_A, to resume editing.

Only possible way I can think of, is to use a snippet system, like
snippetsEmu[1] or something. Any other suggestions?


Here's one: http://vim.sourceforge.net/scripts/script.php?script_id=1269

As an example of use:

if`   (that's a backquote)

expands to

if() {}

(with indentation handled by cindent)

and the cursor after the first "(".  Type whatever, hit .  The 
cursor is then moved

to a new line after the "{".

Regards,
Chip Campbell



Re: bracket completion

2007-04-03 Thread Karl Guertin

On 4/3/07, Silent1 <[EMAIL PROTECTED]> wrote:

where | is the cursor position. Is there any option to change this or
am i doing something wrong?


Sorry, no. I'll probably add support for {{ doing that, which was the
plan, but I never got around to it. Maybe this afternoon.


Re: bracket completion

2007-04-03 Thread Silent1

Just tried the plugin and it works great, the only issue i'm having is
typing '{'
results in this
'{|}' not
{
  |
}
where | is the cursor position. Is there any option to change this or
am i doing something wrong? Thanks
--Brendon

On 4/3/07, Karl Guertin <[EMAIL PROTECTED]> wrote:

On 3/31/07, Greg Fitzgerald <[EMAIL PROTECTED]> wrote:
> Anyone know of a way to achieve bracket completion?

I've been sitting on a plugin that does this for a month or so. The
main difference between my plugin and the rest of the options here is
that I do the completion without breaking history or repeat.

Freshly uploaded to vim.org:

http://www.vim.org/scripts/script.php?script_id=1849

This plugin was pared down from a larger script that included a set of
less reusable mappings, so let me know if there's a problem.



Re: bracket completion

2007-04-03 Thread Karl Guertin

On 3/31/07, Greg Fitzgerald <[EMAIL PROTECTED]> wrote:

Anyone know of a way to achieve bracket completion?


I've been sitting on a plugin that does this for a month or so. The
main difference between my plugin and the rest of the options here is
that I do the completion without breaking history or repeat.

Freshly uploaded to vim.org:

http://www.vim.org/scripts/script.php?script_id=1849

This plugin was pared down from a larger script that included a set of
less reusable mappings, so let me know if there's a problem.


Re: completion menu colors

2007-04-03 Thread A.J.Mechelynck
[EMAIL PROTECTED] wrote:
> fREW <[EMAIL PROTECTED]> 写于 2007-04-03 10:56:11:
>> Are these things that should be set in the colorschemes, but just
>> aren't yet because the names are new, or what?
>>
>> -fREW
> 
> This should be set in colorscheme, however, if you're using the default
> colorschme it is buit-in with Vim and you cannot change the source code of
> colorscheme.
> 
> If you are not using the default colorscheme, then you can just edit the
> colorscheme and set those settings.
> 
> Note: a colorscheme does not have to set all the highlight settings, the
> settings which are not set inside a colorscheme will use the default.
> 
> --
> Sincerely, Pan, Shi Zhu. ext: 2606

To edit a colorscheme, first copy it under a different name into
$HOME/.vim/colors (on Unix) or $HOME/vimfiles/colors (in Vim notation, for
Windows). Any changes you make in the directory tree starting at $VIMRUNTIME
may be overwritten without warning by any future upgrade of Vim, and the
$VIMRUNTIME tree will in any case be recreated from scratch the day you
install Vim 7.1 or Vim 8. By that time you will probably have forgotten the
details of your changes, if you made any.

Best regards,
Tony.


Re: invoking yanked register into colon command

2007-04-03 Thread John Little

Gene Kwiecinski wrote:


Me, I go to whatever I'm looking for, hit 'v', then use normal motion
commands (eg, "3e") to highlight the text in question, instead of using
the mouse.

If a single word, '*' will automagically highlight and search for the
word under the cursor.


And with

vnoremap * y:exe 'norm! /' . escape(@@, '/*.\[$^~') . "\r"

in your .vimrc, it works for more than a single word, any stuff up to a
line's worth.

HTH
John


Re: Newbee question:Why don't I have the syntax highlighting when editing files like *.sh *.xml,etc?

2007-04-03 Thread A.J.Mechelynck

wangxu wrote:

Why don't I have the syntax highlighting when editing files like *.sh
*.xml,etc?
After commands like "syntax on",still nothing happened.
below is my /etc/vim/vimrc,what else should I do to turn the syntax
highlighting on?
Thanks,
shell.

[...]

The ":scriptnames" command will list all scripts that have been sourced so far 
in the current Vim session. They are listed in the order of first sourcing. 
When editing your vimrc, the list should include:

- the vimrc near the top;
- $VIMRUNTIME/syntax/vim.vim somewhere lower down. The $VIMRUNTIME variable 
will be resolved; on your system, I expect its value to be /usr/share/vim/vim70


/etc/vim/vimrc is a strange location for a system vimrc. If the above shows 
that is wasn't sourced, try putting it at /usr/share/vim/vimrc -- if you don't 
want to move the Debian vimrc you can use a soft link:


cd /usr/share/vim
ln -vs /etc/vim/vimrc


Oh, and next time you post a ":version" listing on the list, please first do 
":language messages C" (on Unix). I know just enough Chinese to understand 
that 大 on the fourth line means "big", so I can guess that that fourth line 
probably means "Big version with GTK2 GUI. Features included (+) or not (-):" 
but the average subscriber to this list cannot even be assumed to know any 
Chinese at all.



Best regards,
Tony.
--
"All flesh is grass"
-- Isaiah
Smoke a friend today.


Re: bracket completion

2007-04-03 Thread hermitte
shawn bright <[EMAIL PROTECTED]> wrote:

> i got the main functionality working, pretty much. I only really
> desire the bracket matching, and so far, i am really pleased. They all
> work except the [] . So i think maybe there is a conflict with another
> plugin ( i have the snippets-Emu, supertabs, and taglist plugins also.
> ) The overall effect is really cool.

I can't tell if there are conflicts with these plugins as I don't use them.

Try a
   :verbose imap [

If my plugin is correctly working, and not overidden, it should point to a
mapping defined in plugin/common_brackets.vim


> thanks again.

You're welcome.


--
Luc Hermitte
http://hermitte.free.fr/vim/


Re: repeat replace many time on each line

2007-04-03 Thread Arnaud Bourree


Tobia wrote on 02/04/2007 23:51:
> Bob Hiestand wrote:
>> Tobia wrote:
>>> Arnaud Bourree wrote:
 I've Xml document with attribute likes:
 foo="00 12 AF"
 I want to replace with:
 foo="0x00 0x12 0xAF"
>>> this works:
>>>
>>> %s/\%(\%(foo=\"\)\@<=\%([0-9A-F]\{2\}\s\)*\)\@<=\([0-9A-F]\{2\}\)/0x\1/g
>> In using :s with the /g flag, I take it the potential changes are
>> marked first, and then executed, per line?
> 
> It would seem so.
> 
> By the way, I would have used a simpler pattern for such a task:
> 
> %s/\v%(foo\="[^"]*)@<=(<\x\x>)/0x\1/g
Thanks that is exactly what I expect: it works for all values listed in
foo attribute. I don't need to repeat the command.
Good lesson for me today: keep it simple ;-)
> 
> 
>> I prefer when dealing with that many special characters to use the
>> very-magic form
> 
> Me too.  I can't stand trying to match \( \) with my eyes, they just
> don't look right, not to mention \{ \? \+...  Egrep and Perl have it
> right.  I wish I could turn very-magic on by default.
> 
> 
> Tobia
> 

-- 
Reclaim Your Inbox!
http://www.mozilla.org/products/thunderbird