Re: Folding in vim helpfiles

2007-04-07 Thread Ian Tegebo

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

Quoting Mikolaj Machowski <[EMAIL PROTECTED]>:

> On pitek 06 kwiecieD 2007, vim@vim.org wrote:
> > After looking at foldutil.vim and AutoFold.vim I'm not sure what the
> > best way is going to be for exploiting the outline format of helpfiles
> > to automatically create folds.
> >
> > Has anyone done this before?  Ideally, I'd like to use this with the
> > foldlist.vim plugin to have something like a left-side nav-bar while
> > reading helpfiles.
>
> AFAIR Chip Campbell on his page had special version of help.vim with
> folding, extended highlighting etc.

I have an additional-help syntax file at my website (and it does support
syntax-based folding):

  http://mysite.verizon.net/astronaut/vim/index.html#HELP

I updated the one on my website, too.  Caveat: I used to have a version on
vim.sf.net, but it was receiving -1s, so I withdrew it.  Nonetheless, I use it
all the time (the withdrawn one didn't support syntax folding, because vim
itself didn't support folding back then).  Its in vimball format; you'll need a
new vimball plugin to extract it.  Directions for that are also on my website.
The new vimball plugin has been fairly stable recently, so hopefully when the
new vim comes out whenever this will be considerably simpler.

Thanks a lot!

Folding works on the GetLatestVimScripts helpfile but I'm not getting folds
for the non-local addition helpfiles, e.g. usr_41.txt.  If I change the start
pattern for the 'fold' line in the help.vim syntax file to the following I get
what I expect:

start="^\*\?\d\+\.\(\d\+\)\*\?\(\s\|\a\)"

I'm new to fold definitions in syntax files, how could I define subfolds for
sections that you see in helpfiles like usr_41.txt?  I feel confident
constructing the start/end pattens for those regions that are delimited by
all-caps headings.  After reading syn-fold I think all I have to do is add:

syn match helpSubsection ... start= ...

At any rate, I'll keep playing around; this did just what I was looking for.


--
Ian Tegebo


Re: copy pasting HTML code into vim

2007-04-07 Thread Kamaraju Kusumanchi
Quoting Sartak <[EMAIL PROTECTED]>:

> 
> There's a Firefox extension named "Extended Copy Menu" which adds
> "Copy As Html" and "Copy As Plain Text" options to the right-click
> menu.
> 
> Shawn M Moore
> 

Thanks. Exactly what I was looking for.

raju


Re: Folding in vim helpfiles

2007-04-07 Thread drchip
Quoting Mikolaj Machowski <[EMAIL PROTECTED]>:

> On piątek 06 kwiecień 2007, vim@vim.org wrote:
> > After looking at foldutil.vim and AutoFold.vim I'm not sure what the
> > best way is going to be for exploiting the outline format of helpfiles
> > to automatically create folds.
> >
> > Has anyone done this before?  Ideally, I'd like to use this with the
> > foldlist.vim plugin to have something like a left-side nav-bar while
> > reading helpfiles.
>
> AFAIR Chip Campbell on his page had special version of help.vim with
> folding, extended highlighting etc.

I have an additional-help syntax file at my website (and it does support
syntax-based folding):

  http://mysite.verizon.net/astronaut/vim/index.html#HELP

I updated the one on my website, too.  Caveat: I used to have a version on
vim.sf.net, but it was receiving -1s, so I withdrew it.  Nonetheless, I use it
all the time (the withdrawn one didn't support syntax folding, because vim
itself didn't support folding back then).  Its in vimball format; you'll need a
new vimball plugin to extract it.  Directions for that are also on my website. 
The new vimball plugin has been fairly stable recently, so hopefully when the
new vim comes out whenever this will be considerably simpler.

Regards,
Chip Campbell




Re: Is it possible to source all scripts/plugins from VIM without leaving VIM?

2007-04-07 Thread A.J.Mechelynck

Marc Weber wrote:

On Thu, Apr 05, 2007 at 01:34:10PM +, Eric Leenman wrote:

Hi,

Is it possible to source all scripts/plugins from VIM without leaving VIM?
When experimenting with plugins, I now
1) modify plugin
2) start VIM
3) test plugin
4) detect an error
5) close VIM
6) goto 1)

Don't see why you need this.
You might try registering :exec 'source '.expand('%')
as BufWritePost autocommand. Then :wa should suffice ?
I have one mapping sourcing the currentfile which works fine most of the
time for me.

There are sessions. So you can write a script opening vim forever
loading the session file. When exiting you can write it.
See :h mksession

HTH
Marc Weber



Global plugins, like the vimrc and gvimrc, are not meant to be sourced more 
than once in the course of a given session. Depending on how they are written, 
it may or may not be possible to source them again without ill effects; but 
you won't be sure that they work as intended if you don't test them in their 
intended environment, i.e., in a fresh instance of Vim.


Filetype plugins (or syntax and indent plugins) are not meant to be sourced 
more than once for a given buffer, but if you wipeout the buffer and load it 
again they should be sourced again. Also, a filetype-plugin (or a syntax or 
indent plugin) MUST NOT alter settings in parallel split-windows, nor the 
default settings for future buffers of a different filetype (and for 
non-native English speakers: "must not" = "is required not to").



Best regards,
Tony.
--
"Why be a man when you can be a success?"
-- Bertold Brecht


Re: Need help with error format

2007-04-07 Thread Marc Weber
On Thu, Apr 05, 2007 at 05:29:58PM +0100, Christophe Dupre wrote:
> Hello,
> 
> I'm trying to write a compiler plug-in for a compiler (it's a compiler
> use for PIC microcontrollers) and I'm hafing difficulties defining the
> error format.
> 
> Here is a typical compiler output:
> >>> Warning 208
> "C:\Project\1816-CooperDataInterrogator\CircularBuffer.c" Line 60(6,15):
> Function not void and does not return a value  PutRecord
> *** Error 165 "C:\Project\1816-CooperDataInterrogator\test.c" Line
> 7(10,11): No overload function matches
> 
> And it's made of:
> Error No - Filename - line No(Column Start,Column End) - Message.
> 
> I've defined the error format the following way:
> CompilerSet errorformat=%*[^0-9]%n\ %f\ %l%v%p%m
> 
> After setting the compiler and running make, the first error is
> recognised but the line and column number aren't.
> How can I model line No(Column Start,Column End), e.g.:  "Line 60(6,15):
> ", and "Line 7(10,11): "

CompilerSet errorformat=%f\ Line\ %l(%c%m,
 \\*\*\*\ Error\ %*[0-9]\ %f
This works for both:
"C:\Project\1816-CooperDataInterrogator\CircularBuffer.c" Line 60(6,15):
*** Error 165 "C:\Project\1816-CooperDataInterrogator\test.c" Line

You can use a mapping such like this
map  :w  compiler! test  cf error
and an error file error to speed up fixing your errorformat.

HTH
Marc Weber


Re: Is it possible to source all scripts/plugins from VIM without leaving VIM?

2007-04-07 Thread Marc Weber
On Thu, Apr 05, 2007 at 01:34:10PM +, Eric Leenman wrote:
> Hi,
> 
> Is it possible to source all scripts/plugins from VIM without leaving VIM?
> When experimenting with plugins, I now
> 1) modify plugin
> 2) start VIM
> 3) test plugin
> 4) detect an error
> 5) close VIM
> 6) goto 1)
Don't see why you need this.
You might try registering :exec 'source '.expand('%')
as BufWritePost autocommand. Then :wa should suffice ?
I have one mapping sourcing the currentfile which works fine most of the
time for me.

There are sessions. So you can write a script opening vim forever
loading the session file. When exiting you can write it.
See :h mksession

HTH
Marc Weber


Re: how to set font italic

2007-04-07 Thread Tim Chase
> i want to set some words in the text file in italic format, but not the
> whole file, i use gvim and when i set font from the edit menu, and choose
> italic, it will set all words in that file to be italic, but that is not
> what i want, how to use command to implement? and i think there is also
> problem with setting font bold

It sounds like you want some sort of syntax highlighting.  It
allows for changing not only the color but the attributes
(bold/italic/underline/undercurl) assuming your display supports
it (gvim does, and some characteristics may be on the terminal
such as bold).

Assuming you have some way to discern your italic text, you can
do things like

:hi Italic gui=italic
:match Italic !/\w*\(/\w\+\)*/!

which will highlight text like /this/ or /compound/strings/ as
italicized.

You can read more at

:help :hi
:help :match
:help :syn-match

and it can be helpful to read some of the syntax-highlighting
files that come with vim in your $VIMRUNTIME/syntax/ especially
for things that do something similar to what you describe.
Particularly, the rst.vim file may have a lot of good stuff in it.

-tim




Re: how to set font italic

2007-04-07 Thread A.J.Mechelynck

flyfish wrote:

Hi,

i want to set some words in the text file in italic format, but not the
whole file, i use gvim and when i set font from the edit menu, and choose
italic, it will set all words in that file to be italic, but that is not
what i want, how to use command to implement? and i think there is also
problem with setting font bold

Thanks


You will have to define a 'syntax' telling Vim how to decide what it italic, 
or bold, or both, or neither. For instance, the HTML syntax 
$VIMRUNTIME/syntax/html.vim defines a number of syntax groups for when   
tags are encountered (and where), and then it defines a 
number of highlight groups for those syntax groups (quoting the GUI part from 
memory):


hi default htmlBold gui=bold
hi default htmlItalic gui=italic
hi default htmlUnderline gui=underline
hi default htmlBoldItalic gui=bold,italic
hi default link htmlItalicBold htmlBoldItalic
hi default htmlBoldUnderline gui=bold,underline
hi default link htmlUnderlineBold htmlBoldUnderline
hi default htmlItalicUnderline gui=italic,underline
hi default link htmlUnderlineItalic htmlItalicUnderline

etc. -- there are quite a lot of them. View that syntax file for more 
details.; then see


:help usr_44.txt
:help syntax.txt

Best regards,
Tony.
--
Atlee is a very modest man.  And with reason.
-- Winston Churchill


Re: how to set font italic

2007-04-07 Thread Ricky Zhou
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

flyfish wrote:
> i want to set some words in the text file in italic format, but not the
> whole file, i use gvim and when i set font from the edit menu, and choose
> italic, it will set all words in that file to be italic, but that is not
> what i want, how to use command to implement? and i think there is also
> problem with setting font bold
If you're editing a plain text file, then you can't really control text
formatting.  That kind of functionality would only be present in other
formats (such as those created by most word processors, etc.)

Hope this helps,
Ricky
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFGF8BQiXbZ7NjlUcARAsW8AKCtzFAgSs4L/9xmjyNggqTWXSr3/wCfUFVM
V83WLWspHAQYReXGJGGt6dE=
=frlX
-END PGP SIGNATURE-


how to set font italic

2007-04-07 Thread flyfish

Hi,

i want to set some words in the text file in italic format, but not the
whole file, i use gvim and when i set font from the edit menu, and choose
italic, it will set all words in that file to be italic, but that is not
what i want, how to use command to implement? and i think there is also
problem with setting font bold

Thanks
-- 
View this message in context: 
http://www.nabble.com/how-to-set-font-italic-tf3541049.html#a9884872
Sent from the Vim - General mailing list archive at Nabble.com.



Re: how to color the word

2007-04-07 Thread Yakov Lerner

On 4/7/07, flyfish <[EMAIL PROTECTED]> wrote:

i see the help file of vim and some words in the text is colored, for
example, when i read the develop.txt help file, some words like "Note",
"design-goal" are colored with yellow or pink, how could it be done? i also
want to color some keywords in my files, how to do?


:help :match
:help syntax

Yakov


Re: Silly Question

2007-04-07 Thread Matthew Winn
On Fri, 06 Apr 2007 14:37:30 -0400, Mitch Wiedemann <[EMAIL PROTECTED]>
wrote:

> I'm unlucky enough to have 'i' as the second letter in both my first and
> last names...
> 
> So I get a jump to the middle of the screen, or to the first word in the
> line, and then boring ol' text insertion...

I'm almost exactly the same, except that the end of my forename is
placed one character to the right of yours. If I stick to lower case
then it's a bit more interesting because the "a" becomes a mark, and
the rest of my name makes the cursor stagger along the line without
changing anything, ending up at the start of the word following the
word containing the next "t".

Vowels are a problem. Unless you have an escape in your name, a, i
and o are boring letters. I know someone named Veerle and her name
is actually quite destructive, overwriting an entire line with "l".
What's the most interesting name anyone can find, and also the most
damaging?

-- 
Matthew Winn


how to color the word

2007-04-07 Thread flyfish

Hi,

i see the help file of vim and some words in the text is colored, for
example, when i read the develop.txt help file, some words like "Note",
"design-goal" are colored with yellow or pink, how could it be done? i also
want to color some keywords in my files, how to do?

Thank you very much.
-- 
View this message in context: 
http://www.nabble.com/how-to-color-the-word-tf3540162.html#a9882273
Sent from the Vim - General mailing list archive at Nabble.com.