Re: Checking an option

2006-11-13 Thread Meino Christian Cramer
From: Peter Hodge <[EMAIL PROTECTED]>
Subject: Re: Checking an option
Date: Tue, 14 Nov 2006 17:00:06 +1100 (EST)

Hi Peter,

 thank you for your super fast reply! :)

 Some things are quite too simple for me... ;O)   <<<--- VERY BIG smiley!

 Keep editing!
 mcc



> Hello,
> 
> The 'no{option}' options aren't really options, that's just a way of turning
> them off. You can use:
> 
>   if ! &startofline
> (do something)
>   endif
> 
> regards,
> Peter
> 
> --- Meino Christian Cramer <[EMAIL PROTECTED]> wrote:
> 
> > 
> > Hi,
> > 
> >  in a script I want to to something like:
> > 
> >   if 
> >  (do something)
> >   endif
> > 
> >  From the help I got under the toppic "expr-option"
> > 
> > option  *expr-option* *E112* 
> > *E113*
> > --
> > &option option value, local value if possible
> > &g:option   global option value
> > &l:option   local option value
> > 
> > Examples: >
> > echo "tabstop is " . &tabstop
> > if &insertmode
> > 
> > Any option name can be used here.  See |options|.  When using the local
> > value
> > and there is no buffer-local or window-local value, the global value is
> > used
> > anyway.
> > 
> > 
> > 
> >  So I wrote (before there was a "set nostartofline")
> > 
> > if &nostartofline
> >(do something)
> > endif
> > 
> >  but it fails with:
> > 
> > Error detected while processing /home/mccramer/.vimrc:
> > line  561:
> > E113: Unknown option: nostartofline
> > E15: Invalid expression: &nostartofline
> > 
> >  which I dont understand, since some line before "set nostartofline"
> >  was used and there "nostartofline" was known...
> > 
> >  What can I do to solve the problem ?
> > 
> >  Thank you very much in advance for any help !
> > 
> >  Keep editing!
> >  mcc
> > 
> > 
> > 
> > 
> 
> 
> Send instant messages to your online friends http://au.messenger.yahoo.com 
> 


Re: Checking an option

2006-11-13 Thread Peter Hodge
Hello,

The 'no{option}' options aren't really options, that's just a way of turning
them off. You can use:

  if ! &startofline
(do something)
  endif

regards,
Peter

--- Meino Christian Cramer <[EMAIL PROTECTED]> wrote:

> 
> Hi,
> 
>  in a script I want to to something like:
> 
> if 
>(do something)
>   endif
> 
>  From the help I got under the toppic "expr-option"
> 
> option*expr-option* *E112* 
> *E113*
> --
> &option   option value, local value if possible
> &g:option global option value
> &l:option local option value
> 
> Examples: >
>   echo "tabstop is " . &tabstop
>   if &insertmode
> 
> Any option name can be used here.  See |options|.  When using the local
> value
> and there is no buffer-local or window-local value, the global value is
> used
> anyway.
> 
> 
> 
>  So I wrote (before there was a "set nostartofline")
> 
> if &nostartofline
>  (do something)
> endif
> 
>  but it fails with:
> 
> Error detected while processing /home/mccramer/.vimrc:
> line  561:
> E113: Unknown option: nostartofline
> E15: Invalid expression: &nostartofline
> 
>  which I dont understand, since some line before "set nostartofline"
>  was used and there "nostartofline" was known...
> 
>  What can I do to solve the problem ?
> 
>  Thank you very much in advance for any help !
> 
>  Keep editing!
>  mcc
> 
> 
> 
> 


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


Checking an option

2006-11-13 Thread Meino Christian Cramer

Hi,

 in a script I want to to something like:

  if 
 (do something)
  endif

 From the help I got under the toppic "expr-option"

option  *expr-option* *E112* 
*E113*
--
&option option value, local value if possible
&g:option   global option value
&l:option   local option value

Examples: >
echo "tabstop is " . &tabstop
if &insertmode

Any option name can be used here.  See |options|.  When using the local 
value
and there is no buffer-local or window-local value, the global value is used
anyway.



 So I wrote (before there was a "set nostartofline")

if &nostartofline
   (do something)
endif

 but it fails with:

Error detected while processing /home/mccramer/.vimrc:
line  561:
E113: Unknown option: nostartofline
E15: Invalid expression: &nostartofline

 which I dont understand, since some line before "set nostartofline"
 was used and there "nostartofline" was known...

 What can I do to solve the problem ?

 Thank you very much in advance for any help !

 Keep editing!
 mcc





ANN: Vim Taglist plugin home page moved to sourceforge

2006-11-13 Thread Yegappan Lakshmanan

Hi all,

I have registered the Vim taglist plugin as a sourceforge project.
The home page for the taglist plugin is now at:

http://vim-taglist.sourceforge.net/

The sourceforge project page is at:

http://sourceforge.net/projects/vim-taglist

- Yegappan


Re: Search unfolded lines only

2006-11-13 Thread Benji Fisher
On Mon, Nov 13, 2006 at 04:35:51PM -0500, Jean-Rene David wrote:
> Is there any way to search for text in open folds
> only? For example, if fold 1 and fold 2 below are
> closed and fold 3 is open, and placing the cursor
> on the line which says "Start search here", I
> would like to end up on the "foo" in fold 3 when
> typing "/foo".
> 
> Start search here
> 
> {{{
>fold1
>foo
>fold1
> }}}
> {{{
>fold2
>foo
>fold2
> }}}
> {{{
>fold3
>foo
>fold3
> }}}
> 
> -- 
> JR
>  vim: fdm=marker

 It helps to

:set foldopen-=search

Then, as you search for "foo", the closed folds stay closed; and if
"foo" matches more than once in a given fold, "n" will still move the
the next "foo" outside the fold.  If that is not enough, you can map a
key to do

/foo
:while foldclosed(".") != -1
  call search(@/, 'W')
endwhile

(untested).

 For details on the 'foldopen' option,

:help 'foldopen'

To help find the option you did not know existed,

:options

HTH --Benji Fisher


Search unfolded lines only

2006-11-13 Thread Jean-Rene David
Is there any way to search for text in open folds
only? For example, if fold 1 and fold 2 below are
closed and fold 3 is open, and placing the cursor
on the line which says "Start search here", I
would like to end up on the "foo" in fold 3 when
typing "/foo".

Start search here

{{{
   fold1
   foo
   fold1
}}}
{{{
   fold2
   foo
   fold2
}}}
{{{
   fold3
   foo
   fold3
}}}

-- 
JR
 vim: fdm=marker


Re: ma misbehaviour

2006-11-13 Thread Yakov Lerner

On 11/13/06, Max Dyckhoff <[EMAIL PROTECTED]> wrote:

Do you have a CursorHold au command? Do this to find out:

:au CursorHold


Exactly; Thanks Max. It was &ut value too low. Raising the &ut
value fixed it.

Yakov



If you do then you are getting the same issue as I do in a lot of places. Apparently the 
CursorHold au will generate some input command which will override pending commands. If 
you have "showcmd" set then you can see the effect.

1. Move to a location (or leave insert mode by pressing escape)
2. Very quickly, press a key (like m, q, etc).
3. Watch the "showcmd" and see it display the m.
4. After 'updatetime' the command will be cancelled (often with a bell sound, 
if you have that turned on).

So what is happening with you is that you aren't pressing "a" quickly enough after the "m", and 
hence the "m" is being cancelled and the "a" is putting you into insert mode.

It's massively annoying! To get around it, there are a few things you can try:

a. Remove your au command.
b. Massively decrease the updatetime (I'd like to see you press "m" less than 10 
milliseconds after "esc" :)
c. Remember to wait a short time after moving to a location before doing a 
command.
d. Complain to Bram and see if he can come up with a fix to it.


I think this was brought to Bram attention some months ago.


My suggested fix would be to block CursorHold and CursorHoldI au commands if 
there was a pending user command, but I have no idea if this is even possible.

Hope that helps,

Max


> -Original Message-
> From: Yakov Lerner [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 13, 2006 12:39 PM
> To: Vim List
> Subject: ma misbehaviour
>
> I often use ma to mark the 'a mark. But recently if I press ma
> shortly after Esc, this puts vim into insert mode ! (and does
> not set any 'a mark).
>
> I don't have any mapping for ma or ma or m:
> nmap m -> No mapping found
> nmap ma -> No mapping found
> nmap ma -> No mapping found
> nmap m -> No mapping found
> I looked into 'set termcap' for a key defined as ^[ma, nothing.
>
> How can I fix this or track down the reason ?
>
> Thanks
> Yakov



RE: ma misbehaviour

2006-11-13 Thread Max Dyckhoff
Do you have a CursorHold au command? Do this to find out:

:au CursorHold

If you do then you are getting the same issue as I do in a lot of places. 
Apparently the CursorHold au will generate some input command which will 
override pending commands. If you have "showcmd" set then you can see the 
effect.

1. Move to a location (or leave insert mode by pressing escape)
2. Very quickly, press a key (like m, q, etc).
3. Watch the "showcmd" and see it display the m.
4. After 'updatetime' the command will be cancelled (often with a bell sound, 
if you have that turned on).

So what is happening with you is that you aren't pressing "a" quickly enough 
after the "m", and hence the "m" is being cancelled and the "a" is putting you 
into insert mode.

It's massively annoying! To get around it, there are a few things you can try:

a. Remove your au command.
b. Massively decrease the updatetime (I'd like to see you press "m" less than 
10 milliseconds after "esc" :)
c. Remember to wait a short time after moving to a location before doing a 
command.
d. Complain to Bram and see if he can come up with a fix to it.

My suggested fix would be to block CursorHold and CursorHoldI au commands if 
there was a pending user command, but I have no idea if this is even possible.

Hope that helps,

Max


> -Original Message-
> From: Yakov Lerner [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 13, 2006 12:39 PM
> To: Vim List
> Subject: ma misbehaviour
>
> I often use ma to mark the 'a mark. But recently if I press ma
> shortly after Esc, this puts vim into insert mode ! (and does
> not set any 'a mark).
>
> I don't have any mapping for ma or ma or m:
> nmap m -> No mapping found
> nmap ma -> No mapping found
> nmap ma -> No mapping found
> nmap m -> No mapping found
> I looked into 'set termcap' for a key defined as ^[ma, nothing.
>
> How can I fix this or track down the reason ?
>
> Thanks
> Yakov


ma misbehaviour

2006-11-13 Thread Yakov Lerner

I often use ma to mark the 'a mark. But recently if I press ma
shortly after Esc, this puts vim into insert mode ! (and does
not set any 'a mark).

I don't have any mapping for ma or ma or m:
   nmap m -> No mapping found
   nmap ma -> No mapping found
   nmap ma -> No mapping found
   nmap m -> No mapping found
I looked into 'set termcap' for a key defined as ^[ma, nothing.

How can I fix this or track down the reason ?

Thanks
Yakov


Re: search between two brackets

2006-11-13 Thread Benji Fisher
On Mon, Nov 13, 2006 at 01:05:00PM -0600, Ben K. wrote:
> 
> Vimmers,
> 
> I have a long source code consisting of multiple modules wrapped in {}.
> Sometimes I use "*" to find the next match. But I'd like to search only 
> within the same module or class that I started from. (which is wrapped
> inside sub ... {})
> 
> In the following example, I'd like * or "n" to at least let me know that I
> crossed the module boundary for instance 3. Or not match it at all.
> If there's a way to highlight between the matching brackets
> (open/close),
> it would also be helpful, even if it doesn't allow highlighting of the
> searched pattern.
> 
> 
> sub aaa {
> ...
> instance 1# Begin by "*"
> ...
> instance 2# This is OK.
> ...
> }
> sub bbb {
> ...
> instance 3# This is not what I want
> ...
> }
> 
> Is there a simple way to do it?

 If you are using vim 7.0, then you can take advantage of the
optional stopline argument in the search() function:

:let pat = '\<' . expand('') . '\>'
:let stopline = searchpair('{', '', '}', 'n')
:call search(pat, '', stopline)

Of course, that does not count as "simple," but you can wrap those three
lines in a function and map * to call it:

:nmap * :call MySearch()
fun! MySearch()
  let pat = '\<' . expand('') . '\>'
  let stopline = searchpair('{', '', '}', 'n')
  call search(pat, '', stopline)
endfun

Or you could choose another key, and of course there are various ways t
make it all more flexible.

 I am not sure exactly what sort of highlighting you want.

HTH --Benji Fisher


Re: search between two brackets

2006-11-13 Thread Yegappan Lakshmanan

Hi,

On 11/13/06, Ben K. <[EMAIL PROTECTED]> wrote:


Vimmers,

I have a long source code consisting of multiple modules wrapped in {}.
Sometimes I use "*" to find the next match. But I'd like to search only
within the same module or class that I started from. (which is wrapped
inside sub ... {})

In the following example, I'd like * or "n" to at least let me know that I
crossed the module boundary for instance 3. Or not match it at all.
If there's a way to highlight between the matching brackets
(open/close),
it would also be helpful, even if it doesn't allow highlighting of the
searched pattern.



You can use the command Vib to highlight all the lines between the
opening and closing braces.

  V - start linewise visual mode
  ib - Inner block text object

To search for a pattern within only a selected range of lines, you
can use the following command:

command! -nargs=* -range RS exe 'normal /\%>' . ( - 1) . 'l\%<'
. ( + 1) . 'l'

The above command should be all in one line and you can add this
to your .vimrc file.

With the above command, after visually selecting a block, you can use

  :RS mypattern

- Yegappan



sub aaa {
...
instance 1  # Begin by "*"
...
instance 2  # This is OK.
...
}
sub bbb {
...
instance 3  # This is not what I want
...
}

Is there a simple way to do it?

Thanks.


Ben K.
Developer
http://benix.tamu.edu



Fwd: chasing symlink

2006-11-13 Thread Bob Hiestand

Forwarded because I fail at manipulating reply-tos.

On 11/8/06, Yakov Lerner <[EMAIL PROTECTED]> wrote:

The problem at hand here is that there is checked-out file, X,
under SVN control, and a symlink Y->X, and Y is outside of
checked-out subtree, and I want to check-in file from inside vim.

I can edit the file as X or as Y, fine. But if I try to check in file
under [symlinked] name Y, then SVN cannot do it.
I need to chase the link in vim and check it in under name X.


Yakov,

 I don't know which tool you find having trouble.  As a shameless
plug, the vcscommand plugin will handle this for you (that is, you can
edit the file as 'Y' and have access to the full range of commands).

Thank you,

Bob


search between two brackets

2006-11-13 Thread Ben K.


Vimmers,

I have a long source code consisting of multiple modules wrapped in {}.
Sometimes I use "*" to find the next match. But I'd like to search only 
within the same module or class that I started from. (which is wrapped

inside sub ... {})

In the following example, I'd like * or "n" to at least let me know that I
crossed the module boundary for instance 3. Or not match it at all.
If there's a way to highlight between the matching brackets
(open/close),
it would also be helpful, even if it doesn't allow highlighting of the
searched pattern.


sub aaa {
...
instance 1  # Begin by "*"
...
instance 2  # This is OK.
...
}
sub bbb {
...
instance 3  # This is not what I want
...
}

Is there a simple way to do it?

Thanks.


Ben K.
Developer
http://benix.tamu.edu


Re: Two other "problems" while diting a big table

2006-11-13 Thread Charles E Campbell Jr

Meino Christian Cramer wrote:


Hi,

Currently I want to "reformat" a huge table of data of shortwave
broadcasters. This table is build from lines of 318 characters each
(***none is shorter or longer***). The entries are speperated by
char/byte offsets only (defined in another file). The rows are
seperated by newlines. Wrapping is off.

I am currently on the way to insert " | "s at the boundaries between
the entries to make the table a little more readable.
 

After you've inserted your |s, if you use the Align.vim and 
AlignMaps.vim plugin:


V(move)\t|

will align the entire table along the |s.

You can get Align from:  
http://vim.sourceforge.net/scripts/script.php?script_id=294


Regards,
Chip Campbell



Re: Entering citations (footnotes) in vim

2006-11-13 Thread Anthony Campbell
Actually, looking at the commands in the plugin script 
more carefully I see that it does allow you to change the 
numbering of the footnotes. I'd found this a long time ago 
but forgotten it. This makes it more usable, though some 
manual readjustment will still be required.



This message has been scanned for viruses by BlackSpider MailControl - 
www.blackspider.com


Re: Entering citations (footnotes) in vim

2006-11-13 Thread Alan Isaac
On Mon, 13 Nov 2006, Anthony Campbell wrote: 
> Is there any simple way to add numbered footnotes 
> (citations) in vim? 

http://docutils.sourceforge.net/rst.html 
http://docutils.sourceforge.net/docs/user/rst/quickref.html#footnotes

hth,
Alan Isaac






Entering citations (footnotes) in vim

2006-11-13 Thread Anthony Campbell
Is there any simple way to add numbered footnotes 
(citations) in vim? I have the vimfootnotes plugin, which 
works, but if I need to add or delete a footnote later I 
then have to continue to do everything by hand, which 
rather defetes the object.


Any suggestions?

Anthony


This message has been scanned for viruses by BlackSpider MailControl - 
www.blackspider.com


how can I manage for VIM to not recalculate syntax for some place s of file?

2006-11-13 Thread Konovalov, Vadim Vladimirovich (Vadim)** CTR **
Are there exist some kind of markers so VIM will not quess the
syntax, but will follow my instructions?

The problem is quite annoying when a file is a language mess of perl and tcl/tk 
simultaneously, and VIM often incorrectly quesses, and, strangely, the same 
place in file often highlighted differently, i.e the syntax algorithm do not 
work well.

I want to exactly point out what a syntax at some point is.

Thanks in advance.

Vadim. 


Odp: Print folded text

2006-11-13 Thread Mikołaj Machowski
Dnia 13-11-2006 o godz. 9:56 Christian Brehm napisał(a):
> 
> Is there a way to print folded code folded??

:TOhtml

and print from browser.

m.


Tegoroczne odkrycie TopTrendy - debiutancja płyta Lidii "Intuicja"
http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fd34.html&sid=928




Odp: Print folded text

2006-11-13 Thread Mikołaj Machowski
> 
> Is there a way to print folded code folded??

:TOhtml

and print from browser.

m.


Gdy zawrzesz pakt z tajemnymi mocami, możesz robić wszystko. 
Ale czy wiesz, jaka będzie tego cena? 
Znakomity thriller "Pakt milczenia" w kinach od 10 listopada!
http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fpakt_milczenia.html&sid=930




Print folded text

2006-11-13 Thread Christian Brehm
Hi,

I love the folding functionality because one can easily get an overview
on the code.

Is there a way to print folded code folded??



Thanks for any hints

Cheers
Christian